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
wso2/transport-http
components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/ssl/SSLHandlerFactory.java
SSLHandlerFactory.buildServerSSLEngine
public SSLEngine buildServerSSLEngine(SSLContext sslContext) { SSLEngine engine = sslContext.createSSLEngine(); engine.setUseClientMode(false); if (needClientAuth) { engine.setNeedClientAuth(true); } else if (wantClientAuth) { engine.setWantClientAuth(true); ...
java
public SSLEngine buildServerSSLEngine(SSLContext sslContext) { SSLEngine engine = sslContext.createSSLEngine(); engine.setUseClientMode(false); if (needClientAuth) { engine.setNeedClientAuth(true); } else if (wantClientAuth) { engine.setWantClientAuth(true); ...
[ "public", "SSLEngine", "buildServerSSLEngine", "(", "SSLContext", "sslContext", ")", "{", "SSLEngine", "engine", "=", "sslContext", ".", "createSSLEngine", "(", ")", ";", "engine", ".", "setUseClientMode", "(", "false", ")", ";", "if", "(", "needClientAuth", ")"...
Build the server ssl engine using the ssl context. @param sslContext sslContext. @return SSLEngine.
[ "Build", "the", "server", "ssl", "engine", "using", "the", "ssl", "context", "." ]
c51aa715b473db6c1b82a7d7b22f6e65f74df4c9
https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/ssl/SSLHandlerFactory.java#L143-L152
train
Build the server SSL engine.
Of course, here is the Java code you requested: ```java public SSLEngine buildServerSSLEngine(SSLContext sslContext) { SSLEngine engine = sslContext.createSSLEngine(); engine.setUseClientMode(false); if (needClientAuth) { engine.setNeedClientAuth(true); } else if (wantClient...
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/URLResource.java
URLResource.addPath
public Resource addPath(String path) throws IOException,MalformedURLException { if (path==null) return null; path = URI.canonicalPath(path); return newResource(URI.addPaths(_url.toExternalForm(),path)); }
java
public Resource addPath(String path) throws IOException,MalformedURLException { if (path==null) return null; path = URI.canonicalPath(path); return newResource(URI.addPaths(_url.toExternalForm(),path)); }
[ "public", "Resource", "addPath", "(", "String", "path", ")", "throws", "IOException", ",", "MalformedURLException", "{", "if", "(", "path", "==", "null", ")", "return", "null", ";", "path", "=", "URI", ".", "canonicalPath", "(", "path", ")", ";", "return",...
Returns the resource contained inside the current resource with the given name
[ "Returns", "the", "resource", "contained", "inside", "the", "current", "resource", "with", "the", "given", "name" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/URLResource.java#L253-L262
train
Add a path to the resource.
Of course, here is the Java code you requested: ```java public Resource addPath(String path) throws IOException,MalformedURLException { if (path==null) return null; path = URI.canonicalPath(path); return newResource(URI.addPaths(_url.toExternalForm(),path)); } ``` ...
nemerosa/ontrack
ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/BuildController.java
BuildController.getBuildLinkForm
@RequestMapping(value = "builds/{buildId}/links", method = RequestMethod.GET) public Form getBuildLinkForm(@PathVariable ID buildId) { // Gets the form values List<BuildLinkFormItem> items = structureService.getBuildLinksFrom(structureService.getBuild(buildId)) .stream() ...
java
@RequestMapping(value = "builds/{buildId}/links", method = RequestMethod.GET) public Form getBuildLinkForm(@PathVariable ID buildId) { // Gets the form values List<BuildLinkFormItem> items = structureService.getBuildLinksFrom(structureService.getBuild(buildId)) .stream() ...
[ "@", "RequestMapping", "(", "value", "=", "\"builds/{buildId}/links\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "Form", "getBuildLinkForm", "(", "@", "PathVariable", "ID", "buildId", ")", "{", "// Gets the form values", "List", "<", "BuildL...
Form to create a link between a build and another @param buildId From this build... @return List of builds
[ "Form", "to", "create", "a", "link", "between", "a", "build", "and", "another" ]
37b0874cbf387b58aba95cd3c1bc3b15e11bc913
https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/BuildController.java#L274-L293
train
Gets the form for the links of a build
Of course, here is the Java code you requested: ```java @RequestMapping(value = "builds/{buildId}/links", method = RequestMethod.GET) public Form getBuildLinkForm(@PathVariable ID buildId) { // Gets the form values List<BuildLinkFormItem> items = structureService.getBuildLinksFrom(structureService....
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObjectScope.java
SharedObjectScope.dispatchEvent
@Override public void dispatchEvent(IEvent e) { if (e instanceof ISharedObjectMessage || e.getType() == IEvent.Type.SHARED_OBJECT) { ISharedObjectMessage msg = (ISharedObjectMessage) e; if (msg.hasSource()) { beginUpdate(msg.getSource()); } else { ...
java
@Override public void dispatchEvent(IEvent e) { if (e instanceof ISharedObjectMessage || e.getType() == IEvent.Type.SHARED_OBJECT) { ISharedObjectMessage msg = (ISharedObjectMessage) e; if (msg.hasSource()) { beginUpdate(msg.getSource()); } else { ...
[ "@", "Override", "public", "void", "dispatchEvent", "(", "IEvent", "e", ")", "{", "if", "(", "e", "instanceof", "ISharedObjectMessage", "||", "e", ".", "getType", "(", ")", "==", "IEvent", ".", "Type", ".", "SHARED_OBJECT", ")", "{", "ISharedObjectMessage", ...
{@inheritDoc}
[ "{" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L606-L680
train
Override the dispatchEvent method to handle events from the IEvent interface.
Of course, here is the Java code you requested: ```java @Override public void dispatchEvent(IEvent e) { if (e instanceof ISharedObjectMessage || e.getType() == IEvent.Type.SHARED_OBJECT) { ISharedObjectMessage msg = (ISharedObjectMessage) e; if (msg.hasSource()) { ...
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java
LevelDbInputReader.readToTmp
private void readToTmp(int length, boolean expectEnd) throws IOException { tmpBuffer.clear(); tmpBuffer.limit(length); int read = read(tmpBuffer); if (read == -1 && expectEnd) { throw new NoSuchElementException(); } if (read != length) { throw new CorruptDataException("Premature end ...
java
private void readToTmp(int length, boolean expectEnd) throws IOException { tmpBuffer.clear(); tmpBuffer.limit(length); int read = read(tmpBuffer); if (read == -1 && expectEnd) { throw new NoSuchElementException(); } if (read != length) { throw new CorruptDataException("Premature end ...
[ "private", "void", "readToTmp", "(", "int", "length", ",", "boolean", "expectEnd", ")", "throws", "IOException", "{", "tmpBuffer", ".", "clear", "(", ")", ";", "tmpBuffer", ".", "limit", "(", "length", ")", ";", "int", "read", "=", "read", "(", "tmpBuffe...
Reads {@code length} number of bytes into {@link #tmpBuffer}. {@link #offset} is incremented and {@link #tmpBuffer} is flipped. @param expectEnd if end of stream encountered will throw {@link NoSuchElementException} when true and {@link CorruptDataException} when false.
[ "Reads", "{", "@code", "length", "}", "number", "of", "bytes", "into", "{", "@link", "#tmpBuffer", "}", ".", "{", "@link", "#offset", "}", "is", "incremented", "and", "{", "@link", "#tmpBuffer", "}", "is", "flipped", "." ]
2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java#L220-L233
train
Read length bytes from the input stream to the temporary buffer.
Of course, here is the Java code you requested: ```java private void readToTmp(int length, boolean expectEnd) throws IOException { tmpBuffer.clear(); tmpBuffer.limit(length); int read = read(tmpBuffer); if (read == -1 && expectEnd) { throw new NoSuchElementException(); } if (read != lengt...
Jasig/uPortal
uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/TagTrackingCacheEventListener.java
TagTrackingCacheEventListener.getTags
protected Set<CacheEntryTag> getTags(Element element) { final Object key = element.getObjectKey(); if (key instanceof TaggedCacheEntry) { return ((TaggedCacheEntry) key).getTags(); } final Object value = element.getObjectValue(); if (value instanceof TaggedCacheEntry...
java
protected Set<CacheEntryTag> getTags(Element element) { final Object key = element.getObjectKey(); if (key instanceof TaggedCacheEntry) { return ((TaggedCacheEntry) key).getTags(); } final Object value = element.getObjectValue(); if (value instanceof TaggedCacheEntry...
[ "protected", "Set", "<", "CacheEntryTag", ">", "getTags", "(", "Element", "element", ")", "{", "final", "Object", "key", "=", "element", ".", "getObjectKey", "(", ")", ";", "if", "(", "key", "instanceof", "TaggedCacheEntry", ")", "{", "return", "(", "(", ...
Get the tags associated with the element
[ "Get", "the", "tags", "associated", "with", "the", "element" ]
c1986542abb9acd214268f2df21c6305ad2f262b
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/TagTrackingCacheEventListener.java#L119-L131
train
Get the tags from the element.
Of course, here is the Java code you requested: ```java protected Set<CacheEntryTag> getTags(Element element) { final Object key = element.getObjectKey(); if (key instanceof TaggedCacheEntry) { return ((TaggedCacheEntry) key).getTags(); } final Object value = element.getObj...
googleapis/google-cloud-java
google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java
ProductSearchClient.formatProductSetName
@Deprecated public static final String formatProductSetName( String project, String location, String productSet) { return PRODUCT_SET_PATH_TEMPLATE.instantiate( "project", project, "location", location, "product_set", productSet); }
java
@Deprecated public static final String formatProductSetName( String project, String location, String productSet) { return PRODUCT_SET_PATH_TEMPLATE.instantiate( "project", project, "location", location, "product_set", productSet); }
[ "@", "Deprecated", "public", "static", "final", "String", "formatProductSetName", "(", "String", "project", ",", "String", "location", ",", "String", "productSet", ")", "{", "return", "PRODUCT_SET_PATH_TEMPLATE", ".", "instantiate", "(", "\"project\"", ",", "project...
Formats a string containing the fully-qualified path to represent a product_set resource. @deprecated Use the {@link ProductSetName} class instead.
[ "Formats", "a", "string", "containing", "the", "fully", "-", "qualified", "path", "to", "represent", "a", "product_set", "resource", "." ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java#L176-L183
train
Formats a string containing the fully - qualified path to represent a necessity of a product_set resource.
Of course, here is the Java code you requested: ```java @Deprecated public static final String formatProductSetName( String project, String location, String productSet) { return PRODUCT_SET_PATH_TEMPLATE.instantiate( "project", project, "location", location, "product_set", productSe...
wisdom-framework/wisdom-jdbc
wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java
AbstractJTACrud.findAll
@Override public Iterable<T> findAll() { return inTransaction(new Callable<Iterable<T>>() { @Override public Iterable<T> call() throws Exception { CriteriaQuery<T> cq = entityManager.getCriteriaBuilder().createQuery(entity); Root<T> pet = cq.from(entit...
java
@Override public Iterable<T> findAll() { return inTransaction(new Callable<Iterable<T>>() { @Override public Iterable<T> call() throws Exception { CriteriaQuery<T> cq = entityManager.getCriteriaBuilder().createQuery(entity); Root<T> pet = cq.from(entit...
[ "@", "Override", "public", "Iterable", "<", "T", ">", "findAll", "(", ")", "{", "return", "inTransaction", "(", "new", "Callable", "<", "Iterable", "<", "T", ">", ">", "(", ")", "{", "@", "Override", "public", "Iterable", "<", "T", ">", "call", "(", ...
Returns all instances of the entity. @return the instances, empty if none.
[ "Returns", "all", "instances", "of", "the", "entity", "." ]
931f5acf0b2bcb0a8f3b683d60d326caafd09a72
https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L215-L226
train
Find all the records in the database.
Of course, here is the Java code you requested: ```java @Override public Iterable<T> findAll() { return inTransaction(new Callable<Iterable<T>>() { @Override public Iterable<T> call() throws Exception { CriteriaQuery<T> cq = entityManager.getCriteriaBuilder().createQ...
cesarferreira/AndroidQuickUtils
library/src/main/java/quickutils/core/categories/security.java
security.privateBase64Decoder
private static String privateBase64Decoder(String decode, int flags) { if (flags == -1) { flags = Base64.DEFAULT; } byte[] data1 = Base64.decode(decode, flags); String decodedBase64 = null; try { decodedBase64 = new String(data1, "UTF-8"); } catch (UnsupportedEncodingException e) { e.pri...
java
private static String privateBase64Decoder(String decode, int flags) { if (flags == -1) { flags = Base64.DEFAULT; } byte[] data1 = Base64.decode(decode, flags); String decodedBase64 = null; try { decodedBase64 = new String(data1, "UTF-8"); } catch (UnsupportedEncodingException e) { e.pri...
[ "private", "static", "String", "privateBase64Decoder", "(", "String", "decode", ",", "int", "flags", ")", "{", "if", "(", "flags", "==", "-", "1", ")", "{", "flags", "=", "Base64", ".", "DEFAULT", ";", "}", "byte", "[", "]", "data1", "=", "Base64", "...
Private decoder in base64 @param toDecode String to be encoded @param flags flags to decode the String @return decoded String in base64
[ "Private", "decoder", "in", "base64" ]
73a91daedbb9f7be7986ea786fbc441c9e5a881c
https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/security.java#L101-L115
train
Private base64 decoder.
Of course, here is the Java code you requested: ```java private static String privateBase64Decoder(String decode, int flags) { if (flags == -1) { flags = Base64.DEFAULT; } byte[] data1 = Base64.decode(decode, flags); String decodedBase64 = null; try { decodedBase64 = new String(data1, "UTF-8")...
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/MetricContext.java
MetricContext.sendNotification
public void sendNotification(final Notification notification) { ContextAwareTimer.Context timer = this.notificationTimer.time(); if(!this.notificationTargets.isEmpty()) { for (final Map.Entry<UUID, Function<Notification, Void>> entry : this.notificationTargets.entrySet()) { try { ...
java
public void sendNotification(final Notification notification) { ContextAwareTimer.Context timer = this.notificationTimer.time(); if(!this.notificationTargets.isEmpty()) { for (final Map.Entry<UUID, Function<Notification, Void>> entry : this.notificationTargets.entrySet()) { try { ...
[ "public", "void", "sendNotification", "(", "final", "Notification", "notification", ")", "{", "ContextAwareTimer", ".", "Context", "timer", "=", "this", ".", "notificationTimer", ".", "time", "(", ")", ";", "if", "(", "!", "this", ".", "notificationTargets", "...
Send a notification to all targets of this context and to the parent of this context. @param notification {@link org.apache.gobblin.metrics.notification.Notification} to send.
[ "Send", "a", "notification", "to", "all", "targets", "of", "this", "context", "and", "to", "the", "parent", "of", "this", "context", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/MetricContext.java#L605-L622
train
Send a notification to all the targets.
Of course, here is the Java code you requested: ```java public void sendNotification(final Notification notification) { ContextAwareTimer.Context timer = this.notificationTimer.time(); if(!this.notificationTargets.isEmpty()) { for (final Map.Entry<UUID, Function<Notification, Void>> entry : this.notif...
brianwhu/xillium
base/src/main/java/org/xillium/base/util/Objects.java
Objects.setProperty
@SuppressWarnings("unchecked") public static void setProperty(Object object, String name, String text) throws NoSuchFieldException { try { // need to get to the field for any typeinfo annotation, so here we go ... int length = name.lastIndexOf('.'); if (length > 0) { ...
java
@SuppressWarnings("unchecked") public static void setProperty(Object object, String name, String text) throws NoSuchFieldException { try { // need to get to the field for any typeinfo annotation, so here we go ... int length = name.lastIndexOf('.'); if (length > 0) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "void", "setProperty", "(", "Object", "object", ",", "String", "name", ",", "String", "text", ")", "throws", "NoSuchFieldException", "{", "try", "{", "// need to get to the field for any typeinfo ...
Updates a property. @param object the target object @param name a dot-separated path to the property @param text a String representation of the new value @throws NoSuchFieldException if the property is not found @throws IllegalArgumentException if the value expression is invalid or can't be assigned to the property
[ "Updates", "a", "property", "." ]
e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/util/Objects.java#L60-L93
train
Sets the property of the given object to the given text.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static void setProperty(Object object, String name, String text) throws NoSuchFieldException { try { // need to get to the field for any typeinfo annotation, so here we go ... int length = ...
aeshell/aesh-readline
examples/src/main/java/examples/ShellExample.java
ShellExample.read
public void read(final Connection conn, final Readline readline) { // Just call readline and get a callback when line is openBlocking Prompt prompt = new Prompt(new TerminalString("[aesh@rules]$ ", new TerminalColor(Color.GREEN, Color.DEFAULT, Color.Intensity.BRIGHT))); ...
java
public void read(final Connection conn, final Readline readline) { // Just call readline and get a callback when line is openBlocking Prompt prompt = new Prompt(new TerminalString("[aesh@rules]$ ", new TerminalColor(Color.GREEN, Color.DEFAULT, Color.Intensity.BRIGHT))); ...
[ "public", "void", "read", "(", "final", "Connection", "conn", ",", "final", "Readline", "readline", ")", "{", "// Just call readline and get a callback when line is openBlocking", "Prompt", "prompt", "=", "new", "Prompt", "(", "new", "TerminalString", "(", "\"[aesh@rule...
Use {@link Readline} to openBlocking a user input and then process it @param conn the tty connection @param readline the readline object
[ "Use", "{", "@link", "Readline", "}", "to", "openBlocking", "a", "user", "input", "and", "then", "process", "it" ]
3d7258f6490a422658ec85c8457514390c03232d
https://github.com/aeshell/aesh-readline/blob/3d7258f6490a422658ec85c8457514390c03232d/examples/src/main/java/examples/ShellExample.java#L90-L132
train
Read a block of content from a single thread.
Of course, here is the Java code you requested: ```java public void read(final Connection conn, final Readline readline) { // Just call readline and get a callback when line is openBlocking Prompt prompt = new Prompt(new TerminalString("[aesh@rules]$ ", new TerminalColor(Color.G...
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java
ArtifactDetailsLayout.populateArtifactDetails
public void populateArtifactDetails(final SoftwareModule softwareModule) { if (softwareModule == null) { populateArtifactDetails(null, null); } else { populateArtifactDetails(softwareModule.getId(), HawkbitCommonUtil.getFormattedNameVersion(softwareModule.getN...
java
public void populateArtifactDetails(final SoftwareModule softwareModule) { if (softwareModule == null) { populateArtifactDetails(null, null); } else { populateArtifactDetails(softwareModule.getId(), HawkbitCommonUtil.getFormattedNameVersion(softwareModule.getN...
[ "public", "void", "populateArtifactDetails", "(", "final", "SoftwareModule", "softwareModule", ")", "{", "if", "(", "softwareModule", "==", "null", ")", "{", "populateArtifactDetails", "(", "null", ",", "null", ")", ";", "}", "else", "{", "populateArtifactDetails"...
Populate artifact details. @param softwareModule software module
[ "Populate", "artifact", "details", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java#L418-L425
train
Populate artifact details.
Of course, here is the Java code you requested: ```java public void populateArtifactDetails(final SoftwareModule softwareModule) { if (softwareModule == null) { populateArtifactDetails(null, null); } else { populateArtifactDetails(softwareModule.getId(), Hawk...
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java
TimePickerDialog.isTypedTimeFullyLegal
private boolean isTypedTimeFullyLegal() { if (mIs24HourMode) { // For 24-hour mode, the time is legal if the hours and minutes are each legal. Note: // getEnteredTime() will ONLY call isTypedTimeFullyLegal() when NOT in 24hour mode. Boolean[] enteredZeros = {false, false, fal...
java
private boolean isTypedTimeFullyLegal() { if (mIs24HourMode) { // For 24-hour mode, the time is legal if the hours and minutes are each legal. Note: // getEnteredTime() will ONLY call isTypedTimeFullyLegal() when NOT in 24hour mode. Boolean[] enteredZeros = {false, false, fal...
[ "private", "boolean", "isTypedTimeFullyLegal", "(", ")", "{", "if", "(", "mIs24HourMode", ")", "{", "// For 24-hour mode, the time is legal if the hours and minutes are each legal. Note:", "// getEnteredTime() will ONLY call isTypedTimeFullyLegal() when NOT in 24hour mode.", "Boolean", "...
Check if the time that has been typed so far is completely legal, as is.
[ "Check", "if", "the", "time", "that", "has", "been", "typed", "so", "far", "is", "completely", "legal", "as", "is", "." ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java#L1416-L1429
train
Checks if the typed time is fully legal.
Of course, here is the Java code you requested: ```java private boolean isTypedTimeFullyLegal() { if (mIs24HourMode) { // For 24-hour mode, the time is legal if the hours and minutes are each legal. Note: // getEnteredTime() will ONLY call isTypedTimeFullyLegal() when NOT in 24hour mode...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java
ChunkedIntArray.writeEntry
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException { /* try { fastArray[( position*slotsize)+offset] = value; } catch(ArrayIndexOutOfBoundsException aioobe) */ { if (offset >= slotsize) throw new ArrayIndexOutOfBoundsException(XML...
java
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException { /* try { fastArray[( position*slotsize)+offset] = value; } catch(ArrayIndexOutOfBoundsException aioobe) */ { if (offset >= slotsize) throw new ArrayIndexOutOfBoundsException(XML...
[ "void", "writeEntry", "(", "int", "position", ",", "int", "offset", ",", "int", "value", ")", "throws", "ArrayIndexOutOfBoundsException", "{", "/*\n try\n {\n fastArray[( position*slotsize)+offset] = value;\n }\n catch(ArrayIndexOutOfBoundsException aioobe)\n */", ...
Overwrite the integer found at a specific record and column. Used to back-patch existing records, most often changing their "next sibling" reference from 0 (unknown) to something meaningful @param position int Record number @param offset int Column number @param value int New contents
[ "Overwrite", "the", "integer", "found", "at", "a", "specific", "record", "and", "column", ".", "Used", "to", "back", "-", "patch", "existing", "records", "most", "often", "changing", "their", "next", "sibling", "reference", "from", "0", "(", "unknown", ")", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java#L192-L210
train
Write an entry to the array.
Of course, here is the Java code you requested: ```java void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException { /* try { fastArray[( position*slotsize)+offset] = value; } catch(ArrayIndexOutOfBoundsException aioobe) */ { if (offset >= slots...
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java
CommonOps_DDF2.divide
public static void divide( DMatrix2x2 a , double alpha ) { a.a11 /= alpha; a.a12 /= alpha; a.a21 /= alpha; a.a22 /= alpha; }
java
public static void divide( DMatrix2x2 a , double alpha ) { a.a11 /= alpha; a.a12 /= alpha; a.a21 /= alpha; a.a22 /= alpha; }
[ "public", "static", "void", "divide", "(", "DMatrix2x2", "a", ",", "double", "alpha", ")", "{", "a", ".", "a11", "/=", "alpha", ";", "a", ".", "a12", "/=", "alpha", ";", "a", ".", "a21", "/=", "alpha", ";", "a", ".", "a22", "/=", "alpha", ";", ...
<p> Performs an in-place element by element scalar division. Scalar denominator.<br> <br> a<sub>ij</sub> = a<sub>ij</sub>/&alpha; </p> @param a The matrix whose elements are to be divided. Modified. @param alpha the amount each element is divided by.
[ "<p", ">", "Performs", "an", "in", "-", "place", "element", "by", "element", "scalar", "division", ".", "Scalar", "denominator", ".", "<br", ">", "<br", ">", "a<sub", ">", "ij<", "/", "sub", ">", "=", "a<sub", ">", "ij<", "/", "sub", ">", "/", "&al...
1444680cc487af5e866730e62f48f5f9636850d9
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L1038-L1041
train
Divide the elements of the matrix by the given alpha value.
Of course, here is the Java code you requested: ```java public static void divide( DMatrix2x2 a , double alpha ) { a.a11 /= alpha; a.a12 /= alpha; a.a21 /= alpha; a.a22 /= alpha; } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.kie.eclipse.navigator/src/main/java/org/kie/eclipse/navigator/preferences/FieldEditorPropertyPage.java
FieldEditorPropertyPage.dispose
@Override public void dispose() { super.dispose(); if (fields != null) { Iterator<FieldEditor> e = fields.iterator(); while (e.hasNext()) { FieldEditor pe = e.next(); pe.setPage(null); pe.setPropertyChangeListener(null); pe.setPreferenceStore(null); } } }
java
@Override public void dispose() { super.dispose(); if (fields != null) { Iterator<FieldEditor> e = fields.iterator(); while (e.hasNext()) { FieldEditor pe = e.next(); pe.setPage(null); pe.setPropertyChangeListener(null); pe.setPreferenceStore(null); } } }
[ "@", "Override", "public", "void", "dispose", "(", ")", "{", "super", ".", "dispose", "(", ")", ";", "if", "(", "fields", "!=", "null", ")", "{", "Iterator", "<", "FieldEditor", ">", "e", "=", "fields", ".", "iterator", "(", ")", ";", "while", "(",...
The field editor preference page implementation of an <code>IDialogPage</code> method disposes of this page's controls and images. Subclasses may override to release their own allocated SWT resources, but must call <code>super.dispose</code>.
[ "The", "field", "editor", "preference", "page", "implementation", "of", "an", "<code", ">", "IDialogPage<", "/", "code", ">", "method", "disposes", "of", "this", "page", "s", "controls", "and", "images", ".", "Subclasses", "may", "override", "to", "release", ...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse.navigator/src/main/java/org/kie/eclipse/navigator/preferences/FieldEditorPropertyPage.java#L222-L234
test
Dispose of the object.
Of course, here is the Java code you requested: ```java @Override public void dispose() { super.dispose(); if (fields != null) { Iterator<FieldEditor> e = fields.iterator(); while (e.hasNext()) { FieldEditor pe = e.next(); pe.setPage(null); pe.setPropertyChangeListener(null); pe.setPreferenc...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.setDoctype
public void setDoctype(String doctypeSystem, String doctypePublic) { setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, doctypeSystem); setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, doctypePublic); }
java
public void setDoctype(String doctypeSystem, String doctypePublic) { setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, doctypeSystem); setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, doctypePublic); }
[ "public", "void", "setDoctype", "(", "String", "doctypeSystem", ",", "String", "doctypePublic", ")", "{", "setOutputProperty", "(", "OutputKeys", ".", "DOCTYPE_SYSTEM", ",", "doctypeSystem", ")", ";", "setOutputProperty", "(", "OutputKeys", ".", "DOCTYPE_PUBLIC", ",...
Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties @param doctypeSystem the system identifier to be used in the DOCTYPE declaration in the output document. @param doctypePublic the public identifier to be used in the DOCTYPE declaration in the output document.
[ "Set", "the", "value", "coming", "from", "the", "xsl", ":", "output", "doctype", "-", "public", "and", "doctype", "-", "system", "stylesheet", "properties" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L643-L647
train
Sets the doctype system and public attributes of the XML document.
Of course, here is the Java code you requested: ```java public void setDoctype(String doctypeSystem, String doctypePublic) { setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, doctypeSystem); setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, doctypePublic); } ``` Hope this helps!
haraldk/TwelveMonkeys
common/common-io/src/main/java/com/twelvemonkeys/io/LittleEndianDataOutputStream.java
LittleEndianDataOutputStream.writeChar
public void writeChar(int pChar) throws IOException { out.write(pChar & 0xFF); out.write((pChar >>> 8) & 0xFF); bytesWritten += 2; }
java
public void writeChar(int pChar) throws IOException { out.write(pChar & 0xFF); out.write((pChar >>> 8) & 0xFF); bytesWritten += 2; }
[ "public", "void", "writeChar", "(", "int", "pChar", ")", "throws", "IOException", "{", "out", ".", "write", "(", "pChar", "&", "0xFF", ")", ";", "out", ".", "write", "(", "(", "pChar", ">>>", "8", ")", "&", "0xFF", ")", ";", "bytesWritten", "+=", "...
Writes a two byte {@code char} to the underlying output stream in little endian order, low byte first. @param pChar the {@code char} value to be written. @throws IOException if the underlying stream throws an IOException.
[ "Writes", "a", "two", "byte", "{", "@code", "char", "}", "to", "the", "underlying", "output", "stream", "in", "little", "endian", "order", "low", "byte", "first", "." ]
7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/LittleEndianDataOutputStream.java#L162-L166
train
Write a single octet of a .
Of course, here is the Java code you requested: ```java public void writeChar(int pChar) throws IOException { out.write(pChar & 0xFF); out.write((pChar >>> 8) & 0xFF); bytesWritten += 2; } ``` Hope this helps!
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/net/ssl/SSLContextFactoryBean.java
SSLContextFactoryBean.keyStoreFromSystemProperties
private KeyStoreFactoryBean keyStoreFromSystemProperties(String property) { if (System.getProperty(property) == null) return null; KeyStoreFactoryBean keyStore = new KeyStoreFactoryBean(); keyStore.setLocation(locationFromSystemProperty(property)); keyStore.setProvider(System.getProperty(property + "Pro...
java
private KeyStoreFactoryBean keyStoreFromSystemProperties(String property) { if (System.getProperty(property) == null) return null; KeyStoreFactoryBean keyStore = new KeyStoreFactoryBean(); keyStore.setLocation(locationFromSystemProperty(property)); keyStore.setProvider(System.getProperty(property + "Pro...
[ "private", "KeyStoreFactoryBean", "keyStoreFromSystemProperties", "(", "String", "property", ")", "{", "if", "(", "System", ".", "getProperty", "(", "property", ")", "==", "null", ")", "return", "null", ";", "KeyStoreFactoryBean", "keyStore", "=", "new", "KeyStore...
Constructs a key store factory bean using JSSE system properties. @param property base property name (e.g. {@code javax.net.ssl.keyStore}) @return key store or {@code null} if no value is defined for the base system property name
[ "Constructs", "a", "key", "store", "factory", "bean", "using", "JSSE", "system", "properties", "." ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/net/ssl/SSLContextFactoryBean.java#L217-L225
test
This method is used to get a KeyStoreFactoryBean from system properties.
Of course, here is the Java code you requested: ```java private KeyStoreFactoryBean keyStoreFromSystemProperties(String property) { if (System.getProperty(property) == null) return null; KeyStoreFactoryBean keyStore = new KeyStoreFactoryBean(); keyStore.setLocation(locationFromSystemProperty(property)); ...
apptik/jus
android/jus-android/src/main/java/io/apptik/comm/jus/util/BitmapLruPool.java
BitmapLruPool.getBytesPerPixel
protected static int getBytesPerPixel(Bitmap.Config config) { if (config == Bitmap.Config.ARGB_8888) { return 4; } else if (config == Bitmap.Config.RGB_565) { return 2; } else if (config == Bitmap.Config.ARGB_4444) { return 2; } else if (config == Bitm...
java
protected static int getBytesPerPixel(Bitmap.Config config) { if (config == Bitmap.Config.ARGB_8888) { return 4; } else if (config == Bitmap.Config.RGB_565) { return 2; } else if (config == Bitmap.Config.ARGB_4444) { return 2; } else if (config == Bitm...
[ "protected", "static", "int", "getBytesPerPixel", "(", "Bitmap", ".", "Config", "config", ")", "{", "if", "(", "config", "==", "Bitmap", ".", "Config", ".", "ARGB_8888", ")", "{", "return", "4", ";", "}", "else", "if", "(", "config", "==", "Bitmap", "....
Return the byte usage per pixel of a bitmap based on its configuration. @param config The bitmap configuration. @return The byte usage per pixel.
[ "Return", "the", "byte", "usage", "per", "pixel", "of", "a", "bitmap", "based", "on", "its", "configuration", "." ]
8a37a21b41f897d68eaeaab07368ec22a1e5a60e
https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/util/BitmapLruPool.java#L206-L217
train
Get the bytes per pixel for a bitmap.
Of course, here is the Java code you requested: ```java protected static int getBytesPerPixel(Bitmap.Config config) { if (config == Bitmap.Config.ARGB_8888) { return 4; } else if (config == Bitmap.Config.RGB_565) { return 2; } else if (config == Bitmap.Config.ARGB_4444) ...
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java
Organizer.makeCopies
@SuppressWarnings( { "unchecked", "rawtypes" }) public static void makeCopies(Collection<Copier> aFrom, Collection<Copier> aTo) { if (aFrom == null || aTo == null) return; List<Copier> fromList = new ArrayList<Copier>(aFrom); List<Copier> toList = new ArrayList<Copier>(aTo); Collections.sort((Li...
java
@SuppressWarnings( { "unchecked", "rawtypes" }) public static void makeCopies(Collection<Copier> aFrom, Collection<Copier> aTo) { if (aFrom == null || aTo == null) return; List<Copier> fromList = new ArrayList<Copier>(aFrom); List<Copier> toList = new ArrayList<Copier>(aTo); Collections.sort((Li...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "static", "void", "makeCopies", "(", "Collection", "<", "Copier", ">", "aFrom", ",", "Collection", "<", "Copier", ">", "aTo", ")", "{", "if", "(", "aFrom", "==", ...
Copy data from object to object @param aFrom the object to copy from @param aTo the object to copy to
[ "Copy", "data", "from", "object", "to", "object" ]
38d5b843c76eae9762bbca20453ed0f0ad8412a9
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java#L845-L868
train
Creates a copy of the given collections.
Of course, here is the Java code you requested: ```java @SuppressWarnings( { "unchecked", "rawtypes" }) public static void makeCopies(Collection<Copier> aFrom, Collection<Copier> aTo) { if (aFrom == null || aTo == null) return; List<Copier> fromList = new ArrayList<Copier>(aFrom); List<Copier> toL...
igniterealtime/Smack
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/sshare/api/OctTreeQuantizer.java
OctTreeQuantizer.addPixels
@Override public void addPixels(int[] pixels, int offset, int count) { for (int i = 0; i < count; i++) { insertColor(pixels[i + offset]); if (colors > reduceColors) reduceTree(reduceColors); } }
java
@Override public void addPixels(int[] pixels, int offset, int count) { for (int i = 0; i < count; i++) { insertColor(pixels[i + offset]); if (colors > reduceColors) reduceTree(reduceColors); } }
[ "@", "Override", "public", "void", "addPixels", "(", "int", "[", "]", "pixels", ",", "int", "offset", ",", "int", "count", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "insertColor", "(", "pixels",...
Add pixels to the quantizer. @param pixels the array of ARGB pixels @param offset the offset into the array @param count the count of pixels
[ "Add", "pixels", "to", "the", "quantizer", "." ]
870756997faec1e1bfabfac0cd6c2395b04da873
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/sshare/api/OctTreeQuantizer.java#L102-L109
train
Add pixels to the image.
Of course, here is the Java code you requested: ```java @Override public void addPixels(int[] pixels, int offset, int count) { for (int i = 0; i < count; i++) { insertColor(pixels[i + offset]); if (colors > reduceColors) reduceTree(reduceColors); } } ``` ...
nmdp-bioinformatics/ngs
range/src/main/java/org/nmdp/ngs/range/Ranges.java
Ranges.isLessThan
public static <C extends Comparable> boolean isLessThan(final Range<C> range, final C value) { checkNotNull(range); checkNotNull(value); if (!range.hasUpperBound()) { return false; } if (range.upperBoundType() == BoundType.OPEN && range.upperEndpoint().equals(value))...
java
public static <C extends Comparable> boolean isLessThan(final Range<C> range, final C value) { checkNotNull(range); checkNotNull(value); if (!range.hasUpperBound()) { return false; } if (range.upperBoundType() == BoundType.OPEN && range.upperEndpoint().equals(value))...
[ "public", "static", "<", "C", "extends", "Comparable", ">", "boolean", "isLessThan", "(", "final", "Range", "<", "C", ">", "range", ",", "final", "C", "value", ")", "{", "checkNotNull", "(", "range", ")", ";", "checkNotNull", "(", "value", ")", ";", "i...
Return true if the specified range is strictly less than the specified value. @param <C> range endpoint type @param range range, must not be null @param value value, must not be null @return true if the specified range is strictly less than the specified value
[ "Return", "true", "if", "the", "specified", "range", "is", "strictly", "less", "than", "the", "specified", "value", "." ]
277627e4311313a80f5dc110b3185b0d7af32bd0
https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/range/src/main/java/org/nmdp/ngs/range/Ranges.java#L110-L121
train
Check if the range is less than the given value.
Of course, here is the Java code you requested: ```java public static <C extends Comparable> boolean isLessThan(final Range<C> range, final C value) { checkNotNull(range); checkNotNull(value); if (!range.hasUpperBound()) { return false; } if (range.upperBoundType() ...
Wikidata/Wikidata-Toolkit
wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFileManager.java
WmfDumpFileManager.mergeDumpLists
List<MwDumpFile> mergeDumpLists(List<MwDumpFile> localDumps, List<MwDumpFile> onlineDumps) { List<MwDumpFile> result = new ArrayList<>(localDumps); HashSet<String> localDateStamps = new HashSet<>(); for (MwDumpFile dumpFile : localDumps) { localDateStamps.add(dumpFile.getDateStamp()); } for (MwDumpFile...
java
List<MwDumpFile> mergeDumpLists(List<MwDumpFile> localDumps, List<MwDumpFile> onlineDumps) { List<MwDumpFile> result = new ArrayList<>(localDumps); HashSet<String> localDateStamps = new HashSet<>(); for (MwDumpFile dumpFile : localDumps) { localDateStamps.add(dumpFile.getDateStamp()); } for (MwDumpFile...
[ "List", "<", "MwDumpFile", ">", "mergeDumpLists", "(", "List", "<", "MwDumpFile", ">", "localDumps", ",", "List", "<", "MwDumpFile", ">", "onlineDumps", ")", "{", "List", "<", "MwDumpFile", ">", "result", "=", "new", "ArrayList", "<>", "(", "localDumps", "...
Merges a list of local and online dumps. For dumps available both online and locally, only the local version is included. The list is order with most recent dump date first. @return a merged list of dump files
[ "Merges", "a", "list", "of", "local", "and", "online", "dumps", ".", "For", "dumps", "available", "both", "online", "and", "locally", "only", "the", "local", "version", "is", "included", ".", "The", "list", "is", "order", "with", "most", "recent", "dump", ...
7732851dda47e1febff406fba27bfec023f4786e
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-dumpfiles/src/main/java/org/wikidata/wdtk/dumpfiles/wmf/WmfDumpFileManager.java#L215-L230
train
Merge a list of local and online dump lists into one.
Of course, here is the Java code you requested: ```java List<MwDumpFile> mergeDumpLists(List<MwDumpFile> localDumps, List<MwDumpFile> onlineDumps) { List<MwDumpFile> result = new ArrayList<>(localDumps); HashSet<String> localDateStamps = new HashSet<>(); for (MwDumpFile dumpFile : localDumps) { localDateS...
jenkinsci/java-client-api
jenkins-client/src/main/java/com/offbytwo/jenkins/client/util/ResponseUtils.java
ResponseUtils.getJenkinsVersion
public static String getJenkinsVersion(final HttpResponse response) { final Header[] hdrs = response.getHeaders("X-Jenkins"); return hdrs.length == 0 ? "" : hdrs[0].getValue(); }
java
public static String getJenkinsVersion(final HttpResponse response) { final Header[] hdrs = response.getHeaders("X-Jenkins"); return hdrs.length == 0 ? "" : hdrs[0].getValue(); }
[ "public", "static", "String", "getJenkinsVersion", "(", "final", "HttpResponse", "response", ")", "{", "final", "Header", "[", "]", "hdrs", "=", "response", ".", "getHeaders", "(", "\"X-Jenkins\"", ")", ";", "return", "hdrs", ".", "length", "==", "0", "?", ...
Get Jenkins version from supplied response if any. @param response the response @return the version or empty string
[ "Get", "Jenkins", "version", "from", "supplied", "response", "if", "any", "." ]
c4f5953d3d4dda92cd946ad3bf2b811524c32da9
https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/client/util/ResponseUtils.java#L32-L35
train
Gets the Jenkins version from the response.
Of course, here is the Java code you requested: ```java public static String getJenkinsVersion(final HttpResponse response) { final Header[] hdrs = response.getHeaders("X-Jenkins"); return hdrs.length == 0 ? "" : hdrs[0].getValue(); } ``` Hope this helps!
infinispan/infinispan
core/src/main/java/org/infinispan/util/concurrent/locks/StripedLock.java
StripedLock.acquireLock
public void acquireLock(Object key, boolean exclusive) { ReentrantReadWriteLock lock = getLock(key); if (exclusive) { lock.writeLock().lock(); if (trace) log.tracef("WL acquired for '%s'", key); } else { lock.readLock().lock(); if (trace) log.tracef("RL acquired for...
java
public void acquireLock(Object key, boolean exclusive) { ReentrantReadWriteLock lock = getLock(key); if (exclusive) { lock.writeLock().lock(); if (trace) log.tracef("WL acquired for '%s'", key); } else { lock.readLock().lock(); if (trace) log.tracef("RL acquired for...
[ "public", "void", "acquireLock", "(", "Object", "key", ",", "boolean", "exclusive", ")", "{", "ReentrantReadWriteLock", "lock", "=", "getLock", "(", "key", ")", ";", "if", "(", "exclusive", ")", "{", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ...
Blocks until a lock is acquired. @param exclusive if true, a write (exclusive) lock is attempted, otherwise a read (shared) lock is used.
[ "Blocks", "until", "a", "lock", "is", "acquired", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/util/concurrent/locks/StripedLock.java#L74-L83
train
Acquires a lock on the specified key.
Of course, here is the Java code you requested: ```java public void acquireLock(Object key, boolean exclusive) { ReentrantReadWriteLock lock = getLock(key); if (exclusive) { lock.writeLock().lock(); if (trace) log.tracef("WL acquired for '%s'", key); } else { lock.readLock(...
spring-projects/spring-security-oauth
spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/RSA_SHA1SignatureMethod.java
RSA_SHA1SignatureMethod.sign
public String sign(String signatureBaseString) { if (privateKey == null) { throw new UnsupportedOperationException("Cannot sign the base string: no private key supplied."); } try { Signature signer = Signature.getInstance("SHA1withRSA"); signer.initSign(privateKey); signer.update(si...
java
public String sign(String signatureBaseString) { if (privateKey == null) { throw new UnsupportedOperationException("Cannot sign the base string: no private key supplied."); } try { Signature signer = Signature.getInstance("SHA1withRSA"); signer.initSign(privateKey); signer.update(si...
[ "public", "String", "sign", "(", "String", "signatureBaseString", ")", "{", "if", "(", "privateKey", "==", "null", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"Cannot sign the base string: no private key supplied.\"", ")", ";", "}", "try", "{", ...
The Signature Base String is signed using the Consumer’s RSA private key per RFC3447 section 8.2.1, where K is the Consumer’s RSA private key, M the Signature Base String, and S is the result signature octet string: {@code S = RSASSA-PKCS1-V1_5-SIGN (K, M) } oauth_signature is set to S, first base64-encoded per RFC20...
[ "The", "Signature", "Base", "String", "is", "signed", "using", "the", "Consumer’s", "RSA", "private", "key", "per", "RFC3447", "section", "8", ".", "2", ".", "1", "where", "K", "is", "the", "Consumer’s", "RSA", "private", "key", "M", "the", "Signature", ...
bbae0027eceb2c74a21ac26bbc86142dc732ffbe
https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/RSA_SHA1SignatureMethod.java#L92-L117
train
Sign the given base string using the private key.
Of course, here is the Java code you requested: ```java public String sign(String signatureBaseString) { if (privateKey == null) { throw new UnsupportedOperationException("Cannot sign the base string: no private key supplied."); } try { Signature signer = Signature.getInstance("SHA1withRSA"); ...
thorntail/thorntail
core/container/src/main/java/org/wildfly/swarm/Swarm.java
Swarm.stop
public Swarm stop() throws Exception { if (this.server == null) { throw SwarmMessages.MESSAGES.containerNotStarted("stop()"); } this.server.stop(); this.server = null; Module module = Module.getBootModuleLoader().loadModule(CONTAINER_MODULE_NAME); Class<?> ...
java
public Swarm stop() throws Exception { if (this.server == null) { throw SwarmMessages.MESSAGES.containerNotStarted("stop()"); } this.server.stop(); this.server = null; Module module = Module.getBootModuleLoader().loadModule(CONTAINER_MODULE_NAME); Class<?> ...
[ "public", "Swarm", "stop", "(", ")", "throws", "Exception", "{", "if", "(", "this", ".", "server", "==", "null", ")", "{", "throw", "SwarmMessages", ".", "MESSAGES", ".", "containerNotStarted", "(", "\"stop()\"", ")", ";", "}", "this", ".", "server", "."...
Stop the container, first undeploying all deployments. @return THe container. @throws Exception If an error occurs.
[ "Stop", "the", "container", "first", "undeploying", "all", "deployments", "." ]
4a391b68ffae98c6e66d30a3bfb99dadc9509f14
https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/container/src/main/java/org/wildfly/swarm/Swarm.java#L428-L444
train
Stop the container.
Of course, here is the Java code you requested: ```java public Swarm stop() throws Exception { if (this.server == null) { throw SwarmMessages.MESSAGES.containerNotStarted("stop()"); } this.server.stop(); this.server = null; Module module = Module.getBootModuleLoad...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServicesConfiguration.java
TaskManagerServicesConfiguration.fromConfiguration
public static TaskManagerServicesConfiguration fromConfiguration( Configuration configuration, long maxJvmHeapMemory, InetAddress remoteAddress, boolean localCommunication) { final String[] tmpDirs = ConfigurationUtils.parseTempDirectories(configuration); String[] localStateRootDir = ConfigurationUtils....
java
public static TaskManagerServicesConfiguration fromConfiguration( Configuration configuration, long maxJvmHeapMemory, InetAddress remoteAddress, boolean localCommunication) { final String[] tmpDirs = ConfigurationUtils.parseTempDirectories(configuration); String[] localStateRootDir = ConfigurationUtils....
[ "public", "static", "TaskManagerServicesConfiguration", "fromConfiguration", "(", "Configuration", "configuration", ",", "long", "maxJvmHeapMemory", ",", "InetAddress", "remoteAddress", ",", "boolean", "localCommunication", ")", "{", "final", "String", "[", "]", "tmpDirs"...
Utility method to extract TaskManager config parameters from the configuration and to sanity check them. @param configuration The configuration. @param maxJvmHeapMemory The maximum JVM heap size, in bytes. @param remoteAddress identifying the IP address under which the TaskManager will be accessible @param localCommun...
[ "Utility", "method", "to", "extract", "TaskManager", "config", "parameters", "from", "the", "configuration", "and", "to", "sanity", "check", "them", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServicesConfiguration.java#L205-L248
train
Creates a new TaskManagerServicesConfiguration from the given configuration.
Of course, here is the Java code you requested: ```java public static TaskManagerServicesConfiguration fromConfiguration( Configuration configuration, long maxJvmHeapMemory, InetAddress remoteAddress, boolean localCommunication) { final String[] tmpDirs = ConfigurationUtils.parseTempDirectories(configura...
forge/furnace
se/src/main/java/org/jboss/forge/furnace/se/FurnaceFactory.java
FurnaceFactory.getInstance
public static Furnace getInstance() { try { final BootstrapClassLoader loader = new BootstrapClassLoader("bootpath"); return getInstance(FurnaceFactory.class.getClassLoader(), loader); } catch (Exception e) { throw new RuntimeException(e); } }
java
public static Furnace getInstance() { try { final BootstrapClassLoader loader = new BootstrapClassLoader("bootpath"); return getInstance(FurnaceFactory.class.getClassLoader(), loader); } catch (Exception e) { throw new RuntimeException(e); } }
[ "public", "static", "Furnace", "getInstance", "(", ")", "{", "try", "{", "final", "BootstrapClassLoader", "loader", "=", "new", "BootstrapClassLoader", "(", "\"bootpath\"", ")", ";", "return", "getInstance", "(", "FurnaceFactory", ".", "class", ".", "getClassLoade...
Produce a {@link Furnace} instance using the default bootstrap {@link ClassLoader} to load core furnace implementation JARs from `<code>src/main/java/bootpath/*</code>`.
[ "Produce", "a", "{" ]
bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a
https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/se/src/main/java/org/jboss/forge/furnace/se/FurnaceFactory.java#L28-L39
train
Get a Furnace instance.
Of course, here is the Java code you requested: ```java public static Furnace getInstance() { try { final BootstrapClassLoader loader = new BootstrapClassLoader("bootpath"); return getInstance(FurnaceFactory.class.getClassLoader(), loader); } catch (Exception e) { ...
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/resourceindex/cdxserver/AccessCheckFilter.java
AccessCheckFilter.includeUrl
@Override public boolean includeUrl(String urlKey, String originalUrl) { // return include(urlKey, originalUrl, true); if (UrlOperations.urlToScheme(originalUrl) == null) { originalUrl = UrlOperations.HTTP_SCHEME + originalUrl; } CaptureSearchResult resultTester = new FastCaptureSearchResult(); resultTest...
java
@Override public boolean includeUrl(String urlKey, String originalUrl) { // return include(urlKey, originalUrl, true); if (UrlOperations.urlToScheme(originalUrl) == null) { originalUrl = UrlOperations.HTTP_SCHEME + originalUrl; } CaptureSearchResult resultTester = new FastCaptureSearchResult(); resultTest...
[ "@", "Override", "public", "boolean", "includeUrl", "(", "String", "urlKey", ",", "String", "originalUrl", ")", "{", "//\t\treturn include(urlKey, originalUrl, true);", "if", "(", "UrlOperations", ".", "urlToScheme", "(", "originalUrl", ")", "==", "null", ")", "{", ...
}
[ "}" ]
da74c3a59a5b5a5c365bd4702dcb45d263535794
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/resourceindex/cdxserver/AccessCheckFilter.java#L147-L161
train
Include the URL with the given key and original URL.
Of course, here is the Java code you requested: ```java @Override public boolean includeUrl(String urlKey, String originalUrl) { // return include(urlKey, originalUrl, true); if (UrlOperations.urlToScheme(originalUrl) == null) { originalUrl = UrlOperations.HTTP_SCHEME + originalUrl; } CaptureSearchResult r...
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/DefaultVersion.java
DefaultVersion.trimPadding
private static void trimPadding(List<Element> elements) { for (ListIterator<Element> it = elements.listIterator(elements.size()); it.hasPrevious();) { Element element = it.previous(); if (element.compareTo(null) == 0) { it.remove(); } else { ...
java
private static void trimPadding(List<Element> elements) { for (ListIterator<Element> it = elements.listIterator(elements.size()); it.hasPrevious();) { Element element = it.previous(); if (element.compareTo(null) == 0) { it.remove(); } else { ...
[ "private", "static", "void", "trimPadding", "(", "List", "<", "Element", ">", "elements", ")", "{", "for", "(", "ListIterator", "<", "Element", ">", "it", "=", "elements", ".", "listIterator", "(", "elements", ".", "size", "(", ")", ")", ";", "it", "."...
Remove empty elements. @param elements the list of clean
[ "Remove", "empty", "elements", "." ]
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/version/internal/DefaultVersion.java#L456-L467
train
trim padding from the elements list
Of course, here is the Java code you requested: ```java private static void trimPadding(List<Element> elements) { for (ListIterator<Element> it = elements.listIterator(elements.size()); it.hasPrevious();) { Element element = it.previous(); if (element.compareTo(null) == 0) { ...
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/generic/NullnessConversationInstruction.java
NullnessConversationInstruction.accept
@Override public void accept( Visitor v ) { v.visitTypedInstruction(this); v.visitStackProducer(this); v.visitStackConsumer(this); v.visitConversionInstruction(this); }
java
@Override public void accept( Visitor v ) { v.visitTypedInstruction(this); v.visitStackProducer(this); v.visitStackConsumer(this); v.visitConversionInstruction(this); }
[ "@", "Override", "public", "void", "accept", "(", "Visitor", "v", ")", "{", "v", ".", "visitTypedInstruction", "(", "this", ")", ";", "v", ".", "visitStackProducer", "(", "this", ")", ";", "v", ".", "visitStackConsumer", "(", "this", ")", ";", "v", "."...
Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last. @param v Visitor object
[ "Call", "corresponding", "visitor", "method", "(", "s", ")", ".", "The", "order", "is", ":", "Call", "visitor", "methods", "of", "implemented", "interfaces", "first", "then", "call", "methods", "according", "to", "the", "class", "hierarchy", "in", "descending"...
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/bcel/generic/NullnessConversationInstruction.java#L62-L68
train
Visit this node the type of the XSD header.
Of course, here is the Java code you requested: ```java @Override public void accept( Visitor v ) { v.visitTypedInstruction(this); v.visitStackProducer(this); v.visitStackConsumer(this); v.visitConversionInstruction(this); } ``` Hope this helps!
cybazeitalia/emaze-dysfunctional
src/main/java/net/emaze/dysfunctional/Groups.java
Groups.partition
public static <T, CA extends Collection<T>, CR extends Collection<T>> Pair<CA, CR> partition(Iterable<T> values, Predicate<T> partitioner, Supplier<CA> acceptedCollectionProvider, Supplier<CR> refusedCollectionProvider) { dbc.precondition(values != null, "cannot partition a null iterable"); return new P...
java
public static <T, CA extends Collection<T>, CR extends Collection<T>> Pair<CA, CR> partition(Iterable<T> values, Predicate<T> partitioner, Supplier<CA> acceptedCollectionProvider, Supplier<CR> refusedCollectionProvider) { dbc.precondition(values != null, "cannot partition a null iterable"); return new P...
[ "public", "static", "<", "T", ",", "CA", "extends", "Collection", "<", "T", ">", ",", "CR", "extends", "Collection", "<", "T", ">", ">", "Pair", "<", "CA", ",", "CR", ">", "partition", "(", "Iterable", "<", "T", ">", "values", ",", "Predicate", "<"...
Partitions elements from the iterable into two collections containing elements that match the predicate (left side collection) and elements that don't (right side collection). E.g: <code>partition([1,2,3,4], isOdd) -> ([1,3],[2,4])</code> @param <T> the element type @param <CA> the accepted elements collection type @p...
[ "Partitions", "elements", "from", "the", "iterable", "into", "two", "collections", "containing", "elements", "that", "match", "the", "predicate", "(", "left", "side", "collection", ")", "and", "elements", "that", "don", "t", "(", "right", "side", "collection", ...
98115a436e35335c5e8831f9fdc12f6d93d524be
https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Groups.java#L295-L298
train
Partition a collection of objects using the specified predicate.
Of course, here is the Java code you requested: ```java public static <T, CA extends Collection<T>, CR extends Collection<T>> Pair<CA, CR> partition(Iterable<T> values, Predicate<T> partitioner, Supplier<CA> acceptedCollectionProvider, Supplier<CR> refusedCollectionProvider) { dbc.precondition(values != null, ...
linkedin/linkedin-utils
org.linkedin.util-core/src/main/java/org/linkedin/util/xml/AbstractXMLBuilder.java
AbstractXMLBuilder.addTag
@Override public void addTag(String tagName, double value) { addTag(tagName, String.valueOf(value)); }
java
@Override public void addTag(String tagName, double value) { addTag(tagName, String.valueOf(value)); }
[ "@", "Override", "public", "void", "addTag", "(", "String", "tagName", ",", "double", "value", ")", "{", "addTag", "(", "tagName", ",", "String", ".", "valueOf", "(", "value", ")", ")", ";", "}" ]
Adds a tag @param tagName the name of the tag to add @param value the value of the tag to add
[ "Adds", "a", "tag" ]
ca097410b537fb09847c42037593c0f474c0571f
https://github.com/linkedin/linkedin-utils/blob/ca097410b537fb09847c42037593c0f474c0571f/org.linkedin.util-core/src/main/java/org/linkedin/util/xml/AbstractXMLBuilder.java#L50-L54
valid
Override the addTag method in the AbstractHessian object.
Of course, here is the Java code you requested: ```java @Override public void addTag(String tagName, double value) { addTag(tagName, String.valueOf(value)); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSManagedConnectionFactoryImpl.java
WSManagedConnectionFactoryImpl.onConnect
private void onConnect(Connection con, String[] sqlCommands) throws SQLException { final boolean trace = TraceComponent.isAnyTracingEnabled(); TransactionManager tm = connectorSvc.getTransactionManager(); Transaction suspendedTx = null; String currentSQL = null; Throwable failur...
java
private void onConnect(Connection con, String[] sqlCommands) throws SQLException { final boolean trace = TraceComponent.isAnyTracingEnabled(); TransactionManager tm = connectorSvc.getTransactionManager(); Transaction suspendedTx = null; String currentSQL = null; Throwable failur...
[ "private", "void", "onConnect", "(", "Connection", "con", ",", "String", "[", "]", "sqlCommands", ")", "throws", "SQLException", "{", "final", "boolean", "trace", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "TransactionManager", "tm", "=", ...
Execute the onConnect SQL commands. The connection won't be enlisted in a WAS transaction yet, but it's necessary to suspend and WAS global transaction in order to avoid confusing the DB2 type 2 JDBC driver. @param con the connection @param sqlCommands ordered list of SQL commands to run on the connection. @throws SQL...
[ "Execute", "the", "onConnect", "SQL", "commands", ".", "The", "connection", "won", "t", "be", "enlisted", "in", "a", "WAS", "transaction", "yet", "but", "it", "s", "necessary", "to", "suspend", "and", "WAS", "global", "transaction", "in", "order", "to", "a...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSManagedConnectionFactoryImpl.java#L1241-L1278
train
On connect.
Of course, here is the Java code you requested: ```java private void onConnect(Connection con, String[] sqlCommands) throws SQLException { final boolean trace = TraceComponent.isAnyTracingEnabled(); TransactionManager tm = connectorSvc.getTransactionManager(); Transaction suspendedTx = null; ...
beangle/beangle3
commons/core/src/main/java/org/beangle/commons/lang/Strings.java
Strings.isEqualSeq
public static boolean isEqualSeq(final String first, final String second, final String delimiter) { if (isNotEmpty(first) && isNotEmpty(second)) { String[] firstWords = split(first, delimiter); Set<String> firstSet = CollectUtils.newHashSet(); for (int i = 0; i < firstWords.length; i++) { ...
java
public static boolean isEqualSeq(final String first, final String second, final String delimiter) { if (isNotEmpty(first) && isNotEmpty(second)) { String[] firstWords = split(first, delimiter); Set<String> firstSet = CollectUtils.newHashSet(); for (int i = 0; i < firstWords.length; i++) { ...
[ "public", "static", "boolean", "isEqualSeq", "(", "final", "String", "first", ",", "final", "String", "second", ",", "final", "String", "delimiter", ")", "{", "if", "(", "isNotEmpty", "(", "first", ")", "&&", "isNotEmpty", "(", "second", ")", ")", "{", "...
判断两个","逗号相隔的字符串中的单词是否完全等同. @param first a {@link java.lang.String} object. @param second a {@link java.lang.String} object. @param delimiter a {@link java.lang.String} object. @return a boolean.
[ "判断两个", "逗号相隔的字符串中的单词是否完全等同", "." ]
33df2873a5f38e28ac174a1d3b8144eb2f808e64
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L357-L373
train
Compare two sequence of words.
Of course, here is the Java code you requested: ```java public static boolean isEqualSeq(final String first, final String second, final String delimiter) { if (isNotEmpty(first) && isNotEmpty(second)) { String[] firstWords = split(first, delimiter); Set<String> firstSet = CollectUtils.newHashSet(); ...
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/DigitalSignature.java
DigitalSignature.verify
public boolean verify(String base64Signature, String content, String timestamp) throws Exception { return verify(base64Signature, content, timestamp, keyName); }
java
public boolean verify(String base64Signature, String content, String timestamp) throws Exception { return verify(base64Signature, content, timestamp, keyName); }
[ "public", "boolean", "verify", "(", "String", "base64Signature", ",", "String", "content", ",", "String", "timestamp", ")", "throws", "Exception", "{", "return", "verify", "(", "base64Signature", ",", "content", ",", "timestamp", ",", "keyName", ")", ";", "}" ...
Verifies the validity of the digital signature using stored key name. @param base64Signature The digital signature. @param content The authorization string to which the signature was applied. @param timestamp The timestamp of the digital signature. @return True if the signature is valid. @throws Exception Unspecified ...
[ "Verifies", "the", "validity", "of", "the", "digital", "signature", "using", "stored", "key", "name", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/DigitalSignature.java#L87-L89
train
Verify a base64 signature.
Of course, here is the Java code you requested: ```java public boolean verify(String base64Signature, String content, String timestamp) throws Exception { return verify(base64Signature, content, timestamp, keyName); } ``` Hope this helps!
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/MetamodelImpl.java
MetamodelImpl.getEntityAttribute
public Attribute getEntityAttribute(Class clazz, String fieldName) { if (entityTypes != null && entityTypes.containsKey(clazz)) { EntityType entityType = entityTypes.get(clazz); return entityType.getAttribute(fieldName); } throw new IllegalArgumentExcep...
java
public Attribute getEntityAttribute(Class clazz, String fieldName) { if (entityTypes != null && entityTypes.containsKey(clazz)) { EntityType entityType = entityTypes.get(clazz); return entityType.getAttribute(fieldName); } throw new IllegalArgumentExcep...
[ "public", "Attribute", "getEntityAttribute", "(", "Class", "clazz", ",", "String", "fieldName", ")", "{", "if", "(", "entityTypes", "!=", "null", "&&", "entityTypes", ".", "containsKey", "(", "clazz", ")", ")", "{", "EntityType", "entityType", "=", "entityType...
Returns entity attribute for given managed entity class. @param clazz Entity class @param fieldName field name @return entity attribute
[ "Returns", "entity", "attribute", "for", "given", "managed", "entity", "class", "." ]
268958ab1ec09d14ec4d9184f0c8ded7a9158908
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/MetamodelImpl.java#L367-L375
train
Gets the entity attribute for the specified class and field name.
Of course, here is the Java code you requested: ```java public Attribute getEntityAttribute(Class clazz, String fieldName) { if (entityTypes != null && entityTypes.containsKey(clazz)) { EntityType entityType = entityTypes.get(clazz); return entityType.getAttribute(field...
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java
SDValidation.validateBool
protected static void validateBool(String opName, SDVariable v) { if (v == null) return; if (v.dataType() != DataType.BOOL) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with non-boolean point data type " + v.dat...
java
protected static void validateBool(String opName, SDVariable v) { if (v == null) return; if (v.dataType() != DataType.BOOL) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with non-boolean point data type " + v.dat...
[ "protected", "static", "void", "validateBool", "(", "String", "opName", ",", "SDVariable", "v", ")", "{", "if", "(", "v", "==", "null", ")", "return", ";", "if", "(", "v", ".", "dataType", "(", ")", "!=", "DataType", ".", "BOOL", ")", "throw", "new",...
Validate that the operation is being applied on a boolean type SDVariable @param opName Operation name to print in the exception @param v Variable to validate datatype for (input to operation)
[ "Validate", "that", "the", "operation", "is", "being", "applied", "on", "a", "boolean", "type", "SDVariable" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java#L118-L123
train
Validate boolean operation
Of course, here is the Java code you requested: ```java protected static void validateBool(String opName, SDVariable v) { if (v == null) return; if (v.dataType() != DataType.BOOL) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getV...
mapbox/mapbox-navigation-android
libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/maneuver/ManeuverView.java
ManeuverView.setRoundaboutAngle
public void setRoundaboutAngle(@FloatRange(from = 60f, to = 300f) float roundaboutAngle) { if (ROUNDABOUT_MANEUVER_TYPES.contains(maneuverType) && this.roundaboutAngle != roundaboutAngle) { updateRoundaboutAngle(roundaboutAngle); invalidate(); } }
java
public void setRoundaboutAngle(@FloatRange(from = 60f, to = 300f) float roundaboutAngle) { if (ROUNDABOUT_MANEUVER_TYPES.contains(maneuverType) && this.roundaboutAngle != roundaboutAngle) { updateRoundaboutAngle(roundaboutAngle); invalidate(); } }
[ "public", "void", "setRoundaboutAngle", "(", "@", "FloatRange", "(", "from", "=", "60f", ",", "to", "=", "300f", ")", "float", "roundaboutAngle", ")", "{", "if", "(", "ROUNDABOUT_MANEUVER_TYPES", ".", "contains", "(", "maneuverType", ")", "&&", "this", ".", ...
Updates the angle to render the roundabout maneuver. <p> This value will only be considered if the current maneuver type is a roundabout. @param roundaboutAngle angle to be rendered
[ "Updates", "the", "angle", "to", "render", "the", "roundabout", "maneuver", ".", "<p", ">", "This", "value", "will", "only", "be", "considered", "if", "the", "current", "maneuver", "type", "is", "a", "roundabout", "." ]
375a89c017d360b9defc2c90d0c03468165162ec
https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/maneuver/ManeuverView.java#L163-L168
train
Set the roundaboutAngle value.
Of course, here is the Java code you requested: ```java public void setRoundaboutAngle(@FloatRange(from = 60f, to = 300f) float roundaboutAngle) { if (ROUNDABOUT_MANEUVER_TYPES.contains(maneuverType) && this.roundaboutAngle != roundaboutAngle) { updateRoundaboutAngle(roundaboutAngle); invalidate(); ...
Netflix/denominator
example-android/src/main/java/denominator/example/android/ui/HomeActivity.java
HomeActivity.onZones
@Subscribe public void onZones(ZoneList.SuccessEvent event) { String durationEvent = getString(R.string.list_duration, event.duration); Toast.makeText(this, durationEvent, LENGTH_SHORT).show(); }
java
@Subscribe public void onZones(ZoneList.SuccessEvent event) { String durationEvent = getString(R.string.list_duration, event.duration); Toast.makeText(this, durationEvent, LENGTH_SHORT).show(); }
[ "@", "Subscribe", "public", "void", "onZones", "(", "ZoneList", ".", "SuccessEvent", "event", ")", "{", "String", "durationEvent", "=", "getString", "(", "R", ".", "string", ".", "list_duration", ",", "event", ".", "duration", ")", ";", "Toast", ".", "make...
flash the response time of doing the list.
[ "flash", "the", "response", "time", "of", "doing", "the", "list", "." ]
c565e3b8c6043051252e0947029511f9ac5d306f
https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/example-android/src/main/java/denominator/example/android/ui/HomeActivity.java#L83-L87
train
Show toast when zones are successfully added.
Of course, here is the Java code you requested: ```java @Subscribe public void onZones(ZoneList.SuccessEvent event) { String durationEvent = getString(R.string.list_duration, event.duration); Toast.makeText(this, durationEvent, LENGTH_SHORT).show(); } ``` Hope this helps!
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java
AjaxHelper.registerContainer
static AjaxOperation registerContainer(final String triggerId, final String containerId, final List<String> containerContentIds) { AjaxOperation operation = new AjaxOperation(triggerId, containerContentIds); operation.setTargetContainerId(containerId); operation.setAction(AjaxOperation.AjaxAction.REPLACE_CONTE...
java
static AjaxOperation registerContainer(final String triggerId, final String containerId, final List<String> containerContentIds) { AjaxOperation operation = new AjaxOperation(triggerId, containerContentIds); operation.setTargetContainerId(containerId); operation.setAction(AjaxOperation.AjaxAction.REPLACE_CONTE...
[ "static", "AjaxOperation", "registerContainer", "(", "final", "String", "triggerId", ",", "final", "String", "containerId", ",", "final", "List", "<", "String", ">", "containerContentIds", ")", "{", "AjaxOperation", "operation", "=", "new", "AjaxOperation", "(", "...
This internal method is used to register an arbitrary target container. It must only used by components which contain implicit AJAX capability. @param triggerId the id of the trigger that will cause the component to be painted. @param containerId the target container id. This is not necessarily a WComponent id. @param...
[ "This", "internal", "method", "is", "used", "to", "register", "an", "arbitrary", "target", "container", ".", "It", "must", "only", "used", "by", "components", "which", "contain", "implicit", "AJAX", "capability", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L146-L153
train
Register container.
Of course, here is the Java code you requested: ```java static AjaxOperation registerContainer(final String triggerId, final String containerId, final List<String> containerContentIds) { AjaxOperation operation = new AjaxOperation(triggerId, containerContentIds); operation.setTargetContainerId(containerId); o...
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java
DocCommentParser.reference
@SuppressWarnings("fallthrough") protected DCReference reference(boolean allowMember) throws ParseException { int pos = bp; int depth = 0; // scan to find the end of the signature, by looking for the first // whitespace not enclosed in () or <>, or the end of the tag loop: ...
java
@SuppressWarnings("fallthrough") protected DCReference reference(boolean allowMember) throws ParseException { int pos = bp; int depth = 0; // scan to find the end of the signature, by looking for the first // whitespace not enclosed in () or <>, or the end of the tag loop: ...
[ "@", "SuppressWarnings", "(", "\"fallthrough\"", ")", "protected", "DCReference", "reference", "(", "boolean", "allowMember", ")", "throws", "ParseException", "{", "int", "pos", "=", "bp", ";", "int", "depth", "=", "0", ";", "// scan to find the end of the signature...
TODO: update to use ReferenceParser
[ "TODO", ":", "update", "to", "use", "ReferenceParser" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java#L388-L486
train
reference method.
Of course, here is the Java code you requested: ```java @SuppressWarnings("fallthrough") protected DCReference reference(boolean allowMember) throws ParseException { int pos = bp; int depth = 0; // scan to find the end of the signature, by looking for the first // whitespace not en...
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java
DefaultInternalConfiguration.getProperties
@Override public Properties getProperties(final String key) { String[] keyValuePairs = getStringArray(key); Properties props = new Properties(); for (String pair : keyValuePairs) { int index = pair.indexOf('='); if (index < 1) { throw new IllegalArgumentException("Malformed property: " + pair); }...
java
@Override public Properties getProperties(final String key) { String[] keyValuePairs = getStringArray(key); Properties props = new Properties(); for (String pair : keyValuePairs) { int index = pair.indexOf('='); if (index < 1) { throw new IllegalArgumentException("Malformed property: " + pair); }...
[ "@", "Override", "public", "Properties", "getProperties", "(", "final", "String", "key", ")", "{", "String", "[", "]", "keyValuePairs", "=", "getStringArray", "(", "key", ")", ";", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "for", "(",...
{@inheritDoc}
[ "{" ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java#L1340-L1357
train
Get the properties for the specified key.
Of course, here is the Java code you requested: ```java @Override public Properties getProperties(final String key) { String[] keyValuePairs = getStringArray(key); Properties props = new Properties(); for (String pair : keyValuePairs) { int index = pair.indexOf('='); if (index < 1) { throw new Ille...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Bool.java
Bool.operate
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { if (XObject.CLASS_BOOLEAN == right.getType()) return right; else return right.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { if (XObject.CLASS_BOOLEAN == right.getType()) return right; else return right.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
[ "public", "XObject", "operate", "(", "XObject", "right", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "if", "(", "XObject", ".", "CLASS_BOOLEAN", "==", "right", ".", "getType", "(", ")", ")", "return", "right", ";...
Apply the operation to two operands, and return the result. @param right non-null reference to the evaluated right operand. @return non-null reference to the XObject that represents the result of the operation. @throws javax.xml.transform.TransformerException
[ "Apply", "the", "operation", "to", "two", "operands", "and", "return", "the", "result", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Bool.java#L44-L51
train
This method is used to operate on a single node.
Of course, here is the Java code you requested: ```java public XObject operate(XObject right) throws javax.xml.transform.TransformerException { if (XObject.CLASS_BOOLEAN == right.getType()) return right; else return right.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; } ``` Hope this helps!
kiegroup/optaplanner
optaplanner-benchmark/src/main/java/org/optaplanner/benchmark/impl/report/BenchmarkReport.java
BenchmarkReport.getRelativePathToBenchmarkReportDirectory
public String getRelativePathToBenchmarkReportDirectory(File file) { String benchmarkReportDirectoryPath = plannerBenchmarkResult.getBenchmarkReportDirectory().getAbsoluteFile().toURI().getPath(); String filePath = file.getAbsoluteFile().toURI().getPath(); if (!filePath.startsWith(benchmarkRepor...
java
public String getRelativePathToBenchmarkReportDirectory(File file) { String benchmarkReportDirectoryPath = plannerBenchmarkResult.getBenchmarkReportDirectory().getAbsoluteFile().toURI().getPath(); String filePath = file.getAbsoluteFile().toURI().getPath(); if (!filePath.startsWith(benchmarkRepor...
[ "public", "String", "getRelativePathToBenchmarkReportDirectory", "(", "File", "file", ")", "{", "String", "benchmarkReportDirectoryPath", "=", "plannerBenchmarkResult", ".", "getBenchmarkReportDirectory", "(", ")", ".", "getAbsoluteFile", "(", ")", ".", "toURI", "(", ")...
************************************************************************
[ "************************************************************************" ]
b8f1459b4e6b0f7aafe941fd165bff640c11d7d5
https://github.com/kiegroup/optaplanner/blob/b8f1459b4e6b0f7aafe941fd165bff640c11d7d5/optaplanner-benchmark/src/main/java/org/optaplanner/benchmark/impl/report/BenchmarkReport.java#L207-L219
valid
Get the relative path to the benchmark report directory.
Of course, here is the Java code you requested: ```java public String getRelativePathToBenchmarkReportDirectory(File file) { String benchmarkReportDirectoryPath = plannerBenchmarkResult.getBenchmarkReportDirectory().getAbsoluteFile().toURI().getPath(); String filePath = file.getAbsoluteFile().toURI().g...
spring-projects/spring-ldap
core/src/main/java/org/springframework/ldap/core/support/SingleContextSource.java
SingleContextSource.destroy
public void destroy() { try { ctx.close(); } catch (javax.naming.NamingException e) { LOG.warn("Error when closing", e); } }
java
public void destroy() { try { ctx.close(); } catch (javax.naming.NamingException e) { LOG.warn("Error when closing", e); } }
[ "public", "void", "destroy", "(", ")", "{", "try", "{", "ctx", ".", "close", "(", ")", ";", "}", "catch", "(", "javax", ".", "naming", ".", "NamingException", "e", ")", "{", "LOG", ".", "warn", "(", "\"Error when closing\"", ",", "e", ")", ";", "}"...
Destroy method that allows the target DirContext to be cleaned up when the SingleContextSource is not going to be used any more.
[ "Destroy", "method", "that", "allows", "the", "target", "DirContext", "to", "be", "cleaned", "up", "when", "the", "SingleContextSource", "is", "not", "going", "to", "be", "used", "any", "more", "." ]
15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0
https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/SingleContextSource.java#L90-L97
train
Destroy the base class.
Of course, here is the Java code you requested: ```java public void destroy() { try { ctx.close(); } catch (javax.naming.NamingException e) { LOG.warn("Error when closing", e); } } ``` Hope this helps!
EasyinnovaSL/Tiff-Library-4J
src/main/java/com/easyinnova/tiff/model/IccProfileCreators.java
IccProfileCreators.getIccProfile
public static IccProfileCreator getIccProfile(int identifier) { IccProfileCreator icc = null; try { if (instance == null) getIccProfileCreators(); if (creatorsMap.containsKey(identifier)) icc = creatorsMap.get(identifier); } catch (ReadIccConfigIOException e) { } return ...
java
public static IccProfileCreator getIccProfile(int identifier) { IccProfileCreator icc = null; try { if (instance == null) getIccProfileCreators(); if (creatorsMap.containsKey(identifier)) icc = creatorsMap.get(identifier); } catch (ReadIccConfigIOException e) { } return ...
[ "public", "static", "IccProfileCreator", "getIccProfile", "(", "int", "identifier", ")", "{", "IccProfileCreator", "icc", "=", "null", ";", "try", "{", "if", "(", "instance", "==", "null", ")", "getIccProfileCreators", "(", ")", ";", "if", "(", "creatorsMap", ...
Gets tag information. @param identifier Tag id @return the tag or null if the identifier does not exist
[ "Gets", "tag", "information", "." ]
682605d3ed207a66213278c054c98f1b909472b7
https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/IccProfileCreators.java#L137-L148
train
Get the IccProfileCreator for a given identifier.
Of course, here is the Java code you requested: ```java public static IccProfileCreator getIccProfile(int identifier) { IccProfileCreator icc = null; try { if (instance == null) getIccProfileCreators(); if (creatorsMap.containsKey(identifier)) icc = creatorsMap.get(identifier); ...
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/AbstractDependencyMojo.java
AbstractDependencyMojo.levelTraverseVerboseTreeList
private Set<org.eclipse.aether.graph.DependencyNode> levelTraverseVerboseTreeList( Set<org.eclipse.aether.graph.DependencyNode> nodeList, List <org.eclipse.aether.graph.DependencyNode> aggDepNodeList, org.eclipse.aether.graph.DependencyNode rootNode) throws MojoExecutionException { // Fi...
java
private Set<org.eclipse.aether.graph.DependencyNode> levelTraverseVerboseTreeList( Set<org.eclipse.aether.graph.DependencyNode> nodeList, List <org.eclipse.aether.graph.DependencyNode> aggDepNodeList, org.eclipse.aether.graph.DependencyNode rootNode) throws MojoExecutionException { // Fi...
[ "private", "Set", "<", "org", ".", "eclipse", ".", "aether", ".", "graph", ".", "DependencyNode", ">", "levelTraverseVerboseTreeList", "(", "Set", "<", "org", ".", "eclipse", ".", "aether", ".", "graph", ".", "DependencyNode", ">", "nodeList", ",", "List", ...
helper function for traversing nodes from the Aether package in Level-Order way. (copied/refactored from the levelTraverseTreeList method) @param nodeList {@link List} representing current breadth of nodes to be visited @param aggDepNodeList {@link List} representing aggregate nodes current breadth is added to. @param...
[ "helper", "function", "for", "traversing", "nodes", "from", "the", "Aether", "package", "in", "Level", "-", "Order", "way", ".", "(", "copied", "/", "refactored", "from", "the", "levelTraverseTreeList", "method", ")" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/AbstractDependencyMojo.java#L428-L451
train
Level Traverse verbose tree list.
Of course, here is the Java code you requested: ```java private Set<org.eclipse.aether.graph.DependencyNode> levelTraverseVerboseTreeList( Set<org.eclipse.aether.graph.DependencyNode> nodeList, List <org.eclipse.aether.graph.DependencyNode> aggDepNodeList, org.eclipse.aether.graph.DependencyN...
lucee/Lucee
core/src/main/java/lucee/commons/io/res/util/ResourceSnippet.java
ResourceSnippet.createResourceSnippet
public static ResourceSnippet createResourceSnippet(InputStream is, int startChar, int endChar, String charset) { return createResourceSnippet(getContents(is, charset), startChar, endChar); }
java
public static ResourceSnippet createResourceSnippet(InputStream is, int startChar, int endChar, String charset) { return createResourceSnippet(getContents(is, charset), startChar, endChar); }
[ "public", "static", "ResourceSnippet", "createResourceSnippet", "(", "InputStream", "is", ",", "int", "startChar", ",", "int", "endChar", ",", "String", "charset", ")", "{", "return", "createResourceSnippet", "(", "getContents", "(", "is", ",", "charset", ")", "...
extract a ResourceSnippet from InputStream at the given char positions @param is - InputStream of the Resource @param startChar - start position of the snippet @param endChar - end position of the snippet @param charset - use server's charset, default should be UTF-8 @return
[ "extract", "a", "ResourceSnippet", "from", "InputStream", "at", "the", "given", "char", "positions" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceSnippet.java#L106-L109
train
Create a ResourceSnippet from an input stream.
Of course, here is the Java code you requested: ```java public static ResourceSnippet createResourceSnippet(InputStream is, int startChar, int endChar, String charset) { return createResourceSnippet(getContents(is, charset), startChar, endChar); } ``` Hope this helps!
unbescape/unbescape
src/main/java/org/unbescape/xml/XmlEscapeUtil.java
XmlEscapeUtil.unescape
static String unescape(final String text, final XmlEscapeSymbols symbols) { if (text == null) { return null; } StringBuilder strBuilder = null; final int offset = 0; final int max = text.length(); int readOffset = offset; int referenceOffset = offs...
java
static String unescape(final String text, final XmlEscapeSymbols symbols) { if (text == null) { return null; } StringBuilder strBuilder = null; final int offset = 0; final int max = text.length(); int readOffset = offset; int referenceOffset = offs...
[ "static", "String", "unescape", "(", "final", "String", "text", ",", "final", "XmlEscapeSymbols", "symbols", ")", "{", "if", "(", "text", "==", "null", ")", "{", "return", "null", ";", "}", "StringBuilder", "strBuilder", "=", "null", ";", "final", "int", ...
/* Perform an unescape operation based on String.
[ "/", "*", "Perform", "an", "unescape", "operation", "based", "on", "String", "." ]
ec5435fb3508c2eed25d8165dc27ded2602cae13
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscapeUtil.java#L575-L775
train
Unescape the text.
Of course, here is the Java code you requested: ```java static String unescape(final String text, final XmlEscapeSymbols symbols) { if (text == null) { return null; } StringBuilder strBuilder = null; final int offset = 0; final int max = text.length(); in...
lucee/Lucee
core/src/main/java/lucee/runtime/coder/HexCoder.java
HexCoder.encode
public static String encode(byte[] bytes) { String retorno = ""; if (bytes == null || bytes.length == 0) { return retorno; } for (int i = 0; i < bytes.length; i++) { byte valor = bytes[i]; int d1 = valor & 0xF; d1 += (d1 < 10) ? 48 : 55; int d2 = (valor & 0xF0) >> 4; d2 += (d2 < 10) ? ...
java
public static String encode(byte[] bytes) { String retorno = ""; if (bytes == null || bytes.length == 0) { return retorno; } for (int i = 0; i < bytes.length; i++) { byte valor = bytes[i]; int d1 = valor & 0xF; d1 += (d1 < 10) ? 48 : 55; int d2 = (valor & 0xF0) >> 4; d2 += (d2 < 10) ? ...
[ "public", "static", "String", "encode", "(", "byte", "[", "]", "bytes", ")", "{", "String", "retorno", "=", "\"\"", ";", "if", "(", "bytes", "==", "null", "||", "bytes", ".", "length", "==", "0", ")", "{", "return", "retorno", ";", "}", "for", "(",...
encodes a byte array to a String @param bytes @return encoed String
[ "encodes", "a", "byte", "array", "to", "a", "String" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/coder/HexCoder.java#L34-L48
train
Encode a byte array to a String
Of course, here is the Java code you requested: ```java public static String encode(byte[] bytes) { String retorno = ""; if (bytes == null || bytes.length == 0) { return retorno; } for (int i = 0; i < bytes.length; i++) { byte valor = bytes[i]; int d1 = valor & 0xF; d1 += (d1 < 10) ? 48 : 55; ...
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/StatePaintDrawable.java
StatePaintDrawable.updateTintFilter
PorterDuffColorFilter updateTintFilter(PorterDuffColorFilter tintFilter, ColorStateList tint, PorterDuff.Mode tintMode) { if (tint == null || tintMode == null) { return null; } final int color = tint.getColorForState(getState(), Color.TRANS...
java
PorterDuffColorFilter updateTintFilter(PorterDuffColorFilter tintFilter, ColorStateList tint, PorterDuff.Mode tintMode) { if (tint == null || tintMode == null) { return null; } final int color = tint.getColorForState(getState(), Color.TRANS...
[ "PorterDuffColorFilter", "updateTintFilter", "(", "PorterDuffColorFilter", "tintFilter", ",", "ColorStateList", "tint", ",", "PorterDuff", ".", "Mode", "tintMode", ")", "{", "if", "(", "tint", "==", "null", "||", "tintMode", "==", "null", ")", "{", "return", "nu...
Ensures the tint filter is consistent with the current tint color and mode.
[ "Ensures", "the", "tint", "filter", "is", "consistent", "with", "the", "current", "tint", "color", "and", "mode", "." ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/StatePaintDrawable.java#L187-L212
train
Update the tint filter.
Of course, here is the Java code you requested: ```java PorterDuffColorFilter updateTintFilter(PorterDuffColorFilter tintFilter, ColorStateList tint, PorterDuff.Mode tintMode) { if (tint == null || tintMode == null) { return null; } final ...
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/query/N1qlQuery.java
N1qlQuery.parameterized
public static ParameterizedN1qlQuery parameterized(Statement statement, JsonArray positionalParams) { return new ParameterizedN1qlQuery(statement, positionalParams, null); }
java
public static ParameterizedN1qlQuery parameterized(Statement statement, JsonArray positionalParams) { return new ParameterizedN1qlQuery(statement, positionalParams, null); }
[ "public", "static", "ParameterizedN1qlQuery", "parameterized", "(", "Statement", "statement", ",", "JsonArray", "positionalParams", ")", "{", "return", "new", "ParameterizedN1qlQuery", "(", "statement", ",", "positionalParams", ",", "null", ")", ";", "}" ]
Create a new query with positional parameters. Note that the {@link JsonArray} should not be mutated until {@link #n1ql()} is called since it backs the creation of the query string. Positional parameters have the form of `$n`, where the `n` represents the position, starting with 1. The following two examples are equiv...
[ "Create", "a", "new", "query", "with", "positional", "parameters", ".", "Note", "that", "the", "{", "@link", "JsonArray", "}", "should", "not", "be", "mutated", "until", "{", "@link", "#n1ql", "()", "}", "is", "called", "since", "it", "backs", "the", "cr...
f36a0ee0c66923bdde47838ca543e50cbaa99e14
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/N1qlQuery.java#L151-L153
train
Create a new parameterized N1QL query.
Of course, here is the Java code you requested: ```java public static ParameterizedN1qlQuery parameterized(Statement statement, JsonArray positionalParams) { return new ParameterizedN1qlQuery(statement, positionalParams, null); } ``` Hope this helps!
bazaarvoice/emodb
event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/ChannelAllocationState.java
ChannelAllocationState.attachAndAllocate
public synchronized SlabAllocation attachAndAllocate(SlabRef slab, PeekingIterator<Integer> eventSizes) { attach(slab); return allocate(eventSizes); }
java
public synchronized SlabAllocation attachAndAllocate(SlabRef slab, PeekingIterator<Integer> eventSizes) { attach(slab); return allocate(eventSizes); }
[ "public", "synchronized", "SlabAllocation", "attachAndAllocate", "(", "SlabRef", "slab", ",", "PeekingIterator", "<", "Integer", ">", "eventSizes", ")", "{", "attach", "(", "slab", ")", ";", "return", "allocate", "(", "eventSizes", ")", ";", "}" ]
Attaches a slab and allocates from it in a single atomic operation.
[ "Attaches", "a", "slab", "and", "allocates", "from", "it", "in", "a", "single", "atomic", "operation", "." ]
97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/ChannelAllocationState.java#L32-L35
train
Attaches a slab and allocates a new slab.
Of course, here is the Java code you requested: ```java public synchronized SlabAllocation attachAndAllocate(SlabRef slab, PeekingIterator<Integer> eventSizes) { attach(slab); return allocate(eventSizes); } ``` Hope this helps!
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java
CompositeDialogPage.addPages
public void addPages(DialogPage[] pages) { for (int i = 0; i < pages.length; i++) { addPage(pages[i]); } }
java
public void addPages(DialogPage[] pages) { for (int i = 0; i < pages.length; i++) { addPage(pages[i]); } }
[ "public", "void", "addPages", "(", "DialogPage", "[", "]", "pages", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pages", ".", "length", ";", "i", "++", ")", "{", "addPage", "(", "pages", "[", "i", "]", ")", ";", "}", "}" ]
Adds an array DialogPage to the list of pages managed by this CompositeDialogPage. @param pages the pages to add
[ "Adds", "an", "array", "DialogPage", "to", "the", "list", "of", "pages", "managed", "by", "this", "CompositeDialogPage", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java#L114-L118
train
Add the specified pages to the dialog.
Of course, here is the Java code you requested: ```java public void addPages(DialogPage[] pages) { for (int i = 0; i < pages.length; i++) { addPage(pages[i]); } } ``` Hope this helps!
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java
HSQLInterface.loadHsqldb
public static HSQLInterface loadHsqldb(ParameterStateManager psMgr) { // Specifically set the timezone to UTC to avoid the default usage local timezone in HSQL. // This ensures that all VoltDB data paths use the same timezone for representing time. TimeZone.setDefault(TimeZone.getTimeZone("GMT+0...
java
public static HSQLInterface loadHsqldb(ParameterStateManager psMgr) { // Specifically set the timezone to UTC to avoid the default usage local timezone in HSQL. // This ensures that all VoltDB data paths use the same timezone for representing time. TimeZone.setDefault(TimeZone.getTimeZone("GMT+0...
[ "public", "static", "HSQLInterface", "loadHsqldb", "(", "ParameterStateManager", "psMgr", ")", "{", "// Specifically set the timezone to UTC to avoid the default usage local timezone in HSQL.", "// This ensures that all VoltDB data paths use the same timezone for representing time.", "TimeZone...
Load up an HSQLDB in-memory instance. @return A newly initialized in-memory HSQLDB instance accessible through the returned instance of HSQLInterface
[ "Load", "up", "an", "HSQLDB", "in", "-", "memory", "instance", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/HSQLInterface.java#L146-L168
train
Load the HSQLDB interface.
Of course, here is the Java code you requested: ```java public static HSQLInterface loadHsqldb(ParameterStateManager psMgr) { // Specifically set the timezone to UTC to avoid the default usage local timezone in HSQL. // This ensures that all VoltDB data paths use the same timezone for representing time...
Stratio/stratio-cassandra
src/java/org/apache/cassandra/repair/Validator.java
Validator.complete
public void complete() { completeTree(); StageManager.getStage(Stage.ANTI_ENTROPY).execute(this); if (logger.isDebugEnabled()) { // log distribution of rows in tree logger.debug("Validated {} partitions for {}. Partitions per leaf are:", validated, desc.ses...
java
public void complete() { completeTree(); StageManager.getStage(Stage.ANTI_ENTROPY).execute(this); if (logger.isDebugEnabled()) { // log distribution of rows in tree logger.debug("Validated {} partitions for {}. Partitions per leaf are:", validated, desc.ses...
[ "public", "void", "complete", "(", ")", "{", "completeTree", "(", ")", ";", "StageManager", ".", "getStage", "(", "Stage", ".", "ANTI_ENTROPY", ")", ".", "execute", "(", "this", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", ...
Registers the newly created tree for rendezvous in Stage.ANTIENTROPY.
[ "Registers", "the", "newly", "created", "tree", "for", "rendezvous", "in", "Stage", ".", "ANTIENTROPY", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/Validator.java#L208-L222
train
Complete the entire assessment tree.
Of course, here is the Java code you requested: ```java public void complete() { completeTree(); StageManager.getStage(Stage.ANTI_ENTROPY).execute(this); if (logger.isDebugEnabled()) { // log distribution of rows in tree logger.debug("Validated {} partition...
protegeproject/jpaul
src/main/java/jpaul/Misc/UComp.java
UComp.compare
public int compare(T o1, T o2) { if(o1 == o2) return 0; String str1 = (o1 == null) ? "null" : o1.toString(); String str2 = (o2 == null) ? "null" : o2.toString(); return str1.compareTo(str2); }
java
public int compare(T o1, T o2) { if(o1 == o2) return 0; String str1 = (o1 == null) ? "null" : o1.toString(); String str2 = (o2 == null) ? "null" : o2.toString(); return str1.compareTo(str2); }
[ "public", "int", "compare", "(", "T", "o1", ",", "T", "o2", ")", "{", "if", "(", "o1", "==", "o2", ")", "return", "0", ";", "String", "str1", "=", "(", "o1", "==", "null", ")", "?", "\"null\"", ":", "o1", ".", "toString", "(", ")", ";", "Stri...
Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the string representation of the first argument is less than, equal to, or greater to the string representation of the second.
[ "Compares", "its", "two", "arguments", "for", "order", ".", "Returns", "a", "negative", "integer", "zero", "or", "a", "positive", "integer", "as", "the", "string", "representation", "of", "the", "first", "argument", "is", "less", "than", "equal", "to", "or",...
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Misc/UComp.java#L26-L31
train
Compare two objects.
Of course, here is the Java code you requested: ```java public int compare(T o1, T o2) { if(o1 == o2) return 0; String str1 = (o1 == null) ? "null" : o1.toString(); String str2 = (o2 == null) ? "null" : o2.toString(); return str1.compareTo(str2); } ``` Hope this helps!
Clivern/Racter
src/main/java/com/clivern/racter/senders/templates/ButtonTemplate.java
ButtonTemplate.build
public String build() { this.message_string = "{"; if( this.recipient_id != null ){ this.message_string += "\"recipient\": {\"id\": \"" + this.recipient_id + "\"},"; } if( (this.message_text != null) && !(this.message_text.equals("")) && !(this.buttons....
java
public String build() { this.message_string = "{"; if( this.recipient_id != null ){ this.message_string += "\"recipient\": {\"id\": \"" + this.recipient_id + "\"},"; } if( (this.message_text != null) && !(this.message_text.equals("")) && !(this.buttons....
[ "public", "String", "build", "(", ")", "{", "this", ".", "message_string", "=", "\"{\"", ";", "if", "(", "this", ".", "recipient_id", "!=", "null", ")", "{", "this", ".", "message_string", "+=", "\"\\\"recipient\\\": {\\\"id\\\": \\\"\"", "+", "this", ".", "...
Build and get message as a string @return String the final message
[ "Build", "and", "get", "message", "as", "a", "string" ]
bbde02f0c2a8a80653ad6b1607376d8408acd71c
https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/ButtonTemplate.java#L109-L155
train
Build the XML string for a CRSCustom.
Of course, here is the Java code you requested: ```java public String build() { this.message_string = "{"; if( this.recipient_id != null ){ this.message_string += "\"recipient\": {\"id\": \"" + this.recipient_id + "\"},"; } if( (this.message_text != nu...
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/DoubleStream.java
DoubleStream.filter
@NotNull public DoubleStream filter(@NotNull final DoublePredicate predicate) { return new DoubleStream(params, new DoubleFilter(iterator, predicate)); }
java
@NotNull public DoubleStream filter(@NotNull final DoublePredicate predicate) { return new DoubleStream(params, new DoubleFilter(iterator, predicate)); }
[ "@", "NotNull", "public", "DoubleStream", "filter", "(", "@", "NotNull", "final", "DoublePredicate", "predicate", ")", "{", "return", "new", "DoubleStream", "(", "params", ",", "new", "DoubleFilter", "(", "iterator", ",", "predicate", ")", ")", ";", "}" ]
Returns {@code DoubleStream} with elements that satisfy the given predicate. <p> This is an intermediate operation. <p>Example: <pre> predicate: (a) -&gt; a &gt; 2 stream: [1, 2, 3, 4, -8, 0, 11] result: [3, 4, 11] </pre> @param predicate the predicate used to filter elements @return the new stream
[ "Returns", "{", "@code", "DoubleStream", "}", "with", "elements", "that", "satisfy", "the", "given", "predicate", "." ]
f29fd57208c20252a4549b084d55ed082c3e58f0
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L318-L321
train
Returns a new stream consisting of the elements of this stream that match the given predicate.
Of course, here is the Java code you requested: ```java @NotNull public DoubleStream filter(@NotNull final DoublePredicate predicate) { return new DoubleStream(params, new DoubleFilter(iterator, predicate)); } ``` Hope this helps!
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleryDialog.java
CmsGalleryDialog.getTab
public A_CmsTab getTab(GalleryTabId tabId) { for (A_CmsTab tab : m_tabbedPanel) { if (tabId == GalleryTabId.valueOf(tab.getTabId())) { return tab; } } return null; }
java
public A_CmsTab getTab(GalleryTabId tabId) { for (A_CmsTab tab : m_tabbedPanel) { if (tabId == GalleryTabId.valueOf(tab.getTabId())) { return tab; } } return null; }
[ "public", "A_CmsTab", "getTab", "(", "GalleryTabId", "tabId", ")", "{", "for", "(", "A_CmsTab", "tab", ":", "m_tabbedPanel", ")", "{", "if", "(", "tabId", "==", "GalleryTabId", ".", "valueOf", "(", "tab", ".", "getTabId", "(", ")", ")", ")", "{", "retu...
Gets the tab with a given tab id, or null if the dialog has no such tab.<p> @param tabId the tab id to look for @return the tab with the given tab id, or null
[ "Gets", "the", "tab", "with", "a", "given", "tab", "id", "or", "null", "if", "the", "dialog", "has", "no", "such", "tab", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleryDialog.java#L461-L469
train
Gets the tab with the given id.
Of course, here is the Java code you requested: ```java public A_CmsTab getTab(GalleryTabId tabId) { for (A_CmsTab tab : m_tabbedPanel) { if (tabId == GalleryTabId.valueOf(tab.getTabId())) { return tab; } } return null; } ``` Hope this helps!
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/instance/DefaultAddressPicker.java
DefaultAddressPicker.skipInterface
private boolean skipInterface(NetworkInterface ni) throws SocketException { boolean skipInterface = !ni.isUp() || ni.isVirtual() || ni.isLoopback(); if (skipInterface && logger.isFineEnabled()) { logger.fine("Skipping NetworkInterface '" + ni.getName() + "': isUp=" + ni.isUp() + ", isVirtual...
java
private boolean skipInterface(NetworkInterface ni) throws SocketException { boolean skipInterface = !ni.isUp() || ni.isVirtual() || ni.isLoopback(); if (skipInterface && logger.isFineEnabled()) { logger.fine("Skipping NetworkInterface '" + ni.getName() + "': isUp=" + ni.isUp() + ", isVirtual...
[ "private", "boolean", "skipInterface", "(", "NetworkInterface", "ni", ")", "throws", "SocketException", "{", "boolean", "skipInterface", "=", "!", "ni", ".", "isUp", "(", ")", "||", "ni", ".", "isVirtual", "(", ")", "||", "ni", ".", "isLoopback", "(", ")",...
Checks given network interface and returns true when it should not be used for picking address. Reasons for skipping are the interface is: down, virtual or loopback.
[ "Checks", "given", "network", "interface", "and", "returns", "true", "when", "it", "should", "not", "be", "used", "for", "picking", "address", ".", "Reasons", "for", "skipping", "are", "the", "interface", "is", ":", "down", "virtual", "or", "loopback", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/instance/DefaultAddressPicker.java#L380-L387
train
Skip the interface if it is up virtual or loopback.
Of course, here is the Java code you requested: ```java private boolean skipInterface(NetworkInterface ni) throws SocketException { boolean skipInterface = !ni.isUp() || ni.isVirtual() || ni.isLoopback(); if (skipInterface && logger.isFineEnabled()) { logger.fine("Skipping NetworkInterface ...
xmlunit/xmlunit
xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/jaxp13/Validator.java
Validator.addSchemaSource
public void addSchemaSource(Source s) { sources.add(s); validator.setSchemaSources(sources.toArray(new Source[0])); }
java
public void addSchemaSource(Source s) { sources.add(s); validator.setSchemaSources(sources.toArray(new Source[0])); }
[ "public", "void", "addSchemaSource", "(", "Source", "s", ")", "{", "sources", ".", "add", "(", "s", ")", ";", "validator", ".", "setSchemaSources", "(", "sources", ".", "toArray", "(", "new", "Source", "[", "0", "]", ")", ")", ";", "}" ]
Adds a source for the schema defintion.
[ "Adds", "a", "source", "for", "the", "schema", "defintion", "." ]
fe3d701d43f57ee83dcba336e4c1555619d3084b
https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/jaxp13/Validator.java#L108-L111
train
Add a schema source to the schema.
Of course, here is the Java code you requested: ```java public void addSchemaSource(Source s) { sources.add(s); validator.setSchemaSources(sources.toArray(new Source[0])); } ``` Hope this helps!
m-m-m/util
value/src/main/java/net/sf/mmm/util/value/impl/DefaultComposedValueConverter.java
DefaultComposedValueConverter.getInstance
public static ComposedValueConverter getInstance() { if (instance == null) { synchronized (DefaultComposedValueConverter.class) { if (instance == null) { DefaultComposedValueConverter impl = new DefaultComposedValueConverter(); impl.initialize(); instance = impl; ...
java
public static ComposedValueConverter getInstance() { if (instance == null) { synchronized (DefaultComposedValueConverter.class) { if (instance == null) { DefaultComposedValueConverter impl = new DefaultComposedValueConverter(); impl.initialize(); instance = impl; ...
[ "public", "static", "ComposedValueConverter", "getInstance", "(", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "synchronized", "(", "DefaultComposedValueConverter", ".", "class", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "DefaultComp...
This method gets the singleton instance of this {@link ComposedValueConverter}. <br> <b>ATTENTION:</b><br> Please prefer dependency-injection instead of using this method. @return the singleton instance. @since 3.1.0
[ "This", "method", "gets", "the", "singleton", "instance", "of", "this", "{", "@link", "ComposedValueConverter", "}", ".", "<br", ">", "<b", ">", "ATTENTION", ":", "<", "/", "b", ">", "<br", ">", "Please", "prefer", "dependency", "-", "injection", "instead"...
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/value/src/main/java/net/sf/mmm/util/value/impl/DefaultComposedValueConverter.java#L39-L51
train
Get the singleton instance of the ComposedValueConverter class.
Of course, here is the Java code you requested: ```java public static ComposedValueConverter getInstance() { if (instance == null) { synchronized (DefaultComposedValueConverter.class) { if (instance == null) { DefaultComposedValueConverter impl = new DefaultComposedValueConverter(); ...
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/journal/helpers/ParameterHelper.java
ParameterHelper.getOptionalBooleanParameter
public static boolean getOptionalBooleanParameter(Map<String, String> parameters, String parameterName, boolean defaultValue) throws JournalException { validateParameters(parameters); ...
java
public static boolean getOptionalBooleanParameter(Map<String, String> parameters, String parameterName, boolean defaultValue) throws JournalException { validateParameters(parameters); ...
[ "public", "static", "boolean", "getOptionalBooleanParameter", "(", "Map", "<", "String", ",", "String", ">", "parameters", ",", "String", "parameterName", ",", "boolean", "defaultValue", ")", "throws", "JournalException", "{", "validateParameters", "(", "parameters", ...
Get an optional boolean parameter. If not found, use the default value. @throws JournalException if a value is supplied that is neither "true" nor "false". @throws NullPointerException if either 'parameters' or 'parameterName' is null.
[ "Get", "an", "optional", "boolean", "parameter", ".", "If", "not", "found", "use", "the", "default", "value", "." ]
37df51b9b857fd12c6ab8269820d406c3c4ad774
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/helpers/ParameterHelper.java#L66-L86
train
Gets the optional boolean parameter.
Of course, here is the Java code you requested: ```java public static boolean getOptionalBooleanParameter(Map<String, String> parameters, String parameterName, boolean defaultValue) throws JournalExc...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.setContentHandler
public void setContentHandler(ContentHandler handler) { if (handler == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_CONTENT_HANDLER, null)); //"Null content handler"); } else { m_outputContentHandler = handler; if (null == m_serial...
java
public void setContentHandler(ContentHandler handler) { if (handler == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_CONTENT_HANDLER, null)); //"Null content handler"); } else { m_outputContentHandler = handler; if (null == m_serial...
[ "public", "void", "setContentHandler", "(", "ContentHandler", "handler", ")", "{", "if", "(", "handler", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "XSLMessages", ".", "createMessage", "(", "XSLTErrorResources", ".", "ER_NULL_CONTENT_HANDLE...
Set the content event handler. NEEDSDOC @param handler @throws java.lang.NullPointerException If the handler is null. @see org.xml.sax.XMLReader#setContentHandler
[ "Set", "the", "content", "event", "handler", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1703-L1725
train
Sets the content handler for this SAX document.
Of course, here is the Java code you requested: ```java public void setContentHandler(ContentHandler handler) { if (handler == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_CONTENT_HANDLER, null)); //"Null content handler"); } else { m_ou...
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/balancer/metrics/BalancerMetrics.java
BalancerMetrics.doUpdates
@Override public void doUpdates(MetricsContext unused) { synchronized (this) { for (MetricsBase m : registry.getMetricsList()) { m.pushMetric(metricsRecord); } } metricsRecord.update(); }
java
@Override public void doUpdates(MetricsContext unused) { synchronized (this) { for (MetricsBase m : registry.getMetricsList()) { m.pushMetric(metricsRecord); } } metricsRecord.update(); }
[ "@", "Override", "public", "void", "doUpdates", "(", "MetricsContext", "unused", ")", "{", "synchronized", "(", "this", ")", "{", "for", "(", "MetricsBase", "m", ":", "registry", ".", "getMetricsList", "(", ")", ")", "{", "m", ".", "pushMetric", "(", "me...
Since this object is a registered updater, this method will be called periodically, e.g. every 5 seconds.
[ "Since", "this", "object", "is", "a", "registered", "updater", "this", "method", "will", "be", "called", "periodically", "e", ".", "g", ".", "every", "5", "seconds", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/balancer/metrics/BalancerMetrics.java#L74-L82
train
Updates the metrics record.
Of course, here is the Java code you requested: ```java @Override public void doUpdates(MetricsContext unused) { synchronized (this) { for (MetricsBase m : registry.getMetricsList()) { m.pushMetric(metricsRecord); } } metricsRecord.update(); } ``` Hope this helps!
wigforss/Ka-Jmx
core/src/main/java/org/kasource/jmx/core/util/JmxValueFormatterImpl.java
JmxValueFormatterImpl.asList
private Object asList(Object value) { Class<?> componentClass = value.getClass().getComponentType(); if (componentClass.isPrimitive()) { if (componentClass.equals(int.class)) { return asIntList(value); } else if (componentClass.equals(long.class)) { ...
java
private Object asList(Object value) { Class<?> componentClass = value.getClass().getComponentType(); if (componentClass.isPrimitive()) { if (componentClass.equals(int.class)) { return asIntList(value); } else if (componentClass.equals(long.class)) { ...
[ "private", "Object", "asList", "(", "Object", "value", ")", "{", "Class", "<", "?", ">", "componentClass", "=", "value", ".", "getClass", "(", ")", ".", "getComponentType", "(", ")", ";", "if", "(", "componentClass", ".", "isPrimitive", "(", ")", ")", ...
Returns the array value as a List. @param value Array to convert into a list. @return the array value as a List.
[ "Returns", "the", "array", "value", "as", "a", "List", "." ]
7f096394e5a11ad5ef483c90ce511a2ba2c14ab2
https://github.com/wigforss/Ka-Jmx/blob/7f096394e5a11ad5ef483c90ce511a2ba2c14ab2/core/src/main/java/org/kasource/jmx/core/util/JmxValueFormatterImpl.java#L138-L157
train
AsList method.
Of course, here is the Java code you requested: ```java private Object asList(Object value) { Class<?> componentClass = value.getClass().getComponentType(); if (componentClass.isPrimitive()) { if (componentClass.equals(int.class)) { return asIntList(value); } els...
nutzam/nutz
src/org/nutz/repo/org/objectweb/asm/commons/GeneratorAdapter.java
GeneratorAdapter.loadInsn
private void loadInsn(final Type type, final int index) { mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), index); }
java
private void loadInsn(final Type type, final int index) { mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), index); }
[ "private", "void", "loadInsn", "(", "final", "Type", "type", ",", "final", "int", "index", ")", "{", "mv", ".", "visitVarInsn", "(", "type", ".", "getOpcode", "(", "Opcodes", ".", "ILOAD", ")", ",", "index", ")", ";", "}" ]
Generates the instruction to push a local variable on the stack. @param type the type of the local variable to be loaded. @param index an index in the frame's local variables array.
[ "Generates", "the", "instruction", "to", "push", "a", "local", "variable", "on", "the", "stack", "." ]
a38694d5cbda2692e7931ab093c168487a6a4bfe
https://github.com/nutzam/nutz/blob/a38694d5cbda2692e7931ab093c168487a6a4bfe/src/org/nutz/repo/org/objectweb/asm/commons/GeneratorAdapter.java#L532-L534
valid
Load instruction.
Of course, here is the Java code you requested: ```java private void loadInsn(final Type type, final int index) { mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), index); } ``` Hope this helps!
chargebee/chargebee-java
src/main/java/com/chargebee/models/CouponSet.java
CouponSet.create
public static CreateRequest create() throws IOException { String uri = uri("coupon_sets"); return new CreateRequest(Method.POST, uri); }
java
public static CreateRequest create() throws IOException { String uri = uri("coupon_sets"); return new CreateRequest(Method.POST, uri); }
[ "public", "static", "CreateRequest", "create", "(", ")", "throws", "IOException", "{", "String", "uri", "=", "uri", "(", "\"coupon_sets\"", ")", ";", "return", "new", "CreateRequest", "(", "Method", ".", "POST", ",", "uri", ")", ";", "}" ]
===========
[ "===========" ]
0772f9af799492bd94b789a39a8ae56f91d47c05
https://github.com/chargebee/chargebee-java/blob/0772f9af799492bd94b789a39a8ae56f91d47c05/src/main/java/com/chargebee/models/CouponSet.java#L62-L65
train
Create a new CIDCTYPE.
Of course, here is the Java code you requested: ```java public static CreateRequest create() throws IOException { String uri = uri("coupon_sets"); return new CreateRequest(Method.POST, uri); } ``` Hope this helps!
ops4j/org.ops4j.pax.wicket
service/src/main/java/org/ops4j/pax/wicket/api/support/AbstractFilterFactory.java
AbstractFilterFactory.updated
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { Integer filterPriority = (Integer) config.get(FILTER_PRIORITY); String applicationName = (String) config.get(APPLICATION_NAME); setPriority(filterPriority); set...
java
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { Integer filterPriority = (Integer) config.get(FILTER_PRIORITY); String applicationName = (String) config.get(APPLICATION_NAME); setPriority(filterPriority); set...
[ "public", "void", "updated", "(", "Dictionary", "<", "String", ",", "?", ">", "config", ")", "throws", "ConfigurationException", "{", "if", "(", "config", "!=", "null", ")", "{", "Integer", "filterPriority", "=", "(", "Integer", ")", "config", ".", "get", ...
{@inheritDoc}
[ "{" ]
ef7cb4bdf918e9e61ec69789b9c690567616faa9
https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/api/support/AbstractFilterFactory.java#L131-L141
train
Updates the configuration of the class.
Of course, here is the Java code you requested: ```java public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { Integer filterPriority = (Integer) config.get(FILTER_PRIORITY); String applicationName = (String) config.get(APPLICATION_NAME);...
ops4j/org.ops4j.pax.wicket
service/src/main/java/org/ops4j/pax/wicket/spi/support/BundleInjectionProviderHelper.java
BundleInjectionProviderHelper.setApplicationName
public final void setApplicationName(String applicationName) { synchronized (lock) { if (applicationName == null) { serviceProperties.remove(APPLICATION_NAME); bundleAnalysingComponentInstantiationListener = null; } else { serviceProperties...
java
public final void setApplicationName(String applicationName) { synchronized (lock) { if (applicationName == null) { serviceProperties.remove(APPLICATION_NAME); bundleAnalysingComponentInstantiationListener = null; } else { serviceProperties...
[ "public", "final", "void", "setApplicationName", "(", "String", "applicationName", ")", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "applicationName", "==", "null", ")", "{", "serviceProperties", ".", "remove", "(", "APPLICATION_NAME", ")", ";", "bu...
Sets the application nane. @param applicationName a {@link java.lang.String} object.
[ "Sets", "the", "application", "nane", "." ]
ef7cb4bdf918e9e61ec69789b9c690567616faa9
https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/spi/support/BundleInjectionProviderHelper.java#L116-L131
train
Sets the application name.
Of course, here is the Java code you requested: ```java public final void setApplicationName(String applicationName) { synchronized (lock) { if (applicationName == null) { serviceProperties.remove(APPLICATION_NAME); bundleAnalysingComponentInstantiationListener = nul...
pac4j/pac4j
pac4j-saml/src/main/java/org/pac4j/saml/util/SAML2Utils.java
SAML2Utils.normalizePortNumbersInUri
private static URI normalizePortNumbersInUri(final URI uri) throws URISyntaxException { int port = uri.getPort(); final String scheme = uri.getScheme(); if (SCHEME_HTTP.equals(scheme) && port == DEFAULT_HTTP_PORT) { port = -1; } if (SCHEME_HTTPS.equals(scheme) && por...
java
private static URI normalizePortNumbersInUri(final URI uri) throws URISyntaxException { int port = uri.getPort(); final String scheme = uri.getScheme(); if (SCHEME_HTTP.equals(scheme) && port == DEFAULT_HTTP_PORT) { port = -1; } if (SCHEME_HTTPS.equals(scheme) && por...
[ "private", "static", "URI", "normalizePortNumbersInUri", "(", "final", "URI", "uri", ")", "throws", "URISyntaxException", "{", "int", "port", "=", "uri", ".", "getPort", "(", ")", ";", "final", "String", "scheme", "=", "uri", ".", "getScheme", "(", ")", ";...
Normalizes a URI. If it contains the default port for the used scheme, the method replaces the port with "default". @param uri The URI to normalize. @return A normalized URI. @throws URISyntaxException If a URI cannot be created because of wrong syntax.
[ "Normalizes", "a", "URI", ".", "If", "it", "contains", "the", "default", "port", "for", "the", "used", "scheme", "the", "method", "replaces", "the", "port", "with", "default", "." ]
d9cd029f8783792b31dd48bf1e32f80628f2c4a3
https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-saml/src/main/java/org/pac4j/saml/util/SAML2Utils.java#L79-L92
train
Normalize port numbers in URI.
Of course, here is the Java code you requested: ```java private static URI normalizePortNumbersInUri(final URI uri) throws URISyntaxException { int port = uri.getPort(); final String scheme = uri.getScheme(); if (SCHEME_HTTP.equals(scheme) && port == DEFAULT_HTTP_PORT) { port = -1;...
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/cookie/DefaultCookie.java
DefaultCookie.validateValue
@Deprecated protected String validateValue(String name, String value) { return validateAttributeValue(name, value); }
java
@Deprecated protected String validateValue(String name, String value) { return validateAttributeValue(name, value); }
[ "@", "Deprecated", "protected", "String", "validateValue", "(", "String", "name", ",", "String", "value", ")", "{", "return", "validateAttributeValue", "(", "name", ",", "value", ")", ";", "}" ]
Validate a cookie attribute value, throws a {@link IllegalArgumentException} otherwise. Only intended to be used by {@link io.netty.handler.codec.http.DefaultCookie}. @param name attribute name @param value attribute value @return the trimmed, validated attribute value @deprecated CookieUtil is package private, will be...
[ "Validate", "a", "cookie", "attribute", "value", "throws", "a", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cookie/DefaultCookie.java#L205-L208
train
Validate a value for a resource attribute.
Of course, here is the Java code you requested: ```java @Deprecated protected String validateValue(String name, String value) { return validateAttributeValue(name, value); } ``` Hope this helps!
contentful/contentful-management.java
src/main/java/com/contentful/java/cma/ModuleAssets.java
ModuleAssets.delete
public Integer delete(CMAAsset asset) { final String assetId = getResourceIdOrThrow(asset, "asset"); final String spaceId = getSpaceIdOrThrow(asset, "asset"); final String environmentId = asset.getEnvironmentId(); return service.delete(spaceId, environmentId, assetId).blockingFirst().code(); }
java
public Integer delete(CMAAsset asset) { final String assetId = getResourceIdOrThrow(asset, "asset"); final String spaceId = getSpaceIdOrThrow(asset, "asset"); final String environmentId = asset.getEnvironmentId(); return service.delete(spaceId, environmentId, assetId).blockingFirst().code(); }
[ "public", "Integer", "delete", "(", "CMAAsset", "asset", ")", "{", "final", "String", "assetId", "=", "getResourceIdOrThrow", "(", "asset", ",", "\"asset\"", ")", ";", "final", "String", "spaceId", "=", "getSpaceIdOrThrow", "(", "asset", ",", "\"asset\"", ")",...
Delete an Asset. @param asset Asset @return An integer representing the result of the delete operation @throws IllegalArgumentException if spaceId is null. @throws IllegalArgumentException if assetId is null.
[ "Delete", "an", "Asset", "." ]
ca310fb9ea9577fcff0ca57949ab7c2315fa2534
https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleAssets.java#L144-L150
train
Delete an Asset.
Of course, here is the Java code you requested: ```java public Integer delete(CMAAsset asset) { final String assetId = getResourceIdOrThrow(asset, "asset"); final String spaceId = getSpaceIdOrThrow(asset, "asset"); final String environmentId = asset.getEnvironmentId(); return service.delete(spaceId, e...
flow/nbt
src/main/java/com/flowpowered/nbt/util/NBTMapper.java
NBTMapper.getTagValue
public static <T> T getTagValue(Tag<?> t, Class<? extends T> clazz) { Object o = toTagValue(t); if (o == null) { return null; } try { return clazz.cast(o); } catch (ClassCastException e) { return null; } }
java
public static <T> T getTagValue(Tag<?> t, Class<? extends T> clazz) { Object o = toTagValue(t); if (o == null) { return null; } try { return clazz.cast(o); } catch (ClassCastException e) { return null; } }
[ "public", "static", "<", "T", ">", "T", "getTagValue", "(", "Tag", "<", "?", ">", "t", ",", "Class", "<", "?", "extends", "T", ">", "clazz", ")", "{", "Object", "o", "=", "toTagValue", "(", "t", ")", ";", "if", "(", "o", "==", "null", ")", "{...
Takes in an NBT tag, sanely checks null status, and then returns it value. This method will return null if the value cannot be cast to the given class. @param t Tag to get the value from @param clazz the return type to use @return the value as an onbject of the same type as the given class
[ "Takes", "in", "an", "NBT", "tag", "sanely", "checks", "null", "status", "and", "then", "returns", "it", "value", ".", "This", "method", "will", "return", "null", "if", "the", "value", "cannot", "be", "cast", "to", "the", "given", "class", "." ]
7a1b6d986e6fbd01862356d47827b8b357349a22
https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/util/NBTMapper.java#L53-L63
train
Get the value of a tag.
Of course, here is the Java code you requested: ```java public static <T> T getTagValue(Tag<?> t, Class<? extends T> clazz) { Object o = toTagValue(t); if (o == null) { return null; } try { return clazz.cast(o); } catch (ClassCastException e) { ...
eclipse/xtext-extras
org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/impl/XIfExpressionImpl.java
XIfExpressionImpl.eUnset
@Override public void eUnset(int featureID) { switch (featureID) { case XbasePackage.XIF_EXPRESSION__IF: setIf((XExpression)null); return; case XbasePackage.XIF_EXPRESSION__THEN: setThen((XExpression)null); return; case XbasePackage.XIF_EXPRESSION__ELSE: setElse((XExpression)null); ...
java
@Override public void eUnset(int featureID) { switch (featureID) { case XbasePackage.XIF_EXPRESSION__IF: setIf((XExpression)null); return; case XbasePackage.XIF_EXPRESSION__THEN: setThen((XExpression)null); return; case XbasePackage.XIF_EXPRESSION__ELSE: setElse((XExpression)null); ...
[ "@", "Override", "public", "void", "eUnset", "(", "int", "featureID", ")", "{", "switch", "(", "featureID", ")", "{", "case", "XbasePackage", ".", "XIF_EXPRESSION__IF", ":", "setIf", "(", "(", "XExpression", ")", "null", ")", ";", "return", ";", "case", ...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
451359541295323a29f5855e633f770cec02069a
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/impl/XIfExpressionImpl.java#L351-L370
train
Override the eUnset method for the XIfExpression.
Of course, here is the Java code you requested: ```java @Override public void eUnset(int featureID) { switch (featureID) { case XbasePackage.XIF_EXPRESSION__IF: setIf((XExpression)null); return; case XbasePackage.XIF_EXPRESSION__THEN: setThen((XExpression)null); return; case XbasePackage...
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/Index.java
Index.saveObject
public JSONObject saveObject(JSONObject object, String objectID, @Nullable RequestOptions requestOptions) throws AlgoliaException { try { return client.putRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8"), /* urlParameters: */ null, object.toString(), requestOptio...
java
public JSONObject saveObject(JSONObject object, String objectID, @Nullable RequestOptions requestOptions) throws AlgoliaException { try { return client.putRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8"), /* urlParameters: */ null, object.toString(), requestOptio...
[ "public", "JSONObject", "saveObject", "(", "JSONObject", "object", ",", "String", "objectID", ",", "@", "Nullable", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "try", "{", "return", "client", ".", "putRequest", "(", "\"/1/indexes/\"",...
Override the content of object. @param object the object to save @param requestOptions Request-specific options. @throws AlgoliaException
[ "Override", "the", "content", "of", "object", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L1201-L1207
test
Save an object in the index.
Of course, here is the Java code you requested: ```java public JSONObject saveObject(JSONObject object, String objectID, @Nullable RequestOptions requestOptions) throws AlgoliaException { try { return client.putRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8"), /...
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/Sorting.java
Sorting.addField
public void addField(String fieldName, SortDirection sortDirection) { if (sortFields == null) sortFields = new HashMap<>(); sortFields.put(fieldName, sortDirection); }
java
public void addField(String fieldName, SortDirection sortDirection) { if (sortFields == null) sortFields = new HashMap<>(); sortFields.put(fieldName, sortDirection); }
[ "public", "void", "addField", "(", "String", "fieldName", ",", "SortDirection", "sortDirection", ")", "{", "if", "(", "sortFields", "==", "null", ")", "sortFields", "=", "new", "HashMap", "<>", "(", ")", ";", "sortFields", ".", "put", "(", "fieldName", ","...
Adds field to sort by. @param fieldName Property name to sort by. @param sortDirection Sort direction.
[ "Adds", "field", "to", "sort", "by", "." ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/Sorting.java#L34-L38
train
Add a field to the sort fields map.
Of course, here is the Java code you requested: ```java public void addField(String fieldName, SortDirection sortDirection) { if (sortFields == null) sortFields = new HashMap<>(); sortFields.put(fieldName, sortDirection); } ``` Hope this helps!
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Nodes.java
Nodes.emptyNode
@SuppressWarnings("unchecked") static <T> Node<T> emptyNode(StreamShape shape) { switch (shape) { case REFERENCE: return (Node<T>) EMPTY_NODE; case INT_VALUE: return (Node<T>) EMPTY_INT_NODE; case LONG_VALUE: return (Node<T>) EMPTY_LONG_NODE; case DOUB...
java
@SuppressWarnings("unchecked") static <T> Node<T> emptyNode(StreamShape shape) { switch (shape) { case REFERENCE: return (Node<T>) EMPTY_NODE; case INT_VALUE: return (Node<T>) EMPTY_INT_NODE; case LONG_VALUE: return (Node<T>) EMPTY_LONG_NODE; case DOUB...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "static", "<", "T", ">", "Node", "<", "T", ">", "emptyNode", "(", "StreamShape", "shape", ")", "{", "switch", "(", "shape", ")", "{", "case", "REFERENCE", ":", "return", "(", "Node", "<", "T", ">", ...
Produces an empty node whose count is zero, has no children and no content. @param <T> the type of elements of the created node @param shape the shape of the node to be created @return an empty node.
[ "Produces", "an", "empty", "node", "whose", "count", "is", "zero", "has", "no", "children", "and", "no", "content", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Nodes.java#L81-L91
train
Returns an empty node of the specified shape.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") static <T> Node<T> emptyNode(StreamShape shape) { switch (shape) { case REFERENCE: return (Node<T>) EMPTY_NODE; case INT_VALUE: return (Node<T>) EMPTY_INT_NODE; case LONG_VALUE: ...
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/util/Resource.java
Resource.getResourceUrl
public static URL getResourceUrl(FacesContext ctx, String path) throws MalformedURLException { final ExternalContext externalContext = ctx.getExternalContext(); URL url = externalContext.getResource(path); if (log.isLoggable(Level.FINE)) { log.fine("Resource-Url from exte...
java
public static URL getResourceUrl(FacesContext ctx, String path) throws MalformedURLException { final ExternalContext externalContext = ctx.getExternalContext(); URL url = externalContext.getResource(path); if (log.isLoggable(Level.FINE)) { log.fine("Resource-Url from exte...
[ "public", "static", "URL", "getResourceUrl", "(", "FacesContext", "ctx", ",", "String", "path", ")", "throws", "MalformedURLException", "{", "final", "ExternalContext", "externalContext", "=", "ctx", ".", "getExternalContext", "(", ")", ";", "URL", "url", "=", "...
Get an URL of an internal resource. First, {@link javax.faces.context.ExternalContext#getResource(String)} is checked for an non-null URL return value. In the case of a null return value (as it is the case for Weblogic 8.1 for a packed war), a URL with a special URL handler is constructed, which can be used for <em>ope...
[ "Get", "an", "URL", "of", "an", "internal", "resource", ".", "First", "{", "@link", "javax", ".", "faces", ".", "context", ".", "ExternalContext#getResource", "(", "String", ")", "}", "is", "checked", "for", "an", "non", "-", "null", "URL", "return", "va...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/util/Resource.java#L61-L84
train
Get the URL of a resource from the ExternalContext.
Of course, here is the Java code you requested: ```java public static URL getResourceUrl(FacesContext ctx, String path) throws MalformedURLException { final ExternalContext externalContext = ctx.getExternalContext(); URL url = externalContext.getResource(path); if (log.isLoggable(Level.FINE...
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java
AtomContainerManipulator.removeNonChiralHydrogens
public static IAtomContainer removeNonChiralHydrogens(IAtomContainer org) { Map<IAtom, IAtom> map = new HashMap<IAtom, IAtom>(); // maps original atoms to clones. List<IAtom> remove = new ArrayList<IAtom>(); // lists removed Hs. // Clone atoms except those to be removed. IAtomContainer...
java
public static IAtomContainer removeNonChiralHydrogens(IAtomContainer org) { Map<IAtom, IAtom> map = new HashMap<IAtom, IAtom>(); // maps original atoms to clones. List<IAtom> remove = new ArrayList<IAtom>(); // lists removed Hs. // Clone atoms except those to be removed. IAtomContainer...
[ "public", "static", "IAtomContainer", "removeNonChiralHydrogens", "(", "IAtomContainer", "org", ")", "{", "Map", "<", "IAtom", ",", "IAtom", ">", "map", "=", "new", "HashMap", "<", "IAtom", ",", "IAtom", ">", "(", ")", ";", "// maps original atoms to clones.", ...
Produces an AtomContainer without explicit non stereo-relevant Hs but with H count from one with Hs. The new molecule is a deep copy. @param org The AtomContainer from which to remove the hydrogens @return The molecule without non stereo-relevant Hs. @cdk.keyword hydrogens, removal
[ "Produces", "an", "AtomContainer", "without", "explicit", "non", "stereo", "-", "relevant", "Hs", "but", "with", "H", "count", "from", "one", "with", "Hs", ".", "The", "new", "molecule", "is", "a", "deep", "copy", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L721-L832
train
Removes all non - chiral hydrogens from an atom container.
Of course, here is the Java code you requested: ```java public static IAtomContainer removeNonChiralHydrogens(IAtomContainer org) { Map<IAtom, IAtom> map = new HashMap<IAtom, IAtom>(); // maps original atoms to clones. List<IAtom> remove = new ArrayList<IAtom>(); // lists removed Hs. // Clone...
alkacon/opencms-core
src/org/opencms/loader/CmsResourceManager.java
CmsResourceManager.initResourceType
private synchronized void initResourceType( I_CmsResourceType resourceType, CmsResourceManagerConfiguration configuration) { // add the loader to the internal list of loaders configuration.addResourceType(resourceType); if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT....
java
private synchronized void initResourceType( I_CmsResourceType resourceType, CmsResourceManagerConfiguration configuration) { // add the loader to the internal list of loaders configuration.addResourceType(resourceType); if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT....
[ "private", "synchronized", "void", "initResourceType", "(", "I_CmsResourceType", "resourceType", ",", "CmsResourceManagerConfiguration", "configuration", ")", "{", "// add the loader to the internal list of loaders", "configuration", ".", "addResourceType", "(", "resourceType", "...
Adds a new resource type to the internal list of loaded resource types and initializes options for the resource type.<p> @param resourceType the resource type to add @param configuration the resource configuration
[ "Adds", "a", "new", "resource", "type", "to", "the", "internal", "list", "of", "loaded", "resource", "types", "and", "initializes", "options", "for", "the", "resource", "type", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L1409-L1442
train
Initialize the resource type.
Of course, here is the Java code you requested: ```java private synchronized void initResourceType( I_CmsResourceType resourceType, CmsResourceManagerConfiguration configuration) { // add the loader to the internal list of loaders configuration.addResourceType(resourceType); if...
aws/aws-sdk-java
aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/AmazonLightsailClient.java
AmazonLightsailClient.getRelationalDatabaseSnapshot
@Override public GetRelationalDatabaseSnapshotResult getRelationalDatabaseSnapshot(GetRelationalDatabaseSnapshotRequest request) { request = beforeClientExecution(request); return executeGetRelationalDatabaseSnapshot(request); }
java
@Override public GetRelationalDatabaseSnapshotResult getRelationalDatabaseSnapshot(GetRelationalDatabaseSnapshotRequest request) { request = beforeClientExecution(request); return executeGetRelationalDatabaseSnapshot(request); }
[ "@", "Override", "public", "GetRelationalDatabaseSnapshotResult", "getRelationalDatabaseSnapshot", "(", "GetRelationalDatabaseSnapshotRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeGetRelationalDatabaseSnapshot"...
<p> Returns information about a specific database snapshot in Amazon Lightsail. </p> @param getRelationalDatabaseSnapshotRequest @return Result of the GetRelationalDatabaseSnapshot operation returned by the service. @throws ServiceException A general service exception. @throws InvalidInputException Lightsail throws th...
[ "<p", ">", "Returns", "information", "about", "a", "specific", "database", "snapshot", "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#L6327-L6331
train
Retrieves a database snapshot.
Of course, here is the Java code you requested: ```java @Override public GetRelationalDatabaseSnapshotResult getRelationalDatabaseSnapshot(GetRelationalDatabaseSnapshotRequest request) { request = beforeClientExecution(request); return executeGetRelationalDatabaseSnapshot(request); } ``` Hope ...
OpenLiberty/open-liberty
dev/com.ibm.ws.security.jaas.common/src/com/ibm/websphere/security/auth/callback/WSCallbackHandlerImpl.java
WSCallbackHandlerImpl.handle
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { int len = 0; if ((callbacks == null) || ((len = callbacks.length) == 0)) { return; } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Stri...
java
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { int len = 0; if ((callbacks == null) || ((len = callbacks.length) == 0)) { return; } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Stri...
[ "@", "Override", "public", "void", "handle", "(", "Callback", "[", "]", "callbacks", ")", "throws", "IOException", ",", "UnsupportedCallbackException", "{", "int", "len", "=", "0", ";", "if", "(", "(", "callbacks", "==", "null", ")", "||", "(", "(", "len...
<p> This implementation of <code>CallbackHandler</code> pushes the data specified in the constructor to the login module. </p> @param callbacks An array of <code>Callback</code> objects provided by the underlying security service which contains the information requested to be retrieved or displayed. @exception IOExcep...
[ "<p", ">", "This", "implementation", "of", "<code", ">", "CallbackHandler<", "/", "code", ">", "pushes", "the", "data", "specified", "in", "the", "constructor", "to", "the", "login", "module", ".", "<", "/", "p", ">" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaas.common/src/com/ibm/websphere/security/auth/callback/WSCallbackHandlerImpl.java#L168-L208
train
Override handle method to override the handle method in the class path.
Of course, here is the Java code you requested: ```java @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { int len = 0; if ((callbacks == null) || ((len = callbacks.length) == 0)) { return; } if (TraceComponent.isAnyTr...
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/Environment.java
Environment.callService
public void callService(String url, String templateName, Object model, XmlHttpResponse result, Map<String, Object> headers) { doHttpPost(url, templateName, model, result, headers, XmlHttpResponse.CONTENT_TYPE_XML_TEXT_UTF8); setContext(result); }
java
public void callService(String url, String templateName, Object model, XmlHttpResponse result, Map<String, Object> headers) { doHttpPost(url, templateName, model, result, headers, XmlHttpResponse.CONTENT_TYPE_XML_TEXT_UTF8); setContext(result); }
[ "public", "void", "callService", "(", "String", "url", ",", "String", "templateName", ",", "Object", "model", ",", "XmlHttpResponse", "result", ",", "Map", "<", "String", ",", "Object", ">", "headers", ")", "{", "doHttpPost", "(", "url", ",", "templateName",...
Performs POST to supplied url of result of applying template with model. All namespaces registered in this environment will be registered with result. @param url url to post to. @param templateName name of template to use. @param model model for template. @param result result to populate with response. @param headers h...
[ "Performs", "POST", "to", "supplied", "url", "of", "result", "of", "applying", "template", "with", "model", ".", "All", "namespaces", "registered", "in", "this", "environment", "will", "be", "registered", "with", "result", "." ]
4e9018d7386a9aa65bfcbf07eb28ae064edd1732
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L247-L250
train
Call a service.
Of course, here is the Java code you requested: ```java public void callService(String url, String templateName, Object model, XmlHttpResponse result, Map<String, Object> headers) { doHttpPost(url, templateName, model, result, headers, XmlHttpResponse.CONTENT_TYPE_XML_TEXT_UTF8); setContext(result); ...
RestComm/jss7
tcap/tcap-impl/src/main/java/org/restcomm/protocols/ss7/tcap/asn/ReturnResultImpl.java
ReturnResultImpl.encode
public void encode(AsnOutputStream aos) throws EncodeException { if (invokeId == null) throw new EncodeException("No Invoke ID set."); try { aos.writeTag(Tag.CLASS_CONTEXT_SPECIFIC, false, _TAG); int pos = aos.StartContentDefiniteLength(); aos.writeInte...
java
public void encode(AsnOutputStream aos) throws EncodeException { if (invokeId == null) throw new EncodeException("No Invoke ID set."); try { aos.writeTag(Tag.CLASS_CONTEXT_SPECIFIC, false, _TAG); int pos = aos.StartContentDefiniteLength(); aos.writeInte...
[ "public", "void", "encode", "(", "AsnOutputStream", "aos", ")", "throws", "EncodeException", "{", "if", "(", "invokeId", "==", "null", ")", "throw", "new", "EncodeException", "(", "\"No Invoke ID set.\"", ")", ";", "try", "{", "aos", ".", "writeTag", "(", "T...
/* (non-Javadoc) @see org.restcomm.protocols.ss7.tcap.asn.Encodable#encode(org.mobicents.protocols .asn.AsnOutputStream)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
402b4b3984e581c581e309cb5f6a858fde6dbc33
https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tcap/tcap-impl/src/main/java/org/restcomm/protocols/ss7/tcap/asn/ReturnResultImpl.java#L187-L213
train
Encode the result of a Sequence.
Of course, here is the Java code you requested: ```java public void encode(AsnOutputStream aos) throws EncodeException { if (invokeId == null) throw new EncodeException("No Invoke ID set."); try { aos.writeTag(Tag.CLASS_CONTEXT_SPECIFIC, false, _TAG); int pos = aos...
sagiegurari/fax4j
src/main/java/org/fax4j/spi/http/HTTPFaxClientSpi.java
HTTPFaxClientSpi.initializeFaxActionType2ResourceMap
protected Map<FaxActionType,String> initializeFaxActionType2ResourceMap() { //get resources Map<FaxActionType,String> map=new HashMap<FaxActionType,String>(); FaxActionType[] faxActionTypes=new FaxActionType[]{FaxActionType.SUBMIT_FAX_JOB, ...
java
protected Map<FaxActionType,String> initializeFaxActionType2ResourceMap() { //get resources Map<FaxActionType,String> map=new HashMap<FaxActionType,String>(); FaxActionType[] faxActionTypes=new FaxActionType[]{FaxActionType.SUBMIT_FAX_JOB, ...
[ "protected", "Map", "<", "FaxActionType", ",", "String", ">", "initializeFaxActionType2ResourceMap", "(", ")", "{", "//get resources", "Map", "<", "FaxActionType", ",", "String", ">", "map", "=", "new", "HashMap", "<", "FaxActionType", ",", "String", ">", "(", ...
This function initializes the fax action type to resource mappings. @return The fax action type to resource mappings
[ "This", "function", "initializes", "the", "fax", "action", "type", "to", "resource", "mappings", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/HTTPFaxClientSpi.java#L352-L378
train
This function initializes the fax action type 2 resource map.
Of course, here is the Java code you requested: ```java protected Map<FaxActionType,String> initializeFaxActionType2ResourceMap() { //get resources Map<FaxActionType,String> map=new HashMap<FaxActionType,String>(); FaxActionType[] faxActionTypes=new FaxActionType[]{FaxActionType.SUBMIT_FAX_...
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/ByteArrayWrapper.java
ByteArrayWrapper.seek
public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; }
java
public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; }
[ "public", "synchronized", "void", "seek", "(", "long", "position", ")", "throws", "IOException", "{", "if", "(", "position", "<", "0", "||", "position", ">=", "count", ")", "{", "throw", "new", "IOException", "(", "\"cannot seek position \"", "+", "position", ...
Seeks and sets position to the specified value. @throws IOException if position is negative or exceeds the buffer size {@inheritDoc}
[ "Seeks", "and", "sets", "position", "to", "the", "specified", "value", "." ]
e35996b6e2f016bcd18db0bad320be7c93d95208
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/ByteArrayWrapper.java#L49-L54
train
Seek to the specified position.
Of course, here is the Java code you requested: ```java public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } ``` Hope this helps!
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java
Ifc4PackageImpl.getIfcInventory
@Override public EClass getIfcInventory() { if (ifcInventoryEClass == null) { ifcInventoryEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(327); } return ifcInventoryEClass; }
java
@Override public EClass getIfcInventory() { if (ifcInventoryEClass == null) { ifcInventoryEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(327); } return ifcInventoryEClass; }
[ "@", "Override", "public", "EClass", "getIfcInventory", "(", ")", "{", "if", "(", "ifcInventoryEClass", "==", "null", ")", "{", "ifcInventoryEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "Ifc4Package",...
<!-- 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#L20208-L20215
train
Get the IfcInventoryEClass from the IFF4Package.
Of course, here is the Java code you requested: ```java @Override public EClass getIfcInventory() { if (ifcInventoryEClass == null) { ifcInventoryEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(327); } return ifcInventoryEClass; } ``` Hope th...
JodaOrg/joda-beans
src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java
DirectMetaProperty.ofReadOnlyBuildable
public static <P> DirectMetaProperty<P> ofReadOnlyBuildable( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, Prope...
java
public static <P> DirectMetaProperty<P> ofReadOnlyBuildable( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(metaBean, propertyName, declaringType, propertyType, Prope...
[ "public", "static", "<", "P", ">", "DirectMetaProperty", "<", "P", ">", "ofReadOnlyBuildable", "(", "MetaBean", "metaBean", ",", "String", "propertyName", ",", "Class", "<", "?", ">", "declaringType", ",", "Class", "<", "P", ">", "propertyType", ")", "{", ...
Factory to create a buildable read-only meta-property avoiding duplicate generics. @param <P> the property type @param metaBean the meta-bean, not null @param propertyName the property name, not empty @param declaringType the type declaring the property, not null @param propertyType the property type, not null @r...
[ "Factory", "to", "create", "a", "buildable", "read", "-", "only", "meta", "-", "property", "avoiding", "duplicate", "generics", "." ]
f07dbe42947150b23a173f35984c6ab33c5529bf
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/direct/DirectMetaProperty.java#L109-L113
train
Creates a read - only buildable meta - property.
Of course, here is the Java code you requested: ```java public static <P> DirectMetaProperty<P> ofReadOnlyBuildable( MetaBean metaBean, String propertyName, Class<?> declaringType, Class<P> propertyType) { Field field = findField(metaBean, propertyName); return new DirectMetaProperty<>(m...
querydsl/querydsl
querydsl-sql/src/main/java/com/querydsl/sql/SQLExpressions.java
SQLExpressions.addMinutes
public static <D extends Comparable> DateTimeExpression<D> addMinutes(DateTimeExpression<D> date, int minutes) { return Expressions.dateTimeOperation(date.getType(), Ops.DateTimeOps.ADD_MINUTES, date, ConstantImpl.create(minutes)); }
java
public static <D extends Comparable> DateTimeExpression<D> addMinutes(DateTimeExpression<D> date, int minutes) { return Expressions.dateTimeOperation(date.getType(), Ops.DateTimeOps.ADD_MINUTES, date, ConstantImpl.create(minutes)); }
[ "public", "static", "<", "D", "extends", "Comparable", ">", "DateTimeExpression", "<", "D", ">", "addMinutes", "(", "DateTimeExpression", "<", "D", ">", "date", ",", "int", "minutes", ")", "{", "return", "Expressions", ".", "dateTimeOperation", "(", "date", ...
Add the given amount of minutes to the date @param date datetime @param minutes minutes to add @return converted datetime
[ "Add", "the", "given", "amount", "of", "minutes", "to", "the", "date" ]
2bf234caf78549813a1e0f44d9c30ecc5ef734e3
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/SQLExpressions.java#L512-L514
train
Create a new date time expression that is added to the given minutes.
Of course, here is the Java code you requested: ```java public static <D extends Comparable> DateTimeExpression<D> addMinutes(DateTimeExpression<D> date, int minutes) { return Expressions.dateTimeOperation(date.getType(), Ops.DateTimeOps.ADD_MINUTES, date, ConstantImpl.create(minutes)); } ``` Hope this he...
wisdom-framework/wisdom
core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java
Result.json
public Result json() { setContentType(MimeTypes.JSON); charset = Charsets.UTF_8; // If we already have a String content, we must set the type. // The renderable object checks whether or not the given String is a valid JSON string, // or if a transformation is required. if...
java
public Result json() { setContentType(MimeTypes.JSON); charset = Charsets.UTF_8; // If we already have a String content, we must set the type. // The renderable object checks whether or not the given String is a valid JSON string, // or if a transformation is required. if...
[ "public", "Result", "json", "(", ")", "{", "setContentType", "(", "MimeTypes", ".", "JSON", ")", ";", "charset", "=", "Charsets", ".", "UTF_8", ";", "// If we already have a String content, we must set the type.", "// The renderable object checks whether or not the given Stri...
Sets the content type of this result to {@link MimeTypes#JSON}. @return the same result where you executed this method on. But the content type is now {@link MimeTypes#JSON}.
[ "Sets", "the", "content", "type", "of", "this", "result", "to", "{", "@link", "MimeTypes#JSON", "}", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L467-L477
train
Sets the content type and charset to JSON.
Of course, here is the Java code you requested: ```java public Result json() { setContentType(MimeTypes.JSON); charset = Charsets.UTF_8; // If we already have a String content, we must set the type. // The renderable object checks whether or not the given String is a valid JSON string, ...
mongodb/mongo-java-driver
driver-core/src/main/com/mongodb/internal/connection/ConcurrentLinkedDeque.java
Node.back
Node<E> back() { Node<E> f = predecessor(); return (f == null || f.isSpecial()) ? null : f; }
java
Node<E> back() { Node<E> f = predecessor(); return (f == null || f.isSpecial()) ? null : f; }
[ "Node", "<", "E", ">", "back", "(", ")", "{", "Node", "<", "E", ">", "f", "=", "predecessor", "(", ")", ";", "return", "(", "f", "==", "null", "||", "f", ".", "isSpecial", "(", ")", ")", "?", "null", ":", "f", ";", "}" ]
Returns previous node containing a nondeleted user element, if possible. Use for backward list traversal, but beware that if this method is called from a deleted node, it might not be able to determine a usable predecessor. @return predecessor, or null if no such could be found
[ "Returns", "previous", "node", "containing", "a", "nondeleted", "user", "element", "if", "possible", ".", "Use", "for", "backward", "list", "traversal", "but", "beware", "that", "if", "this", "method", "is", "called", "from", "a", "deleted", "node", "it", "m...
a92d47e2e9f2fca55d09229a0a2e2cdc714db085
https://github.com/mongodb/mongo-java-driver/blob/a92d47e2e9f2fca55d09229a0a2e2cdc714db085/driver-core/src/main/com/mongodb/internal/connection/ConcurrentLinkedDeque.java#L336-L339
valid
Get the back predecessor.
Of course, here is the Java code you requested: ```java Node<E> back() { Node<E> f = predecessor(); return (f == null || f.isSpecial()) ? null : f; } ``` Hope this helps!
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/PartitionKeyMapper.java
PartitionKeyMapper.term
public Term term(DecoratedKey partitionKey) { String serializedKey = ByteBufferUtils.toString(partitionKey.getKey()); return new Term(FIELD_NAME, serializedKey); }
java
public Term term(DecoratedKey partitionKey) { String serializedKey = ByteBufferUtils.toString(partitionKey.getKey()); return new Term(FIELD_NAME, serializedKey); }
[ "public", "Term", "term", "(", "DecoratedKey", "partitionKey", ")", "{", "String", "serializedKey", "=", "ByteBufferUtils", ".", "toString", "(", "partitionKey", ".", "getKey", "(", ")", ")", ";", "return", "new", "Term", "(", "FIELD_NAME", ",", "serializedKey...
Returns the specified raw partition key as a Lucene {@link Term}. @param partitionKey The raw partition key to be converted. @return The specified raw partition key as a Lucene {@link Term}.
[ "Returns", "the", "specified", "raw", "partition", "key", "as", "a", "Lucene", "{", "@link", "Term", "}", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/PartitionKeyMapper.java#L96-L99
train
Create a term from a key
Of course, here is the Java code you requested: ```java public Term term(DecoratedKey partitionKey) { String serializedKey = ByteBufferUtils.toString(partitionKey.getKey()); return new Term(FIELD_NAME, serializedKey); } ``` Hope this helps!
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcipher.java
sslcipher.delete
public static base_responses delete(nitro_service client, String ciphergroupname[]) throws Exception { base_responses result = null; if (ciphergroupname != null && ciphergroupname.length > 0) { sslcipher deleteresources[] = new sslcipher[ciphergroupname.length]; for (int i=0;i<ciphergroupname.length;i++){ ...
java
public static base_responses delete(nitro_service client, String ciphergroupname[]) throws Exception { base_responses result = null; if (ciphergroupname != null && ciphergroupname.length > 0) { sslcipher deleteresources[] = new sslcipher[ciphergroupname.length]; for (int i=0;i<ciphergroupname.length;i++){ ...
[ "public", "static", "base_responses", "delete", "(", "nitro_service", "client", ",", "String", "ciphergroupname", "[", "]", ")", "throws", "Exception", "{", "base_responses", "result", "=", "null", ";", "if", "(", "ciphergroupname", "!=", "null", "&&", "ciphergr...
Use this API to delete sslcipher resources of given names.
[ "Use", "this", "API", "to", "delete", "sslcipher", "resources", "of", "given", "names", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcipher.java#L185-L196
train
Use this API to delete sslcipher resources of given names.
Of course, here is the Java code you requested: ```java public static base_responses delete(nitro_service client, String ciphergroupname[]) throws Exception { base_responses result = null; if (ciphergroupname != null && ciphergroupname.length > 0) { sslcipher deleteresources[] = new sslcipher[ciphergroupname.le...
google/guava
android/guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java
AtomicDoubleArray.getAndAdd
@CanIgnoreReturnValue public final double getAndAdd(int i, double delta) { while (true) { long current = longs.get(i); double currentVal = longBitsToDouble(current); double nextVal = currentVal + delta; long next = doubleToRawLongBits(nextVal); if (longs.compareAndSet(i, current, nex...
java
@CanIgnoreReturnValue public final double getAndAdd(int i, double delta) { while (true) { long current = longs.get(i); double currentVal = longBitsToDouble(current); double nextVal = currentVal + delta; long next = doubleToRawLongBits(nextVal); if (longs.compareAndSet(i, current, nex...
[ "@", "CanIgnoreReturnValue", "public", "final", "double", "getAndAdd", "(", "int", "i", ",", "double", "delta", ")", "{", "while", "(", "true", ")", "{", "long", "current", "=", "longs", ".", "get", "(", "i", ")", ";", "double", "currentVal", "=", "lon...
Atomically adds the given value to the element at index {@code i}. @param i the index @param delta the value to add @return the previous value
[ "Atomically", "adds", "the", "given", "value", "to", "the", "element", "at", "index", "{", "@code", "i", "}", "." ]
7155d12b70a2406fa84d94d4b8b3bc108e89abfd
https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/android/guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java#L171-L182
valid
Gets the value of the entry at the given index and adds the given delta to the value of the entry at the given index.
Of course, here is the Java code you requested: ```java @CanIgnoreReturnValue public final double getAndAdd(int i, double delta) { while (true) { long current = longs.get(i); double currentVal = longBitsToDouble(current); double nextVal = currentVal + delta; long next = doubleToRawLongBit...