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
aws/aws-sdk-java
aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/VPCOptionsMarshaller.java
VPCOptionsMarshaller.marshall
public void marshall(VPCOptions vPCOptions, ProtocolMarshaller protocolMarshaller) { if (vPCOptions == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(vPCOptions.getSubnetIds(), SUBNETIDS_BINDING); ...
java
public void marshall(VPCOptions vPCOptions, ProtocolMarshaller protocolMarshaller) { if (vPCOptions == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(vPCOptions.getSubnetIds(), SUBNETIDS_BINDING); ...
[ "public", "void", "marshall", "(", "VPCOptions", "vPCOptions", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "vPCOptions", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshall(...)\"", ")", "...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/VPCOptionsMarshaller.java#L45-L57
train
marshalls the given VPCOptions object to the JSON object.
Of course, here is the Java code you requested: ```java public void marshall(VPCOptions vPCOptions, ProtocolMarshaller protocolMarshaller) { if (vPCOptions == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.m...
apiman/apiman
manager/api/core/src/main/java/io/apiman/manager/api/core/util/PolicyTemplateUtil.java
PolicyTemplateUtil.getTemplateBean
private static PolicyDefinitionTemplateBean getTemplateBean(PolicyDefinitionBean def) { Locale currentLocale = Messages.i18n.getLocale(); String lang = currentLocale.getLanguage(); String country = lang + "_" + currentLocale.getCountry(); //$NON-NLS-1$ PolicyDefinitionTemplateBean nullB...
java
private static PolicyDefinitionTemplateBean getTemplateBean(PolicyDefinitionBean def) { Locale currentLocale = Messages.i18n.getLocale(); String lang = currentLocale.getLanguage(); String country = lang + "_" + currentLocale.getCountry(); //$NON-NLS-1$ PolicyDefinitionTemplateBean nullB...
[ "private", "static", "PolicyDefinitionTemplateBean", "getTemplateBean", "(", "PolicyDefinitionBean", "def", ")", "{", "Locale", "currentLocale", "=", "Messages", ".", "i18n", ".", "getLocale", "(", ")", ";", "String", "lang", "=", "currentLocale", ".", "getLanguage"...
Determines the appropriate template bean to use given the current locale. @param def
[ "Determines", "the", "appropriate", "template", "bean", "to", "use", "given", "the", "current", "locale", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/util/PolicyTemplateUtil.java#L109-L137
train
Get the template bean from the given policy definition.
Of course, here is the Java code you requested: ```java private static PolicyDefinitionTemplateBean getTemplateBean(PolicyDefinitionBean def) { Locale currentLocale = Messages.i18n.getLocale(); String lang = currentLocale.getLanguage(); String country = lang + "_" + currentLocale.getCountry(); ...
ironjacamar/ironjacamar
core/src/main/java/org/ironjacamar/core/deploymentrepository/AdminObjectImpl.java
AdminObjectImpl.deactivate
public boolean deactivate() throws Exception { if (activated) { if (jndiObject != null) { jndiStrategy.unbind(jndiName, jndiObject); } else { jndiStrategy.unbind(jndiName, adminObject); } activated = false; r...
java
public boolean deactivate() throws Exception { if (activated) { if (jndiObject != null) { jndiStrategy.unbind(jndiName, jndiObject); } else { jndiStrategy.unbind(jndiName, adminObject); } activated = false; r...
[ "public", "boolean", "deactivate", "(", ")", "throws", "Exception", "{", "if", "(", "activated", ")", "{", "if", "(", "jndiObject", "!=", "null", ")", "{", "jndiStrategy", ".", "unbind", "(", "jndiName", ",", "jndiObject", ")", ";", "}", "else", "{", "...
{@inheritDoc}
[ "{" ]
f0389ee7e62aa8b40ba09b251edad76d220ea796
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/deploymentrepository/AdminObjectImpl.java#L213-L231
train
Deactivate the object.
Of course, here is the Java code you requested: ```java public boolean deactivate() throws Exception { if (activated) { if (jndiObject != null) { jndiStrategy.unbind(jndiName, jndiObject); } else { jndiStrategy.unbind(jndiName, adminOb...
eclipse/xtext-extras
org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/impl/XInstanceOfExpressionImpl.java
XInstanceOfExpressionImpl.eGet
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XbasePackage.XINSTANCE_OF_EXPRESSION__TYPE: return getType(); case XbasePackage.XINSTANCE_OF_EXPRESSION__EXPRESSION: return getExpression(); } return super.eGet(featureID, resolve, coreType...
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XbasePackage.XINSTANCE_OF_EXPRESSION__TYPE: return getType(); case XbasePackage.XINSTANCE_OF_EXPRESSION__EXPRESSION: return getExpression(); } return super.eGet(featureID, resolve, coreType...
[ "@", "Override", "public", "Object", "eGet", "(", "int", "featureID", ",", "boolean", "resolve", ",", "boolean", "coreType", ")", "{", "switch", "(", "featureID", ")", "{", "case", "XbasePackage", ".", "XINSTANCE_OF_EXPRESSION__TYPE", ":", "return", "getType", ...
<!-- 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/XInstanceOfExpressionImpl.java#L200-L211
train
Override eGet to return the value of the feature.
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XbasePackage.XINSTANCE_OF_EXPRESSION__TYPE: return getType(); case XbasePackage.XINSTANCE_OF_EXPRESSION__EXPRESSION: return getExpressio...
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java
TheMovieDbApi.getMovieReviews
public ResultList<Review> getMovieReviews(int movieId, Integer page, String language) throws MovieDbException { return tmdbMovies.getMovieReviews(movieId, page, language); }
java
public ResultList<Review> getMovieReviews(int movieId, Integer page, String language) throws MovieDbException { return tmdbMovies.getMovieReviews(movieId, page, language); }
[ "public", "ResultList", "<", "Review", ">", "getMovieReviews", "(", "int", "movieId", ",", "Integer", "page", ",", "String", "language", ")", "throws", "MovieDbException", "{", "return", "tmdbMovies", ".", "getMovieReviews", "(", "movieId", ",", "page", ",", "...
Get the reviews for a particular movie id. @param movieId movieId @param page page @param language language @return @throws MovieDbException exception
[ "Get", "the", "reviews", "for", "a", "particular", "movie", "id", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L1006-L1008
train
Get the list of reviews for a specific movie ID.
Of course, here is the Java code you requested: ```java public ResultList<Review> getMovieReviews(int movieId, Integer page, String language) throws MovieDbException { return tmdbMovies.getMovieReviews(movieId, page, language); } ``` Hope this helps!
phax/ph-bdve
ph-bdve/src/main/java/com/helger/bdve/executorset/ValidationExecutorSetRegistry.java
ValidationExecutorSetRegistry.registerValidationExecutorSet
@Nonnull public <T extends IValidationExecutorSet> T registerValidationExecutorSet (@Nonnull final T aVES) { ValueEnforcer.notNull (aVES, "VES"); final VESID aKey = aVES.getID (); m_aRWLock.writeLocked ( () -> { if (m_aMap.containsKey (aKey)) throw new IllegalStateException ("Another vali...
java
@Nonnull public <T extends IValidationExecutorSet> T registerValidationExecutorSet (@Nonnull final T aVES) { ValueEnforcer.notNull (aVES, "VES"); final VESID aKey = aVES.getID (); m_aRWLock.writeLocked ( () -> { if (m_aMap.containsKey (aKey)) throw new IllegalStateException ("Another vali...
[ "@", "Nonnull", "public", "<", "T", "extends", "IValidationExecutorSet", ">", "T", "registerValidationExecutorSet", "(", "@", "Nonnull", "final", "T", "aVES", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aVES", ",", "\"VES\"", ")", ";", "final", "VESID", ...
Register a validation executor set into this registry. @param aVES The object to register. MAy not be <code>null</code>. @return The passed parameter @throws IllegalStateException If another object with the same ID is already registered in this registry. @param <T> The {@link IValidationExecutorSet} implementation tha...
[ "Register", "a", "validation", "executor", "set", "into", "this", "registry", "." ]
2438f491174cd8989567fcdf129b273bd217e89f
https://github.com/phax/ph-bdve/blob/2438f491174cd8989567fcdf129b273bd217e89f/ph-bdve/src/main/java/com/helger/bdve/executorset/ValidationExecutorSetRegistry.java#L77-L91
train
Register a validation executor set.
Of course, here is the Java code you requested: ```java @Nonnull public <T extends IValidationExecutorSet> T registerValidationExecutorSet (@Nonnull final T aVES) { ValueEnforcer.notNull (aVES, "VES"); final VESID aKey = aVES.getID (); m_aRWLock.writeLocked ( () -> { if (m_aMap.containsKey (aKey...
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java
MasterWorkerInfo.updateCapacityBytes
public void updateCapacityBytes(Map<String, Long> capacityBytesOnTiers) { mCapacityBytes = 0; mTotalBytesOnTiers = capacityBytesOnTiers; for (long t : mTotalBytesOnTiers.values()) { mCapacityBytes += t; } }
java
public void updateCapacityBytes(Map<String, Long> capacityBytesOnTiers) { mCapacityBytes = 0; mTotalBytesOnTiers = capacityBytesOnTiers; for (long t : mTotalBytesOnTiers.values()) { mCapacityBytes += t; } }
[ "public", "void", "updateCapacityBytes", "(", "Map", "<", "String", ",", "Long", ">", "capacityBytesOnTiers", ")", "{", "mCapacityBytes", "=", "0", ";", "mTotalBytesOnTiers", "=", "capacityBytesOnTiers", ";", "for", "(", "long", "t", ":", "mTotalBytesOnTiers", "...
Sets the capacity of the worker in bytes. @param capacityBytesOnTiers used bytes on each storage tier
[ "Sets", "the", "capacity", "of", "the", "worker", "in", "bytes", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java#L412-L418
train
Update the capacity bytes on the Tiers.
Of course, here is the Java code you requested: ```java public void updateCapacityBytes(Map<String, Long> capacityBytesOnTiers) { mCapacityBytes = 0; mTotalBytesOnTiers = capacityBytesOnTiers; for (long t : mTotalBytesOnTiers.values()) { mCapacityBytes += t; } } ``` Hope this helps!
3pillarlabs/spring-data-simpledb
spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/reflection/ReflectionUtils.java
ReflectionUtils.getDeclaredFieldInHierarchy
public static Field getDeclaredFieldInHierarchy(Class<?> clazz, String fieldName) throws NoSuchFieldException { Field field = null; for (Class<?> acls = clazz; acls != null; acls = acls.getSuperclass()) { try { field = acls.getDeclaredField(fieldName); break; } catch (NoSuchFieldException e) { ...
java
public static Field getDeclaredFieldInHierarchy(Class<?> clazz, String fieldName) throws NoSuchFieldException { Field field = null; for (Class<?> acls = clazz; acls != null; acls = acls.getSuperclass()) { try { field = acls.getDeclaredField(fieldName); break; } catch (NoSuchFieldException e) { ...
[ "public", "static", "Field", "getDeclaredFieldInHierarchy", "(", "Class", "<", "?", ">", "clazz", ",", "String", "fieldName", ")", "throws", "NoSuchFieldException", "{", "Field", "field", "=", "null", ";", "for", "(", "Class", "<", "?", ">", "acls", "=", "...
Finds a declared field in given <tt>clazz</tt> and continues to search up the superclass until no more super class is present. @param clazz @param fieldName @return @throws NoSuchFieldException
[ "Finds", "a", "declared", "field", "in", "given", "<tt", ">", "clazz<", "/", "tt", ">", "and", "continues", "to", "search", "up", "the", "superclass", "until", "no", "more", "super", "class", "is", "present", "." ]
f1e0eb4e48ec4674d3966e8f5bc04c95031f93ae
https://github.com/3pillarlabs/spring-data-simpledb/blob/f1e0eb4e48ec4674d3966e8f5bc04c95031f93ae/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/reflection/ReflectionUtils.java#L300-L316
train
Gets the field in the hierarchy of the given class.
Of course, here is the Java code you requested: ```java public static Field getDeclaredFieldInHierarchy(Class<?> clazz, String fieldName) throws NoSuchFieldException { Field field = null; for (Class<?> acls = clazz; acls != null; acls = acls.getSuperclass()) { try { field = acls.getDeclaredField(fieldNam...
wisdom-framework/wisdom
extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java
CSRFServiceImpl.compareTokens
@Override public boolean compareTokens(String a, String b) { if (isSignedToken()) { return crypto.compareSignedTokens(a, b); } else { return crypto.constantTimeEquals(a, b); } }
java
@Override public boolean compareTokens(String a, String b) { if (isSignedToken()) { return crypto.compareSignedTokens(a, b); } else { return crypto.constantTimeEquals(a, b); } }
[ "@", "Override", "public", "boolean", "compareTokens", "(", "String", "a", ",", "String", "b", ")", "{", "if", "(", "isSignedToken", "(", ")", ")", "{", "return", "crypto", ".", "compareSignedTokens", "(", "a", ",", "b", ")", ";", "}", "else", "{", "...
Compares to token. @param a the first token @param b the second token @return {@code true} if the token are equal, {@code false} otherwise
[ "Compares", "to", "token", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L218-L225
train
Compare two tokens.
Of course, here is the Java code you requested: ```java @Override public boolean compareTokens(String a, String b) { if (isSignedToken()) { return crypto.compareSignedTokens(a, b); } else { return crypto.constantTimeEquals(a, b); } } ``` Hope this helps!
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/ByteUtils.java
ByteUtils.bitLength
public static int bitLength (byte[] bytes) { Objects.requireNonNull(bytes, Required.BYTES.toString()); int byteLength = bytes.length; int length = 0; if (byteLength <= MAX_BYTE_LENGTH && byteLength > 0) { length = byteLength * BYTES; } return...
java
public static int bitLength (byte[] bytes) { Objects.requireNonNull(bytes, Required.BYTES.toString()); int byteLength = bytes.length; int length = 0; if (byteLength <= MAX_BYTE_LENGTH && byteLength > 0) { length = byteLength * BYTES; } return...
[ "public", "static", "int", "bitLength", "(", "byte", "[", "]", "bytes", ")", "{", "Objects", ".", "requireNonNull", "(", "bytes", ",", "Required", ".", "BYTES", ".", "toString", "(", ")", ")", ";", "int", "byteLength", "=", "bytes", ".", "length", ";",...
Calculates the bit length of a given byte array @param bytes The byte array @return The number of bit
[ "Calculates", "the", "bit", "length", "of", "a", "given", "byte", "array" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/ByteUtils.java#L26-L36
train
Returns the bit length of the given byte array.
Of course, here is the Java code you requested: ```java public static int bitLength (byte[] bytes) { Objects.requireNonNull(bytes, Required.BYTES.toString()); int byteLength = bytes.length; int length = 0; if (byteLength <= MAX_BYTE_LENGTH && byteLength > 0) { lengt...
oblac/jodd
jodd-http/src/main/java/jodd/http/net/Socks4ProxySocketFactory.java
Socks4ProxySocketFactory.createSocks4ProxySocket
private Socket createSocks4ProxySocket(final String host, final int port) { Socket socket = null; final String proxyHost = proxy.getProxyAddress(); final int proxyPort = proxy.getProxyPort(); final String user = proxy.getProxyUsername(); try { socket = Sockets.connect(proxyHost, proxyPort, connectionTimeo...
java
private Socket createSocks4ProxySocket(final String host, final int port) { Socket socket = null; final String proxyHost = proxy.getProxyAddress(); final int proxyPort = proxy.getProxyPort(); final String user = proxy.getProxyUsername(); try { socket = Sockets.connect(proxyHost, proxyPort, connectionTimeo...
[ "private", "Socket", "createSocks4ProxySocket", "(", "final", "String", "host", ",", "final", "int", "port", ")", "{", "Socket", "socket", "=", "null", ";", "final", "String", "proxyHost", "=", "proxy", ".", "getProxyAddress", "(", ")", ";", "final", "int", ...
Connects to the SOCKS4 proxy and returns proxified socket.
[ "Connects", "to", "the", "SOCKS4", "proxy", "and", "returns", "proxified", "socket", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/net/Socks4ProxySocketFactory.java#L76-L147
test
Creates a SOCKS4 proxy socket.
Of course, here is the Java code you requested: ```java private Socket createSocks4ProxySocket(final String host, final int port) { Socket socket = null; final String proxyHost = proxy.getProxyAddress(); final int proxyPort = proxy.getProxyPort(); final String user = proxy.getProxyUsername(); try { socke...
roboconf/roboconf-platform
core/roboconf-target-iaas-vmware/src/main/java/net/roboconf/target/vmware/internal/VmwareIaasHandler.java
VmwareIaasHandler.createMachine
@Override public String createMachine( TargetHandlerParameters parameters ) throws TargetException { this.logger.fine( "Creating a new VM @ VMware." ); // For IaaS, we only expect root instance names to be passed if( InstanceHelpers.countInstances( parameters.getScopedInstancePath()) > 1 ) throw new TargetE...
java
@Override public String createMachine( TargetHandlerParameters parameters ) throws TargetException { this.logger.fine( "Creating a new VM @ VMware." ); // For IaaS, we only expect root instance names to be passed if( InstanceHelpers.countInstances( parameters.getScopedInstancePath()) > 1 ) throw new TargetE...
[ "@", "Override", "public", "String", "createMachine", "(", "TargetHandlerParameters", "parameters", ")", "throws", "TargetException", "{", "this", ".", "logger", ".", "fine", "(", "\"Creating a new VM @ VMware.\"", ")", ";", "// For IaaS, we only expect root instance names ...
/* (non-Javadoc) @see net.roboconf.target.api.TargetHandler #createMachine(net.roboconf.target.api.TargetHandlerParameters)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
add54eead479effb138d0ff53a2d637902b82702
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-vmware/src/main/java/net/roboconf/target/vmware/internal/VmwareIaasHandler.java#L89-L164
train
Create a new VM.
Of course, here is the Java code you requested: ```java @Override public String createMachine( TargetHandlerParameters parameters ) throws TargetException { this.logger.fine( "Creating a new VM @ VMware." ); // For IaaS, we only expect root instance names to be passed if( InstanceHelpers.countInstances( param...
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/ConnectorService.java
ConnectorService.logMessage
public static final void logMessage(Level level, String key, Object... args) { if (WsLevel.AUDIT.equals(level)) Tr.audit(tc, key, args); else if (WsLevel.ERROR.equals(level)) Tr.error(tc, key, args); else if (Level.INFO.equals(level)) Tr.info(tc, key, args); ...
java
public static final void logMessage(Level level, String key, Object... args) { if (WsLevel.AUDIT.equals(level)) Tr.audit(tc, key, args); else if (WsLevel.ERROR.equals(level)) Tr.error(tc, key, args); else if (Level.INFO.equals(level)) Tr.info(tc, key, args); ...
[ "public", "static", "final", "void", "logMessage", "(", "Level", "level", ",", "String", "key", ",", "Object", "...", "args", ")", "{", "if", "(", "WsLevel", ".", "AUDIT", ".", "equals", "(", "level", ")", ")", "Tr", ".", "audit", "(", "tc", ",", "...
Logs a message from the J2CAMessages file. @param key message key. @param args message parameters
[ "Logs", "a", "message", "from", "the", "J2CAMessages", "file", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/ConnectorService.java#L118-L129
train
Log a message at the specified severity level.
Of course, here is the Java code you requested: ```java public static final void logMessage(Level level, String key, Object... args) { if (WsLevel.AUDIT.equals(level)) Tr.audit(tc, key, args); else if (WsLevel.ERROR.equals(level)) Tr.error(tc, key, args); else if (Level....
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java
SeaGlassSynthPainterImpl.paintTabbedPaneTabAreaBackground
public void paintTabbedPaneTabAreaBackground(SynthContext context, Graphics g, int x, int y, int w, int h) { paintBackground(context, g, x, y, w, h, null); }
java
public void paintTabbedPaneTabAreaBackground(SynthContext context, Graphics g, int x, int y, int w, int h) { paintBackground(context, g, x, y, w, h, null); }
[ "public", "void", "paintTabbedPaneTabAreaBackground", "(", "SynthContext", "context", ",", "Graphics", "g", ",", "int", "x", ",", "int", "y", ",", "int", "w", ",", "int", "h", ")", "{", "paintBackground", "(", "context", ",", "g", ",", "x", ",", "y", "...
Paints the background of the area behind the tabs of a tabbed pane. @param context SynthContext identifying the <code>JComponent</code> and <code>Region</code> to paint to @param g <code>Graphics</code> to paint to @param x X coordinate of the area to paint to @param y Y coordinate of the area to pai...
[ "Paints", "the", "background", "of", "the", "area", "behind", "the", "tabs", "of", "a", "tabbed", "pane", "." ]
f25ecba622923d7b29b64cb7d6068dd8005989b3
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java#L1956-L1958
train
Paint the background of the tab area of a tabbed pane.
Of course, here is the Java code you requested: ```java public void paintTabbedPaneTabAreaBackground(SynthContext context, Graphics g, int x, int y, int w, int h) { paintBackground(context, g, x, y, w, h, null); } ``` Hope this helps!
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/CalendarHelper.java
CalendarHelper.getDatesFromChronologyWithinGregorianYear
@Nonnull public static ICommonsSet <LocalDate> getDatesFromChronologyWithinGregorianYear (final int nTargetMonth, final int nTargetDay, final int nGrego...
java
@Nonnull public static ICommonsSet <LocalDate> getDatesFromChronologyWithinGregorianYear (final int nTargetMonth, final int nTargetDay, final int nGrego...
[ "@", "Nonnull", "public", "static", "ICommonsSet", "<", "LocalDate", ">", "getDatesFromChronologyWithinGregorianYear", "(", "final", "int", "nTargetMonth", ",", "final", "int", "nTargetDay", ",", "final", "int", "nGregorianYear", ",", "final", "Chronology", "aTargetCh...
Searches for the occurrences of a month/day in one chronology within one gregorian year. @param nTargetMonth Target month @param nTargetDay Target day @param nGregorianYear Gregorian year @param aTargetChrono Target chronology @return the list of gregorian dates.
[ "Searches", "for", "the", "occurrences", "of", "a", "month", "/", "day", "in", "one", "chronology", "within", "one", "gregorian", "year", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/CalendarHelper.java#L86-L109
train
Get a set of dates from the chronology within a given gregorian year.
Of course, here is the Java code you requested: ```java @Nonnull public static ICommonsSet <LocalDate> getDatesFromChronologyWithinGregorianYear (final int nTargetMonth, final int nTargetDay, ...
playframework/playframework
documentation/manual/working/javaGuide/main/sql/code/JPARepository.java
JPARepositoryMethods.runningWithTransaction
public CompletionStage<Long> runningWithTransaction() { return CompletableFuture.supplyAsync( () -> { // lambda is an instance of Function<EntityManager, Long> return jpaApi.withTransaction( entityManager -> { Query query = entityManager.createNativeQuery("s...
java
public CompletionStage<Long> runningWithTransaction() { return CompletableFuture.supplyAsync( () -> { // lambda is an instance of Function<EntityManager, Long> return jpaApi.withTransaction( entityManager -> { Query query = entityManager.createNativeQuery("s...
[ "public", "CompletionStage", "<", "Long", ">", "runningWithTransaction", "(", ")", "{", "return", "CompletableFuture", ".", "supplyAsync", "(", "(", ")", "->", "{", "// lambda is an instance of Function<EntityManager, Long>", "return", "jpaApi", ".", "withTransaction", ...
#jpa-withTransaction-function
[ "#jpa", "-", "withTransaction", "-", "function" ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/documentation/manual/working/javaGuide/main/sql/code/JPARepository.java#L38-L49
test
Running with transaction
Of course, here is the Java code you requested: ```java public CompletionStage<Long> runningWithTransaction() { return CompletableFuture.supplyAsync( () -> { // lambda is an instance of Function<EntityManager, Long> return jpaApi.withTransaction( entityManager -> { ...
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java
DatabasesInner.pauseAsync
public Observable<DatabaseInner> pauseAsync(String resourceGroupName, String serverName, String databaseName) { return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() { @Override public DatabaseInne...
java
public Observable<DatabaseInner> pauseAsync(String resourceGroupName, String serverName, String databaseName) { return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() { @Override public DatabaseInne...
[ "public", "Observable", "<", "DatabaseInner", ">", "pauseAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ")", "{", "return", "pauseWithServiceResponseAsync", "(", "resourceGroupName", ",", "serverName", ",", "dat...
Pauses a database. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param databaseName The name of the database to be paused. @throws IllegalArgumentException throw...
[ "Pauses", "a", "database", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L1125-L1132
train
Pause an existing CDN database.
Of course, here is the Java code you requested: ```java public Observable<DatabaseInner> pauseAsync(String resourceGroupName, String serverName, String databaseName) { return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>(...
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java
NullDerefAndRedundantComparisonFinder.noteUnconditionallyDereferencedNullValue
private void noteUnconditionallyDereferencedNullValue(Location thisLocation, Map<ValueNumber, SortedSet<Location>> bugLocations, Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, UnconditionalValueDerefSet derefSet, IsNullValue isNullValue, ValueNumber valueN...
java
private void noteUnconditionallyDereferencedNullValue(Location thisLocation, Map<ValueNumber, SortedSet<Location>> bugLocations, Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, UnconditionalValueDerefSet derefSet, IsNullValue isNullValue, ValueNumber valueN...
[ "private", "void", "noteUnconditionallyDereferencedNullValue", "(", "Location", "thisLocation", ",", "Map", "<", "ValueNumber", ",", "SortedSet", "<", "Location", ">", ">", "bugLocations", ",", "Map", "<", "ValueNumber", ",", "NullValueUnconditionalDeref", ">", "nullV...
Note the locations where a known-null value is unconditionally dereferenced. @param thisLocation @param bugLocations @param nullValueGuaranteedDerefMap map of null values to sets of Locations where they are derefed @param derefSet set of values known to be unconditionally dereferenced @param isNullValue the null value...
[ "Note", "the", "locations", "where", "a", "known", "-", "null", "value", "is", "unconditionally", "dereferenced", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/NullDerefAndRedundantComparisonFinder.java#L602-L636
train
NoteUnconditionallyDereferencedNullValue Method.
Of course, here is the Java code you requested: ```java private void noteUnconditionallyDereferencedNullValue(Location thisLocation, Map<ValueNumber, SortedSet<Location>> bugLocations, Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, UnconditionalValueDerefSet derefSet...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/utils/validator/DomainValidator.java
DomainValidator.isValidInfrastructureTld
public boolean isValidInfrastructureTld(String iTld) { iTld = unicodeToASCII(iTld); return Arrays.binarySearch(INFRASTRUCTURE_TLDS, (chompLeadingDot(iTld.toLowerCase(Locale.ENGLISH)))) >= 0; }
java
public boolean isValidInfrastructureTld(String iTld) { iTld = unicodeToASCII(iTld); return Arrays.binarySearch(INFRASTRUCTURE_TLDS, (chompLeadingDot(iTld.toLowerCase(Locale.ENGLISH)))) >= 0; }
[ "public", "boolean", "isValidInfrastructureTld", "(", "String", "iTld", ")", "{", "iTld", "=", "unicodeToASCII", "(", "iTld", ")", ";", "return", "Arrays", ".", "binarySearch", "(", "INFRASTRUCTURE_TLDS", ",", "(", "chompLeadingDot", "(", "iTld", ".", "toLowerCa...
Returns true if the specified <code>String</code> matches any IANA-defined infrastructure top-level domain. Leading dots are ignored if present. The search is case-insensitive. @param iTld the parameter to check for infrastructure TLD status, not null @return true if the parameter is an infrastructure TLD
[ "Returns", "true", "if", "the", "specified", "<code", ">", "String<", "/", "code", ">", "matches", "any", "IANA", "-", "defined", "infrastructure", "top", "-", "level", "domain", ".", "Leading", "dots", "are", "ignored", "if", "present", ".", "The", "searc...
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/utils/validator/DomainValidator.java#L209-L212
test
Check if the given string is a valid infrastructure tld.
Of course, here is the Java code you requested: ```java public boolean isValidInfrastructureTld(String iTld) { iTld = unicodeToASCII(iTld); return Arrays.binarySearch(INFRASTRUCTURE_TLDS, (chompLeadingDot(iTld.toLowerCase(Locale.ENGLISH)))) >= 0; } ``` Hope this helps!
bazaarvoice/emodb
sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/deser/JsonTokener.java
JsonTokener.nextClean
public char nextClean(char c) { char n = nextClean(); if (n != c) { throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'"); } return n; }
java
public char nextClean(char c) { char n = nextClean(); if (n != c) { throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'"); } return n; }
[ "public", "char", "nextClean", "(", "char", "c", ")", "{", "char", "n", "=", "nextClean", "(", ")", ";", "if", "(", "n", "!=", "c", ")", "{", "throw", "syntaxError", "(", "\"Expected '\"", "+", "c", "+", "\"' and instead saw '\"", "+", "n", "+", "\"'...
Consume the next character, skipping whitespace, and check that it matches a specified character. @param c The character to match. @return The character.
[ "Consume", "the", "next", "character", "skipping", "whitespace", "and", "check", "that", "it", "matches", "a", "specified", "character", "." ]
97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/deser/JsonTokener.java#L143-L149
train
Returns the next character that is not equal to the given character.
Of course, here is the Java code you requested: ```java public char nextClean(char c) { char n = nextClean(); if (n != c) { throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'"); } return n; } ``` Hope this helps!
ops4j/org.ops4j.pax.web
samples/helloworld-wc/src/main/java/org/ops4j/pax/web/samples/helloworld/wc/internal/Activator.java
Activator.start
public void start(BundleContext bc) throws Exception { /* * The pax-web-war service can take a little longer to start, we can't * say how much it will take, so we do need to sit down a while and wait * it's availability in order to use it's reference. * * This is a MUST, it's really important - mostly ...
java
public void start(BundleContext bc) throws Exception { /* * The pax-web-war service can take a little longer to start, we can't * say how much it will take, so we do need to sit down a while and wait * it's availability in order to use it's reference. * * This is a MUST, it's really important - mostly ...
[ "public", "void", "start", "(", "BundleContext", "bc", ")", "throws", "Exception", "{", "/*\n\t\t * The pax-web-war service can take a little longer to start, we can't\n\t\t * say how much it will take, so we do need to sit down a while and wait\n\t\t * it's availability in order to use it's ref...
Called when the OSGi framework starts our bundle.
[ "Called", "when", "the", "OSGi", "framework", "starts", "our", "bundle", "." ]
9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2
https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/samples/helloworld-wc/src/main/java/org/ops4j/pax/web/samples/helloworld/wc/internal/Activator.java#L51-L182
train
Start the servlets and filters.
Of course, here is the Java code you requested: ```java public void start(BundleContext bc) throws Exception { /* * The pax-web-war service can take a little longer to start, we can't * say how much it will take, so we do need to sit down a while and wait * it's availability in order to use it's reference. ...
kiegroup/drools
drools-core/src/main/java/org/drools/core/util/ClassUtils.java
ClassUtils.getPackage
public static String getPackage(Class<?> cls) { // cls.getPackage() sometimes returns null, in which case fall back to string massaging. java.lang.Package pkg = cls.isArray() ? cls.getComponentType().getPackage() : cls.getPackage(); if ( pkg == null ) { int dotPos; int do...
java
public static String getPackage(Class<?> cls) { // cls.getPackage() sometimes returns null, in which case fall back to string massaging. java.lang.Package pkg = cls.isArray() ? cls.getComponentType().getPackage() : cls.getPackage(); if ( pkg == null ) { int dotPos; int do...
[ "public", "static", "String", "getPackage", "(", "Class", "<", "?", ">", "cls", ")", "{", "// cls.getPackage() sometimes returns null, in which case fall back to string massaging.", "java", ".", "lang", ".", "Package", "pkg", "=", "cls", ".", "isArray", "(", ")", "?...
Extracts the package name from the given class object
[ "Extracts", "the", "package", "name", "from", "the", "given", "class", "object" ]
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/util/ClassUtils.java#L377-L400
train
Get the package name of a class.
Of course, here is the Java code you requested: ```java public static String getPackage(Class<?> cls) { // cls.getPackage() sometimes returns null, in which case fall back to string massaging. java.lang.Package pkg = cls.isArray() ? cls.getComponentType().getPackage() : cls.getPackage(); if ( p...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitoring.java
ConsumerMonitoring.addConsumer
public void addConsumer( Object key, String topic, String selectorString, MatchTarget target, boolean isWildcarded) throws SIDiscriminatorSyntaxException { if (tc.isEntryEnabled()) SibTr.entry(tc, "addConsumer", ...
java
public void addConsumer( Object key, String topic, String selectorString, MatchTarget target, boolean isWildcarded) throws SIDiscriminatorSyntaxException { if (tc.isEntryEnabled()) SibTr.entry(tc, "addConsumer", ...
[ "public", "void", "addConsumer", "(", "Object", "key", ",", "String", "topic", ",", "String", "selectorString", ",", "MatchTarget", "target", ",", "boolean", "isWildcarded", ")", "throws", "SIDiscriminatorSyntaxException", "{", "if", "(", "tc", ".", "isEntryEnable...
Method addConsumer A monitored consumer is being added to the system. This method will categorise the subscription depending on whether it is wildcarded and/or has a selector. Additionally it will update the subscriptions information in the consumer monitors table and add appropriate references into the monitored co...
[ "Method", "addConsumer" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitoring.java#L91-L191
train
Add a consumer to the list of consumers.
Of course, here is the Java code you requested: ```java public void addConsumer( Object key, String topic, String selectorString, MatchTarget target, boolean isWildcarded) throws SIDiscriminatorSyntaxException { if (tc.isEntryEnabled()) SibTr....
hdbeukel/james-core
src/main/java/org/jamesframework/core/search/LocalSearch.java
LocalSearch.fireNewCurrentSolution
private void fireNewCurrentSolution(SolutionType newCurrentSolution, Evaluation newCurrentSolutionEvaluation, Validation newCurrentSolutionValidation){ for(SearchListener<? super SolutionType> l : getSearchListeners()){ ...
java
private void fireNewCurrentSolution(SolutionType newCurrentSolution, Evaluation newCurrentSolutionEvaluation, Validation newCurrentSolutionValidation){ for(SearchListener<? super SolutionType> l : getSearchListeners()){ ...
[ "private", "void", "fireNewCurrentSolution", "(", "SolutionType", "newCurrentSolution", ",", "Evaluation", "newCurrentSolutionEvaluation", ",", "Validation", "newCurrentSolutionValidation", ")", "{", "for", "(", "SearchListener", "<", "?", "super", "SolutionType", ">", "l...
Calls {@link SearchListener#newCurrentSolution(LocalSearch, Solution, Evaluation, Validation)} on every attached search listener. Should only be executed when the search is active (initializing, running or terminating) and be fired exactly once for each update of the current solution.
[ "Calls", "{" ]
4e85c20c142902373e5b5e8b5d12a2558650f66d
https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/LocalSearch.java#L118-L126
train
Fired a new current solution event
Of course, here is the Java code you requested: ```java private void fireNewCurrentSolution(SolutionType newCurrentSolution, Evaluation newCurrentSolutionEvaluation, Validation newCurrentSolutionValidation){ for(SearchListener<? su...
oguzbilgener/CircularFloatingActionMenu
library/src/main/java/com/oguzdev/circularfloatingactionmenu/library/SubActionButton.java
SubActionButton.setContentView
public void setContentView(View contentView, FrameLayout.LayoutParams params) { if(params == null) { params = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER); final int margin = getResources().getDimensionPixelSize(R.dimen.sub_action_but...
java
public void setContentView(View contentView, FrameLayout.LayoutParams params) { if(params == null) { params = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER); final int margin = getResources().getDimensionPixelSize(R.dimen.sub_action_but...
[ "public", "void", "setContentView", "(", "View", "contentView", ",", "FrameLayout", ".", "LayoutParams", "params", ")", "{", "if", "(", "params", "==", "null", ")", "{", "params", "=", "new", "FrameLayout", ".", "LayoutParams", "(", "LayoutParams", ".", "WRA...
Sets a content view with custom LayoutParams that will be displayed inside this SubActionButton. @param contentView @param params
[ "Sets", "a", "content", "view", "with", "custom", "LayoutParams", "that", "will", "be", "displayed", "inside", "this", "SubActionButton", "." ]
7614a063f326cbd153ead6b06ba979c6cf40796e
https://github.com/oguzbilgener/CircularFloatingActionMenu/blob/7614a063f326cbd153ead6b06ba979c6cf40796e/library/src/main/java/com/oguzdev/circularfloatingactionmenu/library/SubActionButton.java#L60-L69
valid
setContentView This method sets the contentView and adds it to the application.
Of course, here is the Java code you requested: ```java public void setContentView(View contentView, FrameLayout.LayoutParams params) { if(params == null) { params = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER); final int margin = ge...
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/workspace/VoiceApi.java
VoiceApi.initiateTransfer
public void initiateTransfer( String connId, String destination, KeyValueCollection userData ) throws WorkspaceApiException { this.initiateTransfer(connId, destination, null, null, userData, null, null); }
java
public void initiateTransfer( String connId, String destination, KeyValueCollection userData ) throws WorkspaceApiException { this.initiateTransfer(connId, destination, null, null, userData, null, null); }
[ "public", "void", "initiateTransfer", "(", "String", "connId", ",", "String", "destination", ",", "KeyValueCollection", "userData", ")", "throws", "WorkspaceApiException", "{", "this", ".", "initiateTransfer", "(", "connId", ",", "destination", ",", "null", ",", "...
Initiate a two-step transfer by placing the first call on hold and dialing the destination number (step 1). After initiating the transfer, you can use `completeTransfer()` to complete the transfer (step 2). @param connId The connection ID of the call to be transferred. This call will be placed on hold. @param destinati...
[ "Initiate", "a", "two", "-", "step", "transfer", "by", "placing", "the", "first", "call", "on", "hold", "and", "dialing", "the", "destination", "number", "(", "step", "1", ")", ".", "After", "initiating", "the", "transfer", "you", "can", "use", "completeTr...
509fdd9e89b9359d012f9a72be95037a3cef53e6
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L779-L785
train
Initiate a Transfer of a Taxonomy object.
Of course, here is the Java code you requested: ```java public void initiateTransfer( String connId, String destination, KeyValueCollection userData ) throws WorkspaceApiException { this.initiateTransfer(connId, destination, null, null, userData, null, null); }...
DDTH/ddth-queue
ddth-queue-core/src/main/java/com/github/ddth/pubsub/impl/InmemPubSubHub.java
InmemPubSubHub.publish
@Override public boolean publish(String channel, IMessage<ID, DATA> msg) { try { eventBus.get(channel).post(msg); } catch (ExecutionException e) { throw new RuntimeException(e); } return true; }
java
@Override public boolean publish(String channel, IMessage<ID, DATA> msg) { try { eventBus.get(channel).post(msg); } catch (ExecutionException e) { throw new RuntimeException(e); } return true; }
[ "@", "Override", "public", "boolean", "publish", "(", "String", "channel", ",", "IMessage", "<", "ID", ",", "DATA", ">", "msg", ")", "{", "try", "{", "eventBus", ".", "get", "(", "channel", ")", ".", "post", "(", "msg", ")", ";", "}", "catch", "(",...
{@inheritDoc}
[ "{" ]
b20776850d23111d3d71fc8ed6023c590bc3621f
https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/pubsub/impl/InmemPubSubHub.java#L82-L90
train
Publish a message to a channel.
Of course, here is the Java code you requested: ```java @Override public boolean publish(String channel, IMessage<ID, DATA> msg) { try { eventBus.get(channel).post(msg); } catch (ExecutionException e) { throw new RuntimeException(e); } return true; } ``` ...
mongodb/mongo-java-driver
bson/src/main/org/bson/BsonDocument.java
BsonDocument.getDecimal128
public BsonDecimal128 getDecimal128(final Object key, final BsonDecimal128 defaultValue) { if (!containsKey(key)) { return defaultValue; } return get(key).asDecimal128(); }
java
public BsonDecimal128 getDecimal128(final Object key, final BsonDecimal128 defaultValue) { if (!containsKey(key)) { return defaultValue; } return get(key).asDecimal128(); }
[ "public", "BsonDecimal128", "getDecimal128", "(", "final", "Object", "key", ",", "final", "BsonDecimal128", "defaultValue", ")", "{", "if", "(", "!", "containsKey", "(", "key", ")", ")", "{", "return", "defaultValue", ";", "}", "return", "get", "(", "key", ...
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonDecimal128. @param key the key @param defaultValue the default value @return the value of the key as a BsonDecimal128 @throws org.bson.BsonInvalidOperationException if the document contains th...
[ "If", "the", "document", "does", "not", "contain", "the", "given", "key", "return", "the", "given", "default", "value", ".", "Otherwise", "gets", "the", "value", "of", "the", "key", "as", "a", "BsonDecimal128", "." ]
a92d47e2e9f2fca55d09229a0a2e2cdc714db085
https://github.com/mongodb/mongo-java-driver/blob/a92d47e2e9f2fca55d09229a0a2e2cdc714db085/bson/src/main/org/bson/BsonDocument.java#L583-L588
valid
Gets the decimal 128 value.
Of course, here is the Java code you requested: ```java public BsonDecimal128 getDecimal128(final Object key, final BsonDecimal128 defaultValue) { if (!containsKey(key)) { return defaultValue; } return get(key).asDecimal128(); } ``` Hope this helps!
apache/incubator-gobblin
gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/Instrumented.java
Instrumented.newContextFromReferenceContext
public static MetricContext newContextFromReferenceContext(MetricContext context, List<Tag<?>> newTags, Optional<String> name) { String newName = name.orNull(); if (Strings.isNullOrEmpty(newName)) { UUID uuid = UUID.randomUUID(); String randomIdPrefix = "uuid:"; String oldName = conte...
java
public static MetricContext newContextFromReferenceContext(MetricContext context, List<Tag<?>> newTags, Optional<String> name) { String newName = name.orNull(); if (Strings.isNullOrEmpty(newName)) { UUID uuid = UUID.randomUUID(); String randomIdPrefix = "uuid:"; String oldName = conte...
[ "public", "static", "MetricContext", "newContextFromReferenceContext", "(", "MetricContext", "context", ",", "List", "<", "Tag", "<", "?", ">", ">", "newTags", ",", "Optional", "<", "String", ">", "name", ")", "{", "String", "newName", "=", "name", ".", "orN...
Generates a new {@link org.apache.gobblin.metrics.MetricContext} with the parent and tags taken from the reference context. Allows replacing {@link org.apache.gobblin.metrics.Tag} with new input tags. This method will not copy any {@link org.apache.gobblin.metrics.Metric} contained in the reference {@link org.apache.go...
[ "Generates", "a", "new", "{", "@link", "org", ".", "apache", ".", "gobblin", ".", "metrics", ".", "MetricContext", "}", "with", "the", "parent", "and", "tags", "taken", "from", "the", "reference", "context", ".", "Allows", "replacing", "{", "@link", "org",...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/Instrumented.java#L161-L184
train
Creates a new metric context from a reference context.
Of course, here is the Java code you requested: ```java public static MetricContext newContextFromReferenceContext(MetricContext context, List<Tag<?>> newTags, Optional<String> name) { String newName = name.orNull(); if (Strings.isNullOrEmpty(newName)) { UUID uuid = UUID.randomUUID(); Strin...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasCgerc
public static void cublasCgerc(int m, int n, cuComplex alpha, Pointer x, int incx, Pointer y, int incy, Pointer A, int lda) { cublasCgercNative(m, n, alpha, x, incx, y, incy, A, lda); checkResultBLAS(); }
java
public static void cublasCgerc(int m, int n, cuComplex alpha, Pointer x, int incx, Pointer y, int incy, Pointer A, int lda) { cublasCgercNative(m, n, alpha, x, incx, y, incy, A, lda); checkResultBLAS(); }
[ "public", "static", "void", "cublasCgerc", "(", "int", "m", ",", "int", "n", ",", "cuComplex", "alpha", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "y", ",", "int", "incy", ",", "Pointer", "A", ",", "int", "lda", ")", "{", "cublasCgercNa...
<pre> cublasCgerc (int m, int n, cuComplex alpha, const cuComplex *x, int incx, const cuComplex *y, int incy, cuComplex *A, int lda) performs the symmetric rank 1 operation A = alpha * x * conjugate(transpose(y)) + A, where alpha is a single precision complex scalar, x is an m element single precision complex vector...
[ "<pre", ">", "cublasCgerc", "(", "int", "m", "int", "n", "cuComplex", "alpha", "const", "cuComplex", "*", "x", "int", "incx", "const", "cuComplex", "*", "y", "int", "incy", "cuComplex", "*", "A", "int", "lda", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L5407-L5411
test
Cublas Cgerc
Of course, here is the Java code you requested: ```java public static void cublasCgerc(int m, int n, cuComplex alpha, Pointer x, int incx, Pointer y, int incy, Pointer A, int lda) { cublasCgercNative(m, n, alpha, x, incx, y, incy, A, lda); checkResultBLAS(); } ``` Hope this helps!
dustin/java-memcached-client
src/main/java/net/spy/memcached/MemcachedConnection.java
MemcachedConnection.handleReadsAndWrites
private void handleReadsAndWrites(final SelectionKey sk, final MemcachedNode node) throws IOException { if (sk.isValid() && sk.isReadable()) { handleReads(node); } if (sk.isValid() && sk.isWritable()) { handleWrites(node); } }
java
private void handleReadsAndWrites(final SelectionKey sk, final MemcachedNode node) throws IOException { if (sk.isValid() && sk.isReadable()) { handleReads(node); } if (sk.isValid() && sk.isWritable()) { handleWrites(node); } }
[ "private", "void", "handleReadsAndWrites", "(", "final", "SelectionKey", "sk", ",", "final", "MemcachedNode", "node", ")", "throws", "IOException", "{", "if", "(", "sk", ".", "isValid", "(", ")", "&&", "sk", ".", "isReadable", "(", ")", ")", "{", "handleRe...
A helper method for {@link #handleIO(java.nio.channels.SelectionKey)} to handle reads and writes if appropriate. @param sk the selection key to use. @param node th enode to read write from. @throws IOException if an error occurs during read/write.
[ "A", "helper", "method", "for", "{", "@link", "#handleIO", "(", "java", ".", "nio", ".", "channels", ".", "SelectionKey", ")", "}", "to", "handle", "reads", "and", "writes", "if", "appropriate", "." ]
c232307ad8e0c7ccc926e495dd7d5aad2d713318
https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedConnection.java#L733-L741
train
Handle reads and writes.
Of course, here is the Java code you requested: ```java private void handleReadsAndWrites(final SelectionKey sk, final MemcachedNode node) throws IOException { if (sk.isValid() && sk.isReadable()) { handleReads(node); } if (sk.isValid() && sk.isWritable()) { handleWrites(node); ...
opsmatters/newrelic-api
src/main/java/com/opsmatters/newrelic/api/services/MonitorService.java
MonitorService.updateScript
public Optional<Script> updateScript(String monitorId, Script script) { HTTP.PUT(String.format("/v3/monitors/%s/script", monitorId), script); return Optional.of(script); }
java
public Optional<Script> updateScript(String monitorId, Script script) { HTTP.PUT(String.format("/v3/monitors/%s/script", monitorId), script); return Optional.of(script); }
[ "public", "Optional", "<", "Script", ">", "updateScript", "(", "String", "monitorId", ",", "Script", "script", ")", "{", "HTTP", ".", "PUT", "(", "String", ".", "format", "(", "\"/v3/monitors/%s/script\"", ",", "monitorId", ")", ",", "script", ")", ";", "r...
Updates the given monitor to add a script. @param monitorId The id of the monitor to update @param script The script to add @return The monitor that was updated
[ "Updates", "the", "given", "monitor", "to", "add", "a", "script", "." ]
5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e
https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/MonitorService.java#L174-L178
train
Updates the specified monitor s script.
Of course, here is the Java code you requested: ```java public Optional<Script> updateScript(String monitorId, Script script) { HTTP.PUT(String.format("/v3/monitors/%s/script", monitorId), script); return Optional.of(script); } ``` Hope this helps!
kiegroup/optaplanner
optaplanner-core/src/main/java/org/optaplanner/core/config/heuristic/selector/move/factory/MoveIteratorFactoryConfig.java
MoveIteratorFactoryConfig.buildBaseMoveSelector
@Override public MoveSelector buildBaseMoveSelector(HeuristicConfigPolicy configPolicy, SelectionCacheType minimumCacheType, boolean randomSelection) { if (moveIteratorFactoryClass == null) { throw new IllegalArgumentException("The moveIteratorFactoryConfig (" + this ...
java
@Override public MoveSelector buildBaseMoveSelector(HeuristicConfigPolicy configPolicy, SelectionCacheType minimumCacheType, boolean randomSelection) { if (moveIteratorFactoryClass == null) { throw new IllegalArgumentException("The moveIteratorFactoryConfig (" + this ...
[ "@", "Override", "public", "MoveSelector", "buildBaseMoveSelector", "(", "HeuristicConfigPolicy", "configPolicy", ",", "SelectionCacheType", "minimumCacheType", ",", "boolean", "randomSelection", ")", "{", "if", "(", "moveIteratorFactoryClass", "==", "null", ")", "{", "...
************************************************************************
[ "************************************************************************" ]
b8f1459b4e6b0f7aafe941fd165bff640c11d7d5
https://github.com/kiegroup/optaplanner/blob/b8f1459b4e6b0f7aafe941fd165bff640c11d7d5/optaplanner-core/src/main/java/org/optaplanner/core/config/heuristic/selector/move/factory/MoveIteratorFactoryConfig.java#L59-L71
valid
Build a base MoveSelector.
Of course, here is the Java code you requested: ```java @Override public MoveSelector buildBaseMoveSelector(HeuristicConfigPolicy configPolicy, SelectionCacheType minimumCacheType, boolean randomSelection) { if (moveIteratorFactoryClass == null) { throw new IllegalArgumentException(...
seedstack/seed
core/src/main/java/org/seedstack/seed/core/internal/el/ELBinder.java
ELBinder.bindELAnnotation
public ELBinder bindELAnnotation(Class<? extends Annotation> annotationClass, ExecutionPolicy policy) { ELInterceptor interceptor = new ELInterceptor(annotationClass, policy); binder.requestInjection(interceptor); binder.bindInterceptor(Matchers.any(), handlerMethodMatcher(annotationClass), inte...
java
public ELBinder bindELAnnotation(Class<? extends Annotation> annotationClass, ExecutionPolicy policy) { ELInterceptor interceptor = new ELInterceptor(annotationClass, policy); binder.requestInjection(interceptor); binder.bindInterceptor(Matchers.any(), handlerMethodMatcher(annotationClass), inte...
[ "public", "ELBinder", "bindELAnnotation", "(", "Class", "<", "?", "extends", "Annotation", ">", "annotationClass", ",", "ExecutionPolicy", "policy", ")", "{", "ELInterceptor", "interceptor", "=", "new", "ELInterceptor", "(", "annotationClass", ",", "policy", ")", ...
Bind an ELInterceptor to the given annotation with the given {@link ELBinder.ExecutionPolicy}. @param annotationClass EL annotation to intercept @param policy determine when the EL is evaluated @return ELBinder
[ "Bind", "an", "ELInterceptor", "to", "the", "given", "annotation", "with", "the", "given", "{", "@link", "ELBinder", ".", "ExecutionPolicy", "}", "." ]
d9cf33bfb2fffcdbb0976f4726e943acda90e828
https://github.com/seedstack/seed/blob/d9cf33bfb2fffcdbb0976f4726e943acda90e828/core/src/main/java/org/seedstack/seed/core/internal/el/ELBinder.java#L71-L76
train
Binds an EL annotation to the current context.
Of course, here is the Java code you requested: ```java public ELBinder bindELAnnotation(Class<? extends Annotation> annotationClass, ExecutionPolicy policy) { ELInterceptor interceptor = new ELInterceptor(annotationClass, policy); binder.requestInjection(interceptor); binder.bindInterceptor(Ma...
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java
PathBuilder.getSet
public <A> SetPath<A, PathBuilder<A>> getSet(String property, Class<A> type) { return this.<A, PathBuilder<A>>getSet(property, type, PathBuilder.class); }
java
public <A> SetPath<A, PathBuilder<A>> getSet(String property, Class<A> type) { return this.<A, PathBuilder<A>>getSet(property, type, PathBuilder.class); }
[ "public", "<", "A", ">", "SetPath", "<", "A", ",", "PathBuilder", "<", "A", ">", ">", "getSet", "(", "String", "property", ",", "Class", "<", "A", ">", "type", ")", "{", "return", "this", ".", "<", "A", ",", "PathBuilder", "<", "A", ">", ">", "...
Create a new Set typed path @param <A> @param property property name @param type property type @return property path
[ "Create", "a", "new", "Set", "typed", "path" ]
2bf234caf78549813a1e0f44d9c30ecc5ef734e3
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java#L426-L428
train
Gets a SetPath for the given property and type.
Of course, here is the Java code you requested: ```java public <A> SetPath<A, PathBuilder<A>> getSet(String property, Class<A> type) { return this.<A, PathBuilder<A>>getSet(property, type, PathBuilder.class); } ``` Hope this helps!
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.updateBeanValue
@Override public void updateBeanValue() { TableDataModel model = getDataModel(); if (model instanceof ScrollableTableDataModel) { LOG.warn("UpdateBeanValue only updating the current page for ScrollableTableDataModel"); updateBeanValueCurrentPageOnly(); } else if (model.getRowCount() > 0) { // Temporari...
java
@Override public void updateBeanValue() { TableDataModel model = getDataModel(); if (model instanceof ScrollableTableDataModel) { LOG.warn("UpdateBeanValue only updating the current page for ScrollableTableDataModel"); updateBeanValueCurrentPageOnly(); } else if (model.getRowCount() > 0) { // Temporari...
[ "@", "Override", "public", "void", "updateBeanValue", "(", ")", "{", "TableDataModel", "model", "=", "getDataModel", "(", ")", ";", "if", "(", "model", "instanceof", "ScrollableTableDataModel", ")", "{", "LOG", ".", "warn", "(", "\"UpdateBeanValue only updating th...
Updates the bean using the table data model's {@link TableDataModel#setValueAt(Object, int, int)} method.
[ "Updates", "the", "bean", "using", "the", "table", "data", "model", "s", "{" ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L342-L356
train
Update the bean value.
Of course, here is the Java code you requested: ```java @Override public void updateBeanValue() { TableDataModel model = getDataModel(); if (model instanceof ScrollableTableDataModel) { LOG.warn("UpdateBeanValue only updating the current page for ScrollableTableDataModel"); updateBeanValueCurrentPageOnly()...
querydsl/querydsl
querydsl-spatial/src/main/java/com/querydsl/spatial/jts/JTSGeometryExpressions.java
JTSGeometryExpressions.geometryOperation
public static JTSGeometryExpression<Geometry> geometryOperation(Operator op, Expression<?>... args) { return new JTSGeometryOperation<Geometry>(Geometry.class, op, args); }
java
public static JTSGeometryExpression<Geometry> geometryOperation(Operator op, Expression<?>... args) { return new JTSGeometryOperation<Geometry>(Geometry.class, op, args); }
[ "public", "static", "JTSGeometryExpression", "<", "Geometry", ">", "geometryOperation", "(", "Operator", "op", ",", "Expression", "<", "?", ">", "...", "args", ")", "{", "return", "new", "JTSGeometryOperation", "<", "Geometry", ">", "(", "Geometry", ".", "clas...
Create a new Geometry operation expression @param op operator @param args arguments @return operation expression
[ "Create", "a", "new", "Geometry", "operation", "expression" ]
2bf234caf78549813a1e0f44d9c30ecc5ef734e3
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-spatial/src/main/java/com/querydsl/spatial/jts/JTSGeometryExpressions.java#L213-L215
train
Create a new geometry operation expression
Of course, here is the Java code you requested: ```java public static JTSGeometryExpression<Geometry> geometryOperation(Operator op, Expression<?>... args) { return new JTSGeometryOperation<Geometry>(Geometry.class, op, args); } ``` Hope this helps!
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java
IndexInfos.addName
public void addName(String name) { if (names.contains(name)) { throw new IllegalArgumentException("already contains: " + name); } indexes.add(name); names.add(name); dirty = true; }
java
public void addName(String name) { if (names.contains(name)) { throw new IllegalArgumentException("already contains: " + name); } indexes.add(name); names.add(name); dirty = true; }
[ "public", "void", "addName", "(", "String", "name", ")", "{", "if", "(", "names", ".", "contains", "(", "name", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"already contains: \"", "+", "name", ")", ";", "}", "indexes", ".", "add", "...
Adds a name to the index infos. @param name the name to add.
[ "Adds", "a", "name", "to", "the", "index", "infos", "." ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java#L284-L293
train
Add a name to the index.
Of course, here is the Java code you requested: ```java public void addName(String name) { if (names.contains(name)) { throw new IllegalArgumentException("already contains: " + name); } indexes.add(name); names.add(name); dirty = true; } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/RetryHandler.java
RetryHandler.handleExceptionProcess
public void handleExceptionProcess(Exception e, Object w) { final String mName = "handleExceptionProcess"; if(logger.isLoggable(Level.FINER)) logger.logp(Level.FINE, className, mName, e.getClass().getName() + "; " + this.toString()); if (!isRetryLimitReached() ...
java
public void handleExceptionProcess(Exception e, Object w) { final String mName = "handleExceptionProcess"; if(logger.isLoggable(Level.FINER)) logger.logp(Level.FINE, className, mName, e.getClass().getName() + "; " + this.toString()); if (!isRetryLimitReached() ...
[ "public", "void", "handleExceptionProcess", "(", "Exception", "e", ",", "Object", "w", ")", "{", "final", "String", "mName", "=", "\"handleExceptionProcess\"", ";", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", ...
Handle exception from a process failure.
[ "Handle", "exception", "from", "a", "process", "failure", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/RetryHandler.java#L263-L291
train
Handle an exception.
Of course, here is the Java code you requested: ```java public void handleExceptionProcess(Exception e, Object w) { final String mName = "handleExceptionProcess"; if(logger.isLoggable(Level.FINER)) logger.logp(Level.FINE, className, mName, e.getClass().getName() + "; " + this....
Stratio/cassandra-lucene-index
plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/builder/TextMapperBuilder.java
TextMapperBuilder.build
@Override public TextMapper build(String field) { return new TextMapper(field, column, validated, analyzer); }
java
@Override public TextMapper build(String field) { return new TextMapper(field, column, validated, analyzer); }
[ "@", "Override", "public", "TextMapper", "build", "(", "String", "field", ")", "{", "return", "new", "TextMapper", "(", "field", ",", "column", ",", "validated", ",", "analyzer", ")", ";", "}" ]
Returns the {@link TextMapper} represented by this {@link MapperBuilder}. @param field the name of the field to be built @return the {@link TextMapper} represented by this
[ "Returns", "the", "{", "@link", "TextMapper", "}", "represented", "by", "this", "{", "@link", "MapperBuilder", "}", "." ]
a94a4d9af6c25d40e1108729974c35c27c54441c
https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/builder/TextMapperBuilder.java#L48-L51
train
Build a CRUD language mapper.
Of course, here is the Java code you requested: ```java @Override public TextMapper build(String field) { return new TextMapper(field, column, validated, analyzer); } ``` Hope this helps!
prestodb/presto
presto-hive/src/main/java/com/facebook/presto/hive/TableParameterCodec.java
TableParameterCodec.encode
public Map<String, String> encode(Map<String, Object> tableProperties) { return ImmutableMap.of(); }
java
public Map<String, String> encode(Map<String, Object> tableProperties) { return ImmutableMap.of(); }
[ "public", "Map", "<", "String", ",", "String", ">", "encode", "(", "Map", "<", "String", ",", "Object", ">", "tableProperties", ")", "{", "return", "ImmutableMap", ".", "of", "(", ")", ";", "}" ]
Encode additional Presto table properties into Hive table parameters.
[ "Encode", "additional", "Presto", "table", "properties", "into", "Hive", "table", "parameters", "." ]
89de5e379d8f85e139d292b0add8c537a2a01a88
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-hive/src/main/java/com/facebook/presto/hive/TableParameterCodec.java#L33-L36
train
Encode a map of table properties to a map of strings.
Of course, here is the Java code you requested: ```java public Map<String, String> encode(Map<String, Object> tableProperties) { return ImmutableMap.of(); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/site/CmsSiteManagerImpl.java
CmsSiteManagerImpl.isSiteUnderSite
public boolean isSiteUnderSite(String siteRootPath) { for (String siteRoot : getSiteRoots()) { if ((siteRootPath.length() > siteRoot.length()) & siteRootPath.startsWith(CmsFileUtil.addTrailingSeparator(siteRoot))) { return true; } } return...
java
public boolean isSiteUnderSite(String siteRootPath) { for (String siteRoot : getSiteRoots()) { if ((siteRootPath.length() > siteRoot.length()) & siteRootPath.startsWith(CmsFileUtil.addTrailingSeparator(siteRoot))) { return true; } } return...
[ "public", "boolean", "isSiteUnderSite", "(", "String", "siteRootPath", ")", "{", "for", "(", "String", "siteRoot", ":", "getSiteRoots", "(", ")", ")", "{", "if", "(", "(", "siteRootPath", ".", "length", "(", ")", ">", "siteRoot", ".", "length", "(", ")",...
Checks if a given site is under another site.<p> @param siteRootPath site root path to check @return true if given site is invalid
[ "Checks", "if", "a", "given", "site", "is", "under", "another", "site", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L1308-L1317
train
Checks if the site root path is under site root.
Of course, here is the Java code you requested: ```java public boolean isSiteUnderSite(String siteRootPath) { for (String siteRoot : getSiteRoots()) { if ((siteRootPath.length() > siteRoot.length()) & siteRootPath.startsWith(CmsFileUtil.addTrailingSeparator(siteRoot))) { ...
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java
Audit.deleteOrphans
public static int deleteOrphans(EntityManager em) { requireArgument(em != null, "Entity manager cannot be null."); Query query = em.createNamedQuery("Audit.cullOrphans"); return query.executeUpdate(); }
java
public static int deleteOrphans(EntityManager em) { requireArgument(em != null, "Entity manager cannot be null."); Query query = em.createNamedQuery("Audit.cullOrphans"); return query.executeUpdate(); }
[ "public", "static", "int", "deleteOrphans", "(", "EntityManager", "em", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager cannot be null.\"", ")", ";", "Query", "query", "=", "em", ".", "createNamedQuery", "(", "\"Audit.cullOrphans\"", "...
Finds all audits. @param em Entity manager. Cannot be null. @return All audits
[ "Finds", "all", "audits", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java#L225-L231
train
Delete all orphan audit records.
Of course, here is the Java code you requested: ```java public static int deleteOrphans(EntityManager em) { requireArgument(em != null, "Entity manager cannot be null."); Query query = em.createNamedQuery("Audit.cullOrphans"); return query.executeUpdate(); } ``` Hope this helps!
codeprimate-software/cp-elements
src/main/java/org/cp/elements/data/struct/tabular/query/Query.java
Query.resolveProjection
private List<Column> resolveProjection(View from) { List<Column> projection = getProjection(); Assert.isTrue(projection.stream().allMatch(from::contains), () -> String.format("The View of Columns %1$s does not contain all the selected, or projected Columns %2$s", from.columns(), projection)); ...
java
private List<Column> resolveProjection(View from) { List<Column> projection = getProjection(); Assert.isTrue(projection.stream().allMatch(from::contains), () -> String.format("The View of Columns %1$s does not contain all the selected, or projected Columns %2$s", from.columns(), projection)); ...
[ "private", "List", "<", "Column", ">", "resolveProjection", "(", "View", "from", ")", "{", "List", "<", "Column", ">", "projection", "=", "getProjection", "(", ")", ";", "Assert", ".", "isTrue", "(", "projection", ".", "stream", "(", ")", ".", "allMatch"...
Resolves the projection used in this {@link Query} by validating the {@link List} of {@literal selected} {@link Column Columns} against the {@link Column Columns} contained in the {@link View}. @param from {@link View} to query. @return the {@link List} of {@link Column Columns} constituting the projection of this {@l...
[ "Resolves", "the", "projection", "used", "in", "this", "{", "@link", "Query", "}", "by", "validating", "the", "{", "@link", "List", "}", "of", "{", "@literal", "selected", "}", "{", "@link", "Column", "Columns", "}", "against", "the", "{", "@link", "Colu...
f2163c149fbbef05015e688132064ebcac7c49ab
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/struct/tabular/query/Query.java#L232-L241
train
Resolve the projection of the view
Of course, here is the Java code you requested: ```java private List<Column> resolveProjection(View from) { List<Column> projection = getProjection(); Assert.isTrue(projection.stream().allMatch(from::contains), () -> String.format("The View of Columns %1$s does not contain all the selected, or projecte...
Wolfgang-Schuetzelhofer/jcypher
src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java
AbstractDomainQuery.TRAVERSE_FROM
public Traverse TRAVERSE_FROM(DomainObjectMatch<?> start) { DomainObjectMatch<?> delegate = APIAccess.getDelegate(start); DomainObjectMatch<?> match = delegate != null ? delegate : start; TraversalExpression te = new TraversalExpression(match, this.queryExecutor); this.queryExecutor.addAstObject(te); Traverse...
java
public Traverse TRAVERSE_FROM(DomainObjectMatch<?> start) { DomainObjectMatch<?> delegate = APIAccess.getDelegate(start); DomainObjectMatch<?> match = delegate != null ? delegate : start; TraversalExpression te = new TraversalExpression(match, this.queryExecutor); this.queryExecutor.addAstObject(te); Traverse...
[ "public", "Traverse", "TRAVERSE_FROM", "(", "DomainObjectMatch", "<", "?", ">", "start", ")", "{", "DomainObjectMatch", "<", "?", ">", "delegate", "=", "APIAccess", ".", "getDelegate", "(", "start", ")", ";", "DomainObjectMatch", "<", "?", ">", "match", "=",...
Start traversing the graph of domain objects. @param start a DomainObjectMatch form where to start the traversal. @return
[ "Start", "traversing", "the", "graph", "of", "domain", "objects", "." ]
0f36914b4d6993a004cc235bb18dd3e02a59d253
https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L284-L292
train
Traverse a domain object from another domain object.
Of course, here is the Java code you requested: ```java public Traverse TRAVERSE_FROM(DomainObjectMatch<?> start) { DomainObjectMatch<?> delegate = APIAccess.getDelegate(start); DomainObjectMatch<?> match = delegate != null ? delegate : start; TraversalExpression te = new TraversalExpression(match, this.queryExe...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java
StringUtils.indexOf
public static int indexOf(String s, String substr, int startIndex, int endIndex) { if (startIndex < 0) { startIndex = 0; } int srclen = s.length(); if (endIndex > srclen) { endIndex = srclen; } int sublen = substr.length(); if (sublen == 0)...
java
public static int indexOf(String s, String substr, int startIndex, int endIndex) { if (startIndex < 0) { startIndex = 0; } int srclen = s.length(); if (endIndex > srclen) { endIndex = srclen; } int sublen = substr.length(); if (sublen == 0)...
[ "public", "static", "int", "indexOf", "(", "String", "s", ",", "String", "substr", ",", "int", "startIndex", ",", "int", "endIndex", ")", "{", "if", "(", "startIndex", "<", "0", ")", "{", "startIndex", "=", "0", ";", "}", "int", "srclen", "=", "s", ...
Finds first occurrence of a substring in the given source but within limited range [start, end). It is fastest possible code, but still original <code>String.indexOf(String, int)</code> is much faster (since it uses char[] value directly) and should be used when no range is needed. @param s source strin...
[ "Finds", "first", "occurrence", "of", "a", "substring", "in", "the", "given", "source", "but", "within", "limited", "range", "[", "start", "end", ")", ".", "It", "is", "fastest", "possible", "code", "but", "still", "original", "<code", ">", "String", ".", ...
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java#L531-L562
test
Method indexOf.
Of course, here is the Java code you requested: ```java public static int indexOf(String s, String substr, int startIndex, int endIndex) { if (startIndex < 0) { startIndex = 0; } int srclen = s.length(); if (endIndex > srclen) { endIndex = srclen; } ...
apache/groovy
src/main/groovy/groovy/lang/NumberRange.java
NumberRange.containsWithinBounds
@Override public boolean containsWithinBounds(Object value) { final int result = compareTo(from, value); return result == 0 || result < 0 && compareTo(to, value) >= 0; }
java
@Override public boolean containsWithinBounds(Object value) { final int result = compareTo(from, value); return result == 0 || result < 0 && compareTo(to, value) >= 0; }
[ "@", "Override", "public", "boolean", "containsWithinBounds", "(", "Object", "value", ")", "{", "final", "int", "result", "=", "compareTo", "(", "from", ",", "value", ")", ";", "return", "result", "==", "0", "||", "result", "<", "0", "&&", "compareTo", "...
Checks whether a value is between the from and to values of a Range @param value the value of interest @return true if the value is within the bounds
[ "Checks", "whether", "a", "value", "is", "between", "the", "from", "and", "to", "values", "of", "a", "Range" ]
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/NumberRange.java#L372-L376
train
Check if the value is within the bounds of the base set.
Of course, here is the Java code you requested: ```java @Override public boolean containsWithinBounds(Object value) { final int result = compareTo(from, value); return result == 0 || result < 0 && compareTo(to, value) >= 0; } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JaxbUnmarshaller.java
JaxbUnmarshaller.unmarshal
public static JaxbPersistence unmarshal(JPAPXml pxml) throws PersistenceException //d86387 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "unmarshal : " + pxml); InputStream is = null; JaxbPersistence ...
java
public static JaxbPersistence unmarshal(JPAPXml pxml) throws PersistenceException //d86387 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "unmarshal : " + pxml); InputStream is = null; JaxbPersistence ...
[ "public", "static", "JaxbPersistence", "unmarshal", "(", "JPAPXml", "pxml", ")", "throws", "PersistenceException", "//d86387", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc...
Determines the correct schema version of the specified persistence.xml file, and invokes the JAXB unmarshaller using the corresponding pre-generated JAXB classes for that version. <p> Non-JAXB, non-version specific objects are returned so the caller does not need to handle different JAXB packaging per schema version. ...
[ "Determines", "the", "correct", "schema", "version", "of", "the", "specified", "persistence", ".", "xml", "file", "and", "invokes", "the", "JAXB", "unmarshaller", "using", "the", "corresponding", "pre", "-", "generated", "JAXB", "classes", "for", "that", "versio...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JaxbUnmarshaller.java#L75-L179
train
Unmarshals the specified JPA XML object into a JaxbPersistence object.
Of course, here is the Java code you requested: ```java public static JaxbPersistence unmarshal(JPAPXml pxml) throws PersistenceException //d86387 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "unmarshal : " + pxml);...
elki-project/elki
elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/SparseShortVector.java
SparseShortVector.setDimensionality
@Override public void setDimensionality(int dimensionality) throws IllegalArgumentException { final int maxdim = getMaxDim(); if(maxdim > dimensionality) { throw new IllegalArgumentException("Given dimensionality " + dimensionality + " is too small w.r.t. the given values (occurring maximum: " + maxdim ...
java
@Override public void setDimensionality(int dimensionality) throws IllegalArgumentException { final int maxdim = getMaxDim(); if(maxdim > dimensionality) { throw new IllegalArgumentException("Given dimensionality " + dimensionality + " is too small w.r.t. the given values (occurring maximum: " + maxdim ...
[ "@", "Override", "public", "void", "setDimensionality", "(", "int", "dimensionality", ")", "throws", "IllegalArgumentException", "{", "final", "int", "maxdim", "=", "getMaxDim", "(", ")", ";", "if", "(", "maxdim", ">", "dimensionality", ")", "{", "throw", "new...
Sets the dimensionality to the new value. @param dimensionality the new dimensionality @throws IllegalArgumentException if the given dimensionality is too small to cover the given values (i.e., the maximum index of any value not zero is bigger than the given dimensionality)
[ "Sets", "the", "dimensionality", "to", "the", "new", "value", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/SparseShortVector.java#L189-L196
train
Sets the dimensionality of the CID .
Of course, here is the Java code you requested: ```java @Override public void setDimensionality(int dimensionality) throws IllegalArgumentException { final int maxdim = getMaxDim(); if(maxdim > dimensionality) { throw new IllegalArgumentException("Given dimensionality " + dimensionality + " is too smal...
redkale/redkale
src/org/redkale/source/ColumnValue.java
ColumnValue.orr
public static ColumnValue orr(String column, Serializable value) { return new ColumnValue(column, ORR, value); }
java
public static ColumnValue orr(String column, Serializable value) { return new ColumnValue(column, ORR, value); }
[ "public", "static", "ColumnValue", "orr", "(", "String", "column", ",", "Serializable", "value", ")", "{", "return", "new", "ColumnValue", "(", "column", ",", "ORR", ",", "value", ")", ";", "}" ]
返回 {column} = {column} | {value} 操作 @param column 字段名 @param value 字段值 @return ColumnValue
[ "返回", "{", "column", "}", "=", "{", "column", "}", "|", "{", "value", "}", "操作" ]
ea5169b5c5ea7412fd762331c0c497165832e901
https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/ColumnValue.java#L109-L111
train
Creates an ORR column from the given column name and value.
Of course, here is the Java code you requested: ```java public static ColumnValue orr(String column, Serializable value) { return new ColumnValue(column, ORR, value); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/db/generic/CmsVfsDriver.java
CmsVfsDriver.checkWritePermissionsInFolder
protected void checkWritePermissionsInFolder(CmsDbContext dbc, CmsResource folder) throws CmsDataAccessException { ResultSet res = null; PreparedStatement stmt = null; Connection conn = null; CmsUUID projectId = dbc.getRequestContext().getCurrentProject().getUuid(); // first r...
java
protected void checkWritePermissionsInFolder(CmsDbContext dbc, CmsResource folder) throws CmsDataAccessException { ResultSet res = null; PreparedStatement stmt = null; Connection conn = null; CmsUUID projectId = dbc.getRequestContext().getCurrentProject().getUuid(); // first r...
[ "protected", "void", "checkWritePermissionsInFolder", "(", "CmsDbContext", "dbc", ",", "CmsResource", "folder", ")", "throws", "CmsDataAccessException", "{", "ResultSet", "res", "=", "null", ";", "PreparedStatement", "stmt", "=", "null", ";", "Connection", "conn", "...
Checks that the current user has write permissions for all subresources of the given folder.<p> @param dbc the current database context @param folder the folder to check @throws CmsDataAccessException if something goes wrong
[ "Checks", "that", "the", "current", "user", "has", "write", "permissions", "for", "all", "subresources", "of", "the", "given", "folder", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L3587-L3658
train
Checks if write permissions for all resources in the given folder.
Of course, here is the Java code you requested: ```java protected void checkWritePermissionsInFolder(CmsDbContext dbc, CmsResource folder) throws CmsDataAccessException { ResultSet res = null; PreparedStatement stmt = null; Connection conn = null; CmsUUID projectId = dbc.getRequestCon...
forge/javaee-descriptors
impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/javaee7/DataSourceTypeImpl.java
DataSourceTypeImpl.getMaxStatements
public Integer getMaxStatements() { if (childNode.getTextValueForPatternName("max-statements") != null && !childNode.getTextValueForPatternName("max-statements").equals("null")) { return Integer.valueOf(childNode.getTextValueForPatternName("max-statements")); } return null; }
java
public Integer getMaxStatements() { if (childNode.getTextValueForPatternName("max-statements") != null && !childNode.getTextValueForPatternName("max-statements").equals("null")) { return Integer.valueOf(childNode.getTextValueForPatternName("max-statements")); } return null; }
[ "public", "Integer", "getMaxStatements", "(", ")", "{", "if", "(", "childNode", ".", "getTextValueForPatternName", "(", "\"max-statements\"", ")", "!=", "null", "&&", "!", "childNode", ".", "getTextValueForPatternName", "(", "\"max-statements\"", ")", ".", "equals",...
Returns the <code>max-statements</code> element @return the node defined for the element <code>max-statements</code>
[ "Returns", "the", "<code", ">", "max", "-", "statements<", "/", "code", ">", "element" ]
cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed
https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/javaee7/DataSourceTypeImpl.java#L736-L742
train
Get the max - statements attribute value.
Of course, here is the Java code you requested: ```java public Integer getMaxStatements() { if (childNode.getTextValueForPatternName("max-statements") != null && !childNode.getTextValueForPatternName("max-statements").equals("null")) { return Integer.valueOf(childNode.getTextValueForPatternName("max-...
eFaps/eFaps-Kernel
src/main/java/org/efaps/db/store/JDBCStoreResource.java
JDBCStoreResource.read
@Override public InputStream read() throws EFapsException { StoreResourceInputStream in = null; ConnectionResource res = null; try { res = Context.getThreadContext().getConnectionResource(); final Statement stmt = res.createStatement(); final ...
java
@Override public InputStream read() throws EFapsException { StoreResourceInputStream in = null; ConnectionResource res = null; try { res = Context.getThreadContext().getConnectionResource(); final Statement stmt = res.createStatement(); final ...
[ "@", "Override", "public", "InputStream", "read", "(", ")", "throws", "EFapsException", "{", "StoreResourceInputStream", "in", "=", "null", ";", "ConnectionResource", "res", "=", "null", ";", "try", "{", "res", "=", "Context", ".", "getThreadContext", "(", ")"...
Returns for the file the input stream. @return input stream of the file with the content @throws EFapsException on error
[ "Returns", "for", "the", "file", "the", "input", "stream", "." ]
04b96548f518c2386a93f5ec2b9349f9b9063859
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/store/JDBCStoreResource.java#L179-L215
train
Read the content of the assessment.
Of course, here is the Java code you requested: ```java @Override public InputStream read() throws EFapsException { StoreResourceInputStream in = null; ConnectionResource res = null; try { res = Context.getThreadContext().getConnectionResource(); final S...
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.getCachedData
@Nullable private DataType getCachedData(@NonNull final KeyType key) { synchronized (cache) { return cache.get(key); } }
java
@Nullable private DataType getCachedData(@NonNull final KeyType key) { synchronized (cache) { return cache.get(key); } }
[ "@", "Nullable", "private", "DataType", "getCachedData", "(", "@", "NonNull", "final", "KeyType", "key", ")", "{", "synchronized", "(", "cache", ")", "{", "return", "cache", ".", "get", "(", "key", ")", ";", "}", "}" ]
Returns the data, which corresponds to a specific key, from the cache. @param key The key of the data, which should be retrieved, as an instance of the generic type KeyType. The key may not be null @return The data, which has been retrieved, as an instance of the generic type DataType or null, if no data with the give...
[ "Returns", "the", "data", "which", "corresponds", "to", "a", "specific", "key", "from", "the", "cache", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L317-L322
train
Gets the cached data.
Of course, here is the Java code you requested: ```java @Nullable private DataType getCachedData(@NonNull final KeyType key) { synchronized (cache) { return cache.get(key); } } ``` Hope this helps!
googleapis/google-cloud-java
google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java
ValueBinder.toFloat64Array
public R toFloat64Array(@Nullable double[] values, int pos, int length) { return handle(Value.float64Array(values, pos, length)); }
java
public R toFloat64Array(@Nullable double[] values, int pos, int length) { return handle(Value.float64Array(values, pos, length)); }
[ "public", "R", "toFloat64Array", "(", "@", "Nullable", "double", "[", "]", "values", ",", "int", "pos", ",", "int", "length", ")", "{", "return", "handle", "(", "Value", ".", "float64Array", "(", "values", ",", "pos", ",", "length", ")", ")", ";", "}...
Binds to {@code Value.float64Array(values, pos, length)}
[ "Binds", "to", "{" ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/ValueBinder.java#L156-L158
train
Converts a double array to a float64 array.
Of course, here is the Java code you requested: ```java public R toFloat64Array(@Nullable double[] values, int pos, int length) { return handle(Value.float64Array(values, pos, length)); } ``` Hope this helps!
javalite/activeweb
activeweb/src/main/java/org/javalite/activeweb/RequestUtils.java
RequestUtils.param
public static String param(String name){ if(name.equals("id")){ return getId(); }else if(RequestContext.getRequestVo().getUserSegments().get(name) != null){ return RequestContext.getRequestVo().getUserSegments().get(name); }else if(RequestContext.getRequestVo().getWildCar...
java
public static String param(String name){ if(name.equals("id")){ return getId(); }else if(RequestContext.getRequestVo().getUserSegments().get(name) != null){ return RequestContext.getRequestVo().getUserSegments().get(name); }else if(RequestContext.getRequestVo().getWildCar...
[ "public", "static", "String", "param", "(", "String", "name", ")", "{", "if", "(", "name", ".", "equals", "(", "\"id\"", ")", ")", "{", "return", "getId", "(", ")", ";", "}", "else", "if", "(", "RequestContext", ".", "getRequestVo", "(", ")", ".", ...
Returns value of routing user segment, or route wild card value, or request parameter. If this name represents multiple values, this call will result in {@link IllegalArgumentException}. @param name name of parameter. @return value of routing user segment, or route wild card value, or request parameter.
[ "Returns", "value", "of", "routing", "user", "segment", "or", "route", "wild", "card", "value", "or", "request", "parameter", ".", "If", "this", "name", "represents", "multiple", "values", "this", "call", "will", "result", "in", "{", "@link", "IllegalArgumentE...
f25f589da94852b6f5625182360732e0861794a6
https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/RequestUtils.java#L38-L49
train
Get a parameter from a request.
Of course, here is the Java code you requested: ```java public static String param(String name){ if(name.equals("id")){ return getId(); }else if(RequestContext.getRequestVo().getUserSegments().get(name) != null){ return RequestContext.getRequestVo().getUserSegments().get(name); ...
sonyxperiadev/gerrit-events
src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritHandler.java
GerritHandler.removeAllEventListeners
public Collection<GerritEventListener> removeAllEventListeners() { synchronized (this) { HashSet<GerritEventListener> listeners = new HashSet<GerritEventListener>(gerritEventListeners); gerritEventListeners.clear(); return listeners; } }
java
public Collection<GerritEventListener> removeAllEventListeners() { synchronized (this) { HashSet<GerritEventListener> listeners = new HashSet<GerritEventListener>(gerritEventListeners); gerritEventListeners.clear(); return listeners; } }
[ "public", "Collection", "<", "GerritEventListener", ">", "removeAllEventListeners", "(", ")", "{", "synchronized", "(", "this", ")", "{", "HashSet", "<", "GerritEventListener", ">", "listeners", "=", "new", "HashSet", "<", "GerritEventListener", ">", "(", "gerritE...
Removes all event listeners and returns those that where removed. @return the former list of listeners.
[ "Removes", "all", "event", "listeners", "and", "returns", "those", "that", "where", "removed", "." ]
9a443d13dded85cc4709136ac33989f2bbb34fe2
https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritHandler.java#L376-L382
train
Removes all event listeners from the set.
Of course, here is the Java code you requested: ```java public Collection<GerritEventListener> removeAllEventListeners() { synchronized (this) { HashSet<GerritEventListener> listeners = new HashSet<GerritEventListener>(gerritEventListeners); gerritEventListeners.clear(); ret...
liyiorg/weixin-popular
src/main/java/weixin/popular/api/BizwifiAPI.java
BizwifiAPI.shopUpdate
public static BaseResult shopUpdate(String accessToken, ShopUpdate shopUpdate) { return shopUpdate(accessToken, JsonUtil.toJSONString(shopUpdate)); }
java
public static BaseResult shopUpdate(String accessToken, ShopUpdate shopUpdate) { return shopUpdate(accessToken, JsonUtil.toJSONString(shopUpdate)); }
[ "public", "static", "BaseResult", "shopUpdate", "(", "String", "accessToken", ",", "ShopUpdate", "shopUpdate", ")", "{", "return", "shopUpdate", "(", "accessToken", ",", "JsonUtil", ".", "toJSONString", "(", "shopUpdate", ")", ")", ";", "}" ]
Wi-Fi门店管理-修改门店网络信息 @param accessToken accessToken @param shopUpdate shopUpdate @return BaseResult
[ "Wi", "-", "Fi门店管理", "-", "修改门店网络信息" ]
c64255292d41463bdb671938feaabf42a335d82c
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/BizwifiAPI.java#L254-L256
train
Convenience method to make an HTTP PUT request to the Hudson API for updating a Shop.
Of course, here is the Java code you requested: ```java public static BaseResult shopUpdate(String accessToken, ShopUpdate shopUpdate) { return shopUpdate(accessToken, JsonUtil.toJSONString(shopUpdate)); } ``` Hope this helps!
geomajas/geomajas-project-server
plugin/cache/cache-infinispan/src/main/java/org/geomajas/plugin/caching/infinispan/configuration/SimpleInfinispanCacheInfo.java
SimpleInfinispanCacheInfo.setLevel2CacheLocation
public void setLevel2CacheLocation(String locationExpr) { if (null != locationExpr) { // property name handling in location String location = propertyReplace(locationExpr); // create caching directory File dir = new File(location); if (!dir.isDirectory()) { if (dir.exists()) { log.error("Loca...
java
public void setLevel2CacheLocation(String locationExpr) { if (null != locationExpr) { // property name handling in location String location = propertyReplace(locationExpr); // create caching directory File dir = new File(location); if (!dir.isDirectory()) { if (dir.exists()) { log.error("Loca...
[ "public", "void", "setLevel2CacheLocation", "(", "String", "locationExpr", ")", "{", "if", "(", "null", "!=", "locationExpr", ")", "{", "// property name handling in location", "String", "location", "=", "propertyReplace", "(", "locationExpr", ")", ";", "// create cac...
Set the location for the second level cache. This needs to be a directory which is created if needed. <p/> The location can point to a system property by using the "${propertyName}" notation. If the property does not exist it is replaced by a temporary directory. The property needs to be at the start of the string (so ...
[ "Set", "the", "location", "for", "the", "second", "level", "cache", ".", "This", "needs", "to", "be", "a", "directory", "which", "is", "created", "if", "needed", ".", "<p", "/", ">", "The", "location", "can", "point", "to", "a", "system", "property", "...
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/cache/cache-infinispan/src/main/java/org/geomajas/plugin/caching/infinispan/configuration/SimpleInfinispanCacheInfo.java#L135-L155
train
Sets the location for the 2nd level cache.
Of course, here is the Java code you requested: ```java public void setLevel2CacheLocation(String locationExpr) { if (null != locationExpr) { // property name handling in location String location = propertyReplace(locationExpr); // create caching directory File dir = new File(location); if (!dir.isDi...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbours.java
Neighbours.deleteBus
private void deleteBus(BusGroup group) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "deleteBus", group); // Find the position in the list which contains the group, and remove // the group. final BusGroup[] t = _buses; for (int i = 0; i < _buses.length;...
java
private void deleteBus(BusGroup group) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "deleteBus", group); // Find the position in the list which contains the group, and remove // the group. final BusGroup[] t = _buses; for (int i = 0; i < _buses.length;...
[ "private", "void", "deleteBus", "(", "BusGroup", "group", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"deleteBus\"", ",", "group", ...
Removes the Bus with the given name from the list of all Buss. @param group The group to be removed
[ "Removes", "the", "Bus", "with", "the", "given", "name", "from", "the", "list", "of", "all", "Buss", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbours.java#L1155-L1180
train
Delete the bus from the list of buses.
Of course, here is the Java code you requested: ```java private void deleteBus(BusGroup group) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "deleteBus", group); // Find the position in the list which contains the group, and remove // the group. final BusG...
kamranzafar/jtar
src/main/java/org/kamranzafar/jtar/Octal.java
Octal.getLongOctalBytes
public static int getLongOctalBytes(long value, byte[] buf, int offset, int length) { byte[] temp = new byte[length + 1]; getOctalBytes( value, temp, 0, length + 1 ); System.arraycopy( temp, 0, buf, offset, length ); return offset + length; }
java
public static int getLongOctalBytes(long value, byte[] buf, int offset, int length) { byte[] temp = new byte[length + 1]; getOctalBytes( value, temp, 0, length + 1 ); System.arraycopy( temp, 0, buf, offset, length ); return offset + length; }
[ "public", "static", "int", "getLongOctalBytes", "(", "long", "value", ",", "byte", "[", "]", "buf", ",", "int", "offset", ",", "int", "length", ")", "{", "byte", "[", "]", "temp", "=", "new", "byte", "[", "length", "+", "1", "]", ";", "getOctalBytes"...
Write an octal long integer to a header buffer. @param value The value to write. @param buf The header buffer from which to parse. @param offset The offset into the buffer from which to parse. @param length The number of header bytes to parse. @return The long value of the octal bytes.
[ "Write", "an", "octal", "long", "integer", "to", "a", "header", "buffer", "." ]
aace0a3c8a6478fd1bac95865c27535e658afb73
https://github.com/kamranzafar/jtar/blob/aace0a3c8a6478fd1bac95865c27535e658afb73/src/main/java/org/kamranzafar/jtar/Octal.java#L137-L142
train
Gets the octal bytes of a long from a byte array.
Of course, here is the Java code you requested: ```java public static int getLongOctalBytes(long value, byte[] buf, int offset, int length) { byte[] temp = new byte[length + 1]; getOctalBytes( value, temp, 0, length + 1 ); System.arraycopy( temp, 0, buf, offset, length ); return off...
killme2008/gecko
src/main/java/com/taobao/gecko/core/core/impl/FutureLockImpl.java
FutureLockImpl.get
public R get() throws InterruptedException, ExecutionException { latch.await(); try { lock.lock(); if (isCancelled) { throw new CancellationException(); } else if (failure != null) { throw new ExecutionException(failure); ...
java
public R get() throws InterruptedException, ExecutionException { latch.await(); try { lock.lock(); if (isCancelled) { throw new CancellationException(); } else if (failure != null) { throw new ExecutionException(failure); ...
[ "public", "R", "get", "(", ")", "throws", "InterruptedException", ",", "ExecutionException", "{", "latch", ".", "await", "(", ")", ";", "try", "{", "lock", ".", "lock", "(", ")", ";", "if", "(", "isCancelled", ")", "{", "throw", "new", "CancellationExcep...
{@inheritDoc}
[ "{" ]
0873b690ffde51e40e6eadfcd5d599eb4e3b642d
https://github.com/killme2008/gecko/blob/0873b690ffde51e40e6eadfcd5d599eb4e3b642d/src/main/java/com/taobao/gecko/core/core/impl/FutureLockImpl.java#L180-L197
train
Get the result of the operation.
Of course, here is the Java code you requested: ```java public R get() throws InterruptedException, ExecutionException { latch.await(); try { lock.lock(); if (isCancelled) { throw new CancellationException(); } else if (failure != null) {...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ImportInstanceRequest.java
ImportInstanceRequest.getDryRunRequest
@Override public Request<ImportInstanceRequest> getDryRunRequest() { Request<ImportInstanceRequest> request = new ImportInstanceRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
java
@Override public Request<ImportInstanceRequest> getDryRunRequest() { Request<ImportInstanceRequest> request = new ImportInstanceRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
[ "@", "Override", "public", "Request", "<", "ImportInstanceRequest", ">", "getDryRunRequest", "(", ")", "{", "Request", "<", "ImportInstanceRequest", ">", "request", "=", "new", "ImportInstanceRequestMarshaller", "(", ")", ".", "marshall", "(", "this", ")", ";", ...
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
[ "This", "method", "is", "intended", "for", "internal", "use", "only", ".", "Returns", "the", "marshaled", "request", "configured", "with", "additional", "parameters", "to", "enable", "operation", "dry", "-", "run", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ImportInstanceRequest.java#L285-L290
train
Returns a request configured with additional parameters to indicate if the DryRun is set to true.
Of course, here is the Java code you requested: ```java @Override public Request<ImportInstanceRequest> getDryRunRequest() { Request<ImportInstanceRequest> request = new ImportInstanceRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request;...
eclipse/xtext-extras
org.eclipse.xtext.common.types/emf-gen/org/eclipse/xtext/common/types/impl/JvmEnumAnnotationValueImpl.java
JvmEnumAnnotationValueImpl.eUnset
@Override public void eUnset(int featureID) { switch (featureID) { case TypesPackage.JVM_ENUM_ANNOTATION_VALUE__VALUES: getValues().clear(); return; } super.eUnset(featureID); }
java
@Override public void eUnset(int featureID) { switch (featureID) { case TypesPackage.JVM_ENUM_ANNOTATION_VALUE__VALUES: getValues().clear(); return; } super.eUnset(featureID); }
[ "@", "Override", "public", "void", "eUnset", "(", "int", "featureID", ")", "{", "switch", "(", "featureID", ")", "{", "case", "TypesPackage", ".", "JVM_ENUM_ANNOTATION_VALUE__VALUES", ":", "getValues", "(", ")", ".", "clear", "(", ")", ";", "return", ";", ...
<!-- 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.common.types/emf-gen/org/eclipse/xtext/common/types/impl/JvmEnumAnnotationValueImpl.java#L122-L132
train
Method called to clear the value of the object reference.
Of course, here is the Java code you requested: ```java @Override public void eUnset(int featureID) { switch (featureID) { case TypesPackage.JVM_ENUM_ANNOTATION_VALUE__VALUES: getValues().clear(); return; } super.eUnset(featureID); } ``` Hope this helps!
openzipkin-contrib/brave-opentracing
src/main/java/brave/opentracing/BraveSpan.java
BraveSpan.setTag
@Override public BraveSpan setTag(String key, Number value) { if (finishCalled) return this; if (trySetPeer(key, value)) return this; // handle late sampling decision if (Tags.SAMPLING_PRIORITY.getKey().equals(key) && value.intValue() == 0) { delegate.abandon(); // convert the span to no-o...
java
@Override public BraveSpan setTag(String key, Number value) { if (finishCalled) return this; if (trySetPeer(key, value)) return this; // handle late sampling decision if (Tags.SAMPLING_PRIORITY.getKey().equals(key) && value.intValue() == 0) { delegate.abandon(); // convert the span to no-o...
[ "@", "Override", "public", "BraveSpan", "setTag", "(", "String", "key", ",", "Number", "value", ")", "{", "if", "(", "finishCalled", ")", "return", "this", ";", "if", "(", "trySetPeer", "(", "key", ",", "value", ")", ")", "return", "this", ";", "// han...
<em>Note:</em>If the key is {@linkplain Tags#SAMPLING_PRIORITY} and the value is zero, the current span will be abandoned and future references to the {@link #context()} will be unsampled. This does not affect the active span, nor does it affect any equivalent instances of this object. This is a best efforts means to h...
[ "<em", ">", "Note", ":", "<", "/", "em", ">", "If", "the", "key", "is", "{" ]
07653ac3a67beb7df71008961051ff03db2b60b7
https://github.com/openzipkin-contrib/brave-opentracing/blob/07653ac3a67beb7df71008961051ff03db2b60b7/src/main/java/brave/opentracing/BraveSpan.java#L82-L94
train
Set the tag of the span.
Of course, here is the Java code you requested: ```java @Override public BraveSpan setTag(String key, Number value) { if (finishCalled) return this; if (trySetPeer(key, value)) return this; // handle late sampling decision if (Tags.SAMPLING_PRIORITY.getKey().equals(key) && value.intValue() == 0) { ...
paypal/SeLion
client/src/main/java/com/paypal/selion/platform/html/AbstractElement.java
AbstractElement.clickAndExpectOneOf
public Object clickAndExpectOneOf(final Object... expected) { dispatcher.beforeClick(this, expected); getElement().click(); if (Boolean.parseBoolean(Config.getConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING))) { logUIAction(UIActions.CLICKED); } // If there are no ...
java
public Object clickAndExpectOneOf(final Object... expected) { dispatcher.beforeClick(this, expected); getElement().click(); if (Boolean.parseBoolean(Config.getConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING))) { logUIAction(UIActions.CLICKED); } // If there are no ...
[ "public", "Object", "clickAndExpectOneOf", "(", "final", "Object", "...", "expected", ")", "{", "dispatcher", ".", "beforeClick", "(", "this", ",", "expected", ")", ";", "getElement", "(", ")", ".", "click", "(", ")", ";", "if", "(", "Boolean", ".", "par...
The click function and wait for one of the expected {@link Object} items to load. @param expected parameters in the form of an element locator {@link String}, a {@link WebPage}, or an {@link AbstractElement} @return the first object that was matched
[ "The", "click", "function", "and", "wait", "for", "one", "of", "the", "expected", "{", "@link", "Object", "}", "items", "to", "load", "." ]
694d12d0df76db48d0360b16192770c6a4fbdfd2
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/AbstractElement.java#L648-L721
train
Click and expect one of the given objects.
Of course, here is the Java code you requested: ```java public Object clickAndExpectOneOf(final Object... expected) { dispatcher.beforeClick(this, expected); getElement().click(); if (Boolean.parseBoolean(Config.getConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING))) { logUIAction(U...
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/modules/CmsModulesUploadFromServer.java
CmsModulesUploadFromServer.defineWidgets
@Override protected void defineWidgets() { List selectOptions = getModulesFromServer(); if (selectOptions.isEmpty()) { // no import modules available, display message addWidget( new CmsWidgetDialogParameter( this, "mod...
java
@Override protected void defineWidgets() { List selectOptions = getModulesFromServer(); if (selectOptions.isEmpty()) { // no import modules available, display message addWidget( new CmsWidgetDialogParameter( this, "mod...
[ "@", "Override", "protected", "void", "defineWidgets", "(", ")", "{", "List", "selectOptions", "=", "getModulesFromServer", "(", ")", ";", "if", "(", "selectOptions", ".", "isEmpty", "(", ")", ")", "{", "// no import modules available, display message", "addWidget",...
Creates the list of widgets for this dialog.<p>
[ "Creates", "the", "list", "of", "widgets", "for", "this", "dialog", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/modules/CmsModulesUploadFromServer.java#L234-L251
train
Define the widgets for the CRUD.
Of course, here is the Java code you requested: ```java @Override protected void defineWidgets() { List selectOptions = getModulesFromServer(); if (selectOptions.isEmpty()) { // no import modules available, display message addWidget( new CmsWidgetDialogPara...
bbossgroups/bboss-elasticsearch
bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/serial/CharEscapeUtil.java
CharEscapeUtil._writeStringCustom
private void _writeStringCustom(final int len) throws IOException, JsonGenerationException { // And then we'll need to verify need for escaping etc: int end = _outputTail + len; final int[] escCodes = _outputEscapes; final int maxNonEscaped = (_maximumNonEscapedChar < 1) ? 0xFFFF : _maximumNonEscapedChar; ...
java
private void _writeStringCustom(final int len) throws IOException, JsonGenerationException { // And then we'll need to verify need for escaping etc: int end = _outputTail + len; final int[] escCodes = _outputEscapes; final int maxNonEscaped = (_maximumNonEscapedChar < 1) ? 0xFFFF : _maximumNonEscapedChar; ...
[ "private", "void", "_writeStringCustom", "(", "final", "int", "len", ")", "throws", "IOException", ",", "JsonGenerationException", "{", "// And then we'll need to verify need for escaping etc:", "int", "end", "=", "_outputTail", "+", "len", ";", "final", "int", "[", "...
/* Same as "_writeString2()", except needs additional escaping for subset of characters
[ "/", "*", "Same", "as", "_writeString2", "()", "except", "needs", "additional", "escaping", "for", "subset", "of", "characters" ]
31717c8aa2c4c880987be53aeeb8a0cf5183c3a7
https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/serial/CharEscapeUtil.java#L478-L521
train
Write a string with custom escaping
Of course, here is the Java code you requested: ```java private void _writeStringCustom(final int len) throws IOException, JsonGenerationException { // And then we'll need to verify need for escaping etc: int end = _outputTail + len; final int[] escCodes = _outputEscapes; final int maxNonEscaped = (_maximu...
apereo/cas
core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/authentication/DefaultAuthenticationAttributeReleasePolicy.java
DefaultAuthenticationAttributeReleasePolicy.decideIfProxyGrantingTicketShouldBeReleasedAsAttribute
protected void decideIfProxyGrantingTicketShouldBeReleasedAsAttribute(final Map<String, List<Object>> attributes, final Map<String, Object> model, final RegisteredService service) { val policy = service.getAttributeReleasePolicy(); ...
java
protected void decideIfProxyGrantingTicketShouldBeReleasedAsAttribute(final Map<String, List<Object>> attributes, final Map<String, Object> model, final RegisteredService service) { val policy = service.getAttributeReleasePolicy(); ...
[ "protected", "void", "decideIfProxyGrantingTicketShouldBeReleasedAsAttribute", "(", "final", "Map", "<", "String", ",", "List", "<", "Object", ">", ">", "attributes", ",", "final", "Map", "<", "String", ",", "Object", ">", "model", ",", "final", "RegisteredService...
Decide if PGT should be released as attribute. The PGT must have been cached as an authentication attribute and the attribute release policy must be allowed to release the attribute. @param attributes the attributes @param model the model @param service the service
[ "Decide", "if", "PGT", "should", "be", "released", "as", "attribute", ".", "The", "PGT", "must", "have", "been", "cached", "as", "an", "authentication", "attribute", "and", "the", "attribute", "release", "policy", "must", "be", "allowed", "to", "release", "t...
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/authentication/DefaultAuthenticationAttributeReleasePolicy.java#L126-L137
train
Decide if proxy granting ticket should be released as attribute.
Of course, here is the Java code you requested: ```java protected void decideIfProxyGrantingTicketShouldBeReleasedAsAttribute(final Map<String, List<Object>> attributes, final Map<String, Object> model, final RegisteredService service) { ...
j256/simplecsv
src/main/java/com/j256/simplecsv/processor/CsvProcessor.java
CsvProcessor.buildLine
public String buildLine(T entity, boolean appendLineTermination) { checkEntityConfig(); StringBuilder sb = new StringBuilder(); boolean first = true; for (ColumnInfo<Object> columnInfo : allColumnInfos) { if (first) { first = false; } else { sb.append(columnSeparator); } Object value; try...
java
public String buildLine(T entity, boolean appendLineTermination) { checkEntityConfig(); StringBuilder sb = new StringBuilder(); boolean first = true; for (ColumnInfo<Object> columnInfo : allColumnInfos) { if (first) { first = false; } else { sb.append(columnSeparator); } Object value; try...
[ "public", "String", "buildLine", "(", "T", "entity", ",", "boolean", "appendLineTermination", ")", "{", "checkEntityConfig", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", ...
Convert the entity into a string of column values. @param appendLineTermination Set to true to add the newline to the end of the line.
[ "Convert", "the", "entity", "into", "a", "string", "of", "column", "values", "." ]
964fe53073c43e2a311341e3f8fd2c94372f60cb
https://github.com/j256/simplecsv/blob/964fe53073c43e2a311341e3f8fd2c94372f60cb/src/main/java/com/j256/simplecsv/processor/CsvProcessor.java#L512-L564
train
Build a line of text from the entity.
Of course, here is the Java code you requested: ```java public String buildLine(T entity, boolean appendLineTermination) { checkEntityConfig(); StringBuilder sb = new StringBuilder(); boolean first = true; for (ColumnInfo<Object> columnInfo : allColumnInfos) { if (first) { first = false; } else { ...
jenkinsci/jenkins
core/src/main/java/hudson/FilePath.java
FilePath.getBaseName
public String getBaseName() { String n = getName(); int idx = n.lastIndexOf('.'); if (idx<0) return n; return n.substring(0,idx); }
java
public String getBaseName() { String n = getName(); int idx = n.lastIndexOf('.'); if (idx<0) return n; return n.substring(0,idx); }
[ "public", "String", "getBaseName", "(", ")", "{", "String", "n", "=", "getName", "(", ")", ";", "int", "idx", "=", "n", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "idx", "<", "0", ")", "return", "n", ";", "return", "n", ".", "subst...
Gets the file name portion except the extension. For example, "foo" for "foo.txt" and "foo.tar" for "foo.tar.gz".
[ "Gets", "the", "file", "name", "portion", "except", "the", "extension", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/FilePath.java#L1296-L1301
train
Get the base name of the class.
Of course, here is the Java code you requested: ```java public String getBaseName() { String n = getName(); int idx = n.lastIndexOf('.'); if (idx<0) return n; return n.substring(0,idx); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/PersistentExecutorImpl.java
PersistentExecutorImpl.notificationCreated
@Override public void notificationCreated(RuntimeUpdateManager updateManager, RuntimeUpdateNotification notification) { class MyCompletionListener implements CompletionListener<Boolean> { String notificationName; public MyCompletionListener(String name) { notificati...
java
@Override public void notificationCreated(RuntimeUpdateManager updateManager, RuntimeUpdateNotification notification) { class MyCompletionListener implements CompletionListener<Boolean> { String notificationName; public MyCompletionListener(String name) { notificati...
[ "@", "Override", "public", "void", "notificationCreated", "(", "RuntimeUpdateManager", "updateManager", ",", "RuntimeUpdateNotification", "notification", ")", "{", "class", "MyCompletionListener", "implements", "CompletionListener", "<", "Boolean", ">", "{", "String", "no...
This method is driven for various RuntimeUpdateNotification's. When we receive a notification we will bump our count of active configuration updates in progress. A non-zero count value signifies configuration update(s) are in progress. We monitor the completion of the Futures related to the notifications. When we are ...
[ "This", "method", "is", "driven", "for", "various", "RuntimeUpdateNotification", "s", ".", "When", "we", "receive", "a", "notification", "we", "will", "bump", "our", "count", "of", "active", "configuration", "updates", "in", "progress", ".", "A", "non", "-", ...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/PersistentExecutorImpl.java#L1975-L2014
train
Notification created method.
Of course, here is the Java code you requested: ```java @Override public void notificationCreated(RuntimeUpdateManager updateManager, RuntimeUpdateNotification notification) { class MyCompletionListener implements CompletionListener<Boolean> { String notificationName; public MyCom...
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java
DigitPickerPreference.setNumberOfDigits
public final void setNumberOfDigits(final int numberOfDigits) { Condition.INSTANCE .ensureAtLeast(numberOfDigits, 1, "The number of digits must be at least 1"); this.numberOfDigits = numberOfDigits; setNumber(Math.min(getNumber(), getMaxNumber(numberOfDigits))); }
java
public final void setNumberOfDigits(final int numberOfDigits) { Condition.INSTANCE .ensureAtLeast(numberOfDigits, 1, "The number of digits must be at least 1"); this.numberOfDigits = numberOfDigits; setNumber(Math.min(getNumber(), getMaxNumber(numberOfDigits))); }
[ "public", "final", "void", "setNumberOfDigits", "(", "final", "int", "numberOfDigits", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureAtLeast", "(", "numberOfDigits", ",", "1", ",", "\"The number of digits must be at least 1\"", ")", ";", "this", ".", "numberOf...
Sets the number of digits of the numbers, the preference should allow to choose. @param numberOfDigits The number of digits, which should be set, as an {@link Integer} value. The number of digits must be at least 1
[ "Sets", "the", "number", "of", "digits", "of", "the", "numbers", "the", "preference", "should", "allow", "to", "choose", "." ]
73a7e449458313bd041fc8d6038e290506b68eb1
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java#L348-L353
train
Sets the number of digits which should be used to generate a new language code.
Of course, here is the Java code you requested: ```java public final void setNumberOfDigits(final int numberOfDigits) { Condition.INSTANCE .ensureAtLeast(numberOfDigits, 1, "The number of digits must be at least 1"); this.numberOfDigits = numberOfDigits; setNumber(Math.min(getNu...
alkacon/opencms-core
src/org/opencms/db/CmsDriverManager.java
CmsDriverManager.deleteRelationsWithSiblings
protected void deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException { // get all siblings List<CmsResource> siblings; if (resource.getSiblingCount() > 1) { siblings = readSiblings(dbc, resource, CmsResourceFilter.ALL); } else { ...
java
protected void deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException { // get all siblings List<CmsResource> siblings; if (resource.getSiblingCount() > 1) { siblings = readSiblings(dbc, resource, CmsResourceFilter.ALL); } else { ...
[ "protected", "void", "deleteRelationsWithSiblings", "(", "CmsDbContext", "dbc", ",", "CmsResource", "resource", ")", "throws", "CmsException", "{", "// get all siblings", "List", "<", "CmsResource", ">", "siblings", ";", "if", "(", "resource", ".", "getSiblingCount", ...
Deletes all relations for the given resource and all its siblings.<p> @param dbc the current database context @param resource the resource to delete the resource for @throws CmsException if something goes wrong
[ "Deletes", "all", "relations", "for", "the", "given", "resource", "and", "all", "its", "siblings", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L10352-L10374
train
Deletes all relations with siblings.
Of course, here is the Java code you requested: ```java protected void deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException { // get all siblings List<CmsResource> siblings; if (resource.getSiblingCount() > 1) { siblings = readSiblings(dbc, resour...
alkacon/opencms-core
src/org/opencms/ui/apps/git/CmsGitCheckin.java
CmsGitCheckin.checkIn
public int checkIn() { try { synchronized (STATIC_LOCK) { m_logStream = new PrintStream(new FileOutputStream(DEFAULT_LOGFILE_PATH, false)); CmsObject cms = getCmsObject(); if (cms != null) { return checkInInternal(); ...
java
public int checkIn() { try { synchronized (STATIC_LOCK) { m_logStream = new PrintStream(new FileOutputStream(DEFAULT_LOGFILE_PATH, false)); CmsObject cms = getCmsObject(); if (cms != null) { return checkInInternal(); ...
[ "public", "int", "checkIn", "(", ")", "{", "try", "{", "synchronized", "(", "STATIC_LOCK", ")", "{", "m_logStream", "=", "new", "PrintStream", "(", "new", "FileOutputStream", "(", "DEFAULT_LOGFILE_PATH", ",", "false", ")", ")", ";", "CmsObject", "cms", "=", ...
Start export and check in of the selected modules. @return The exit code of the check in procedure (like a script's exit code).
[ "Start", "export", "and", "check", "in", "of", "the", "selected", "modules", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L232-L249
train
Check in.
Of course, here is the Java code you requested: ```java public int checkIn() { try { synchronized (STATIC_LOCK) { m_logStream = new PrintStream(new FileOutputStream(DEFAULT_LOGFILE_PATH, false)); CmsObject cms = getCmsObject(); if (cms != null) { ...
Azure/azure-sdk-for-java
policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java
PolicyDefinitionsInner.getAtManagementGroupAsync
public Observable<PolicyDefinitionInner> getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) { return getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).map(new Func1<ServiceResponse<PolicyDefinitionInner>, PolicyDefinitionInner>() { @O...
java
public Observable<PolicyDefinitionInner> getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) { return getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).map(new Func1<ServiceResponse<PolicyDefinitionInner>, PolicyDefinitionInner>() { @O...
[ "public", "Observable", "<", "PolicyDefinitionInner", ">", "getAtManagementGroupAsync", "(", "String", "policyDefinitionName", ",", "String", "managementGroupId", ")", "{", "return", "getAtManagementGroupWithServiceResponseAsync", "(", "policyDefinitionName", ",", "managementGr...
Gets the policy definition at management group level. @param policyDefinitionName The name of the policy definition to get. @param managementGroupId The ID of the management group. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PolicyDefinitionInner object
[ "Gets", "the", "policy", "definition", "at", "management", "group", "level", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java#L648-L655
train
Get the policy definition with the specified management group ID.
Of course, here is the Java code you requested: ```java public Observable<PolicyDefinitionInner> getAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) { return getAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).map(new Func1<ServiceResponse<PolicyDe...
groupe-sii/ogham
ogham-core/src/main/java/fr/sii/ogham/core/util/ArrayUtils.java
ArrayUtils.concat
public static <T> T[] concat(T first, T[] others) { @SuppressWarnings("unchecked") T[] arr = (T[]) Array.newInstance(first.getClass(), 1); arr[0] = first; return concat(arr, others); }
java
public static <T> T[] concat(T first, T[] others) { @SuppressWarnings("unchecked") T[] arr = (T[]) Array.newInstance(first.getClass(), 1); arr[0] = first; return concat(arr, others); }
[ "public", "static", "<", "T", ">", "T", "[", "]", "concat", "(", "T", "first", ",", "T", "[", "]", "others", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "T", "[", "]", "arr", "=", "(", "T", "[", "]", ")", "Array", ".", "newIns...
Create an array starting with first element and followed by others. <p> This can be useful when handling vararg parameters and when you want to force to have at least one value. <p> @param first the first element @param others the other elements @param <T> the type of each element in the array @return the combined arr...
[ "Create", "an", "array", "starting", "with", "first", "element", "and", "followed", "by", "others", ".", "<p", ">", "This", "can", "be", "useful", "when", "handling", "vararg", "parameters", "and", "when", "you", "want", "to", "force", "to", "have", "at", ...
e273b845604add74b5a25dfd931cb3c166b1008f
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/util/ArrayUtils.java#L25-L30
train
Concatenates two arrays of objects.
Of course, here is the Java code you requested: ```java public static <T> T[] concat(T first, T[] others) { @SuppressWarnings("unchecked") T[] arr = (T[]) Array.newInstance(first.getClass(), 1); arr[0] = first; return concat(arr, others); } ``` Hope this helps!
FasterXML/woodstox
src/main/java/com/ctc/wstx/sw/SimpleNsStreamWriter.java
SimpleNsStreamWriter.copyStartElement
@Override public final void copyStartElement(InputElementStack elemStack, AttributeCollector attrCollector) throws IOException, XMLStreamException { // Any namespace declarations/bindings? int nsCount = elemStack.getCurrentNsCount(); if (nsCount > 0) { // yup, got som...
java
@Override public final void copyStartElement(InputElementStack elemStack, AttributeCollector attrCollector) throws IOException, XMLStreamException { // Any namespace declarations/bindings? int nsCount = elemStack.getCurrentNsCount(); if (nsCount > 0) { // yup, got som...
[ "@", "Override", "public", "final", "void", "copyStartElement", "(", "InputElementStack", "elemStack", ",", "AttributeCollector", "attrCollector", ")", "throws", "IOException", ",", "XMLStreamException", "{", "// Any namespace declarations/bindings?", "int", "nsCount", "=",...
Element copier method implementation suitable to be used with namespace-aware writers in non-repairing (explicit namespaces) mode. The trickiest thing is having to properly order calls to <code>setPrefix</code>, <code>writeNamespace</code> and <code>writeStartElement</code>; the order writers expect is bit different fr...
[ "Element", "copier", "method", "implementation", "suitable", "to", "be", "used", "with", "namespace", "-", "aware", "writers", "in", "non", "-", "repairing", "(", "explicit", "namespaces", ")", "mode", ".", "The", "trickiest", "thing", "is", "having", "to", ...
ffcaabdc06672d9564c48c25d601d029b7fd6548
https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sw/SimpleNsStreamWriter.java#L285-L338
train
Copy start element.
Of course, here is the Java code you requested: ```java @Override public final void copyStartElement(InputElementStack elemStack, AttributeCollector attrCollector) throws IOException, XMLStreamException { // Any namespace declarations/bindings? int nsCount = elemStack.getCur...
jryans/jless
src/main/java/com/bazaarvoice/jless/parser/Parser.java
Parser.Unicode
Rule Unicode() { return Sequence( '\\', Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex()))))), Optional(Whitespace()) ); }
java
Rule Unicode() { return Sequence( '\\', Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex()))))), Optional(Whitespace()) ); }
[ "Rule", "Unicode", "(", ")", "{", "return", "Sequence", "(", "'", "'", ",", "Hex", "(", ")", ",", "Optional", "(", "Hex", "(", ")", ",", "Optional", "(", "Hex", "(", ")", ",", "Optional", "(", "Hex", "(", ")", ",", "Optional", "(", "Hex", "(", ...
'\' [0-9a-fA-F]{1,6} wc?
[ "\\", "[", "0", "-", "9a", "-", "fA", "-", "F", "]", "{", "1", "6", "}", "wc?" ]
0e448fac752b4fc7bfef6b220ed1c64a490c29c0
https://github.com/jryans/jless/blob/0e448fac752b4fc7bfef6b220ed1c64a490c29c0/src/main/java/com/bazaarvoice/jless/parser/Parser.java#L884-L890
test
Unicode - > Unicode
Of course, here is the Java code you requested: ```java Rule Unicode() { return Sequence( '\\', Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex(), Optional(Hex()))))), Optional(Whitespace()) ); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/TimeLimitDaemon.java
TimeLimitDaemon.valueWasAccessed
public void valueWasAccessed(DCache cache, Object id, long expirationTime, int inactivity) { valueHasChanged(cache, id, expirationTime, inactivity); }
java
public void valueWasAccessed(DCache cache, Object id, long expirationTime, int inactivity) { valueHasChanged(cache, id, expirationTime, inactivity); }
[ "public", "void", "valueWasAccessed", "(", "DCache", "cache", ",", "Object", "id", ",", "long", "expirationTime", ",", "int", "inactivity", ")", "{", "valueHasChanged", "(", "cache", ",", "id", ",", "expirationTime", ",", "inactivity", ")", ";", "}" ]
CPF-Inactivity - cache check inactivity > 0 before calling this method.
[ "CPF", "-", "Inactivity", "-", "cache", "check", "inactivity", ">", "0", "before", "calling", "this", "method", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/TimeLimitDaemon.java#L298-L300
train
Called when an entry has been accessed.
Of course, here is the Java code you requested: ```java public void valueWasAccessed(DCache cache, Object id, long expirationTime, int inactivity) { valueHasChanged(cache, id, expirationTime, inactivity); } ``` Hope this helps!
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/util/GeneratorMap.java
GeneratorMap.get
public T get(Object term) { // Check that an index vector does not already exist. T v = termToItem.get(term); if (v == null) { synchronized (this) { // Confirm that some other thread has not created an index // vector for this term. v =...
java
public T get(Object term) { // Check that an index vector does not already exist. T v = termToItem.get(term); if (v == null) { synchronized (this) { // Confirm that some other thread has not created an index // vector for this term. v =...
[ "public", "T", "get", "(", "Object", "term", ")", "{", "// Check that an index vector does not already exist.", "T", "v", "=", "termToItem", ".", "get", "(", "term", ")", ";", "if", "(", "v", "==", "null", ")", "{", "synchronized", "(", "this", ")", "{", ...
Returns a {@code T} for the given term, if no mapping for {@code term} then a new vaue is generated, stored, and returned. @param term The term specifying the item to return. @return A generated item corresponding to {@code term}.
[ "Returns", "a", "{", "@code", "T", "}", "for", "the", "given", "term", "if", "no", "mapping", "for", "{", "@code", "term", "}", "then", "a", "new", "vaue", "is", "generated", "stored", "and", "returned", "." ]
a608102737dfd3d59038a9ead33fe60356bc6029
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/GeneratorMap.java#L115-L131
train
Get the index vector for the given term.
Of course, here is the Java code you requested: ```java public T get(Object term) { // Check that an index vector does not already exist. T v = termToItem.get(term); if (v == null) { synchronized (this) { // Confirm that some other thread has not created an index ...
jbossws/jbossws-common
src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java
ReflectionUtils.assertOneParameter
public static void assertOneParameter(final Method method, Class<? extends Annotation> annotation) { if (method.getParameterTypes().length != 1) { throw annotation == null ? MESSAGES.methodHasToDeclareExactlyOneParameter(method) : MESSAGES.methodHasToDeclareExactlyOneParameter2(method, annotatio...
java
public static void assertOneParameter(final Method method, Class<? extends Annotation> annotation) { if (method.getParameterTypes().length != 1) { throw annotation == null ? MESSAGES.methodHasToDeclareExactlyOneParameter(method) : MESSAGES.methodHasToDeclareExactlyOneParameter2(method, annotatio...
[ "public", "static", "void", "assertOneParameter", "(", "final", "Method", "method", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotation", ")", "{", "if", "(", "method", ".", "getParameterTypes", "(", ")", ".", "length", "!=", "1", ")", "{", ...
Asserts method have exactly one parameter. @param method to validate @param annotation annotation to propagate in exception message
[ "Asserts", "method", "have", "exactly", "one", "parameter", "." ]
fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7
https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java#L277-L283
train
Assert method has exactly one parameter.
Of course, here is the Java code you requested: ```java public static void assertOneParameter(final Method method, Class<? extends Annotation> annotation) { if (method.getParameterTypes().length != 1) { throw annotation == null ? MESSAGES.methodHasToDeclareExactlyOneParameter(method) : MESSAGES...
rhuss/jolokia
agent/jmx/src/main/java/org/jolokia/jmx/MBeanServerProxy.java
MBeanServerProxy.registerMBean
public ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { return delegate.registerMBean(object, name); }
java
public ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { return delegate.registerMBean(object, name); }
[ "public", "ObjectInstance", "registerMBean", "(", "Object", "object", ",", "ObjectName", "name", ")", "throws", "InstanceAlreadyExistsException", ",", "MBeanRegistrationException", ",", "NotCompliantMBeanException", "{", "return", "delegate", ".", "registerMBean", "(", "o...
{@inheritDoc}
[ "{" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/MBeanServerProxy.java#L61-L63
train
Register an MBean with the MBeanManager.
Of course, here is the Java code you requested: ```java public ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { return delegate.registerMBean(object, name); } ``` Hope this helps!
tango-controls/JTango
common/src/main/java/fr/esrf/TangoApi/Group/Group.java
Group.get_size_i
private int get_size_i(final boolean fwd) { int size = 0; final Iterator it = elements.iterator(); while (it.hasNext()) { final GroupElement e = (GroupElement) it.next(); if (e instanceof GroupDeviceElement || fwd) { size += e.get_size(true); } } return size; }
java
private int get_size_i(final boolean fwd) { int size = 0; final Iterator it = elements.iterator(); while (it.hasNext()) { final GroupElement e = (GroupElement) it.next(); if (e instanceof GroupDeviceElement || fwd) { size += e.get_size(true); } } return size; }
[ "private", "int", "get_size_i", "(", "final", "boolean", "fwd", ")", "{", "int", "size", "=", "0", ";", "final", "Iterator", "it", "=", "elements", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "final", "Gr...
Returns the group's size - internal impl
[ "Returns", "the", "group", "s", "size", "-", "internal", "impl" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/common/src/main/java/fr/esrf/TangoApi/Group/Group.java#L440-L450
train
Get the number of elements in the group.
Of course, here is the Java code you requested: ```java private int get_size_i(final boolean fwd) { int size = 0; final Iterator it = elements.iterator(); while (it.hasNext()) { final GroupElement e = (GroupElement) it.next(); if (e instanceof GroupDeviceElement || fwd) { size += e.get_size(true); ...
loldevs/riotapi
rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java
ThrottledApiHandler.getMatch
public Future<MatchDetail> getMatch(long matchId, boolean includeTimeline) { return new ApiFuture<>(() -> handler.getMatch(matchId, includeTimeline)); }
java
public Future<MatchDetail> getMatch(long matchId, boolean includeTimeline) { return new ApiFuture<>(() -> handler.getMatch(matchId, includeTimeline)); }
[ "public", "Future", "<", "MatchDetail", ">", "getMatch", "(", "long", "matchId", ",", "boolean", "includeTimeline", ")", "{", "return", "new", "ApiFuture", "<>", "(", "(", ")", "->", "handler", ".", "getMatch", "(", "matchId", ",", "includeTimeline", ")", ...
Retrieves the specified match. @param matchId The id of the match. @param includeTimeline Whether or not the event timeline should be retrieved. @return The match details. @see <a href="https://developer.riotgames.com/api/methods#!/806/2848">Official API Documentation</a>
[ "Retrieves", "the", "specified", "match", "." ]
0b8aac407aa5289845f249024f9732332855544f
https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L976-L978
train
Get a match by id
Of course, here is the Java code you requested: ```java public Future<MatchDetail> getMatch(long matchId, boolean includeTimeline) { return new ApiFuture<>(() -> handler.getMatch(matchId, includeTimeline)); } ``` Hope this helps!
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/EDMImpl.java
EDMImpl.eIsSet
@Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.EDM__DM_NAME: return DM_NAME_EDEFAULT == null ? dmName != null : !DM_NAME_EDEFAULT.equals(dmName); } return super.eIsSet(featureID); }
java
@Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.EDM__DM_NAME: return DM_NAME_EDEFAULT == null ? dmName != null : !DM_NAME_EDEFAULT.equals(dmName); } return super.eIsSet(featureID); }
[ "@", "Override", "public", "boolean", "eIsSet", "(", "int", "featureID", ")", "{", "switch", "(", "featureID", ")", "{", "case", "AfplibPackage", ".", "EDM__DM_NAME", ":", "return", "DM_NAME_EDEFAULT", "==", "null", "?", "dmName", "!=", "null", ":", "!", "...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/EDMImpl.java#L139-L146
train
Replies if the feature is set to a value.
Of course, here is the Java code you requested: ```java @Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.EDM__DM_NAME: return DM_NAME_EDEFAULT == null ? dmName != null : !DM_NAME_EDEFAULT.equals(dmName); } return super.eIsSet(featureID); } ``` Hope this helps!
gallandarakhneorg/afc
core/vmutils/src/main/java/org/arakhne/afc/vmutil/ColorNames.java
ColorNames.getColorNameFromValue
@Pure public static String getColorNameFromValue(int colorValue) { for (final Entry<String, Integer> entry : COLOR_MATCHES.entrySet()) { final int knownValue = entry.getValue().intValue(); if (colorValue == knownValue) { return entry.getKey(); } } return null; }
java
@Pure public static String getColorNameFromValue(int colorValue) { for (final Entry<String, Integer> entry : COLOR_MATCHES.entrySet()) { final int knownValue = entry.getValue().intValue(); if (colorValue == knownValue) { return entry.getKey(); } } return null; }
[ "@", "Pure", "public", "static", "String", "getColorNameFromValue", "(", "int", "colorValue", ")", "{", "for", "(", "final", "Entry", "<", "String", ",", "Integer", ">", "entry", ":", "COLOR_MATCHES", ".", "entrySet", "(", ")", ")", "{", "final", "int", ...
Replies the color name for the given color value. <p>See the documentation of the {@link #ColorNames} type for obtaining a list of the colors. @param colorValue the color value. @return the color name, or {@code null} if the value does not correspond to an known color.
[ "Replies", "the", "color", "name", "for", "the", "given", "color", "value", "." ]
0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/ColorNames.java#L569-L578
train
Gets the color name from the color value.
Of course, here is the Java code you requested: ```java @Pure public static String getColorNameFromValue(int colorValue) { for (final Entry<String, Integer> entry : COLOR_MATCHES.entrySet()) { final int knownValue = entry.getValue().intValue(); if (colorValue == knownValue) { return entry.getKey(); } ...
ludovicianul/selenium-on-steroids
src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java
WebDriverHelper.scrollContinuously
public void scrollContinuously(final int numberOfSeconds) { for (int i = 0; i < numberOfSeconds; i += 2) { ((JavascriptExecutor) driver) .executeScript("window.scrollBy(0,250);"); try { Thread.sleep(SECONDS_TO_SLEEP); } catch (InterruptedException e) { LOG.info("Error while scrolling!"); } ...
java
public void scrollContinuously(final int numberOfSeconds) { for (int i = 0; i < numberOfSeconds; i += 2) { ((JavascriptExecutor) driver) .executeScript("window.scrollBy(0,250);"); try { Thread.sleep(SECONDS_TO_SLEEP); } catch (InterruptedException e) { LOG.info("Error while scrolling!"); } ...
[ "public", "void", "scrollContinuously", "(", "final", "int", "numberOfSeconds", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfSeconds", ";", "i", "+=", "2", ")", "{", "(", "(", "JavascriptExecutor", ")", "driver", ")", ".", "execu...
This method will scroll the page by 250 pixels every 2 seconds for as long as {@code numberOfSeconds}. @param numberOfSeconds the duration in seconds to scroll
[ "This", "method", "will", "scroll", "the", "page", "by", "250", "pixels", "every", "2", "seconds", "for", "as", "long", "as", "{", "@code", "numberOfSeconds", "}", "." ]
f89d91c59f686114f94624bfc55712f278005bfa
https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L213-L223
train
Scroll continuously.
Of course, here is the Java code you requested: ```java public void scrollContinuously(final int numberOfSeconds) { for (int i = 0; i < numberOfSeconds; i += 2) { ((JavascriptExecutor) driver) .executeScript("window.scrollBy(0,250);"); try { Thread.sleep(SECONDS_TO_SLEEP); } catch (InterruptedExcep...
leancloud/java-sdk-all
realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java
AVIMConversation.setAttributesForInit
void setAttributesForInit(Map<String, Object> attr) { this.attributes.clear(); if (attr != null) { this.attributes.putAll(attr); } }
java
void setAttributesForInit(Map<String, Object> attr) { this.attributes.clear(); if (attr != null) { this.attributes.putAll(attr); } }
[ "void", "setAttributesForInit", "(", "Map", "<", "String", ",", "Object", ">", "attr", ")", "{", "this", ".", "attributes", ".", "clear", "(", ")", ";", "if", "(", "attr", "!=", "null", ")", "{", "this", ".", "attributes", ".", "putAll", "(", "attr",...
设置当前聊天对话的属性,仅用于初始化时 因为 attr 涉及到本地缓存,所以初始化时与主动调用 setAttributes 行为不同 @param attr
[ "设置当前聊天对话的属性,仅用于初始化时", "因为", "attr", "涉及到本地缓存,所以初始化时与主动调用", "setAttributes", "行为不同" ]
323f8e7ee38051b1350790e5192304768c5c9f5f
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java#L384-L389
train
Sets the attributes for the init.
Of course, here is the Java code you requested: ```java void setAttributesForInit(Map<String, Object> attr) { this.attributes.clear(); if (attr != null) { this.attributes.putAll(attr); } } ``` Hope this helps!
spotify/apollo
apollo-route/src/main/java/com/spotify/apollo/route/Rule.java
Rule.fromUri
public static <T> Rule<T> fromUri(final String uri, final List<String> methods, final T target) { return new Rule<>(uri, methods, target); }
java
public static <T> Rule<T> fromUri(final String uri, final List<String> methods, final T target) { return new Rule<>(uri, methods, target); }
[ "public", "static", "<", "T", ">", "Rule", "<", "T", ">", "fromUri", "(", "final", "String", "uri", ",", "final", "List", "<", "String", ">", "methods", ",", "final", "T", "target", ")", "{", "return", "new", "Rule", "<>", "(", "uri", ",", "methods...
Create a new rule.
[ "Create", "a", "new", "rule", "." ]
3aba09840538a2aff9cdac5be42cc114dd276c70
https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-route/src/main/java/com/spotify/apollo/route/Rule.java#L98-L100
train
Create a rule from a URI.
Of course, here is the Java code you requested: ```java public static <T> Rule<T> fromUri(final String uri, final List<String> methods, final T target) { return new Rule<>(uri, methods, target); } ``` Hope this helps!
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java
RecommendationsInner.getRuleDetailsByWebAppWithServiceResponseAsync
public Observable<ServiceResponse<RecommendationRuleInner>> getRuleDetailsByWebAppWithServiceResponseAsync(String resourceGroupName, String siteName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); ...
java
public Observable<ServiceResponse<RecommendationRuleInner>> getRuleDetailsByWebAppWithServiceResponseAsync(String resourceGroupName, String siteName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); ...
[ "public", "Observable", "<", "ServiceResponse", "<", "RecommendationRuleInner", ">", ">", "getRuleDetailsByWebAppWithServiceResponseAsync", "(", "String", "resourceGroupName", ",", "String", "siteName", ",", "String", "name", ")", "{", "if", "(", "resourceGroupName", "=...
Get a recommendation rule for an app. Get a recommendation rule for an app. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Name of the app. @param name Name of the recommendation. @throws IllegalArgumentException thrown if parameters fail the validation @return the o...
[ "Get", "a", "recommendation", "rule", "for", "an", "app", ".", "Get", "a", "recommendation", "rule", "for", "an", "app", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java#L1258-L1288
train
Get the details of a rule.
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<RecommendationRuleInner>> getRuleDetailsByWebAppWithServiceResponseAsync(String resourceGroupName, String siteName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter...
j-a-w-r/jawr
jawr-core/src/main/java/net/jawr/web/taglib/jsf/ImagePathTag.java
ImagePathTag.encodeBegin
@Override public void encodeBegin(FacesContext context) throws IOException { // Initialize attributes String src = (String) getAttributes().get("src"); // src is mandatory if (null == src) throw new IllegalStateException("The src attribute is mandatory for the Jawr image path tag. "); HttpServletReques...
java
@Override public void encodeBegin(FacesContext context) throws IOException { // Initialize attributes String src = (String) getAttributes().get("src"); // src is mandatory if (null == src) throw new IllegalStateException("The src attribute is mandatory for the Jawr image path tag. "); HttpServletReques...
[ "@", "Override", "public", "void", "encodeBegin", "(", "FacesContext", "context", ")", "throws", "IOException", "{", "// Initialize attributes", "String", "src", "=", "(", "String", ")", "getAttributes", "(", ")", ".", "get", "(", "\"src\"", ")", ";", "// src ...
/* (non-Javadoc) @see javax.faces.component.UIComponentBase#encodeBegin(javax.faces.context. FacesContext)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d
https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/taglib/jsf/ImagePathTag.java#L45-L67
train
Override encodeBegin to provide additional processing for the image path tag
Of course, here is the Java code you requested: ```java @Override public void encodeBegin(FacesContext context) throws IOException { // Initialize attributes String src = (String) getAttributes().get("src"); // src is mandatory if (null == src) throw new IllegalStateException("The src attribute is mandat...
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/MapTaskStatus.java
MapTaskStatus.calculateRate
private double calculateRate(long cumulative, long currentTime) { long timeSinceMapStart = 0; assert getPhase() == Phase.MAP : "MapTaskStatus not in map phase!"; long startTime = getStartTime(); timeSinceMapStart = currentTime - startTime; if (timeSinceMapStart <= 0) { LOG.error("Current time...
java
private double calculateRate(long cumulative, long currentTime) { long timeSinceMapStart = 0; assert getPhase() == Phase.MAP : "MapTaskStatus not in map phase!"; long startTime = getStartTime(); timeSinceMapStart = currentTime - startTime; if (timeSinceMapStart <= 0) { LOG.error("Current time...
[ "private", "double", "calculateRate", "(", "long", "cumulative", ",", "long", "currentTime", ")", "{", "long", "timeSinceMapStart", "=", "0", ";", "assert", "getPhase", "(", ")", "==", "Phase", ".", "MAP", ":", "\"MapTaskStatus not in map phase!\"", ";", "long",...
Helper function that calculate the rate, given the total so far and the current time @param cumulative @param currentTime @return
[ "Helper", "function", "that", "calculate", "the", "rate", "given", "the", "total", "so", "far", "and", "the", "current", "time" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/MapTaskStatus.java#L65-L78
train
Calculate the rate of a task based on the cumulative and current time.
Of course, here is the Java code you requested: ```java private double calculateRate(long cumulative, long currentTime) { long timeSinceMapStart = 0; assert getPhase() == Phase.MAP : "MapTaskStatus not in map phase!"; long startTime = getStartTime(); timeSinceMapStart = currentTime - startTime; if...
jboss/jboss-jstl-api_spec
src/main/java/org/apache/taglibs/standard/tag/common/sql/UpdateTagSupport.java
UpdateTagSupport.doStartTag
@Override public int doStartTag() throws JspException { try { conn = getConnection(); } catch (SQLException e) { throw new JspException(sql + ": " + e.getMessage(), e); } return EVAL_BODY_BUFFERED; }
java
@Override public int doStartTag() throws JspException { try { conn = getConnection(); } catch (SQLException e) { throw new JspException(sql + ": " + e.getMessage(), e); } return EVAL_BODY_BUFFERED; }
[ "@", "Override", "public", "int", "doStartTag", "(", ")", "throws", "JspException", "{", "try", "{", "conn", "=", "getConnection", "(", ")", ";", "}", "catch", "(", "SQLException", "e", ")", "{", "throw", "new", "JspException", "(", "sql", "+", "\": \"",...
Prepares for execution by setting the initial state, such as getting the <code>Connection</code>
[ "Prepares", "for", "execution", "by", "setting", "the", "initial", "state", "such", "as", "getting", "the", "<code", ">", "Connection<", "/", "code", ">" ]
4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c
https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/tag/common/sql/UpdateTagSupport.java#L113-L123
train
This method is called by the TagRenderer to start the page.
Of course, here is the Java code you requested: ```java @Override public int doStartTag() throws JspException { try { conn = getConnection(); } catch (SQLException e) { throw new JspException(sql + ": " + e.getMessage(), e); } return EVAL_BODY_BUFFERED; } ``` Hope this helps!
apache/incubator-gobblin
gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/hdfs/SimpleHadoopFilesystemConfigStoreFactory.java
SimpleHadoopFilesystemConfigStoreFactory.createConfigStore
@Override public SimpleHadoopFilesystemConfigStore createConfigStore(URI configKey) throws ConfigStoreCreationException { FileSystem fs = createFileSystem(configKey); URI physicalStoreRoot = getStoreRoot(fs, configKey); URI logicalStoreRoot = URI.create(getSchemePrefix() + physicalStoreRoot); return n...
java
@Override public SimpleHadoopFilesystemConfigStore createConfigStore(URI configKey) throws ConfigStoreCreationException { FileSystem fs = createFileSystem(configKey); URI physicalStoreRoot = getStoreRoot(fs, configKey); URI logicalStoreRoot = URI.create(getSchemePrefix() + physicalStoreRoot); return n...
[ "@", "Override", "public", "SimpleHadoopFilesystemConfigStore", "createConfigStore", "(", "URI", "configKey", ")", "throws", "ConfigStoreCreationException", "{", "FileSystem", "fs", "=", "createFileSystem", "(", "configKey", ")", ";", "URI", "physicalStoreRoot", "=", "g...
Creates a {@link SimpleHadoopFilesystemConfigStore} for the given {@link URI}. The {@link URI} specified should be the fully qualified path to the dataset in question. For example, {@code simple-hdfs://[authority]:[port][path-to-config-store][path-to-dataset]}. It is important to note that the path to the config store ...
[ "Creates", "a", "{", "@link", "SimpleHadoopFilesystemConfigStore", "}", "for", "the", "given", "{", "@link", "URI", "}", ".", "The", "{", "@link", "URI", "}", "specified", "should", "be", "the", "fully", "qualified", "path", "to", "the", "dataset", "in", "...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/hdfs/SimpleHadoopFilesystemConfigStoreFactory.java#L181-L187
train
Create a config store.
Of course, here is the Java code you requested: ```java @Override public SimpleHadoopFilesystemConfigStore createConfigStore(URI configKey) throws ConfigStoreCreationException { FileSystem fs = createFileSystem(configKey); URI physicalStoreRoot = getStoreRoot(fs, configKey); URI logicalStoreRoot = URI.cr...
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.getDeclaredInjectionTargets
Map<Class<?>, List<InjectionTarget>> getDeclaredInjectionTargets (List<InjectionBinding<?>> resolvedInjectionBindings) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "getDeclaredInjectionTargets"); ...
java
Map<Class<?>, List<InjectionTarget>> getDeclaredInjectionTargets (List<InjectionBinding<?>> resolvedInjectionBindings) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "getDeclaredInjectionTargets"); ...
[ "Map", "<", "Class", "<", "?", ">", ",", "List", "<", "InjectionTarget", ">", ">", "getDeclaredInjectionTargets", "(", "List", "<", "InjectionBinding", "<", "?", ">", ">", "resolvedInjectionBindings", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceCompo...
d719917
[ "d719917" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L617-L670
train
Gets the declared injection targets on a per - class basis.
Of course, here is the Java code you requested: ```java Map<Class<?>, List<InjectionTarget>> getDeclaredInjectionTargets (List<InjectionBinding<?>> resolvedInjectionBindings) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) ...
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/AbstractReasonerState.java
AbstractReasonerState.isInconsistent
public synchronized boolean isInconsistent() throws ElkException { restoreConsistencyCheck(); if (!consistencyCheckingState.isInconsistent()) { incompleteness_.log(incompleteness_ .getIncompletenessMonitorForClassification()); } return consistencyCheckingState.isInconsistent(); }
java
public synchronized boolean isInconsistent() throws ElkException { restoreConsistencyCheck(); if (!consistencyCheckingState.isInconsistent()) { incompleteness_.log(incompleteness_ .getIncompletenessMonitorForClassification()); } return consistencyCheckingState.isInconsistent(); }
[ "public", "synchronized", "boolean", "isInconsistent", "(", ")", "throws", "ElkException", "{", "restoreConsistencyCheck", "(", ")", ";", "if", "(", "!", "consistencyCheckingState", ".", "isInconsistent", "(", ")", ")", "{", "incompleteness_", ".", "log", "(", "...
Check consistency of the current ontology, if this has not been done yet. @return {@code true} if the ontology is inconsistent, that is, unsatisfiable. @throws ElkException if the reasoning process cannot be completed successfully
[ "Check", "consistency", "of", "the", "current", "ontology", "if", "this", "has", "not", "been", "done", "yet", "." ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/AbstractReasonerState.java#L486-L495
test
Returns true if the data structure is inconsistent.
Of course, here is the Java code you requested: ```java public synchronized boolean isInconsistent() throws ElkException { restoreConsistencyCheck(); if (!consistencyCheckingState.isInconsistent()) { incompleteness_.log(incompleteness_ .getIncompletenessMonitorForClassification()); } return consisten...
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.getEntry
private CmsFavoriteEntry getEntry(Component row) { if (row instanceof CmsFavInfo) { return ((CmsFavInfo)row).getEntry(); } return null; }
java
private CmsFavoriteEntry getEntry(Component row) { if (row instanceof CmsFavInfo) { return ((CmsFavInfo)row).getEntry(); } return null; }
[ "private", "CmsFavoriteEntry", "getEntry", "(", "Component", "row", ")", "{", "if", "(", "row", "instanceof", "CmsFavInfo", ")", "{", "return", "(", "(", "CmsFavInfo", ")", "row", ")", ".", "getEntry", "(", ")", ";", "}", "return", "null", ";", "}" ]
Gets the favorite entry for a given row. @param row the widget used to display the favorite @return the favorite entry for the widget
[ "Gets", "the", "favorite", "entry", "for", "a", "given", "row", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L357-L366
train
Gets the entry for a given row.
Of course, here is the Java code you requested: ```java private CmsFavoriteEntry getEntry(Component row) { if (row instanceof CmsFavInfo) { return ((CmsFavInfo)row).getEntry(); } return null; } ``` Hope this helps!
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/LongHashPartition.java
LongHashPartition.get
public MatchIterator get(long key, int hashCode) { int bucket = hashCode & numBucketsMask; int bucketOffset = bucket << 4; MemorySegment segment = buckets[bucketOffset >>> segmentSizeBits]; int segOffset = bucketOffset & segmentSizeMask; while (true) { long address = segment.getLong(segOffset + 8); if...
java
public MatchIterator get(long key, int hashCode) { int bucket = hashCode & numBucketsMask; int bucketOffset = bucket << 4; MemorySegment segment = buckets[bucketOffset >>> segmentSizeBits]; int segOffset = bucketOffset & segmentSizeMask; while (true) { long address = segment.getLong(segOffset + 8); if...
[ "public", "MatchIterator", "get", "(", "long", "key", ",", "int", "hashCode", ")", "{", "int", "bucket", "=", "hashCode", "&", "numBucketsMask", ";", "int", "bucketOffset", "=", "bucket", "<<", "4", ";", "MemorySegment", "segment", "=", "buckets", "[", "bu...
Returns an iterator for all the values for the given key, or null if no value found.
[ "Returns", "an", "iterator", "for", "all", "the", "values", "for", "the", "given", "key", "or", "null", "if", "no", "value", "found", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/LongHashPartition.java#L255-L281
train
Returns the iterator for the given key and hashCode.
Of course, here is the Java code you requested: ```java public MatchIterator get(long key, int hashCode) { int bucket = hashCode & numBucketsMask; int bucketOffset = bucket << 4; MemorySegment segment = buckets[bucketOffset >>> segmentSizeBits]; int segOffset = bucketOffset & segmentSizeMask; while (true) ...
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java
BitcoinSerializer.makeInventoryMessage
@Override public InventoryMessage makeInventoryMessage(byte[] payloadBytes, int length) throws ProtocolException { return new InventoryMessage(params, payloadBytes, this, length); }
java
@Override public InventoryMessage makeInventoryMessage(byte[] payloadBytes, int length) throws ProtocolException { return new InventoryMessage(params, payloadBytes, this, length); }
[ "@", "Override", "public", "InventoryMessage", "makeInventoryMessage", "(", "byte", "[", "]", "payloadBytes", ",", "int", "length", ")", "throws", "ProtocolException", "{", "return", "new", "InventoryMessage", "(", "params", ",", "payloadBytes", ",", "this", ",", ...
Make an inventory message from the payload. Extension point for alternative serialization format support.
[ "Make", "an", "inventory", "message", "from", "the", "payload", ".", "Extension", "point", "for", "alternative", "serialization", "format", "support", "." ]
9cf13d29315014ed59cf4fc5944e5f227e8df9a6
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java#L299-L302
train
Create an instance of the NFM Inventory Message class.
Of course, here is the Java code you requested: ```java @Override public InventoryMessage makeInventoryMessage(byte[] payloadBytes, int length) throws ProtocolException { return new InventoryMessage(params, payloadBytes, this, length); } ``` Hope this helps!