repo
stringlengths
7
59
path
stringlengths
3
222
func_name
stringlengths
3
127
original_string
stringlengths
0
466k
language
stringclasses
1 value
code
stringlengths
0
466k
code_tokens
listlengths
0
68.3k
docstring
stringlengths
0
21.3k
docstring_tokens
listlengths
0
1.93k
sha
stringlengths
0
40
url
stringlengths
0
339
partition
stringclasses
3 values
summary
stringlengths
0
250
instruction
stringlengths
38
3.13k
input
stringclasses
1 value
output
stringlengths
146
466k
BBN-E/bue-common-open
common-core-open/src/main/java/com/bbn/bue/common/strings/offsets/OffsetGroup.java
OffsetGroup.fromMatchingCharAndEDT
public static OffsetGroup fromMatchingCharAndEDT(int offset) { return from(CharOffset.asCharOffset(offset), EDTOffset.asEDTOffset(offset)); }
java
public static OffsetGroup fromMatchingCharAndEDT(int offset) { return from(CharOffset.asCharOffset(offset), EDTOffset.asEDTOffset(offset)); }
[ "public", "static", "OffsetGroup", "fromMatchingCharAndEDT", "(", "int", "offset", ")", "{", "return", "from", "(", "CharOffset", ".", "asCharOffset", "(", "offset", ")", ",", "EDTOffset", ".", "asEDTOffset", "(", "offset", ")", ")", ";", "}" ]
Creates an offset group using the same offset value as both the {@link com.bbn.bue.common.strings.offsets.CharOffset} and {@link com.bbn.bue.common.strings.offsets.EDTOffset}. This is for unit testing purposes and probably shouldn't be used in other code.
[ "Creates", "an", "offset", "group", "using", "the", "same", "offset", "value", "as", "both", "the", "{" ]
d618652674d647867306e2e4b987a21b7c29c015
https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/strings/offsets/OffsetGroup.java#L32-L34
train
Creates an offset group from a matching char and EDT offset.
Create a Java method that does the following: "Creates an offset group from a matching char and EDT offset.".
Of course, here is the Java code you requested: ```java public static OffsetGroup fromMatchingCharAndEDT(int offset) { return from(CharOffset.asCharOffset(offset), EDTOffset.asEDTOffset(offset)); } ``` Hope this helps!
RestComm/jain-slee
container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/ChildRelationImpl.java
ChildRelationImpl.remove
public boolean remove(Object object) { sleeContainer.getTransactionManager().mandateTransaction(); if(logger.isDebugEnabled()) { logger.debug("removing sbb local object " + object); } if (object == null) throw new NullPointerException("Null arg for ...
java
public boolean remove(Object object) { sleeContainer.getTransactionManager().mandateTransaction(); if(logger.isDebugEnabled()) { logger.debug("removing sbb local object " + object); } if (object == null) throw new NullPointerException("Null arg for ...
[ "public", "boolean", "remove", "(", "Object", "object", ")", "{", "sleeContainer", ".", "getTransactionManager", "(", ")", ".", "mandateTransaction", "(", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "("...
Spec page 62 The remove methods: clear, remove, removeAll, and retainAll. o These methods may remove SBB entities from the child relation. The input argument specifies which SBB entities will be removed from the child relation or retained in the child relation by specifying the SBB local object or collection of SBB loc...
[ "Spec", "page", "62", "The", "remove", "methods", ":", "clear", "remove", "removeAll", "and", "retainAll", ".", "o", "These", "methods", "may", "remove", "SBB", "entities", "from", "the", "child", "relation", ".", "The", "input", "argument", "specifies", "wh...
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/ChildRelationImpl.java#L236-L258
test
Removes the specified SbbLocalObject from the SbbLocalObjectImpl.
Create a Java method that does the following: "Removes the specified SbbLocalObject from the SbbLocalObjectImpl.".
Of course, here is the Java code you requested: ```java public boolean remove(Object object) { sleeContainer.getTransactionManager().mandateTransaction(); if(logger.isDebugEnabled()) { logger.debug("removing sbb local object " + object); } if (object == null) ...
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/JMXRESTProxyServlet.java
JMXRESTProxyServlet.service
@Override protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { // Setup service - will handle getAndSetRESTHandlerContainer(request); // Request reached here meaning web.xml mapped the URL to us handleWi...
java
@Override protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { // Setup service - will handle getAndSetRESTHandlerContainer(request); // Request reached here meaning web.xml mapped the URL to us handleWi...
[ "@", "Override", "protected", "void", "service", "(", "final", "HttpServletRequest", "request", ",", "final", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "// Setup service - will handle ", "getAndSetRESTHandlerContainer", "...
{@inheritDoc}
[ "{" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/JMXRESTProxyServlet.java#L37-L44
train
Override service to handle the LOGIN_USER_INFO request.
Create a Java method that does the following: "Override service to handle the LOGIN_USER_INFO request.".
Of course, here is the Java code you requested: ```java @Override protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { // Setup service - will handle getAndSetRESTHandlerContainer(request); // Request reached h...
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.updatePomProperty
public static boolean updatePomProperty(Properties properties, String name, Object value, boolean updated) { if (value != null) { Object oldValue = properties.get(name); if (!Objects.equal(oldValue, value)) { getLOG().debug("Updating pom.xml property: " + name + " to " + ...
java
public static boolean updatePomProperty(Properties properties, String name, Object value, boolean updated) { if (value != null) { Object oldValue = properties.get(name); if (!Objects.equal(oldValue, value)) { getLOG().debug("Updating pom.xml property: " + name + " to " + ...
[ "public", "static", "boolean", "updatePomProperty", "(", "Properties", "properties", ",", "String", "name", ",", "Object", "value", ",", "boolean", "updated", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "Object", "oldValue", "=", "properties", ".",...
Updates the given maven property value if value is not null and returns true if the pom has been changed @return true if the value changed and was non null or updated was true
[ "Updates", "the", "given", "maven", "property", "value", "if", "value", "is", "not", "null", "and", "returns", "true", "if", "the", "pom", "has", "been", "changed" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L261-L272
train
Update the specified pom property.
Create a Java method that does the following: "Update the specified pom property.".
Of course, here is the Java code you requested: ```java public static boolean updatePomProperty(Properties properties, String name, Object value, boolean updated) { if (value != null) { Object oldValue = properties.get(name); if (!Objects.equal(oldValue, value)) { getLOG...
dustin/java-memcached-client
src/main/java/net/spy/memcached/MemcachedConnection.java
MemcachedConnection.logRunException
private void logRunException(final Exception e) { if (shutDown) { getLogger().debug("Exception occurred during shutdown", e); } else { getLogger().warn("Problem handling memcached IO", e); } }
java
private void logRunException(final Exception e) { if (shutDown) { getLogger().debug("Exception occurred during shutdown", e); } else { getLogger().warn("Problem handling memcached IO", e); } }
[ "private", "void", "logRunException", "(", "final", "Exception", "e", ")", "{", "if", "(", "shutDown", ")", "{", "getLogger", "(", ")", ".", "debug", "(", "\"Exception occurred during shutdown\"", ",", "e", ")", ";", "}", "else", "{", "getLogger", "(", ")"...
Log a exception to different levels depending on the state. Exceptions get logged at debug level when happening during shutdown, but at warning level when operating normally. @param e the exception to log.
[ "Log", "a", "exception", "to", "different", "levels", "depending", "on", "the", "state", "." ]
c232307ad8e0c7ccc926e495dd7d5aad2d713318
https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedConnection.java#L1484-L1490
train
Logs an exception during memcached IO.
Create a Java method that does the following: "Logs an exception during memcached IO.".
Of course, here is the Java code you requested: ```java private void logRunException(final Exception e) { if (shutDown) { getLogger().debug("Exception occurred during shutdown", e); } else { getLogger().warn("Problem handling memcached IO", e); } } ``` Hope this helps!
igniterealtime/Smack
smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java
OXInstantMessagingManager.addOxMessage
public OpenPgpMetadata addOxMessage(Message message, OpenPgpContact contact, List<ExtensionElement> payload) throws SmackException.NotLoggedInException, PGPException, IOException { return addOxMessage(message, Collections.singleton(contact), payload); }
java
public OpenPgpMetadata addOxMessage(Message message, OpenPgpContact contact, List<ExtensionElement> payload) throws SmackException.NotLoggedInException, PGPException, IOException { return addOxMessage(message, Collections.singleton(contact), payload); }
[ "public", "OpenPgpMetadata", "addOxMessage", "(", "Message", "message", ",", "OpenPgpContact", "contact", ",", "List", "<", "ExtensionElement", ">", "payload", ")", "throws", "SmackException", ".", "NotLoggedInException", ",", "PGPException", ",", "IOException", "{", ...
Add an OX-IM message element to a message. @param message message @param contact recipient of the message @param payload payload which will be encrypted and signed @return {@link OpenPgpMetadata} about the messages encryption + metadata. @throws SmackException.NotLoggedInException in case we are not logged in @throw...
[ "Add", "an", "OX", "-", "IM", "message", "element", "to", "a", "message", "." ]
870756997faec1e1bfabfac0cd6c2395b04da873
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java#L253-L256
train
Add an OX message to the OpenPGP metadata.
Create a Java method that does the following: "Add an OX message to the OpenPGP metadata.".
Of course, here is the Java code you requested: ```java public OpenPgpMetadata addOxMessage(Message message, OpenPgpContact contact, List<ExtensionElement> payload) throws SmackException.NotLoggedInException, PGPException, IOException { return addOxMessage(message, Collections.singleton(contact), p...
flow/math
target/generated-sources/template/com/flowpowered/math/GenericMath.java
GenericMath.castDouble
public static Double castDouble(Object o) { if (o == null) { return null; } if (o instanceof Number) { return ((Number) o).doubleValue(); } try { return Double.valueOf(o.toString()); } catch (NumberFormatException e) { retur...
java
public static Double castDouble(Object o) { if (o == null) { return null; } if (o instanceof Number) { return ((Number) o).doubleValue(); } try { return Double.valueOf(o.toString()); } catch (NumberFormatException e) { retur...
[ "public", "static", "Double", "castDouble", "(", "Object", "o", ")", "{", "if", "(", "o", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "o", "instanceof", "Number", ")", "{", "return", "(", "(", "Number", ")", "o", ")", ".", "dou...
Casts a value to a double. May return null. @param o The object to attempt to cast @return The object as a double
[ "Casts", "a", "value", "to", "a", "double", ".", "May", "return", "null", "." ]
12c1a809720aced976ed22de34fb1457d8eda78f
https://github.com/flow/math/blob/12c1a809720aced976ed22de34fb1457d8eda78f/target/generated-sources/template/com/flowpowered/math/GenericMath.java#L652-L664
valid
Cast a Double object to a Double.
Create a Java method that does the following: "Cast a Double object to a Double.".
Of course, here is the Java code you requested: ```java public static Double castDouble(Object o) { if (o == null) { return null; } if (o instanceof Number) { return ((Number) o).doubleValue(); } try { return Double.valueOf(o.toString()); ...
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java
ServerRedirectService.addServerRedirect
public int addServerRedirect(String region, String srcUrl, String destUrl, String hostHeader, int profileId, int groupId) throws Exception { int serverId = -1; PreparedStatement statement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { ...
java
public int addServerRedirect(String region, String srcUrl, String destUrl, String hostHeader, int profileId, int groupId) throws Exception { int serverId = -1; PreparedStatement statement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { ...
[ "public", "int", "addServerRedirect", "(", "String", "region", ",", "String", "srcUrl", ",", "String", "destUrl", ",", "String", "hostHeader", ",", "int", "profileId", ",", "int", "groupId", ")", "throws", "Exception", "{", "int", "serverId", "=", "-", "1", ...
Add server redirect to a profile @param region region @param srcUrl source URL @param destUrl destination URL @param hostHeader host header @param profileId profile ID @param groupId group ID @return ID of added ServerRedirect @throws Exception exception
[ "Add", "server", "redirect", "to", "a", "profile" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L307-L355
train
Add a server redirect to a region
Create a Java method that does the following: "Add a server redirect to a region".
Of course, here is the Java code you requested: ```java public int addServerRedirect(String region, String srcUrl, String destUrl, String hostHeader, int profileId, int groupId) throws Exception { int serverId = -1; PreparedStatement statement = null; ResultSet results = null; try (Con...
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java
BytecodeUtils.classFromAsmType
public static Class<?> classFromAsmType(Type type) { Optional<Class<?>> maybeClass = objectTypeToClassCache.getUnchecked(type); if (!maybeClass.isPresent()) { throw new IllegalArgumentException("Could not load: " + type); } return maybeClass.get(); }
java
public static Class<?> classFromAsmType(Type type) { Optional<Class<?>> maybeClass = objectTypeToClassCache.getUnchecked(type); if (!maybeClass.isPresent()) { throw new IllegalArgumentException("Could not load: " + type); } return maybeClass.get(); }
[ "public", "static", "Class", "<", "?", ">", "classFromAsmType", "(", "Type", "type", ")", "{", "Optional", "<", "Class", "<", "?", ">", ">", "maybeClass", "=", "objectTypeToClassCache", ".", "getUnchecked", "(", "type", ")", ";", "if", "(", "!", "maybeCl...
Returns the runtime class represented by the given type. @throws IllegalArgumentException if the class cannot be found. It is expected that this method will only be called for types that have a runtime on the compilers classpath.
[ "Returns", "the", "runtime", "class", "represented", "by", "the", "given", "type", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L220-L226
train
Get the Class object from the type.
Create a Java method that does the following: "Get the Class object from the type.".
Of course, here is the Java code you requested: ```java public static Class<?> classFromAsmType(Type type) { Optional<Class<?>> maybeClass = objectTypeToClassCache.getUnchecked(type); if (!maybeClass.isPresent()) { throw new IllegalArgumentException("Could not load: " + type); } return maybeClass...
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableConnection.java
AbstractBigtableConnection.getBufferedMutator
@Override public BufferedMutator getBufferedMutator(BufferedMutatorParams params) throws IOException { TableName tableName = params.getTableName(); if (tableName == null) { throw new IllegalArgumentException("TableName cannot be null."); } final long id = SEQUENCE_GENERATOR.incrementAndGet(); ...
java
@Override public BufferedMutator getBufferedMutator(BufferedMutatorParams params) throws IOException { TableName tableName = params.getTableName(); if (tableName == null) { throw new IllegalArgumentException("TableName cannot be null."); } final long id = SEQUENCE_GENERATOR.incrementAndGet(); ...
[ "@", "Override", "public", "BufferedMutator", "getBufferedMutator", "(", "BufferedMutatorParams", "params", ")", "throws", "IOException", "{", "TableName", "tableName", "=", "params", ".", "getTableName", "(", ")", ";", "if", "(", "tableName", "==", "null", ")", ...
{@inheritDoc}
[ "{" ]
53543f36e4d6f9ed1963640d91a35be2a2047656
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableConnection.java#L163-L187
train
Get a buffered mutator.
Create a Java method that does the following: "Get a buffered mutator.".
Of course, here is the Java code you requested: ```java @Override public BufferedMutator getBufferedMutator(BufferedMutatorParams params) throws IOException { TableName tableName = params.getTableName(); if (tableName == null) { throw new IllegalArgumentException("TableName cannot be null."); } ...
greenhalolabs/EmailAutoCompleteTextView
emailautocompletetextview/src/main/java/com/greenhalolabs/emailautocompletetextview/util/AccountUtil.java
AccountUtil.isEmail
private static boolean isEmail(String account) { if (TextUtils.isEmpty(account)) { return false; } final Pattern emailPattern = Patterns.EMAIL_ADDRESS; final Matcher matcher = emailPattern.matcher(account); return matcher.matches(); }
java
private static boolean isEmail(String account) { if (TextUtils.isEmpty(account)) { return false; } final Pattern emailPattern = Patterns.EMAIL_ADDRESS; final Matcher matcher = emailPattern.matcher(account); return matcher.matches(); }
[ "private", "static", "boolean", "isEmail", "(", "String", "account", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "account", ")", ")", "{", "return", "false", ";", "}", "final", "Pattern", "emailPattern", "=", "Patterns", ".", "EMAIL_ADDRESS", ";...
Returns true if the given string is an email.
[ "Returns", "true", "if", "the", "given", "string", "is", "an", "email", "." ]
f2be63be328198f763fc0c73a7eeabcb75b571ca
https://github.com/greenhalolabs/EmailAutoCompleteTextView/blob/f2be63be328198f763fc0c73a7eeabcb75b571ca/emailautocompletetextview/src/main/java/com/greenhalolabs/emailautocompletetextview/util/AccountUtil.java#L53-L62
train
Check if the given string is an email address.
Create a Java method that does the following: "Check if the given string is an email address.".
Of course, here is the Java code you requested: ```java private static boolean isEmail(String account) { if (TextUtils.isEmpty(account)) { return false; } final Pattern emailPattern = Patterns.EMAIL_ADDRESS; final Matcher matcher = emailPattern.matcher(account); re...
fracpete/multisearch-weka-package
src/main/java/weka/core/setupgenerator/ListSpaceDimension.java
ListSpaceDimension.getValue
public Object getValue(int x) { if (x >= width()) throw new IllegalArgumentException("Index out of scope on axis (" + x + " >= " + width() + ")!"); return m_List[(int) m_Min + x]; }
java
public Object getValue(int x) { if (x >= width()) throw new IllegalArgumentException("Index out of scope on axis (" + x + " >= " + width() + ")!"); return m_List[(int) m_Min + x]; }
[ "public", "Object", "getValue", "(", "int", "x", ")", "{", "if", "(", "x", ">=", "width", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Index out of scope on axis (\"", "+", "x", "+", "\" >= \"", "+", "width", "(", ")", "+", "\")!\"", ...
returns the value at the given point in the dimension. @param x the x-th point on the axis @return the value at the given position
[ "returns", "the", "value", "at", "the", "given", "point", "in", "the", "dimension", "." ]
756fcf343e7cc9fd3844c99a0e1e828368f393d0
https://github.com/fracpete/multisearch-weka-package/blob/756fcf343e7cc9fd3844c99a0e1e828368f393d0/src/main/java/weka/core/setupgenerator/ListSpaceDimension.java#L116-L121
train
Get the value at the specified axis.
Create a Java method that does the following: "Get the value at the specified axis.".
Of course, here is the Java code you requested: ```java public Object getValue(int x) { if (x >= width()) throw new IllegalArgumentException("Index out of scope on axis (" + x + " >= " + width() + ")!"); return m_List[(int) m_Min + x]; } ``` Hope this helps!
MenoData/Time4J
base/src/main/java/net/time4j/calendar/astro/SolarTime.java
SolarTime.equationOfTime
public static double equationOfTime( Moment moment, String calculator ) { if (calculator == null) { throw new NullPointerException("Missing calculator parameter."); } else if (CALCULATORS.containsKey(calculator)) { double jde = JulianDay.getValue(moment, Time...
java
public static double equationOfTime( Moment moment, String calculator ) { if (calculator == null) { throw new NullPointerException("Missing calculator parameter."); } else if (CALCULATORS.containsKey(calculator)) { double jde = JulianDay.getValue(moment, Time...
[ "public", "static", "double", "equationOfTime", "(", "Moment", "moment", ",", "String", "calculator", ")", "{", "if", "(", "calculator", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Missing calculator parameter.\"", ")", ";", "}", "els...
/*[deutsch] <p>Bestimmt die Differenz zwischen wahrer und mittlerer Sonnenzeit zum angegebenen Zeitpunkt. </p> <p>Siehe auch <a href="https://de.wikipedia.org/wiki/Zeitgleichung">Wikipedia</a>. </p> <p>Relation: mittlere Sonnenzeit + Zeitgleichung = wahre Sonnenzeit</p> @param moment the moment when to determ...
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Bestimmt", "die", "Differenz", "zwischen", "wahrer", "und", "mittlerer", "Sonnenzeit", "zum", "angegebenen", "Zeitpunkt", ".", "<", "/", "p", ">" ]
08b2eda6b2dbb140b92011cf7071bb087edd46a5
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/astro/SolarTime.java#L1049-L1063
train
Gets the equation of time.
Create a Java method that does the following: "Gets the equation of time.".
Of course, here is the Java code you requested: ```java public static double equationOfTime( Moment moment, String calculator ) { if (calculator == null) { throw new NullPointerException("Missing calculator parameter."); } else if (CALCULATORS.containsKey(calculator)) {...
apache/reef
lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java
YarnContainerManager.onContainersAllocated
@Override public void onContainersAllocated(final List<Container> allocatedContainers) { String id = null; // ID is used for logging only if (LOG.isLoggable(Level.FINE)) { id = String.format("%s:%d", Thread.currentThread().getName().replace(' ', '_'), System.currentTimeMillis()); LOG.log(Level...
java
@Override public void onContainersAllocated(final List<Container> allocatedContainers) { String id = null; // ID is used for logging only if (LOG.isLoggable(Level.FINE)) { id = String.format("%s:%d", Thread.currentThread().getName().replace(' ', '_'), System.currentTimeMillis()); LOG.log(Level...
[ "@", "Override", "public", "void", "onContainersAllocated", "(", "final", "List", "<", "Container", ">", "allocatedContainers", ")", "{", "String", "id", "=", "null", ";", "// ID is used for logging only", "if", "(", "LOG", ".", "isLoggable", "(", "Level", ".", ...
RM Callback: RM reports that some containers have been allocated. @param allocatedContainers list of containers newly allocated by RM.
[ "RM", "Callback", ":", "RM", "reports", "that", "some", "containers", "have", "been", "allocated", "." ]
e2c47121cde21108a602c560cf76565a40d0e916
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java#L151-L169
train
Handle the Containers allocated.
Create a Java method that does the following: "Handle the Containers allocated.".
Of course, here is the Java code you requested: ```java @Override public void onContainersAllocated(final List<Container> allocatedContainers) { String id = null; // ID is used for logging only if (LOG.isLoggable(Level.FINE)) { id = String.format("%s:%d", Thread.currentThread().getName().replace(' '...
apache/groovy
src/main/java/org/codehaus/groovy/control/CompilationUnit.java
CompilationUnit.iterator
public Iterator<SourceUnit> iterator() { return new Iterator<SourceUnit>() { Iterator<String> nameIterator = names.iterator(); public boolean hasNext() { return nameIterator.hasNext(); } public SourceUnit next() { String name = na...
java
public Iterator<SourceUnit> iterator() { return new Iterator<SourceUnit>() { Iterator<String> nameIterator = names.iterator(); public boolean hasNext() { return nameIterator.hasNext(); } public SourceUnit next() { String name = na...
[ "public", "Iterator", "<", "SourceUnit", ">", "iterator", "(", ")", "{", "return", "new", "Iterator", "<", "SourceUnit", ">", "(", ")", "{", "Iterator", "<", "String", ">", "nameIterator", "=", "names", ".", "iterator", "(", ")", ";", "public", "boolean"...
Returns an iterator on the unit's SourceUnits.
[ "Returns", "an", "iterator", "on", "the", "unit", "s", "SourceUnits", "." ]
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilationUnit.java#L496-L513
train
Returns an iterator over the sources in this source set.
Create a Java method that does the following: "Returns an iterator over the sources in this source set.".
Of course, here is the Java code you requested: ```java public Iterator<SourceUnit> iterator() { return new Iterator<SourceUnit>() { Iterator<String> nameIterator = names.iterator(); public boolean hasNext() { return nameIterator.hasNext(); } pu...
googleads/googleads-java-lib
modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201902/LineItemSummary.java
LineItemSummary.setDeliveryForecastSource
public void setDeliveryForecastSource(com.google.api.ads.admanager.axis.v201902.DeliveryForecastSource deliveryForecastSource) { this.deliveryForecastSource = deliveryForecastSource; }
java
public void setDeliveryForecastSource(com.google.api.ads.admanager.axis.v201902.DeliveryForecastSource deliveryForecastSource) { this.deliveryForecastSource = deliveryForecastSource; }
[ "public", "void", "setDeliveryForecastSource", "(", "com", ".", "google", ".", "api", ".", "ads", ".", "admanager", ".", "axis", ".", "v201902", ".", "DeliveryForecastSource", "deliveryForecastSource", ")", "{", "this", ".", "deliveryForecastSource", "=", "deliver...
Sets the deliveryForecastSource value for this LineItemSummary. @param deliveryForecastSource * Strategy for choosing forecasted traffic shapes to pace line items. This field is optional and defaults to {@link DeliveryForecastSource#HISTORICAL}.
[ "Sets", "the", "deliveryForecastSource", "value", "for", "this", "LineItemSummary", "." ]
967957cc4f6076514e3a7926fe653e4f1f7cc9c9
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201902/LineItemSummary.java#L1083-L1085
train
Sets the deliveryForecastSource value for this BaseProductSegment.
Create a Java method that does the following: "Sets the deliveryForecastSource value for this BaseProductSegment.".
Of course, here is the Java code you requested: ```java public void setDeliveryForecastSource(com.google.api.ads.admanager.axis.v201902.DeliveryForecastSource deliveryForecastSource) { this.deliveryForecastSource = deliveryForecastSource; } ``` Hope this helps!
real-logic/agrona
agrona/src/main/java/org/agrona/collections/IntArrayList.java
IntArrayList.toIntArray
public int[] toIntArray(final int[] dst) { if (dst.length == size) { System.arraycopy(elements, 0, dst, 0, dst.length); return dst; } else { return Arrays.copyOf(elements, size); } }
java
public int[] toIntArray(final int[] dst) { if (dst.length == size) { System.arraycopy(elements, 0, dst, 0, dst.length); return dst; } else { return Arrays.copyOf(elements, size); } }
[ "public", "int", "[", "]", "toIntArray", "(", "final", "int", "[", "]", "dst", ")", "{", "if", "(", "dst", ".", "length", "==", "size", ")", "{", "System", ".", "arraycopy", "(", "elements", ",", "0", ",", "dst", ",", "0", ",", "dst", ".", "len...
Create a new array that is a copy of the elements. @param dst destination array for the copy if it is the correct size. @return a copy of the elements.
[ "Create", "a", "new", "array", "that", "is", "a", "copy", "of", "the", "elements", "." ]
d1ea76e6e3598cd6a0d34879687652ef123f639b
https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/collections/IntArrayList.java#L444-L455
train
To int array.
Create a Java method that does the following: "To int array.".
Of course, here is the Java code you requested: ```java public int[] toIntArray(final int[] dst) { if (dst.length == size) { System.arraycopy(elements, 0, dst, 0, dst.length); return dst; } else { return Arrays.copyOf(elements, size); ...
Bedework/bw-util
bw-util-misc/src/main/java/org/bedework/util/misc/Util.java
Util.buildPath
public static String buildPath(final boolean endWithSep, final String... val) { StringBuilder path = new StringBuilder(); for (String s: val) { if (s != null) { path.append(s); } } String s = path.toString().replaceAll("/+", "/"); if (endWithS...
java
public static String buildPath(final boolean endWithSep, final String... val) { StringBuilder path = new StringBuilder(); for (String s: val) { if (s != null) { path.append(s); } } String s = path.toString().replaceAll("/+", "/"); if (endWithS...
[ "public", "static", "String", "buildPath", "(", "final", "boolean", "endWithSep", ",", "final", "String", "...", "val", ")", "{", "StringBuilder", "path", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "String", "s", ":", "val", ")", "{", "if", ...
Build a path out of the given elements. Any parameter may be a path element or a path separator. Note this only allows "/" as the separator. <p>The path is constrained to either end or not end with the path separator. The path will be adjusted according to the constraint @param endWithSep @param val - list of element...
[ "Build", "a", "path", "out", "of", "the", "given", "elements", ".", "Any", "parameter", "may", "be", "a", "path", "element", "or", "a", "path", "separator", ".", "Note", "this", "only", "allows", "/", "as", "the", "separator", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-misc/src/main/java/org/bedework/util/misc/Util.java#L126-L147
train
Build a path from a list of strings.
Create a Java method that does the following: "Build a path from a list of strings.".
Of course, here is the Java code you requested: ```java public static String buildPath(final boolean endWithSep, final String... val) { StringBuilder path = new StringBuilder(); for (String s: val) { if (s != null) { path.append(s); } } String s = ...
aws/aws-sdk-java
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageResponse.java
SendUsersMessageResponse.withResult
public SendUsersMessageResponse withResult(java.util.Map<String, java.util.Map<String, EndpointMessageResult>> result) { setResult(result); return this; }
java
public SendUsersMessageResponse withResult(java.util.Map<String, java.util.Map<String, EndpointMessageResult>> result) { setResult(result); return this; }
[ "public", "SendUsersMessageResponse", "withResult", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "java", ".", "util", ".", "Map", "<", "String", ",", "EndpointMessageResult", ">", ">", "result", ")", "{", "setResult", "(", "result", ")", ";", ...
An object that shows the endpoints that were messaged for each user. The object provides a list of user IDs. For each user ID, it provides the endpoint IDs that were messaged. For each endpoint ID, it provides an EndpointMessageResult object. @param result An object that shows the endpoints that were messaged for each...
[ "An", "object", "that", "shows", "the", "endpoints", "that", "were", "messaged", "for", "each", "user", ".", "The", "object", "provides", "a", "list", "of", "user", "IDs", ".", "For", "each", "user", "ID", "it", "provides", "the", "endpoint", "IDs", "tha...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageResponse.java#L149-L152
train
Sets the result map for the CDNA user.
Create a Java method that does the following: "Sets the result map for the CDNA user.".
Of course, here is the Java code you requested: ```java public SendUsersMessageResponse withResult(java.util.Map<String, java.util.Map<String, EndpointMessageResult>> result) { setResult(result); return this; } ``` Hope this helps!
jqm4gwt/jqm4gwt
plugins/datatables/src/main/java/com/sksamuel/jqm4gwt/plugins/datatables/JQMDataTable.java
JQMDataTable.setDfltTableStylesStr
public void setDfltTableStylesStr(String classes) { dfltTableStyles.clear(); if (classes == null || classes.isEmpty()) return; List<String> lst = StrUtils.split(classes, " "); for (int k = 0; k < lst.size(); k++) { String s = lst.get(k).trim(); DataTableStyleClass...
java
public void setDfltTableStylesStr(String classes) { dfltTableStyles.clear(); if (classes == null || classes.isEmpty()) return; List<String> lst = StrUtils.split(classes, " "); for (int k = 0; k < lst.size(); k++) { String s = lst.get(k).trim(); DataTableStyleClass...
[ "public", "void", "setDfltTableStylesStr", "(", "String", "classes", ")", "{", "dfltTableStyles", ".", "clear", "(", ")", ";", "if", "(", "classes", "==", "null", "||", "classes", ".", "isEmpty", "(", ")", ")", "return", ";", "List", "<", "String", ">", ...
Expected DataTableStyleClass enum values as space separated string.
[ "Expected", "DataTableStyleClass", "enum", "values", "as", "space", "separated", "string", "." ]
cf59958e9ba6d4b70f42507b2c77f10c2465085b
https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/plugins/datatables/src/main/java/com/sksamuel/jqm4gwt/plugins/datatables/JQMDataTable.java#L624-L638
train
setDfltTableStylesStr This method sets the dfltTableStyles attribute from a string.
Create a Java method that does the following: "setDfltTableStylesStr This method sets the dfltTableStyles attribute from a string.".
Of course, here is the Java code you requested: ```java public void setDfltTableStylesStr(String classes) { dfltTableStyles.clear(); if (classes == null || classes.isEmpty()) return; List<String> lst = StrUtils.split(classes, " "); for (int k = 0; k < lst.size(); k++) { Stri...
NessComputing/syslog4j
src/main/java/com/nesscomputing/syslog4j/Syslog.java
Syslog.createInstance
public static SyslogIF createInstance(String protocol, SyslogConfigIF config) throws SyslogRuntimeException { Preconditions.checkArgument(!StringUtils.isBlank(protocol), "Instance protocol cannot be null or empty"); Preconditions.checkArgument(config != null, "SyslogConfig cannot be null"); ...
java
public static SyslogIF createInstance(String protocol, SyslogConfigIF config) throws SyslogRuntimeException { Preconditions.checkArgument(!StringUtils.isBlank(protocol), "Instance protocol cannot be null or empty"); Preconditions.checkArgument(config != null, "SyslogConfig cannot be null"); ...
[ "public", "static", "SyslogIF", "createInstance", "(", "String", "protocol", ",", "SyslogConfigIF", "config", ")", "throws", "SyslogRuntimeException", "{", "Preconditions", ".", "checkArgument", "(", "!", "StringUtils", ".", "isBlank", "(", "protocol", ")", ",", "...
Use createInstance(protocol,config) to create your own Syslog instance. <p>First, create an implementation of SyslogConfigIF, such as UdpNetSyslogConfig.</p> <p>Second, configure that configuration instance.</p> <p>Third, call createInstance(protocol,config) using a short &amp; simple String for the protocol argumen...
[ "Use", "createInstance", "(", "protocol", "config", ")", "to", "create", "your", "own", "Syslog", "instance", "." ]
698fe4ce926cfc46524329d089052507cdb8cba4
https://github.com/NessComputing/syslog4j/blob/698fe4ce926cfc46524329d089052507cdb8cba4/src/main/java/com/nesscomputing/syslog4j/Syslog.java#L126-L173
train
Creates a new instance of the Syslog class with the specified protocol and configuration.
Create a Java method that does the following: "Creates a new instance of the Syslog class with the specified protocol and configuration.".
Of course, here is the Java code you requested: ```java public static SyslogIF createInstance(String protocol, SyslogConfigIF config) throws SyslogRuntimeException { Preconditions.checkArgument(!StringUtils.isBlank(protocol), "Instance protocol cannot be null or empty"); Preconditions.checkArgum...
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/DbEntityManager.java
DbEntityManager.deletePreserveOrder
public DbBulkOperation deletePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter) { return performBulkOperationPreserveOrder(entityType, statement, parameter, DELETE_BULK); }
java
public DbBulkOperation deletePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter) { return performBulkOperationPreserveOrder(entityType, statement, parameter, DELETE_BULK); }
[ "public", "DbBulkOperation", "deletePreserveOrder", "(", "Class", "<", "?", "extends", "DbEntity", ">", "entityType", ",", "String", "statement", ",", "Object", "parameter", ")", "{", "return", "performBulkOperationPreserveOrder", "(", "entityType", ",", "statement", ...
Several delete operations added by this method will be executed preserving the order of method calls, no matter what entity type they refer to. They will though be executed after all "not-bulk" operations (e.g. {@link DbEntityManager#insert(DbEntity)} or {@link DbEntityManager#merge(DbEntity)}) and after those deletes ...
[ "Several", "delete", "operations", "added", "by", "this", "method", "will", "be", "executed", "preserving", "the", "order", "of", "method", "calls", "no", "matter", "what", "entity", "type", "they", "refer", "to", ".", "They", "will", "though", "be", "execut...
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/DbEntityManager.java#L637-L639
train
Delete the entity in the database using the specified parameters.
Create a Java method that does the following: "Delete the entity in the database using the specified parameters.".
Of course, here is the Java code you requested: ```java public DbBulkOperation deletePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter) { return performBulkOperationPreserveOrder(entityType, statement, parameter, DELETE_BULK); } ``` Hope this helps!
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java
TimeZoneFormat.parseAsciiOffsetFields
private static int parseAsciiOffsetFields(String text, ParsePosition pos, char sep, OffsetFields minFields, OffsetFields maxFields) { int start = pos.getIndex(); int[] fieldVal = {0, 0, 0}; int[] fieldLen = {0, -1, -1}; for (int idx = start, fieldIdx = 0; idx < text.length() ...
java
private static int parseAsciiOffsetFields(String text, ParsePosition pos, char sep, OffsetFields minFields, OffsetFields maxFields) { int start = pos.getIndex(); int[] fieldVal = {0, 0, 0}; int[] fieldLen = {0, -1, -1}; for (int idx = start, fieldIdx = 0; idx < text.length() ...
[ "private", "static", "int", "parseAsciiOffsetFields", "(", "String", "text", ",", "ParsePosition", "pos", ",", "char", "sep", ",", "OffsetFields", "minFields", ",", "OffsetFields", "maxFields", ")", "{", "int", "start", "=", "pos", ".", "getIndex", "(", ")", ...
Parses offset represented by ASCII digits and separators. <p> Note: This method expects the input position is already at the start of ASCII digits and does not parse sign (+/-). @param text The text @param pos The parse position @param sep The separator character @param minFields The minimum Fields to be parsed @param...
[ "Parses", "offset", "represented", "by", "ASCII", "digits", "and", "separators", ".", "<p", ">", "Note", ":", "This", "method", "expects", "the", "input", "position", "is", "already", "at", "the", "start", "of", "ASCII", "digits", "and", "does", "not", "pa...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L2838-L2920
train
Parse ASCII offset fields.
Create a Java method that does the following: "Parse ASCII offset fields.".
Of course, here is the Java code you requested: ```java private static int parseAsciiOffsetFields(String text, ParsePosition pos, char sep, OffsetFields minFields, OffsetFields maxFields) { int start = pos.getIndex(); int[] fieldVal = {0, 0, 0}; int[] fieldLen = {0, -1, -1}; ...
apache/incubator-shardingsphere
sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/api/MasterSlaveDataSourceFactory.java
MasterSlaveDataSourceFactory.createDataSource
public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig, final Properties props) throws SQLException { return new MasterSlaveDataSource(dataSourceMap, masterSlaveRuleConfig, props); }
java
public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig, final Properties props) throws SQLException { return new MasterSlaveDataSource(dataSourceMap, masterSlaveRuleConfig, props); }
[ "public", "static", "DataSource", "createDataSource", "(", "final", "Map", "<", "String", ",", "DataSource", ">", "dataSourceMap", ",", "final", "MasterSlaveRuleConfiguration", "masterSlaveRuleConfig", ",", "final", "Properties", "props", ")", "throws", "SQLException", ...
Create master-slave data source. @param dataSourceMap data source map @param masterSlaveRuleConfig master-slave rule configuration @param props props @return master-slave data source @throws SQLException SQL exception
[ "Create", "master", "-", "slave", "data", "source", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/api/MasterSlaveDataSourceFactory.java#L48-L50
train
Create a DataSource.
Create a Java method that does the following: "Create a DataSource.".
Of course, here is the Java code you requested: ```java public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final MasterSlaveRuleConfiguration masterSlaveRuleConfig, final Properties props) throws SQLException { return new MasterSlaveDataSource(dataSourceMap, masterSlaveRuleC...
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/HeapCompactOrderedSketch.java
HeapCompactOrderedSketch.compact
static CompactSketch compact(final UpdateSketch sketch) { final int curCount = sketch.getRetainedEntries(true); long thetaLong = sketch.getThetaLong(); boolean empty = sketch.isEmpty(); thetaLong = thetaOnCompact(empty, curCount, thetaLong); empty = emptyOnCompact(curCount, thetaLong); final sho...
java
static CompactSketch compact(final UpdateSketch sketch) { final int curCount = sketch.getRetainedEntries(true); long thetaLong = sketch.getThetaLong(); boolean empty = sketch.isEmpty(); thetaLong = thetaOnCompact(empty, curCount, thetaLong); empty = emptyOnCompact(curCount, thetaLong); final sho...
[ "static", "CompactSketch", "compact", "(", "final", "UpdateSketch", "sketch", ")", "{", "final", "int", "curCount", "=", "sketch", ".", "getRetainedEntries", "(", "true", ")", ";", "long", "thetaLong", "=", "sketch", ".", "getThetaLong", "(", ")", ";", "bool...
Converts the given UpdateSketch to this compact form. @param sketch the given UpdateSketch @return a CompactSketch
[ "Converts", "the", "given", "UpdateSketch", "to", "this", "compact", "form", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/HeapCompactOrderedSketch.java#L79-L93
train
Compact a UpdateSketch.
Create a Java method that does the following: "Compact a UpdateSketch.".
Of course, here is the Java code you requested: ```java static CompactSketch compact(final UpdateSketch sketch) { final int curCount = sketch.getRetainedEntries(true); long thetaLong = sketch.getThetaLong(); boolean empty = sketch.isEmpty(); thetaLong = thetaOnCompact(empty, curCount, thetaLong); e...
aws/aws-sdk-java
aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/model/transform/ModifyReplicationInstanceRequestMarshaller.java
ModifyReplicationInstanceRequestMarshaller.marshall
public void marshall(ModifyReplicationInstanceRequest modifyReplicationInstanceRequest, ProtocolMarshaller protocolMarshaller) { if (modifyReplicationInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMar...
java
public void marshall(ModifyReplicationInstanceRequest modifyReplicationInstanceRequest, ProtocolMarshaller protocolMarshaller) { if (modifyReplicationInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMar...
[ "public", "void", "marshall", "(", "ModifyReplicationInstanceRequest", "modifyReplicationInstanceRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "modifyReplicationInstanceRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", ...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/model/transform/ModifyReplicationInstanceRequestMarshaller.java#L63-L84
train
marshalls the given ModifyReplicationInstanceRequest to the JSON file.
Create a Java method that does the following: "marshalls the given ModifyReplicationInstanceRequest to the JSON file.".
Of course, here is the Java code you requested: ```java public void marshall(ModifyReplicationInstanceRequest modifyReplicationInstanceRequest, ProtocolMarshaller protocolMarshaller) { if (modifyReplicationInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall...
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java
LayoutParser.endElement
@Override public void endElement(String namespaceURI, String sName, String qName) throws SAXException { if (! isParsing) { return; } currentNode = currentNode.parent; isParsing = ! qName.equals(currentRoot); }
java
@Override public void endElement(String namespaceURI, String sName, String qName) throws SAXException { if (! isParsing) { return; } currentNode = currentNode.parent; isParsing = ! qName.equals(currentRoot); }
[ "@", "Override", "public", "void", "endElement", "(", "String", "namespaceURI", ",", "String", "sName", ",", "String", "qName", ")", "throws", "SAXException", "{", "if", "(", "!", "isParsing", ")", "{", "return", ";", "}", "currentNode", "=", "currentNode", ...
{@inheritDoc}
[ "{" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/LayoutParser.java#L126-L134
train
EndElement Method.
Create a Java method that does the following: "EndElement Method.".
Of course, here is the Java code you requested: ```java @Override public void endElement(String namespaceURI, String sName, String qName) throws SAXException { if (! isParsing) { return; } currentNode = currentNode.parent; isParsing = ! qName.equals(currentRoot); ...
ltearno/hexa.tools
hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriodAssociative.java
CalendarPeriodAssociative._Combine
private List<PeriodAssociative<T>> _Combine( List<PeriodAssociative<T>> periods1, List<PeriodAssociative<T>> periods2 ) { List<PeriodAssociative<T>> result = new ArrayList<PeriodAssociative<T>>(); int count1 = periods1.size(); int count2 = periods2.size(); int i = 0; int j = 0; while( i < count1 && j < c...
java
private List<PeriodAssociative<T>> _Combine( List<PeriodAssociative<T>> periods1, List<PeriodAssociative<T>> periods2 ) { List<PeriodAssociative<T>> result = new ArrayList<PeriodAssociative<T>>(); int count1 = periods1.size(); int count2 = periods2.size(); int i = 0; int j = 0; while( i < count1 && j < c...
[ "private", "List", "<", "PeriodAssociative", "<", "T", ">", ">", "_Combine", "(", "List", "<", "PeriodAssociative", "<", "T", ">", ">", "periods1", ",", "List", "<", "PeriodAssociative", "<", "T", ">", ">", "periods2", ")", "{", "List", "<", "PeriodAssoc...
combine two period arrays ordered by from date
[ "combine", "two", "period", "arrays", "ordered", "by", "from", "date" ]
604c804901b1bb13fe10b3823cc4a639f8993363
https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriodAssociative.java#L172-L206
train
Combine two period associatives.
Create a Java method that does the following: "Combine two period associatives.".
Of course, here is the Java code you requested: ```java private List<PeriodAssociative<T>> _Combine( List<PeriodAssociative<T>> periods1, List<PeriodAssociative<T>> periods2 ) { List<PeriodAssociative<T>> result = new ArrayList<PeriodAssociative<T>>(); int count1 = periods1.size(); int count2 = periods2.size()...
kiegroup/drools
drools-workbench-models/drools-workbench-models-guided-dtable/src/main/java/org/drools/workbench/models/guided/dtable/shared/model/GuidedDecisionTable52.java
GuidedDecisionTable52.getExpandedColumns
public List<BaseColumn> getExpandedColumns() { final List<BaseColumn> columns = new ArrayList<BaseColumn>(); columns.add(rowNumberCol); columns.add(descriptionCol); columns.addAll(metadataCols); columns.addAll(attributeCols); for (CompositeColumn<?> cc : this.conditionPat...
java
public List<BaseColumn> getExpandedColumns() { final List<BaseColumn> columns = new ArrayList<BaseColumn>(); columns.add(rowNumberCol); columns.add(descriptionCol); columns.addAll(metadataCols); columns.addAll(attributeCols); for (CompositeColumn<?> cc : this.conditionPat...
[ "public", "List", "<", "BaseColumn", ">", "getExpandedColumns", "(", ")", "{", "final", "List", "<", "BaseColumn", ">", "columns", "=", "new", "ArrayList", "<", "BaseColumn", ">", "(", ")", ";", "columns", ".", "add", "(", "rowNumberCol", ")", ";", "colu...
This method expands Composite columns into individual columns where knowledge of individual columns is necessary; for example separate columns in the user-interface or where individual columns need to be analysed. @return A List of individual columns
[ "This", "method", "expands", "Composite", "columns", "into", "individual", "columns", "where", "knowledge", "of", "individual", "columns", "is", "necessary", ";", "for", "example", "separate", "columns", "in", "the", "user", "-", "interface", "or", "where", "ind...
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-workbench-models/drools-workbench-models-guided-dtable/src/main/java/org/drools/workbench/models/guided/dtable/shared/model/GuidedDecisionTable52.java#L283-L314
train
Gets the expanded columns.
Create a Java method that does the following: "Gets the expanded columns.".
Of course, here is the Java code you requested: ```java public List<BaseColumn> getExpandedColumns() { final List<BaseColumn> columns = new ArrayList<BaseColumn>(); columns.add(rowNumberCol); columns.add(descriptionCol); columns.addAll(metadataCols); columns.addAll(attributeCols...
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsInner.java
ServiceEndpointPolicyDefinitionsInner.listByResourceGroupNextAsync
public Observable<Page<ServiceEndpointPolicyDefinitionInner>> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<ServiceEndpointPolicyDefinitionInner>>, Page<ServiceEndpointPolicyDefinitio...
java
public Observable<Page<ServiceEndpointPolicyDefinitionInner>> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<ServiceEndpointPolicyDefinitionInner>>, Page<ServiceEndpointPolicyDefinitio...
[ "public", "Observable", "<", "Page", "<", "ServiceEndpointPolicyDefinitionInner", ">", ">", "listByResourceGroupNextAsync", "(", "final", "String", "nextPageLink", ")", "{", "return", "listByResourceGroupNextWithServiceResponseAsync", "(", "nextPageLink", ")", ".", "map", ...
Gets all service endpoint policy definitions in a service end point policy. @param nextPageLink The NextLink from the previous successful call to List operation. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;ServiceEndpointPolicyDefinitionInner&gt;...
[ "Gets", "all", "service", "endpoint", "policy", "definitions", "in", "a", "service", "end", "point", "policy", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPolicyDefinitionsInner.java#L700-L708
train
Gets a list of service endpoint policy definitions.
Create a Java method that does the following: "Gets a list of service endpoint policy definitions.".
Of course, here is the Java code you requested: ```java public Observable<Page<ServiceEndpointPolicyDefinitionInner>> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<ServiceEndpointPol...
dbracewell/hermes
hermes-core/src/main/java/com/davidbracewell/hermes/Hermes.java
Hermes.loadModel
public static <T> T loadModel(@NonNull Object lock, @NonNull Language language, @NonNull String configProperty, @NonNull String modelName, @NonNull Supplier<T> modelGetter, @NonNull Consumer<T> modelSetter) { if (modelGetter.get() == null) { synchronized (lock) { if (modelGetter.get() == null...
java
public static <T> T loadModel(@NonNull Object lock, @NonNull Language language, @NonNull String configProperty, @NonNull String modelName, @NonNull Supplier<T> modelGetter, @NonNull Consumer<T> modelSetter) { if (modelGetter.get() == null) { synchronized (lock) { if (modelGetter.get() == null...
[ "public", "static", "<", "T", ">", "T", "loadModel", "(", "@", "NonNull", "Object", "lock", ",", "@", "NonNull", "Language", "language", ",", "@", "NonNull", "String", "configProperty", ",", "@", "NonNull", "String", "modelName", ",", "@", "NonNull", "Supp...
<p>Common method for loading a model using java deserialization. The method uses the double-checked locking where it synchronizes on the given <code>lock</code> object. The <code>modelGetter</code> is used to check if the model is already loaded and the <code>modelSetter</code> is used to set the model. </p> <p>The me...
[ "<p", ">", "Common", "method", "for", "loading", "a", "model", "using", "java", "deserialization", ".", "The", "method", "uses", "the", "double", "-", "checked", "locking", "where", "it", "synchronizes", "on", "the", "given", "<code", ">", "lock<", "/", "c...
9ebefe7ad5dea1b731ae6931a30771eb75325ea3
https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/Hermes.java#L218-L241
train
Load a model from a file.
Create a Java method that does the following: "Load a model from a file.".
Of course, here is the Java code you requested: ```java public static <T> T loadModel(@NonNull Object lock, @NonNull Language language, @NonNull String configProperty, @NonNull String modelName, @NonNull Supplier<T> modelGetter, @NonNull Consumer<T> modelSetter) { if (modelGetter.get() == null) { synchr...
aws/aws-sdk-java
aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/AWSGlueClient.java
AWSGlueClient.importCatalogToGlue
@Override public ImportCatalogToGlueResult importCatalogToGlue(ImportCatalogToGlueRequest request) { request = beforeClientExecution(request); return executeImportCatalogToGlue(request); }
java
@Override public ImportCatalogToGlueResult importCatalogToGlue(ImportCatalogToGlueRequest request) { request = beforeClientExecution(request); return executeImportCatalogToGlue(request); }
[ "@", "Override", "public", "ImportCatalogToGlueResult", "importCatalogToGlue", "(", "ImportCatalogToGlueRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeImportCatalogToGlue", "(", "request", ")", ";", "}...
<p> Imports an existing Athena Data Catalog to AWS Glue </p> @param importCatalogToGlueRequest @return Result of the ImportCatalogToGlue operation returned by the service. @throws InternalServiceException An internal service error occurred. @throws OperationTimeoutException The operation timed out. @sample AWSGlue.Imp...
[ "<p", ">", "Imports", "an", "existing", "Athena", "Data", "Catalog", "to", "AWS", "Glue", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/AWSGlueClient.java#L4501-L4505
train
Imports a CDN file from an existing AWS CloudDirectory catalog.
Create a Java method that does the following: "Imports a CDN file from an existing AWS CloudDirectory catalog.".
Of course, here is the Java code you requested: ```java @Override public ImportCatalogToGlueResult importCatalogToGlue(ImportCatalogToGlueRequest request) { request = beforeClientExecution(request); return executeImportCatalogToGlue(request); } ``` Hope this helps!
apache/spark
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java
SQLOperation.getConfigForOperation
private HiveConf getConfigForOperation() throws HiveSQLException { HiveConf sqlOperationConf = getParentSession().getHiveConf(); if (!getConfOverlay().isEmpty() || shouldRunAsync()) { // clone the parent session config for this query sqlOperationConf = new HiveConf(sqlOperationConf); // apply...
java
private HiveConf getConfigForOperation() throws HiveSQLException { HiveConf sqlOperationConf = getParentSession().getHiveConf(); if (!getConfOverlay().isEmpty() || shouldRunAsync()) { // clone the parent session config for this query sqlOperationConf = new HiveConf(sqlOperationConf); // apply...
[ "private", "HiveConf", "getConfigForOperation", "(", ")", "throws", "HiveSQLException", "{", "HiveConf", "sqlOperationConf", "=", "getParentSession", "(", ")", ".", "getHiveConf", "(", ")", ";", "if", "(", "!", "getConfOverlay", "(", ")", ".", "isEmpty", "(", ...
If there are query specific settings to overlay, then create a copy of config There are two cases we need to clone the session config that's being passed to hive driver 1. Async query - If the client changes a config setting, that shouldn't reflect in the execution already underway 2. confOverlay - The query specific s...
[ "If", "there", "are", "query", "specific", "settings", "to", "overlay", "then", "create", "a", "copy", "of", "config", "There", "are", "two", "cases", "we", "need", "to", "clone", "the", "session", "config", "that", "s", "being", "passed", "to", "hive", ...
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java#L443-L459
train
Get the config for this operation.
Create a Java method that does the following: "Get the config for this operation.".
Of course, here is the Java code you requested: ```java private HiveConf getConfigForOperation() throws HiveSQLException { HiveConf sqlOperationConf = getParentSession().getHiveConf(); if (!getConfOverlay().isEmpty() || shouldRunAsync()) { // clone the parent session config for this query sqlOperat...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java
Ifc2x3tc1PackageImpl.getIfcProjectedOrTrueLengthEnum
public EEnum getIfcProjectedOrTrueLengthEnum() { if (ifcProjectedOrTrueLengthEnumEEnum == null) { ifcProjectedOrTrueLengthEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(876); } return ifcProjectedOrTrueLengthEnumEEnum; }
java
public EEnum getIfcProjectedOrTrueLengthEnum() { if (ifcProjectedOrTrueLengthEnumEEnum == null) { ifcProjectedOrTrueLengthEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(876); } return ifcProjectedOrTrueLengthEnumEEnum; }
[ "public", "EEnum", "getIfcProjectedOrTrueLengthEnum", "(", ")", "{", "if", "(", "ifcProjectedOrTrueLengthEnumEEnum", "==", "null", ")", "{", "ifcProjectedOrTrueLengthEnumEEnum", "=", "(", "EEnum", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", ...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L37701-L37707
train
Get the IfcProjectedOrTrueLengthEnum attribute of the interface.
Create a Java method that does the following: "Get the IfcProjectedOrTrueLengthEnum attribute of the interface.".
Of course, here is the Java code you requested: ```java public EEnum getIfcProjectedOrTrueLengthEnum() { if (ifcProjectedOrTrueLengthEnumEEnum == null) { ifcProjectedOrTrueLengthEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(876); } return...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/storage/cache/chm/readbuffer/StripedBuffer.java
StripedBuffer.advanceProbe
private int advanceProbe(int probe) { probe ^= probe << 13; // xorshift probe ^= probe >>> 17; probe ^= probe << 5; this.probe.get().set(probe); return probe; }
java
private int advanceProbe(int probe) { probe ^= probe << 13; // xorshift probe ^= probe >>> 17; probe ^= probe << 5; this.probe.get().set(probe); return probe; }
[ "private", "int", "advanceProbe", "(", "int", "probe", ")", "{", "probe", "^=", "probe", "<<", "13", ";", "// xorshift", "probe", "^=", "probe", ">>>", "17", ";", "probe", "^=", "probe", "<<", "5", ";", "this", ".", "probe", ".", "get", "(", ")", "...
Pseudo-randomly advances and records the given probe value for the given thread.
[ "Pseudo", "-", "randomly", "advances", "and", "records", "the", "given", "probe", "value", "for", "the", "given", "thread", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/cache/chm/readbuffer/StripedBuffer.java#L135-L142
test
Advance the probe.
Create a Java method that does the following: "Advance the probe.".
Of course, here is the Java code you requested: ```java private int advanceProbe(int probe) { probe ^= probe << 13; // xorshift probe ^= probe >>> 17; probe ^= probe << 5; this.probe.get().set(probe); return probe; } ``` Hope this helps!
vakinge/jeesuite-libs
jeesuite-kafka/src/main/java/com/jeesuite/kafka/monitor/ZkConsumerCommand.java
ZkConsumerCommand.getConsumerClusterNodes
public List<String> getConsumerClusterNodes(String groupId){ String path = "/consumers/" + groupId + "/ids"; if(zkClient.exists(path)){ return zkClient.getChildren(path); } return new ArrayList<>(); }
java
public List<String> getConsumerClusterNodes(String groupId){ String path = "/consumers/" + groupId + "/ids"; if(zkClient.exists(path)){ return zkClient.getChildren(path); } return new ArrayList<>(); }
[ "public", "List", "<", "String", ">", "getConsumerClusterNodes", "(", "String", "groupId", ")", "{", "String", "path", "=", "\"/consumers/\"", "+", "groupId", "+", "\"/ids\"", ";", "if", "(", "zkClient", ".", "exists", "(", "path", ")", ")", "{", "return",...
}
[ "}" ]
c48fe2c7fbd294892cf4030dbec96e744dd3e386
https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-kafka/src/main/java/com/jeesuite/kafka/monitor/ZkConsumerCommand.java#L158-L164
train
Get the list of nodes in the cluster of the consumer with the given id.
Create a Java method that does the following: "Get the list of nodes in the cluster of the consumer with the given id.".
Of course, here is the Java code you requested: ```java public List<String> getConsumerClusterNodes(String groupId){ String path = "/consumers/" + groupId + "/ids"; if(zkClient.exists(path)){ return zkClient.getChildren(path); } return new ArrayList<>(); } ``` Hope this helps!
czyzby/gdx-lml
autumn/natives/gwt/src/main/java/com/github/czyzby/autumn/gwt/reflection/generator/ReflectionPoolGenerator.java
ReflectionPoolGenerator.findReflectedClasses
private Set<JType> findReflectedClasses(final GeneratorContext context, final TypeOracle typeOracle, final TreeLogger logger) throws UnableToCompleteException { final Set<JType> types = new HashSet<JType>(); final JPackage[] packages = typeOracle.getPackages(); // gather all ty...
java
private Set<JType> findReflectedClasses(final GeneratorContext context, final TypeOracle typeOracle, final TreeLogger logger) throws UnableToCompleteException { final Set<JType> types = new HashSet<JType>(); final JPackage[] packages = typeOracle.getPackages(); // gather all ty...
[ "private", "Set", "<", "JType", ">", "findReflectedClasses", "(", "final", "GeneratorContext", "context", ",", "final", "TypeOracle", "typeOracle", ",", "final", "TreeLogger", "logger", ")", "throws", "UnableToCompleteException", "{", "final", "Set", "<", "JType", ...
LibGDX code goes here. Slightly modified, refactored and without unnecessary operations.
[ "LibGDX", "code", "goes", "here", ".", "Slightly", "modified", "refactored", "and", "without", "unnecessary", "operations", "." ]
7623b322e6afe49ad4dd636c80c230150a1cfa4e
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/autumn/natives/gwt/src/main/java/com/github/czyzby/autumn/gwt/reflection/generator/ReflectionPoolGenerator.java#L78-L122
train
Find reflected classes.
Create a Java method that does the following: "Find reflected classes.".
Of course, here is the Java code you requested: ```java private Set<JType> findReflectedClasses(final GeneratorContext context, final TypeOracle typeOracle, final TreeLogger logger) throws UnableToCompleteException { final Set<JType> types = new HashSet<JType>(); final JPackage[] package...
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPConnLink.java
TCPConnLink.connectAsynch
public void connectAsynch(Object context) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "connectAsynch"); } this.syncObject = null; // reset proxy response object if (this.proxy != null) { this.proxy.setIsProxyResponse...
java
public void connectAsynch(Object context) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "connectAsynch"); } this.syncObject = null; // reset proxy response object if (this.proxy != null) { this.proxy.setIsProxyResponse...
[ "public", "void", "connectAsynch", "(", "Object", "context", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "tc", ",", "\"connectAsynch\"", ")", ...
/* @see com.ibm.wsspi.channelfw.OutboundConnectionLink#connectAsynch(java.lang. Object)
[ "/", "*" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/TCPConnLink.java#L172-L189
train
This method is called by the TCPConnectRequestContext when the connection is asynch.
Create a Java method that does the following: "This method is called by the TCPConnectRequestContext when the connection is asynch.".
Of course, here is the Java code you requested: ```java public void connectAsynch(Object context) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "connectAsynch"); } this.syncObject = null; // reset proxy response object if (this.p...
acromusashi/acromusashi-stream
src/main/java/acromusashi/stream/helper/SpringContextHelper.java
SpringContextHelper.getComponent
public <T> T getComponent(String componentName, Class<T> componentType) { BeanFactory factory = getBeanFactory(); T component = factory.getBean(componentName, componentType); return component; }
java
public <T> T getComponent(String componentName, Class<T> componentType) { BeanFactory factory = getBeanFactory(); T component = factory.getBean(componentName, componentType); return component; }
[ "public", "<", "T", ">", "T", "getComponent", "(", "String", "componentName", ",", "Class", "<", "T", ">", "componentType", ")", "{", "BeanFactory", "factory", "=", "getBeanFactory", "(", ")", ";", "T", "component", "=", "factory", ".", "getBean", "(", "...
アプリケーションコンテキストから指定した名称、型を持つコンポーネントを取得する。 @param componentName コンポーネント名称 @param componentType コンポーネント型 @param <T> 取得するコンポーネントの総称型パラメータ @return 取得コンポーネント
[ "アプリケーションコンテキストから指定した名称、型を持つコンポーネントを取得する。" ]
65b1f335d771d657c5640a2056ab5c8546eddec9
https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/helper/SpringContextHelper.java#L71-L76
train
Get a component from the bean factory.
Create a Java method that does the following: "Get a component from the bean factory.".
Of course, here is the Java code you requested: ```java public <T> T getComponent(String componentName, Class<T> componentType) { BeanFactory factory = getBeanFactory(); T component = factory.getBean(componentName, componentType); return component; } ``` Hope this helps!
JOML-CI/JOML
src/org/joml/Quaternionf.java
Quaternionf.fromAxisAngleDeg
public Quaternionf fromAxisAngleDeg(Vector3fc axis, float angle) { return fromAxisAngleRad(axis.x(), axis.y(), axis.z(), (float) Math.toRadians(angle)); }
java
public Quaternionf fromAxisAngleDeg(Vector3fc axis, float angle) { return fromAxisAngleRad(axis.x(), axis.y(), axis.z(), (float) Math.toRadians(angle)); }
[ "public", "Quaternionf", "fromAxisAngleDeg", "(", "Vector3fc", "axis", ",", "float", "angle", ")", "{", "return", "fromAxisAngleRad", "(", "axis", ".", "x", "(", ")", ",", "axis", ".", "y", "(", ")", ",", "axis", ".", "z", "(", ")", ",", "(", "float"...
Set this quaternion to be a representation of the supplied axis and angle (in degrees). @param axis the rotation axis @param angle the angle in degrees @return this
[ "Set", "this", "quaternion", "to", "be", "a", "representation", "of", "the", "supplied", "axis", "and", "angle", "(", "in", "degrees", ")", "." ]
ce2652fc236b42bda3875c591f8e6645048a678f
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaternionf.java#L920-L922
train
Create a rotation from the axis and angle.
Create a Java method that does the following: "Create a rotation from the axis and angle.".
Of course, here is the Java code you requested: ```java public Quaternionf fromAxisAngleDeg(Vector3fc axis, float angle) { return fromAxisAngleRad(axis.x(), axis.y(), axis.z(), (float) Math.toRadians(angle)); } ``` Hope this helps!
spring-projects/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTags.java
WebFluxTags.uri
public static Tag uri(ServerWebExchange exchange) { PathPattern pathPattern = exchange .getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); if (pathPattern != null) { return Tag.of("uri", pathPattern.getPatternString()); } HttpStatus status = exchange.getResponse().getStatusCode(); if (status...
java
public static Tag uri(ServerWebExchange exchange) { PathPattern pathPattern = exchange .getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); if (pathPattern != null) { return Tag.of("uri", pathPattern.getPatternString()); } HttpStatus status = exchange.getResponse().getStatusCode(); if (status...
[ "public", "static", "Tag", "uri", "(", "ServerWebExchange", "exchange", ")", "{", "PathPattern", "pathPattern", "=", "exchange", ".", "getAttribute", "(", "HandlerMapping", ".", "BEST_MATCHING_PATTERN_ATTRIBUTE", ")", ";", "if", "(", "pathPattern", "!=", "null", "...
Creates a {@code uri} tag based on the URI of the given {@code exchange}. Uses the {@link HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTE} best matching pattern if available. Falling back to {@code REDIRECTION} for 3xx responses, {@code NOT_FOUND} for 404 responses, {@code root} for requests with no path info, and {@cod...
[ "Creates", "a", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTags.java#L98-L118
train
Returns the URI of the request.
Create a Java method that does the following: "Returns the URI of the request.".
Of course, here is the Java code you requested: ```java public static Tag uri(ServerWebExchange exchange) { PathPattern pathPattern = exchange .getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); if (pathPattern != null) { return Tag.of("uri", pathPattern.getPatternString()); } HttpStatus stat...
apache/incubator-heron
heron/scheduler-core/src/java/org/apache/heron/scheduler/UpdateTopologyManager.java
UpdateTopologyManager.getTopology
@VisibleForTesting TopologyAPI.Topology getTopology(SchedulerStateManagerAdaptor stateManager, String topologyName) { return stateManager.getPhysicalPlan(topologyName).getTopology(); }
java
@VisibleForTesting TopologyAPI.Topology getTopology(SchedulerStateManagerAdaptor stateManager, String topologyName) { return stateManager.getPhysicalPlan(topologyName).getTopology(); }
[ "@", "VisibleForTesting", "TopologyAPI", ".", "Topology", "getTopology", "(", "SchedulerStateManagerAdaptor", "stateManager", ",", "String", "topologyName", ")", "{", "return", "stateManager", ".", "getPhysicalPlan", "(", "topologyName", ")", ".", "getTopology", "(", ...
Returns the topology. It's key that we get the topology from the physical plan to reflect any state changes since launch. The stateManager.getTopology(name) method returns the topology from the time of submission. See additional commentary in topology.proto and physical_plan.proto.
[ "Returns", "the", "topology", ".", "It", "s", "key", "that", "we", "get", "the", "topology", "from", "the", "physical", "plan", "to", "reflect", "any", "state", "changes", "since", "launch", ".", "The", "stateManager", ".", "getTopology", "(", "name", ")",...
776abe2b5a45b93a0eb957fd65cbc149d901a92a
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/scheduler-core/src/java/org/apache/heron/scheduler/UpdateTopologyManager.java#L346-L349
train
Get topology from topology name
Create a Java method that does the following: "Get topology from topology name".
Of course, here is the Java code you requested: ```java @VisibleForTesting TopologyAPI.Topology getTopology(SchedulerStateManagerAdaptor stateManager, String topologyName) { return stateManager.getPhysicalPlan(topologyName).getTopology(); } ``` Hope this helps!
grpc/grpc-java
core/src/main/java/io/grpc/internal/CensusStatsModule.java
CensusStatsModule.newClientCallTracer
@VisibleForTesting ClientCallTracer newClientCallTracer( TagContext parentCtx, String fullMethodName) { return new ClientCallTracer(this, parentCtx, fullMethodName); }
java
@VisibleForTesting ClientCallTracer newClientCallTracer( TagContext parentCtx, String fullMethodName) { return new ClientCallTracer(this, parentCtx, fullMethodName); }
[ "@", "VisibleForTesting", "ClientCallTracer", "newClientCallTracer", "(", "TagContext", "parentCtx", ",", "String", "fullMethodName", ")", "{", "return", "new", "ClientCallTracer", "(", "this", ",", "parentCtx", ",", "fullMethodName", ")", ";", "}" ]
Creates a {@link ClientCallTracer} for a new call.
[ "Creates", "a", "{" ]
973885457f9609de232d2553b82c67f6c3ff57bf
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/CensusStatsModule.java#L143-L147
train
Create a new ClientCallTracer.
Create a Java method that does the following: "Create a new ClientCallTracer.".
Of course, here is the Java code you requested: ```java @VisibleForTesting ClientCallTracer newClientCallTracer( TagContext parentCtx, String fullMethodName) { return new ClientCallTracer(this, parentCtx, fullMethodName); } ``` Hope this helps!
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java
VirtualWANsInner.createOrUpdateAsync
public ServiceFuture<VirtualWANInner> createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback<VirtualWANInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParam...
java
public ServiceFuture<VirtualWANInner> createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback<VirtualWANInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWANName, wANParam...
[ "public", "ServiceFuture", "<", "VirtualWANInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "virtualWANName", ",", "VirtualWANInner", "wANParameters", ",", "final", "ServiceCallback", "<", "VirtualWANInner", ">", "serviceCallback", ")...
Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. @param resourceGroupName The resource group name of the VirtualWan. @param virtualWANName The name of the VirtualWAN being created or updated. @param wANParameters Parameters supplied to create or update VirtualWAN. @param serviceC...
[ "Creates", "a", "VirtualWAN", "resource", "if", "it", "doesn", "t", "exist", "else", "updates", "the", "existing", "VirtualWAN", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java#L225-L227
train
Creates or updates a CDN image.
Create a Java method that does the following: "Creates or updates a CDN image.".
Of course, here is the Java code you requested: ```java public ServiceFuture<VirtualWANInner> createOrUpdateAsync(String resourceGroupName, String virtualWANName, VirtualWANInner wANParameters, final ServiceCallback<VirtualWANInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithService...
VoltDB/voltdb
src/frontend/org/voltdb/TableStreamer.java
TableStreamer.activate
public boolean activate(SystemProcedureExecutionContext context, boolean undo, byte[] predicates) { if (!context.activateTableStream(m_tableId, m_type, undo, predicates)) { String tableName = CatalogUtil.getTableNameFromId(context.getDatabase(), m_tableId); log.debug("Attempted to ac...
java
public boolean activate(SystemProcedureExecutionContext context, boolean undo, byte[] predicates) { if (!context.activateTableStream(m_tableId, m_type, undo, predicates)) { String tableName = CatalogUtil.getTableNameFromId(context.getDatabase(), m_tableId); log.debug("Attempted to ac...
[ "public", "boolean", "activate", "(", "SystemProcedureExecutionContext", "context", ",", "boolean", "undo", ",", "byte", "[", "]", "predicates", ")", "{", "if", "(", "!", "context", ".", "activateTableStream", "(", "m_tableId", ",", "m_type", ",", "undo", ",",...
Activate the stream with the given predicates on the given table. @param context Context @param undoToken The undo token @param predicates Predicates associated with the stream @return true if activation succeeded.
[ "Activate", "the", "stream", "with", "the", "given", "predicates", "on", "the", "given", "table", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TableStreamer.java#L80-L89
train
Activates the table stream of the type.
Create a Java method that does the following: "Activates the table stream of the type.".
Of course, here is the Java code you requested: ```java public boolean activate(SystemProcedureExecutionContext context, boolean undo, byte[] predicates) { if (!context.activateTableStream(m_tableId, m_type, undo, predicates)) { String tableName = CatalogUtil.getTableNameFromId(context.getDatab...
geomajas/geomajas-project-client-gwt
plugin/widget-utility/utility-gwt/src/main/java/org/geomajas/widget/utility/gwt/client/ribbon/RibbonColumnRegistry.java
RibbonColumnRegistry.put
public static void put(String key, RibbonColumnCreator ribbonColumnCreator) { if (null != key && null != ribbonColumnCreator) { REGISTRY.put(key, ribbonColumnCreator); } }
java
public static void put(String key, RibbonColumnCreator ribbonColumnCreator) { if (null != key && null != ribbonColumnCreator) { REGISTRY.put(key, ribbonColumnCreator); } }
[ "public", "static", "void", "put", "(", "String", "key", ",", "RibbonColumnCreator", "ribbonColumnCreator", ")", "{", "if", "(", "null", "!=", "key", "&&", "null", "!=", "ribbonColumnCreator", ")", "{", "REGISTRY", ".", "put", "(", "key", ",", "ribbonColumnC...
Add another key to the registry. This will overwrite the previous value. @param key Unique key for the action within this registry. @param ribbonColumnCreator Implementation of the {@link RibbonColumnCreator} interface to link the correct type of ribbon column widget to the key.
[ "Add", "another", "key", "to", "the", "registry", ".", "This", "will", "overwrite", "the", "previous", "value", "." ]
1c1adc48deb192ed825265eebcc74d70bbf45670
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-utility/utility-gwt/src/main/java/org/geomajas/widget/utility/gwt/client/ribbon/RibbonColumnRegistry.java#L132-L136
train
Register a RibbonColumnCreator with the given key.
Create a Java method that does the following: "Register a RibbonColumnCreator with the given key.".
Of course, here is the Java code you requested: ```java public static void put(String key, RibbonColumnCreator ribbonColumnCreator) { if (null != key && null != ribbonColumnCreator) { REGISTRY.put(key, ribbonColumnCreator); } } ``` Hope this helps!
Commonjava/webdav-handler
common/src/main/java/net/sf/webdav/util/RequestUtil.java
RequestUtil.putMapEntry
private static void putMapEntry( final Map<String, String[]> map, final String name, final String value ) { String[] newValues = null; final String[] oldValues = map.get( name ); if ( oldValues == null ) { newValues = new String[1]; newValues[0] = value; ...
java
private static void putMapEntry( final Map<String, String[]> map, final String name, final String value ) { String[] newValues = null; final String[] oldValues = map.get( name ); if ( oldValues == null ) { newValues = new String[1]; newValues[0] = value; ...
[ "private", "static", "void", "putMapEntry", "(", "final", "Map", "<", "String", ",", "String", "[", "]", ">", "map", ",", "final", "String", "name", ",", "final", "String", "value", ")", "{", "String", "[", "]", "newValues", "=", "null", ";", "final", ...
Put name and value pair in map. When name already exist, add value to array of values. @param map The map to populate @param name The parameter name @param value The parameter value
[ "Put", "name", "and", "value", "pair", "in", "map", ".", "When", "name", "already", "exist", "add", "value", "to", "array", "of", "values", "." ]
39bb7032fc75c1b67d3f2440dd1c234ead96cb9d
https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/util/RequestUtil.java#L672-L688
train
Put a single entry into the map.
Create a Java method that does the following: "Put a single entry into the map.".
Of course, here is the Java code you requested: ```java private static void putMapEntry( final Map<String, String[]> map, final String name, final String value ) { String[] newValues = null; final String[] oldValues = map.get( name ); if ( oldValues == null ) { newValues...
adamfisk/littleshoot-util
src/main/java/org/littleshoot/util/OptionalUtilsImpl.java
OptionalUtilsImpl.isNone
public <T> boolean isNone (final Optional<T> optional) { final OptionalVisitor<Boolean,T> visitor = new OptionalVisitor<Boolean,T> () { public Boolean visitNone (final None<T> none) { return true; ...
java
public <T> boolean isNone (final Optional<T> optional) { final OptionalVisitor<Boolean,T> visitor = new OptionalVisitor<Boolean,T> () { public Boolean visitNone (final None<T> none) { return true; ...
[ "public", "<", "T", ">", "boolean", "isNone", "(", "final", "Optional", "<", "T", ">", "optional", ")", "{", "final", "OptionalVisitor", "<", "Boolean", ",", "T", ">", "visitor", "=", "new", "OptionalVisitor", "<", "Boolean", ",", "T", ">", "(", ")", ...
{@inheritDoc}
[ "{" ]
3c0dc4955116b3382d6b0575d2f164b7508a4f73
https://github.com/adamfisk/littleshoot-util/blob/3c0dc4955116b3382d6b0575d2f164b7508a4f73/src/main/java/org/littleshoot/util/OptionalUtilsImpl.java#L120-L140
train
Is None a Sequence Entry of type T.
Create a Java method that does the following: "Is None a Sequence Entry of type T.".
Of course, here is the Java code you requested: ```java public <T> boolean isNone (final Optional<T> optional) { final OptionalVisitor<Boolean,T> visitor = new OptionalVisitor<Boolean,T> () { public Boolean visitNone (final None<T>...
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-google/src/main/java/org/dashbuilder/renderer/google/client/GoogleTableDisplayer.java
GoogleTableDisplayer.onFilterEnabled
@Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { currentPage = 1; super.onFilterEnabled(displayer, groupOp); }
java
@Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { currentPage = 1; super.onFilterEnabled(displayer, groupOp); }
[ "@", "Override", "public", "void", "onFilterEnabled", "(", "Displayer", "displayer", ",", "DataSetGroup", "groupOp", ")", "{", "currentPage", "=", "1", ";", "super", ".", "onFilterEnabled", "(", "displayer", ",", "groupOp", ")", ";", "}" ]
Reset the current navigation status on filter requests from external displayers.
[ "Reset", "the", "current", "navigation", "status", "on", "filter", "requests", "from", "external", "displayers", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-google/src/main/java/org/dashbuilder/renderer/google/client/GoogleTableDisplayer.java#L207-L211
train
Override onFilterEnabled to set the current page to 1.
Create a Java method that does the following: "Override onFilterEnabled to set the current page to 1.".
Of course, here is the Java code you requested: ```java @Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { currentPage = 1; super.onFilterEnabled(displayer, groupOp); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/relations/CmsLinkUpdateUtil.java
CmsLinkUpdateUtil.updateNode
private static void updateNode(Element parent, String nodeName, String value, boolean cdata) { // get current node element Element nodeElement = parent.element(nodeName); if (value != null) { if (nodeElement == null) { // element wasn't there before, add element and ...
java
private static void updateNode(Element parent, String nodeName, String value, boolean cdata) { // get current node element Element nodeElement = parent.element(nodeName); if (value != null) { if (nodeElement == null) { // element wasn't there before, add element and ...
[ "private", "static", "void", "updateNode", "(", "Element", "parent", ",", "String", "nodeName", ",", "String", "value", ",", "boolean", "cdata", ")", "{", "// get current node element", "Element", "nodeElement", "=", "parent", ".", "element", "(", "nodeName", ")...
Updates the given xml node with the given value.<p> @param parent the parent node @param nodeName the node to update @param value the value to use to update the given node, can be <code>null</code> @param cdata if the value should be in a CDATA section or not
[ "Updates", "the", "given", "xml", "node", "with", "the", "given", "value", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsLinkUpdateUtil.java#L169-L192
train
Update the node with the value.
Create a Java method that does the following: "Update the node with the value.".
Of course, here is the Java code you requested: ```java private static void updateNode(Element parent, String nodeName, String value, boolean cdata) { // get current node element Element nodeElement = parent.element(nodeName); if (value != null) { if (nodeElement == null) { ...
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/cpc/PreambleUtil.java
PreambleUtil.getNumCoupons
static int getNumCoupons(final Memory mem) { final Format format = getFormat(mem); final HiField hiField = HiField.NUM_COUPONS; final long offset = getHiFieldOffset(format, hiField); return mem.getInt(offset); }
java
static int getNumCoupons(final Memory mem) { final Format format = getFormat(mem); final HiField hiField = HiField.NUM_COUPONS; final long offset = getHiFieldOffset(format, hiField); return mem.getInt(offset); }
[ "static", "int", "getNumCoupons", "(", "final", "Memory", "mem", ")", "{", "final", "Format", "format", "=", "getFormat", "(", "mem", ")", ";", "final", "HiField", "hiField", "=", "HiField", ".", "NUM_COUPONS", ";", "final", "long", "offset", "=", "getHiFi...
PREAMBLE HI_FIELD GETS
[ "PREAMBLE", "HI_FIELD", "GETS" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/cpc/PreambleUtil.java#L288-L293
train
Gets the num coupons from the given Memory.
Create a Java method that does the following: "Gets the num coupons from the given Memory.".
Of course, here is the Java code you requested: ```java static int getNumCoupons(final Memory mem) { final Format format = getFormat(mem); final HiField hiField = HiField.NUM_COUPONS; final long offset = getHiFieldOffset(format, hiField); return mem.getInt(offset); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-directory/src/main/java/com/amazonaws/services/directory/model/transform/CreateConditionalForwarderRequestMarshaller.java
CreateConditionalForwarderRequestMarshaller.marshall
public void marshall(CreateConditionalForwarderRequest createConditionalForwarderRequest, ProtocolMarshaller protocolMarshaller) { if (createConditionalForwarderRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocol...
java
public void marshall(CreateConditionalForwarderRequest createConditionalForwarderRequest, ProtocolMarshaller protocolMarshaller) { if (createConditionalForwarderRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocol...
[ "public", "void", "marshall", "(", "CreateConditionalForwarderRequest", "createConditionalForwarderRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "createConditionalForwarderRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException"...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-directory/src/main/java/com/amazonaws/services/directory/model/transform/CreateConditionalForwarderRequestMarshaller.java#L47-L60
train
marshalls the given CreateConditionalForwarderRequest to the given protocolMarshaller.
Create a Java method that does the following: "marshalls the given CreateConditionalForwarderRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public void marshall(CreateConditionalForwarderRequest createConditionalForwarderRequest, ProtocolMarshaller protocolMarshaller) { if (createConditionalForwarderRequest == null) { throw new SdkClientException("Invalid argument passed to marsh...
VoltDB/voltdb
third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogram.java
AbstractHistogram.getStdDeviation
public double getStdDeviation() { if (getTotalCount() == 0) { return 0.0; } final double mean = getMean(); double geometric_deviation_total = 0.0; recordedValuesIterator.reset(); while (recordedValuesIterator.hasNext()) { HistogramIterationValue i...
java
public double getStdDeviation() { if (getTotalCount() == 0) { return 0.0; } final double mean = getMean(); double geometric_deviation_total = 0.0; recordedValuesIterator.reset(); while (recordedValuesIterator.hasNext()) { HistogramIterationValue i...
[ "public", "double", "getStdDeviation", "(", ")", "{", "if", "(", "getTotalCount", "(", ")", "==", "0", ")", "{", "return", "0.0", ";", "}", "final", "double", "mean", "=", "getMean", "(", ")", ";", "double", "geometric_deviation_total", "=", "0.0", ";", ...
Get the computed standard deviation of all recorded values in the histogram @return the standard deviation (in value units) of the histogram data
[ "Get", "the", "computed", "standard", "deviation", "of", "all", "recorded", "values", "in", "the", "histogram" ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogram.java#L1184-L1198
train
Get the standard deviation of the histogram.
Create a Java method that does the following: "Get the standard deviation of the histogram.".
Of course, here is the Java code you requested: ```java public double getStdDeviation() { if (getTotalCount() == 0) { return 0.0; } final double mean = getMean(); double geometric_deviation_total = 0.0; recordedValuesIterator.reset(); while (recordedValuesIt...
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java
EJBMDOrchestrator.getNestedException
@SuppressWarnings("deprecation") protected Throwable getNestedException(Throwable t) { Throwable root = t; for (;;) { if (root instanceof RemoteException) { RemoteException re = (RemoteException) root; if (re.detail == null) break; ...
java
@SuppressWarnings("deprecation") protected Throwable getNestedException(Throwable t) { Throwable root = t; for (;;) { if (root instanceof RemoteException) { RemoteException re = (RemoteException) root; if (re.detail == null) break; ...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "protected", "Throwable", "getNestedException", "(", "Throwable", "t", ")", "{", "Throwable", "root", "=", "t", ";", "for", "(", ";", ";", ")", "{", "if", "(", "root", "instanceof", "RemoteException", ")"...
d494984 eliminate assignment to parameter t.
[ "d494984", "eliminate", "assignment", "to", "parameter", "t", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java#L2090-L2114
train
This method returns the nested exception of the specified exception.
Create a Java method that does the following: "This method returns the nested exception of the specified exception.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("deprecation") protected Throwable getNestedException(Throwable t) { Throwable root = t; for (;;) { if (root instanceof RemoteException) { RemoteException re = (RemoteException) root; ...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayList.java
ArrayList.indexOf
public int indexOf(Object o) { if (o == null) { for (int i = 0; i < size; i++) if (elementData[i]==null) return i; } else { for (int i = 0; i < size; i++) if (o.equals(elementData[i])) return i; } ...
java
public int indexOf(Object o) { if (o == null) { for (int i = 0; i < size; i++) if (elementData[i]==null) return i; } else { for (int i = 0; i < size; i++) if (o.equals(elementData[i])) return i; } ...
[ "public", "int", "indexOf", "(", "Object", "o", ")", "{", "if", "(", "o", "==", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "if", "(", "elementData", "[", "i", "]", "==", "null", ")", "ret...
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index <tt>i</tt> such that <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>, or -1 if there is no such index.
[ "Returns", "the", "index", "of", "the", "first", "occurrence", "of", "the", "specified", "element", "in", "this", "list", "or", "-", "1", "if", "this", "list", "does", "not", "contain", "the", "element", ".", "More", "formally", "returns", "the", "lowest",...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayList.java#L324-L335
train
Gets the index of the specified object in the list.
Create a Java method that does the following: "Gets the index of the specified object in the list.".
Of course, here is the Java code you requested: ```java public int indexOf(Object o) { if (o == null) { for (int i = 0; i < size; i++) if (elementData[i]==null) return i; } else { for (int i = 0; i < size; i++) if (o.equals(ele...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/BaseMessagingEngineImpl.java
BaseMessagingEngineImpl.isStarted
public final boolean isStarted() { String thisMethodName = "isStarted"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, this); } boolean retVal = (_state == STATE_STARTED); if (TraceComponent.isAnyTracingEnabled()...
java
public final boolean isStarted() { String thisMethodName = "isStarted"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, this); } boolean retVal = (_state == STATE_STARTED); if (TraceComponent.isAnyTracingEnabled()...
[ "public", "final", "boolean", "isStarted", "(", ")", "{", "String", "thisMethodName", "=", "\"isStarted\"", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", ...
Returns an indication of whether this ME is started or not @return true if this messaging egine is started; else false.
[ "Returns", "an", "indication", "of", "whether", "this", "ME", "is", "started", "or", "not" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/BaseMessagingEngineImpl.java#L1294-L1309
train
Returns true if the Session has been started.
Create a Java method that does the following: "Returns true if the Session has been started.".
Of course, here is the Java code you requested: ```java public final boolean isStarted() { String thisMethodName = "isStarted"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, this); } boolean retVal = (_state == STATE_ST...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/TransactionCheckpointLogRecord.java
TransactionCheckpointLogRecord.performRecovery
public void performRecovery(ObjectManagerState objectManagerState) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "performRecovery", obj...
java
public void performRecovery(ObjectManagerState objectManagerState) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "performRecovery", obj...
[ "public", "void", "performRecovery", "(", "ObjectManagerState", "objectManagerState", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entr...
Called to perform recovery action during a warm start of the ObjectManager. @param objectManagerState of the ObjectManager performing recovery. @throws ObjectManagerException
[ "Called", "to", "perform", "recovery", "action", "during", "a", "warm", "start", "of", "the", "ObjectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/TransactionCheckpointLogRecord.java#L304-L400
train
Perform a recovery of the ManagedObject.
Create a Java method that does the following: "Perform a recovery of the ManagedObject.".
Of course, here is the Java code you requested: ```java public void performRecovery(ObjectManagerState objectManagerState) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, ...
jboss/jboss-common-core
src/main/java/org/jboss/util/collection/LazyList.java
LazyList.createImplementation
private List<T> createImplementation() { if (delegate instanceof ArrayList == false) return new ArrayList<T>(delegate); return delegate; }
java
private List<T> createImplementation() { if (delegate instanceof ArrayList == false) return new ArrayList<T>(delegate); return delegate; }
[ "private", "List", "<", "T", ">", "createImplementation", "(", ")", "{", "if", "(", "delegate", "instanceof", "ArrayList", "==", "false", ")", "return", "new", "ArrayList", "<", "T", ">", "(", "delegate", ")", ";", "return", "delegate", ";", "}" ]
Create the list implementation @return the list
[ "Create", "the", "list", "implementation" ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/collection/LazyList.java#L48-L53
test
Create implementation of the result
Create a Java method that does the following: "Create implementation of the result".
Of course, here is the Java code you requested: ```java private List<T> createImplementation() { if (delegate instanceof ArrayList == false) return new ArrayList<T>(delegate); return delegate; } ``` Hope this helps!
tvesalainen/util
util/src/main/java/org/vesalainen/navi/CoordinateFormat.java
CoordinateFormat.formatLongitude
public static String formatLongitude(Locale locale, double longitude, UnitType unit) { return format(locale, longitude, unit, EW); }
java
public static String formatLongitude(Locale locale, double longitude, UnitType unit) { return format(locale, longitude, unit, EW); }
[ "public", "static", "String", "formatLongitude", "(", "Locale", "locale", ",", "double", "longitude", ",", "UnitType", "unit", ")", "{", "return", "format", "(", "locale", ",", "longitude", ",", "unit", ",", "EW", ")", ";", "}" ]
Formats longitude @param locale @param longitude @param unit @return
[ "Formats", "longitude" ]
bba7a44689f638ffabc8be40a75bdc9a33676433
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/navi/CoordinateFormat.java#L93-L96
train
Format a longitude in the given unit.
Create a Java method that does the following: "Format a longitude in the given unit.".
Of course, here is the Java code you requested: ```java public static String formatLongitude(Locale locale, double longitude, UnitType unit) { return format(locale, longitude, unit, EW); } ``` Hope this helps!
ModeShape/modeshape
index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumn.java
EsIndexColumn.cast
protected Object[] cast(Object[] values) { Object[] res = new Object[values.length]; for (int i = 0; i < res.length; i++) { res[i] = cast(values[i]); } return res; }
java
protected Object[] cast(Object[] values) { Object[] res = new Object[values.length]; for (int i = 0; i < res.length; i++) { res[i] = cast(values[i]); } return res; }
[ "protected", "Object", "[", "]", "cast", "(", "Object", "[", "]", "values", ")", "{", "Object", "[", "]", "res", "=", "new", "Object", "[", "values", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "res", ".", "length"...
Converts array of values.
[ "Converts", "array", "of", "values", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumn.java#L184-L190
train
Casts the values to an array of objects.
Create a Java method that does the following: "Casts the values to an array of objects.".
Of course, here is the Java code you requested: ```java protected Object[] cast(Object[] values) { Object[] res = new Object[values.length]; for (int i = 0; i < res.length; i++) { res[i] = cast(values[i]); } return res; } ``` Hope this helps!
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/InFixToPostFix.java
InFixToPostFix.infixToPostFix
String infixToPostFix(final CustomTokenizer tokenizer) { final String space = " "; StringBuffer postfix = new StringBuffer(); Stack stack = new Stack(); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); boolean inText = (token.startsWith("'") && (!token.endsWith("'...
java
String infixToPostFix(final CustomTokenizer tokenizer) { final String space = " "; StringBuffer postfix = new StringBuffer(); Stack stack = new Stack(); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); boolean inText = (token.startsWith("'") && (!token.endsWith("'...
[ "String", "infixToPostFix", "(", "final", "CustomTokenizer", "tokenizer", ")", "{", "final", "String", "space", "=", "\" \"", ";", "StringBuffer", "postfix", "=", "new", "StringBuffer", "(", ")", ";", "Stack", "stack", "=", "new", "Stack", "(", ")", ";", "...
convert in-fix expression to post-fix. @param tokenizer tokenizer. @return post-fix expression.
[ "convert", "in", "-", "fix", "expression", "to", "post", "-", "fix", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/InFixToPostFix.java#L147-L221
train
Infix to PostFix
Create a Java method that does the following: "Infix to PostFix".
Of course, here is the Java code you requested: ```java String infixToPostFix(final CustomTokenizer tokenizer) { final String space = " "; StringBuffer postfix = new StringBuffer(); Stack stack = new Stack(); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); boole...
voldemort/voldemort
src/java/voldemort/utils/ConsistencyCheck.java
ConsistencyCheck.connect
public void connect() throws Exception { adminClients = new ArrayList<AdminClient>(urls.size()); // bootstrap from two urls Map<String, Cluster> clusterMap = new HashMap<String, Cluster>(urls.size()); Map<String, StoreDefinition> storeDefinitionMap = new HashMap<String, StoreDefinition>(...
java
public void connect() throws Exception { adminClients = new ArrayList<AdminClient>(urls.size()); // bootstrap from two urls Map<String, Cluster> clusterMap = new HashMap<String, Cluster>(urls.size()); Map<String, StoreDefinition> storeDefinitionMap = new HashMap<String, StoreDefinition>(...
[ "public", "void", "connect", "(", ")", "throws", "Exception", "{", "adminClients", "=", "new", "ArrayList", "<", "AdminClient", ">", "(", "urls", ".", "size", "(", ")", ")", ";", "// bootstrap from two urls", "Map", "<", "String", ",", "Cluster", ">", "clu...
Connect to the clusters using given urls and start fetching process on correct nodes @throws Exception When no such store is found
[ "Connect", "to", "the", "clusters", "using", "given", "urls", "and", "start", "fetching", "process", "on", "correct", "nodes" ]
a7dbdea58032021361680faacf2782cf981c5332
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ConsistencyCheck.java#L86-L188
train
Connect to all the cluster servers.
Create a Java method that does the following: "Connect to all the cluster servers.".
Of course, here is the Java code you requested: ```java public void connect() throws Exception { adminClients = new ArrayList<AdminClient>(urls.size()); // bootstrap from two urls Map<String, Cluster> clusterMap = new HashMap<String, Cluster>(urls.size()); Map<String, StoreDefinition> s...
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheRecordStore.java
AbstractCacheRecordStore.markExpirable
protected void markExpirable(long expiryTime) { if (expiryTime > 0 && expiryTime < Long.MAX_VALUE) { hasEntryWithExpiration = true; } if (isPrimary() && hasEntryWithExpiration) { cacheService.getExpirationManager().scheduleExpirationTask(); } }
java
protected void markExpirable(long expiryTime) { if (expiryTime > 0 && expiryTime < Long.MAX_VALUE) { hasEntryWithExpiration = true; } if (isPrimary() && hasEntryWithExpiration) { cacheService.getExpirationManager().scheduleExpirationTask(); } }
[ "protected", "void", "markExpirable", "(", "long", "expiryTime", ")", "{", "if", "(", "expiryTime", ">", "0", "&&", "expiryTime", "<", "Long", ".", "MAX_VALUE", ")", "{", "hasEntryWithExpiration", "=", "true", ";", "}", "if", "(", "isPrimary", "(", ")", ...
This method marks current replica as expirable and also starts expiration task if necessary. The expiration task runs on only primary replicas. Expiration on backup replicas are dictated by primary replicas. However, it is still important to mark a backup replica as expirable because it might be promoted to be the pri...
[ "This", "method", "marks", "current", "replica", "as", "expirable", "and", "also", "starts", "expiration", "task", "if", "necessary", "." ]
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheRecordStore.java#L1615-L1623
train
Mark the entry as expirable.
Create a Java method that does the following: "Mark the entry as expirable.".
Of course, here is the Java code you requested: ```java protected void markExpirable(long expiryTime) { if (expiryTime > 0 && expiryTime < Long.MAX_VALUE) { hasEntryWithExpiration = true; } if (isPrimary() && hasEntryWithExpiration) { cacheService.getExpirationManager()...
netty/netty
transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java
AbstractKQueueChannel.doReadBytes
protected final int doReadBytes(ByteBuf byteBuf) throws Exception { int writerIndex = byteBuf.writerIndex(); int localReadAmount; unsafe().recvBufAllocHandle().attemptedBytesRead(byteBuf.writableBytes()); if (byteBuf.hasMemoryAddress()) { localReadAmount = socket.readAddress(...
java
protected final int doReadBytes(ByteBuf byteBuf) throws Exception { int writerIndex = byteBuf.writerIndex(); int localReadAmount; unsafe().recvBufAllocHandle().attemptedBytesRead(byteBuf.writableBytes()); if (byteBuf.hasMemoryAddress()) { localReadAmount = socket.readAddress(...
[ "protected", "final", "int", "doReadBytes", "(", "ByteBuf", "byteBuf", ")", "throws", "Exception", "{", "int", "writerIndex", "=", "byteBuf", ".", "writerIndex", "(", ")", ";", "int", "localReadAmount", ";", "unsafe", "(", ")", ".", "recvBufAllocHandle", "(", ...
Read bytes into the given {@link ByteBuf} and return the amount.
[ "Read", "bytes", "into", "the", "given", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java#L248-L262
train
Read bytes from the socket.
Create a Java method that does the following: "Read bytes from the socket.".
Of course, here is the Java code you requested: ```java protected final int doReadBytes(ByteBuf byteBuf) throws Exception { int writerIndex = byteBuf.writerIndex(); int localReadAmount; unsafe().recvBufAllocHandle().attemptedBytesRead(byteBuf.writableBytes()); if (byteBuf.hasMemoryAddre...
juebanlin/util4j
util4j/src/main/java/net/jueb/util4j/hotSwap/classFactory/old/v1/DefaultScriptSource.java
DefaultScriptSource.scanResources
protected void scanResources() { try { File scriptDirFile=new File(scriptDir); if(scriptDirFile.exists() && scriptDirFile.isDirectory()) { if(scanFilter==null || (scanFilter!=null && scanFilter.accpetJars())) { for(File file:FileUtil.findJarFileByDir(scriptDirFile)) {//扫描jar ...
java
protected void scanResources() { try { File scriptDirFile=new File(scriptDir); if(scriptDirFile.exists() && scriptDirFile.isDirectory()) { if(scanFilter==null || (scanFilter!=null && scanFilter.accpetJars())) { for(File file:FileUtil.findJarFileByDir(scriptDirFile)) {//扫描jar ...
[ "protected", "void", "scanResources", "(", ")", "{", "try", "{", "File", "scriptDirFile", "=", "new", "File", "(", "scriptDir", ")", ";", "if", "(", "scriptDirFile", ".", "exists", "(", ")", "&&", "scriptDirFile", ".", "isDirectory", "(", ")", ")", "{", ...
扫描可用资源到缓存
[ "扫描可用资源到缓存" ]
c404b2dbdedf7a8890533b351257fa8af4f1439f
https://github.com/juebanlin/util4j/blob/c404b2dbdedf7a8890533b351257fa8af4f1439f/util4j/src/main/java/net/jueb/util4j/hotSwap/classFactory/old/v1/DefaultScriptSource.java#L133-L160
train
Scans the resources for related information.
Create a Java method that does the following: "Scans the resources for related information.".
Of course, here is the Java code you requested: ```java protected void scanResources() { try { File scriptDirFile=new File(scriptDir); if(scriptDirFile.exists() && scriptDirFile.isDirectory()) { if(scanFilter==null || (scanFilter!=null && scanFilter.accpetJars())) { for(File file:FileU...
google/guice
core/src/com/google/inject/internal/RealMapBinder.java
RealMapBinder.newRealMapBinder
static <K, V> RealMapBinder<K, V> newRealMapBinder( Binder binder, TypeLiteral<K> keyType, Key<V> valueTypeAndAnnotation) { binder = binder.skipSources(RealMapBinder.class); TypeLiteral<V> valueType = valueTypeAndAnnotation.getTypeLiteral(); return newRealMapBinder( binder, keyType, ...
java
static <K, V> RealMapBinder<K, V> newRealMapBinder( Binder binder, TypeLiteral<K> keyType, Key<V> valueTypeAndAnnotation) { binder = binder.skipSources(RealMapBinder.class); TypeLiteral<V> valueType = valueTypeAndAnnotation.getTypeLiteral(); return newRealMapBinder( binder, keyType, ...
[ "static", "<", "K", ",", "V", ">", "RealMapBinder", "<", "K", ",", "V", ">", "newRealMapBinder", "(", "Binder", "binder", ",", "TypeLiteral", "<", "K", ">", "keyType", ",", "Key", "<", "V", ">", "valueTypeAndAnnotation", ")", "{", "binder", "=", "binde...
since it's an easy way to group a type and an optional annotation type or instance.
[ "since", "it", "s", "an", "easy", "way", "to", "group", "a", "type", "and", "an", "optional", "annotation", "type", "or", "instance", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/RealMapBinder.java#L218-L229
test
Create a new RealMapBinder.
Create a Java method that does the following: "Create a new RealMapBinder.".
Of course, here is the Java code you requested: ```java static <K, V> RealMapBinder<K, V> newRealMapBinder( Binder binder, TypeLiteral<K> keyType, Key<V> valueTypeAndAnnotation) { binder = binder.skipSources(RealMapBinder.class); TypeLiteral<V> valueType = valueTypeAndAnnotation.getTypeLiteral(); ret...
google/closure-compiler
src/com/google/javascript/jscomp/deps/DepsFileParser.java
DepsFileParser.parseFileReader
public List<DependencyInfo> parseFileReader(String filePath, Reader reader) { depInfos = new ArrayList<>(); if (logger.isLoggable(Level.FINE)) { logger.fine("Parsing Dep: " + filePath); } doParse(filePath, reader); return depInfos; }
java
public List<DependencyInfo> parseFileReader(String filePath, Reader reader) { depInfos = new ArrayList<>(); if (logger.isLoggable(Level.FINE)) { logger.fine("Parsing Dep: " + filePath); } doParse(filePath, reader); return depInfos; }
[ "public", "List", "<", "DependencyInfo", ">", "parseFileReader", "(", "String", "filePath", ",", "Reader", "reader", ")", "{", "depInfos", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINE", ")...
Parses the file from the given reader and returns a list of dependency information that it contained. @param filePath Path to the file to parse. @param reader A reader for the file. @return A list of DependencyInfo objects.
[ "Parses", "the", "file", "from", "the", "given", "reader", "and", "returns", "a", "list", "of", "dependency", "information", "that", "it", "contained", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/DepsFileParser.java#L131-L138
train
Parse a file from a reader.
Create a Java method that does the following: "Parse a file from a reader.".
Of course, here is the Java code you requested: ```java public List<DependencyInfo> parseFileReader(String filePath, Reader reader) { depInfos = new ArrayList<>(); if (logger.isLoggable(Level.FINE)) { logger.fine("Parsing Dep: " + filePath); } doParse(filePath, reader); return depInfos; } `...
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseCollaboration
public void parseCollaboration() { Element collaboration = rootElement.element("collaboration"); if (collaboration != null) { for (Element participant : collaboration.elements("participant")) { String processRef = participant.attribute("processRef"); if (processRef != null) { Pro...
java
public void parseCollaboration() { Element collaboration = rootElement.element("collaboration"); if (collaboration != null) { for (Element participant : collaboration.elements("participant")) { String processRef = participant.attribute("processRef"); if (processRef != null) { Pro...
[ "public", "void", "parseCollaboration", "(", ")", "{", "Element", "collaboration", "=", "rootElement", ".", "element", "(", "\"collaboration\"", ")", ";", "if", "(", "collaboration", "!=", "null", ")", "{", "for", "(", "Element", "participant", ":", "collabora...
Parses the collaboration definition defined within the 'definitions' root element and get all participants to lookup their process references during DI parsing.
[ "Parses", "the", "collaboration", "definition", "defined", "within", "the", "definitions", "root", "element", "and", "get", "all", "participants", "to", "lookup", "their", "process", "references", "during", "DI", "parsing", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L496-L516
train
Parse the collaboration section.
Create a Java method that does the following: "Parse the collaboration section.".
Of course, here is the Java code you requested: ```java public void parseCollaboration() { Element collaboration = rootElement.element("collaboration"); if (collaboration != null) { for (Element participant : collaboration.elements("participant")) { String processRef = participant.attribute("proc...
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java
ObjectReferenceDescriptor.toXML
public String toXML() { RepositoryTags tags = RepositoryTags.getInstance(); String eol = System.getProperty( "line.separator" ); // opening tag StringBuffer result = new StringBuffer( 1024 ); result.append( " " ); result.append( tags.getOpeningTagNonClos...
java
public String toXML() { RepositoryTags tags = RepositoryTags.getInstance(); String eol = System.getProperty( "line.separator" ); // opening tag StringBuffer result = new StringBuffer( 1024 ); result.append( " " ); result.append( tags.getOpeningTagNonClos...
[ "public", "String", "toXML", "(", ")", "{", "RepositoryTags", "tags", "=", "RepositoryTags", ".", "getInstance", "(", ")", ";", "String", "eol", "=", "System", ".", "getProperty", "(", "\"line.separator\"", ")", ";", "// opening tag\r", "StringBuffer", "result",...
/* @see XmlCapable#toXML()
[ "/", "*" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ObjectReferenceDescriptor.java#L558-L663
train
Returns the XML representation of the object.
Create a Java method that does the following: "Returns the XML representation of the object.".
Of course, here is the Java code you requested: ```java public String toXML() { RepositoryTags tags = RepositoryTags.getInstance(); String eol = System.getProperty( "line.separator" ); // opening tag StringBuffer result = new StringBuffer( 1024 ); result.append( " ...
TheHortonMachine/hortonmachine
modules/src/main/java/org/hortonmachine/modules/Modules.java
Modules.getInstance
public synchronized static Modules getInstance() { if (modules == null) { modules = new Modules(null); modules.gatherInformations(); } return modules; }
java
public synchronized static Modules getInstance() { if (modules == null) { modules = new Modules(null); modules.gatherInformations(); } return modules; }
[ "public", "synchronized", "static", "Modules", "getInstance", "(", ")", "{", "if", "(", "modules", "==", "null", ")", "{", "modules", "=", "new", "Modules", "(", "null", ")", ";", "modules", ".", "gatherInformations", "(", ")", ";", "}", "return", "modul...
Retrieves the {@link Modules}. If it exists, that instance is returned. @return the Modules annotations class.
[ "Retrieves", "the", "{", "@link", "Modules", "}", ".", "If", "it", "exists", "that", "instance", "is", "returned", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/modules/src/main/java/org/hortonmachine/modules/Modules.java#L47-L53
train
Get the singleton instance of the Modules class.
Create a Java method that does the following: "Get the singleton instance of the Modules class.".
Of course, here is the Java code you requested: ```java public synchronized static Modules getInstance() { if (modules == null) { modules = new Modules(null); modules.gatherInformations(); } return modules; } ``` Hope this helps!
tvesalainen/util
util/src/main/java/org/vesalainen/util/concurrent/CachedScheduledThreadPool.java
CachedScheduledThreadPool.submitAfter
public Future<?> submitAfter(Waiter waiter, Runnable runnable, long timeout, TimeUnit unit) { AfterTask<?> task = new AfterTask<>(waiter, runnable, timeout, unit); log(logLevel, "submit after task %s", task); return submit(task); }
java
public Future<?> submitAfter(Waiter waiter, Runnable runnable, long timeout, TimeUnit unit) { AfterTask<?> task = new AfterTask<>(waiter, runnable, timeout, unit); log(logLevel, "submit after task %s", task); return submit(task); }
[ "public", "Future", "<", "?", ">", "submitAfter", "(", "Waiter", "waiter", ",", "Runnable", "runnable", ",", "long", "timeout", ",", "TimeUnit", "unit", ")", "{", "AfterTask", "<", "?", ">", "task", "=", "new", "AfterTask", "<>", "(", "waiter", ",", "r...
submits runnable after waiting future to complete or timeout to exceed. If timeout exceeds task is cancelled. @param waiter @param runnable @param timeout @param unit @return
[ "submits", "runnable", "after", "waiting", "future", "to", "complete", "or", "timeout", "to", "exceed", ".", "If", "timeout", "exceeds", "task", "is", "cancelled", "." ]
bba7a44689f638ffabc8be40a75bdc9a33676433
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/concurrent/CachedScheduledThreadPool.java#L354-L359
train
Submits a Runnable after a timeout.
Create a Java method that does the following: "Submits a Runnable after a timeout.".
Of course, here is the Java code you requested: ```java public Future<?> submitAfter(Waiter waiter, Runnable runnable, long timeout, TimeUnit unit) { AfterTask<?> task = new AfterTask<>(waiter, runnable, timeout, unit); log(logLevel, "submit after task %s", task); return submit(task); ...
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java
ST_Graph.nodesTable
private static void nodesTable(Statement st, TableLocation nodesName, double tolerance, boolean isH2, int srid) throws SQLException { LOGGER.info("Creating the nodes table..."); // Creating nodes table by removing copies from the pts ...
java
private static void nodesTable(Statement st, TableLocation nodesName, double tolerance, boolean isH2, int srid) throws SQLException { LOGGER.info("Creating the nodes table..."); // Creating nodes table by removing copies from the pts ...
[ "private", "static", "void", "nodesTable", "(", "Statement", "st", ",", "TableLocation", "nodesName", ",", "double", "tolerance", ",", "boolean", "isH2", ",", "int", "srid", ")", "throws", "SQLException", "{", "LOGGER", ".", "info", "(", "\"Creating the nodes ta...
Create the nodes table.
[ "Create", "the", "nodes", "table", "." ]
9cd70b447e6469cecbc2fc64b16774b59491df3b
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L451-L506
train
Create the nodes table.
Create a Java method that does the following: "Create the nodes table.".
Of course, here is the Java code you requested: ```java private static void nodesTable(Statement st, TableLocation nodesName, double tolerance, boolean isH2, int srid) throws SQLException { LOGGER.info("Creating the nodes table..."); ...
aws/aws-sdk-java
aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/AmazonKinesisAsyncClient.java
AmazonKinesisAsyncClient.getShardIteratorAsync
@Override public java.util.concurrent.Future<GetShardIteratorResult> getShardIteratorAsync(String streamName, String shardId, String shardIteratorType, String startingSequenceNumber, com.amazonaws.handlers.AsyncHandler<GetShardIteratorRequest, GetShardIteratorResult> asyncHandler) { return getS...
java
@Override public java.util.concurrent.Future<GetShardIteratorResult> getShardIteratorAsync(String streamName, String shardId, String shardIteratorType, String startingSequenceNumber, com.amazonaws.handlers.AsyncHandler<GetShardIteratorRequest, GetShardIteratorResult> asyncHandler) { return getS...
[ "@", "Override", "public", "java", ".", "util", ".", "concurrent", ".", "Future", "<", "GetShardIteratorResult", ">", "getShardIteratorAsync", "(", "String", "streamName", ",", "String", "shardId", ",", "String", "shardIteratorType", ",", "String", "startingSequence...
Simplified method form for invoking the GetShardIterator operation with an AsyncHandler. @see #getShardIteratorAsync(GetShardIteratorRequest, com.amazonaws.handlers.AsyncHandler)
[ "Simplified", "method", "form", "for", "invoking", "the", "GetShardIterator", "operation", "with", "an", "AsyncHandler", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/AmazonKinesisAsyncClient.java#L836-L842
train
Simplified method form for invoking the GetShardIterator operation with an AsyncHandler.
Create a Java method that does the following: "Simplified method form for invoking the GetShardIterator operation with an AsyncHandler.".
Of course, here is the Java code you requested: ```java @Override public java.util.concurrent.Future<GetShardIteratorResult> getShardIteratorAsync(String streamName, String shardId, String shardIteratorType, String startingSequenceNumber, com.amazonaws.handlers.AsyncHandler<GetShardIteratorRequest, Get...
jfree/jfreesvg
src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java
SVGGraphics2D.drawImage
@Override public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { AffineTransform savedTransform = getTransform(); if (xform != null) { transform(xform); } boolean result = drawImage(img, 0, 0, obs); if (xform != null) { ...
java
@Override public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { AffineTransform savedTransform = getTransform(); if (xform != null) { transform(xform); } boolean result = drawImage(img, 0, 0, obs); if (xform != null) { ...
[ "@", "Override", "public", "boolean", "drawImage", "(", "Image", "img", ",", "AffineTransform", "xform", ",", "ImageObserver", "obs", ")", "{", "AffineTransform", "savedTransform", "=", "getTransform", "(", ")", ";", "if", "(", "xform", "!=", "null", ")", "{...
Draws an image with the specified transform. Note that the {@code observer} is ignored. @param img the image. @param xform the transform ({@code null} permitted). @param obs the image observer (ignored). @return {@code true} if the image is drawn.
[ "Draws", "an", "image", "with", "the", "specified", "transform", ".", "Note", "that", "the", "{", "@code", "observer", "}", "is", "ignored", "." ]
2e6cd5f8dde71e37704e4d786e3b64235326adaf
https://github.com/jfree/jfreesvg/blob/2e6cd5f8dde71e37704e4d786e3b64235326adaf/src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java#L2629-L2641
valid
Override the drawImage method to apply the specified transformation and observer to the image.
Create a Java method that does the following: "Override the drawImage method to apply the specified transformation and observer to the image.".
Of course, here is the Java code you requested: ```java @Override public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { AffineTransform savedTransform = getTransform(); if (xform != null) { transform(xform); } boolean result = drawI...
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/VTimeZone.java
VTimeZone.isEquivalentDateRule
private static boolean isEquivalentDateRule(int month, int weekInMonth, int dayOfWeek, DateTimeRule dtrule) { if (month != dtrule.getRuleMonth() || dayOfWeek != dtrule.getRuleDayOfWeek()) { return false; } if (dtrule.getTimeRuleType() != DateTimeRule.WALL_TIME) { // Do no...
java
private static boolean isEquivalentDateRule(int month, int weekInMonth, int dayOfWeek, DateTimeRule dtrule) { if (month != dtrule.getRuleMonth() || dayOfWeek != dtrule.getRuleDayOfWeek()) { return false; } if (dtrule.getTimeRuleType() != DateTimeRule.WALL_TIME) { // Do no...
[ "private", "static", "boolean", "isEquivalentDateRule", "(", "int", "month", ",", "int", "weekInMonth", ",", "int", "dayOfWeek", ",", "DateTimeRule", "dtrule", ")", "{", "if", "(", "month", "!=", "dtrule", ".", "getRuleMonth", "(", ")", "||", "dayOfWeek", "!...
/* Check if the DOW rule specified by month, weekInMonth and dayOfWeek is equivalent to the DateTimerule.
[ "/", "*", "Check", "if", "the", "DOW", "rule", "specified", "by", "month", "weekInMonth", "and", "dayOfWeek", "is", "equivalent", "to", "the", "DateTimerule", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/VTimeZone.java#L1460-L1492
train
Checks if a date rule is equivalent to another date rule.
Create a Java method that does the following: "Checks if a date rule is equivalent to another date rule.".
Of course, here is the Java code you requested: ```java private static boolean isEquivalentDateRule(int month, int weekInMonth, int dayOfWeek, DateTimeRule dtrule) { if (month != dtrule.getRuleMonth() || dayOfWeek != dtrule.getRuleDayOfWeek()) { return false; } if (dtrule.getTimeRul...
streamsets/datacollector
google-cloud-lib/src/main/java/com/streamsets/pipeline/stage/cloudstorage/origin/GcsObjectPostProcessingHandler.java
GcsObjectPostProcessingHandler.delete
private void delete(BlobId blobId) { LOG.debug("Deleting object '{}'", String.format(BLOB_PATH_TEMPLATE, blobId.getBucket(), blobId.getName())); boolean deleted = storage.delete(blobId); if (!deleted) { LOG.error("Cannot delete object '{}'", String.format(BLOB_PATH_TEMPLATE, blobId.getBucket(), blobId...
java
private void delete(BlobId blobId) { LOG.debug("Deleting object '{}'", String.format(BLOB_PATH_TEMPLATE, blobId.getBucket(), blobId.getName())); boolean deleted = storage.delete(blobId); if (!deleted) { LOG.error("Cannot delete object '{}'", String.format(BLOB_PATH_TEMPLATE, blobId.getBucket(), blobId...
[ "private", "void", "delete", "(", "BlobId", "blobId", ")", "{", "LOG", ".", "debug", "(", "\"Deleting object '{}'\"", ",", "String", ".", "format", "(", "BLOB_PATH_TEMPLATE", ",", "blobId", ".", "getBucket", "(", ")", ",", "blobId", ".", "getName", "(", ")...
Delete a blob for gcs @param blobId blobId
[ "Delete", "a", "blob", "for", "gcs" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/google-cloud-lib/src/main/java/com/streamsets/pipeline/stage/cloudstorage/origin/GcsObjectPostProcessingHandler.java#L44-L50
test
Delete the object from the storage.
Create a Java method that does the following: "Delete the object from the storage.".
Of course, here is the Java code you requested: ```java private void delete(BlobId blobId) { LOG.debug("Deleting object '{}'", String.format(BLOB_PATH_TEMPLATE, blobId.getBucket(), blobId.getName())); boolean deleted = storage.delete(blobId); if (!deleted) { LOG.error("Cannot delete object '{}'", Str...
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/AuthenticateApi.java
AuthenticateApi.createSubjectAndPushItOnThreadAsNeeded
private void createSubjectAndPushItOnThreadAsNeeded(HttpServletRequest req, HttpServletResponse res) { // We got a new instance of FormLogoutExtensionProcess every request. logoutSubject = null; Subject subject = subjectManager.getCallerSubject(); if (subject == null || subjectHelper.isU...
java
private void createSubjectAndPushItOnThreadAsNeeded(HttpServletRequest req, HttpServletResponse res) { // We got a new instance of FormLogoutExtensionProcess every request. logoutSubject = null; Subject subject = subjectManager.getCallerSubject(); if (subject == null || subjectHelper.isU...
[ "private", "void", "createSubjectAndPushItOnThreadAsNeeded", "(", "HttpServletRequest", "req", ",", "HttpServletResponse", "res", ")", "{", "// We got a new instance of FormLogoutExtensionProcess every request.", "logoutSubject", "=", "null", ";", "Subject", "subject", "=", "su...
For formLogout, this is a new request and there is no subject on the thread. A previous request handled on this thread may not be from this same client. We have to authenticate using the token and push the subject on thread so webcontainer can use the subject credential to invalidate the session. @param req @param res
[ "For", "formLogout", "this", "is", "a", "new", "request", "and", "there", "is", "no", "subject", "on", "the", "thread", ".", "A", "previous", "request", "handled", "on", "this", "thread", "may", "not", "be", "from", "this", "same", "client", ".", "We", ...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/AuthenticateApi.java#L534-L551
train
This method creates the subject and pushes it on thread as needed.
Create a Java method that does the following: "This method creates the subject and pushes it on thread as needed.".
Of course, here is the Java code you requested: ```java private void createSubjectAndPushItOnThreadAsNeeded(HttpServletRequest req, HttpServletResponse res) { // We got a new instance of FormLogoutExtensionProcess every request. logoutSubject = null; Subject subject = subjectManager.getCallerSu...
jparsec/jparsec
jparsec/src/main/java/org/jparsec/pattern/CharPredicates.java
CharPredicates.and
public static CharPredicate and(final CharPredicate... predicates) { if (predicates.length == 0) return ALWAYS; else if (predicates.length == 1) return predicates[0]; return new CharPredicate() { @Override public boolean isChar(char c) { for(int i = 0;i < predicates.length;i++) { ...
java
public static CharPredicate and(final CharPredicate... predicates) { if (predicates.length == 0) return ALWAYS; else if (predicates.length == 1) return predicates[0]; return new CharPredicate() { @Override public boolean isChar(char c) { for(int i = 0;i < predicates.length;i++) { ...
[ "public", "static", "CharPredicate", "and", "(", "final", "CharPredicate", "...", "predicates", ")", "{", "if", "(", "predicates", ".", "length", "==", "0", ")", "return", "ALWAYS", ";", "else", "if", "(", "predicates", ".", "length", "==", "1", ")", "re...
A {@link CharPredicate} that returns true if all {@code CharPredicate} in {@code predicates} evaluate to true.
[ "A", "{" ]
df1280259f5da9eb5ffc537437569dddba66cb94
https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/CharPredicates.java#L292-L307
train
Create an AND predicate from the given predicates.
Create a Java method that does the following: "Create an AND predicate from the given predicates.".
Of course, here is the Java code you requested: ```java public static CharPredicate and(final CharPredicate... predicates) { if (predicates.length == 0) return ALWAYS; else if (predicates.length == 1) return predicates[0]; return new CharPredicate() { @Override public boolean isChar(char c) { ...
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/RowServiceSkinny.java
RowServiceSkinny.row
private Row row(DecoratedKey partitionKey, long timestamp) { QueryFilter queryFilter = QueryFilter.getIdentityFilter(partitionKey, metadata.cfName, timestamp); ColumnFamily columnFamily = baseCfs.getColumnFamily(queryFilter); if (columnFamily != null) { ColumnFamily cleanColumnFamily...
java
private Row row(DecoratedKey partitionKey, long timestamp) { QueryFilter queryFilter = QueryFilter.getIdentityFilter(partitionKey, metadata.cfName, timestamp); ColumnFamily columnFamily = baseCfs.getColumnFamily(queryFilter); if (columnFamily != null) { ColumnFamily cleanColumnFamily...
[ "private", "Row", "row", "(", "DecoratedKey", "partitionKey", ",", "long", "timestamp", ")", "{", "QueryFilter", "queryFilter", "=", "QueryFilter", ".", "getIdentityFilter", "(", "partitionKey", ",", "metadata", ".", "cfName", ",", "timestamp", ")", ";", "Column...
Returns the CQL3 {@link Row} identified by the specified key pair, using the specified time stamp to ignore deleted columns. The {@link Row} is retrieved from the storage engine, so it involves IO operations. @param partitionKey The partition key. @param timestamp The time stamp to ignore deleted columns. @return T...
[ "Returns", "the", "CQL3", "{", "@link", "Row", "}", "identified", "by", "the", "specified", "key", "pair", "using", "the", "specified", "time", "stamp", "to", "ignore", "deleted", "columns", ".", "The", "{", "@link", "Row", "}", "is", "retrieved", "from", ...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/RowServiceSkinny.java#L133-L141
train
Get a Row from the base CFS.
Create a Java method that does the following: "Get a Row from the base CFS.".
Of course, here is the Java code you requested: ```java private Row row(DecoratedKey partitionKey, long timestamp) { QueryFilter queryFilter = QueryFilter.getIdentityFilter(partitionKey, metadata.cfName, timestamp); ColumnFamily columnFamily = baseCfs.getColumnFamily(queryFilter); if (columnFam...
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java
Camera.setLimits
private void setLimits(Surface surface, int gridH, int gridV) { Check.notNull(surface); if (gridH == 0) { limitRight = 0; } else { limitRight = Math.max(0, surface.getWidth() - UtilMath.getRounded(width, gridH)); } if (gridV ==...
java
private void setLimits(Surface surface, int gridH, int gridV) { Check.notNull(surface); if (gridH == 0) { limitRight = 0; } else { limitRight = Math.max(0, surface.getWidth() - UtilMath.getRounded(width, gridH)); } if (gridV ==...
[ "private", "void", "setLimits", "(", "Surface", "surface", ",", "int", "gridH", ",", "int", "gridV", ")", "{", "Check", ".", "notNull", "(", "surface", ")", ";", "if", "(", "gridH", "==", "0", ")", "{", "limitRight", "=", "0", ";", "}", "else", "{"...
Define the maximum view limit. @param surface The surface reference. @param gridH The horizontal grid. @param gridV The vertical grid. @throws LionEngineException If <code>null</code> surface.
[ "Define", "the", "maximum", "view", "limit", "." ]
cac3d5578532cf11724a737b9f09e71bf9995ab2
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java#L263-L287
train
Set limits for a single image image.
Create a Java method that does the following: "Set limits for a single image image.".
Of course, here is the Java code you requested: ```java private void setLimits(Surface surface, int gridH, int gridV) { Check.notNull(surface); if (gridH == 0) { limitRight = 0; } else { limitRight = Math.max(0, surface.getWidth() - UtilMath....
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/db/DBService.java
DBService.getRow
public DRow getRow(String storeName, String rowKey) { return new DRow(m_tenant, storeName, rowKey); }
java
public DRow getRow(String storeName, String rowKey) { return new DRow(m_tenant, storeName, rowKey); }
[ "public", "DRow", "getRow", "(", "String", "storeName", ",", "String", "rowKey", ")", "{", "return", "new", "DRow", "(", "m_tenant", ",", "storeName", ",", "rowKey", ")", ";", "}" ]
Get iterator for rows with a specific set of keys. Results are returned as an Iterator of {@link DRow} objects. If any given row is not found, no entry with its key will be returned. @param storeName Name of store to query. @param rowKeys Collection of row keys to read. @return Iterator of {@link DRow} obje...
[ "Get", "iterator", "for", "rows", "with", "a", "specific", "set", "of", "keys", ".", "Results", "are", "returned", "as", "an", "Iterator", "of", "{", "@link", "DRow", "}", "objects", ".", "If", "any", "given", "row", "is", "not", "found", "no", "entry"...
ad64d3c37922eefda68ec8869ef089c1ca604b70
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBService.java#L311-L313
train
Gets a row from the database.
Create a Java method that does the following: "Gets a row from the database.".
Of course, here is the Java code you requested: ```java public DRow getRow(String storeName, String rowKey) { return new DRow(m_tenant, storeName, rowKey); } ``` Hope this helps!
apereo/cas
core/cas-server-core-services-authentication/src/main/java/org/apereo/cas/authentication/support/DefaultCasProtocolAttributeEncoder.java
DefaultCasProtocolAttributeEncoder.encryptAndEncodeAndPutIntoAttributesMap
protected void encryptAndEncodeAndPutIntoAttributesMap(final Map<String, Object> attributes, final Map<String, String> cachedAttributesToEncode, final String cachedAttributeName, ...
java
protected void encryptAndEncodeAndPutIntoAttributesMap(final Map<String, Object> attributes, final Map<String, String> cachedAttributesToEncode, final String cachedAttributeName, ...
[ "protected", "void", "encryptAndEncodeAndPutIntoAttributesMap", "(", "final", "Map", "<", "String", ",", "Object", ">", "attributes", ",", "final", "Map", "<", "String", ",", "String", ">", "cachedAttributesToEncode", ",", "final", "String", "cachedAttributeName", "...
Encrypt, encode and put the attribute into attributes map. @param attributes the attributes @param cachedAttributesToEncode the cached attributes to encode @param cachedAttributeName the cached attribute name @param cipher the cipher @param registeredService the registered s...
[ "Encrypt", "encode", "and", "put", "the", "attribute", "into", "attributes", "map", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-services-authentication/src/main/java/org/apereo/cas/authentication/support/DefaultCasProtocolAttributeEncoder.java#L167-L185
train
Encrypt and encode and put into attributes map.
Create a Java method that does the following: "Encrypt and encode and put into attributes map.".
Of course, here is the Java code you requested: ```java protected void encryptAndEncodeAndPutIntoAttributesMap(final Map<String, Object> attributes, final Map<String, String> cachedAttributesToEncode, ...
aws/aws-sdk-java
aws-java-sdk-storagegateway/src/main/java/com/amazonaws/services/storagegateway/model/DescribeCachediSCSIVolumesResult.java
DescribeCachediSCSIVolumesResult.setCachediSCSIVolumes
public void setCachediSCSIVolumes(java.util.Collection<CachediSCSIVolume> cachediSCSIVolumes) { if (cachediSCSIVolumes == null) { this.cachediSCSIVolumes = null; return; } this.cachediSCSIVolumes = new com.amazonaws.internal.SdkInternalList<CachediSCSIVolume>(cachediSCSI...
java
public void setCachediSCSIVolumes(java.util.Collection<CachediSCSIVolume> cachediSCSIVolumes) { if (cachediSCSIVolumes == null) { this.cachediSCSIVolumes = null; return; } this.cachediSCSIVolumes = new com.amazonaws.internal.SdkInternalList<CachediSCSIVolume>(cachediSCSI...
[ "public", "void", "setCachediSCSIVolumes", "(", "java", ".", "util", ".", "Collection", "<", "CachediSCSIVolume", ">", "cachediSCSIVolumes", ")", "{", "if", "(", "cachediSCSIVolumes", "==", "null", ")", "{", "this", ".", "cachediSCSIVolumes", "=", "null", ";", ...
<p> An array of objects where each object contains metadata about one cached volume. </p> @param cachediSCSIVolumes An array of objects where each object contains metadata about one cached volume.
[ "<p", ">", "An", "array", "of", "objects", "where", "each", "object", "contains", "metadata", "about", "one", "cached", "volume", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-storagegateway/src/main/java/com/amazonaws/services/storagegateway/model/DescribeCachediSCSIVolumesResult.java#L60-L67
train
Sets the value of the cachediSCSIVolumes property.
Create a Java method that does the following: "Sets the value of the cachediSCSIVolumes property.".
Of course, here is the Java code you requested: ```java public void setCachediSCSIVolumes(java.util.Collection<CachediSCSIVolume> cachediSCSIVolumes) { if (cachediSCSIVolumes == null) { this.cachediSCSIVolumes = null; return; } this.cachediSCSIVolumes = new com.amazonaw...
cdk/cdk
display/render/src/main/java/org/openscience/cdk/renderer/color/CPKAtomColors.java
CPKAtomColors.getAtomColor
@Override public Color getAtomColor(IAtom atom, Color defaultColor) { Color color = defaultColor; String symbol = atom.getSymbol().toUpperCase(); if (atom.getAtomicNumber() != null && ATOM_COLORS_MASSNUM.containsKey(atom.getAtomicNumber())) { color = ATOM_COLORS_MASSNUM.get(atom....
java
@Override public Color getAtomColor(IAtom atom, Color defaultColor) { Color color = defaultColor; String symbol = atom.getSymbol().toUpperCase(); if (atom.getAtomicNumber() != null && ATOM_COLORS_MASSNUM.containsKey(atom.getAtomicNumber())) { color = ATOM_COLORS_MASSNUM.get(atom....
[ "@", "Override", "public", "Color", "getAtomColor", "(", "IAtom", "atom", ",", "Color", "defaultColor", ")", "{", "Color", "color", "=", "defaultColor", ";", "String", "symbol", "=", "atom", ".", "getSymbol", "(", ")", ".", "toUpperCase", "(", ")", ";", ...
Returns the font color for atom given atom. @param atom the atom. @param defaultColor atom default color. @return A color for the atom. The default colour is used if none is found for the atom.
[ "Returns", "the", "font", "color", "for", "atom", "given", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/color/CPKAtomColors.java#L152-L163
train
Get the color of an atom.
Create a Java method that does the following: "Get the color of an atom.".
Of course, here is the Java code you requested: ```java @Override public Color getAtomColor(IAtom atom, Color defaultColor) { Color color = defaultColor; String symbol = atom.getSymbol().toUpperCase(); if (atom.getAtomicNumber() != null && ATOM_COLORS_MASSNUM.containsKey(atom.getAtomicNumbe...
looly/hutool
hutool-cron/src/main/java/cn/hutool/cron/listener/TaskListenerManager.java
TaskListenerManager.notifyTaskStart
public void notifyTaskStart(TaskExecutor executor) { synchronized (listeners) { int size = listeners.size(); for (int i = 0; i < size; i++) { TaskListener listenerl = listeners.get(i); listenerl.onStart(executor); } } }
java
public void notifyTaskStart(TaskExecutor executor) { synchronized (listeners) { int size = listeners.size(); for (int i = 0; i < size; i++) { TaskListener listenerl = listeners.get(i); listenerl.onStart(executor); } } }
[ "public", "void", "notifyTaskStart", "(", "TaskExecutor", "executor", ")", "{", "synchronized", "(", "listeners", ")", "{", "int", "size", "=", "listeners", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i"...
通知所有监听任务启动器启动 @param executor {@link TaskExecutor}
[ "通知所有监听任务启动器启动" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/listener/TaskListenerManager.java#L45-L53
train
Notifies all listeners that the task is starting.
Create a Java method that does the following: "Notifies all listeners that the task is starting.".
Of course, here is the Java code you requested: ```java public void notifyTaskStart(TaskExecutor executor) { synchronized (listeners) { int size = listeners.size(); for (int i = 0; i < size; i++) { TaskListener listenerl = listeners.get(i); listenerl.onStart(executor); } } } ``` Hope thi...
jbehave/jbehave-core
jbehave-needle/src/main/java/org/jbehave/core/steps/needle/NeedleStepsFactory.java
NeedleStepsFactory.methodReturningConverters
private List<ParameterConverter> methodReturningConverters(final Class<?> type) { final List<ParameterConverter> converters = new ArrayList<>(); for (final Method method : type.getMethods()) { if (method.isAnnotationPresent(AsParameterConverter.class)) { converters.add(new Me...
java
private List<ParameterConverter> methodReturningConverters(final Class<?> type) { final List<ParameterConverter> converters = new ArrayList<>(); for (final Method method : type.getMethods()) { if (method.isAnnotationPresent(AsParameterConverter.class)) { converters.add(new Me...
[ "private", "List", "<", "ParameterConverter", ">", "methodReturningConverters", "(", "final", "Class", "<", "?", ">", "type", ")", "{", "final", "List", "<", "ParameterConverter", ">", "converters", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", ...
Create parameter converters from methods annotated with @AsParameterConverter @see {@link AbstractStepsFactory}
[ "Create", "parameter", "converters", "from", "methods", "annotated", "with" ]
bdd6a6199528df3c35087e72d4644870655b23e6
https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-needle/src/main/java/org/jbehave/core/steps/needle/NeedleStepsFactory.java#L137-L145
train
Method returning converters.
Create a Java method that does the following: "Method returning converters.".
Of course, here is the Java code you requested: ```java private List<ParameterConverter> methodReturningConverters(final Class<?> type) { final List<ParameterConverter> converters = new ArrayList<>(); for (final Method method : type.getMethods()) { if (method.isAnnotationPresent(AsParameter...
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.unprotectedMkdir
private void unprotectedMkdir(long inodeId, INode[] inodes, int pos, byte[] name, PermissionStatus permission, boolean inheritPermission, long timestamp) throws QuotaExceededException { inodes[pos] = addChild(inodes, pos, new INodeDirectory(inodeId, name, permission, timestamp), -1, inhe...
java
private void unprotectedMkdir(long inodeId, INode[] inodes, int pos, byte[] name, PermissionStatus permission, boolean inheritPermission, long timestamp) throws QuotaExceededException { inodes[pos] = addChild(inodes, pos, new INodeDirectory(inodeId, name, permission, timestamp), -1, inhe...
[ "private", "void", "unprotectedMkdir", "(", "long", "inodeId", ",", "INode", "[", "]", "inodes", ",", "int", "pos", ",", "byte", "[", "]", "name", ",", "PermissionStatus", "permission", ",", "boolean", "inheritPermission", ",", "long", "timestamp", ")", "thr...
create a directory at index pos. The parent path to the directory is at [0, pos-1]. All ancestors exist. Newly created one stored at index pos.
[ "create", "a", "directory", "at", "index", "pos", ".", "The", "parent", "path", "to", "the", "directory", "is", "at", "[", "0", "pos", "-", "1", "]", ".", "All", "ancestors", "exist", ".", "Newly", "created", "one", "stored", "at", "index", "pos", "....
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2388-L2394
train
Unprotected mkdir method.
Create a Java method that does the following: "Unprotected mkdir method.".
Of course, here is the Java code you requested: ```java private void unprotectedMkdir(long inodeId, INode[] inodes, int pos, byte[] name, PermissionStatus permission, boolean inheritPermission, long timestamp) throws QuotaExceededException { inodes[pos] = addChild(inodes, pos, new INodeDirector...
networknt/light-4j
registry/src/main/java/com/networknt/registry/URLImpl.java
URLImpl.canServe
@Override public boolean canServe(URL refUrl) { if (refUrl == null || !this.getPath().equals(refUrl.getPath())) { return false; } if(!protocol.equals(refUrl.getProtocol())) { return false; } if (!Constants.NODE_TYPE_SERVICE.equals(this.getParameter(U...
java
@Override public boolean canServe(URL refUrl) { if (refUrl == null || !this.getPath().equals(refUrl.getPath())) { return false; } if(!protocol.equals(refUrl.getProtocol())) { return false; } if (!Constants.NODE_TYPE_SERVICE.equals(this.getParameter(U...
[ "@", "Override", "public", "boolean", "canServe", "(", "URL", "refUrl", ")", "{", "if", "(", "refUrl", "==", "null", "||", "!", "this", ".", "getPath", "(", ")", ".", "equals", "(", "refUrl", ".", "getPath", "(", ")", ")", ")", "{", "return", "fals...
check if this url can serve the refUrl. @param refUrl a URL object @return boolean true can serve
[ "check", "if", "this", "url", "can", "serve", "the", "refUrl", "." ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/registry/src/main/java/com/networknt/registry/URLImpl.java#L348-L376
train
Check if this URL can serve the given refUrl.
Create a Java method that does the following: "Check if this URL can serve the given refUrl.".
Of course, here is the Java code you requested: ```java @Override public boolean canServe(URL refUrl) { if (refUrl == null || !this.getPath().equals(refUrl.getPath())) { return false; } if(!protocol.equals(refUrl.getProtocol())) { return false; } if...
aws/aws-sdk-java
aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/AWSDatabaseMigrationServiceClient.java
AWSDatabaseMigrationServiceClient.deleteEventSubscription
@Override public DeleteEventSubscriptionResult deleteEventSubscription(DeleteEventSubscriptionRequest request) { request = beforeClientExecution(request); return executeDeleteEventSubscription(request); }
java
@Override public DeleteEventSubscriptionResult deleteEventSubscription(DeleteEventSubscriptionRequest request) { request = beforeClientExecution(request); return executeDeleteEventSubscription(request); }
[ "@", "Override", "public", "DeleteEventSubscriptionResult", "deleteEventSubscription", "(", "DeleteEventSubscriptionRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDeleteEventSubscription", "(", "request", ...
<p> Deletes an AWS DMS event subscription. </p> @param deleteEventSubscriptionRequest @return Result of the DeleteEventSubscription operation returned by the service. @throws ResourceNotFoundException The resource could not be found. @throws InvalidResourceStateException The resource is in a state that prevents it fro...
[ "<p", ">", "Deletes", "an", "AWS", "DMS", "event", "subscription", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dms/src/main/java/com/amazonaws/services/databasemigrationservice/AWSDatabaseMigrationServiceClient.java#L962-L966
train
Deletes an event subscription.
Create a Java method that does the following: "Deletes an event subscription.".
Of course, here is the Java code you requested: ```java @Override public DeleteEventSubscriptionResult deleteEventSubscription(DeleteEventSubscriptionRequest request) { request = beforeClientExecution(request); return executeDeleteEventSubscription(request); } ``` Hope this helps!
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/iiop/stub/DynamicStubFactoryFactory.java
DynamicStubFactoryFactory.makeStubClass
public static Class<?> makeStubClass(final Class<?> myClass) { final String stubClassName = myClass + "_Stub"; ClassLoader cl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); if (cl == null) { cl = myClass.getClassLoader(); } if (cl == null) { ...
java
public static Class<?> makeStubClass(final Class<?> myClass) { final String stubClassName = myClass + "_Stub"; ClassLoader cl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); if (cl == null) { cl = myClass.getClassLoader(); } if (cl == null) { ...
[ "public", "static", "Class", "<", "?", ">", "makeStubClass", "(", "final", "Class", "<", "?", ">", "myClass", ")", "{", "final", "String", "stubClassName", "=", "myClass", "+", "\"_Stub\"", ";", "ClassLoader", "cl", "=", "WildFlySecurityManager", ".", "getCu...
Makes a dynamic stub class, if it does not already exist. @param myClass The class to create a stub for @return The dynamic stub class
[ "Makes", "a", "dynamic", "stub", "class", "if", "it", "does", "not", "already", "exist", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/iiop/stub/DynamicStubFactoryFactory.java#L49-L76
test
Make a stub class.
Create a Java method that does the following: "Make a stub class.".
Of course, here is the Java code you requested: ```java public static Class<?> makeStubClass(final Class<?> myClass) { final String stubClassName = myClass + "_Stub"; ClassLoader cl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); if (cl == null) { cl = myClass.get...
cybazeitalia/emaze-dysfunctional
src/main/java/net/emaze/dysfunctional/Spies.java
Spies.spy3rd
public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy3rd(TriPredicate<T1, T2, T3> predicate, Box<T3> param3) { return spy(predicate, Box.<Boolean>empty(), Box.<T1>empty(), Box.<T2>empty(), param3); }
java
public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy3rd(TriPredicate<T1, T2, T3> predicate, Box<T3> param3) { return spy(predicate, Box.<Boolean>empty(), Box.<T1>empty(), Box.<T2>empty(), param3); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ">", "TriPredicate", "<", "T1", ",", "T2", ",", "T3", ">", "spy3rd", "(", "TriPredicate", "<", "T1", ",", "T2", ",", "T3", ">", "predicate", ",", "Box", "<", "T3", ">", "param3", ")", "{", "r...
Proxies a ternary predicate spying for third parameter. @param <T1> the predicate first parameter type @param <T2> the predicate second parameter type @param <T3> the predicate third parameter type @param predicate the predicate that will be spied @param param3 a box that will be containing the third spied parameter @...
[ "Proxies", "a", "ternary", "predicate", "spying", "for", "third", "parameter", "." ]
98115a436e35335c5e8831f9fdc12f6d93d524be
https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L443-L445
train
Proxies a ternary predicate spying for third parameter.
Create a Java method that does the following: "Proxies a ternary predicate spying for third parameter.".
Of course, here is the Java code you requested: ```java public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy3rd(TriPredicate<T1, T2, T3> predicate, Box<T3> param3) { return spy(predicate, Box.<Boolean>empty(), Box.<T1>empty(), Box.<T2>empty(), param3); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/model/transform/RemoveTagsRequestMarshaller.java
RemoveTagsRequestMarshaller.marshall
public void marshall(RemoveTagsRequest removeTagsRequest, ProtocolMarshaller protocolMarshaller) { if (removeTagsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(removeTagsRequest.getResourc...
java
public void marshall(RemoveTagsRequest removeTagsRequest, ProtocolMarshaller protocolMarshaller) { if (removeTagsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(removeTagsRequest.getResourc...
[ "public", "void", "marshall", "(", "RemoveTagsRequest", "removeTagsRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "removeTagsRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshal...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/model/transform/RemoveTagsRequestMarshaller.java#L45-L57
train
Creates the marshalling method for removing the tags request.
Create a Java method that does the following: "Creates the marshalling method for removing the tags request.".
Of course, here is the Java code you requested: ```java public void marshall(RemoveTagsRequest removeTagsRequest, ProtocolMarshaller protocolMarshaller) { if (removeTagsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/generator/GeneratorParameter.java
GeneratorParameter.add
public GeneratorParameter add(Preference preference) { preferences.add(preference); Collections.sort(preferences); return this; }
java
public GeneratorParameter add(Preference preference) { preferences.add(preference); Collections.sort(preferences); return this; }
[ "public", "GeneratorParameter", "add", "(", "Preference", "preference", ")", "{", "preferences", ".", "add", "(", "preference", ")", ";", "Collections", ".", "sort", "(", "preferences", ")", ";", "return", "this", ";", "}" ]
Add a preference. @param preference The preference to add. @return The generator parameter itself.
[ "Add", "a", "preference", "." ]
cac3d5578532cf11724a737b9f09e71bf9995ab2
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/generator/GeneratorParameter.java#L48-L53
train
Adds a new user - defined authority to the generator.
Create a Java method that does the following: "Adds a new user - defined authority to the generator.".
Of course, here is the Java code you requested: ```java public GeneratorParameter add(Preference preference) { preferences.add(preference); Collections.sort(preferences); return this; } ``` Hope this helps!
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/bean/IssueCategory.java
IssueCategory.create
public IssueCategory create() throws RedmineException { if (getProjectId() == null) { throw new IllegalArgumentException( "IssueCategory must contain projectId"); } return transport.addChildEntry(Project.class, getProjectId().toString(), this); }
java
public IssueCategory create() throws RedmineException { if (getProjectId() == null) { throw new IllegalArgumentException( "IssueCategory must contain projectId"); } return transport.addChildEntry(Project.class, getProjectId().toString(), this); }
[ "public", "IssueCategory", "create", "(", ")", "throws", "RedmineException", "{", "if", "(", "getProjectId", "(", ")", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"IssueCategory must contain projectId\"", ")", ";", "}", "return", "tr...
creates a new {@link IssueCategory} for the {@link Project} contained. <br> Pre-condition: the attribute {@link Project} for the {@link IssueCategory} must not be null! @return the new {@link IssueCategory} created by Redmine @throws IllegalArgumentException thrown in case the category does not contain a project...
[ "creates", "a", "new", "{", "@link", "IssueCategory", "}", "for", "the", "{", "@link", "Project", "}", "contained", ".", "<br", ">", "Pre", "-", "condition", ":", "the", "attribute", "{", "@link", "Project", "}", "for", "the", "{", "@link", "IssueCategor...
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/bean/IssueCategory.java#L139-L146
train
Creates an issue category.
Create a Java method that does the following: "Creates an issue category.".
Of course, here is the Java code you requested: ```java public IssueCategory create() throws RedmineException { if (getProjectId() == null) { throw new IllegalArgumentException( "IssueCategory must contain projectId"); } return transport.addChildEntry(Project.cl...
jbundle/jbundle
thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/JRemoteComboBox.java
JRemoteComboBox.init
public void init(ScreenLoc itsLocation, ComponentParent parentScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { this.init(null, null, null, null, null, null, false, null, null); }
java
public void init(ScreenLoc itsLocation, ComponentParent parentScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { this.init(null, null, null, null, null, null, false, null, null); }
[ "public", "void", "init", "(", "ScreenLoc", "itsLocation", ",", "ComponentParent", "parentScreen", ",", "Convert", "converter", ",", "int", "iDisplayFieldDesc", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "this", ".", "init", "(", ...
Initialize. @param itsLocation The location of this component within the parent. @param parentScreen The parent screen. @param fieldConverter The field this screen field is linked to. @param iDisplayFieldDesc Do I display the field desc?
[ "Initialize", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/JRemoteComboBox.java#L267-L270
train
Initialize the base class.
Create a Java method that does the following: "Initialize the base class.".
Of course, here is the Java code you requested: ```java public void init(ScreenLoc itsLocation, ComponentParent parentScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { this.init(null, null, null, null, null, null, false, null, null); } ``` Hope this helps!
JRebirth/JRebirth
org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/key/MultitonKey.java
MultitonKey.convertMethodKeyObject
private String convertMethodKeyObject(final KeyGenerator methodGenerator, final Object keyValue) { String res = ""; if (keyValue instanceof String) { res = (String) keyValue; } else { try { // The default annotation value is toString ...
java
private String convertMethodKeyObject(final KeyGenerator methodGenerator, final Object keyValue) { String res = ""; if (keyValue instanceof String) { res = (String) keyValue; } else { try { // The default annotation value is toString ...
[ "private", "String", "convertMethodKeyObject", "(", "final", "KeyGenerator", "methodGenerator", ",", "final", "Object", "keyValue", ")", "{", "String", "res", "=", "\"\"", ";", "if", "(", "keyValue", "instanceof", "String", ")", "{", "res", "=", "(", "String",...
Convert the key returned by an annotated method to a string (using annotation value or not). @param methodGenerator the method annotation @param keyValue the returned key value @return the key converted from object
[ "Convert", "the", "key", "returned", "by", "an", "annotated", "method", "to", "a", "string", "(", "using", "annotation", "value", "or", "not", ")", "." ]
93f4fc087b83c73db540333b9686e97b4cec694d
https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/key/MultitonKey.java#L182-L218
train
Convert method key object to string.
Create a Java method that does the following: "Convert method key object to string.".
Of course, here is the Java code you requested: ```java private String convertMethodKeyObject(final KeyGenerator methodGenerator, final Object keyValue) { String res = ""; if (keyValue instanceof String) { res = (String) keyValue; } else { try { /...
PureSolTechnologies/parsers
parsers/src/main/java/com/puresoltechnologies/parsers/grammar/GrammarConverter.java
GrammarConverter.getTokens
private Map<String, ParseTreeNode> getTokens() throws GrammarException, TreeException { Map<String, ParseTreeNode> tokens = new HashMap<String, ParseTreeNode>(); ParseTreeNode tokensTree = parserTree.getChild("Tokens"); ParseTreeNode tokenDefinitions = tokensTree.getChild("TokenDefinitions"); for (ParseTreeNod...
java
private Map<String, ParseTreeNode> getTokens() throws GrammarException, TreeException { Map<String, ParseTreeNode> tokens = new HashMap<String, ParseTreeNode>(); ParseTreeNode tokensTree = parserTree.getChild("Tokens"); ParseTreeNode tokenDefinitions = tokensTree.getChild("TokenDefinitions"); for (ParseTreeNod...
[ "private", "Map", "<", "String", ",", "ParseTreeNode", ">", "getTokens", "(", ")", "throws", "GrammarException", ",", "TreeException", "{", "Map", "<", "String", ",", "ParseTreeNode", ">", "tokens", "=", "new", "HashMap", "<", "String", ",", "ParseTreeNode", ...
This method reads all tokens from AST and returns a map with all of them. @return @throws TreeException
[ "This", "method", "reads", "all", "tokens", "from", "AST", "and", "returns", "a", "map", "with", "all", "of", "them", "." ]
61077223b90d3768ff9445ae13036343c98b63cd
https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/grammar/GrammarConverter.java#L158-L181
train
Get tokens from the parser tree.
Create a Java method that does the following: "Get tokens from the parser tree.".
Of course, here is the Java code you requested: ```java private Map<String, ParseTreeNode> getTokens() throws GrammarException, TreeException { Map<String, ParseTreeNode> tokens = new HashMap<String, ParseTreeNode>(); ParseTreeNode tokensTree = parserTree.getChild("Tokens"); ParseTreeNode tokenDefinitions = to...
tango-controls/JTango
client/src/main/java/fr/soleil/tango/statecomposer/PriorityStateManager.java
PriorityStateManager.getDeviceStateNumberArray
public short[] getDeviceStateNumberArray() { final short[] array = new short[deviceStateMap.size()]; int i = 0; for (final Map.Entry<String, DevState> deviceStateEntry : deviceStateMap.entrySet()) { final DevState deviceState = deviceStateEntry.getValue(); array[i++] = (short) getPriorityForState(deviceSt...
java
public short[] getDeviceStateNumberArray() { final short[] array = new short[deviceStateMap.size()]; int i = 0; for (final Map.Entry<String, DevState> deviceStateEntry : deviceStateMap.entrySet()) { final DevState deviceState = deviceStateEntry.getValue(); array[i++] = (short) getPriorityForState(deviceSt...
[ "public", "short", "[", "]", "getDeviceStateNumberArray", "(", ")", "{", "final", "short", "[", "]", "array", "=", "new", "short", "[", "deviceStateMap", ".", "size", "(", ")", "]", ";", "int", "i", "=", "0", ";", "for", "(", "final", "Map", ".", "...
return an array of short which contains the priority of state of monitored devices. @return short[]
[ "return", "an", "array", "of", "short", "which", "contains", "the", "priority", "of", "state", "of", "monitored", "devices", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/statecomposer/PriorityStateManager.java#L131-L140
train
Gets the device state number array.
Create a Java method that does the following: "Gets the device state number array.".
Of course, here is the Java code you requested: ```java public short[] getDeviceStateNumberArray() { final short[] array = new short[deviceStateMap.size()]; int i = 0; for (final Map.Entry<String, DevState> deviceStateEntry : deviceStateMap.entrySet()) { final DevState deviceState = deviceStateEntry.getValue(...
hazelcast/hazelcast
hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/HazelcastClientCachingProvider.java
HazelcastClientCachingProvider.getOrCreateByInstanceName
private HazelcastInstance getOrCreateByInstanceName(String instanceName) { HazelcastInstance instance = HazelcastClient.getHazelcastClientByName(instanceName); if (instance == null) { ClientConfig clientConfig = getDefaultClientConfig(); clientConfig.setInstanceName(instanceName)...
java
private HazelcastInstance getOrCreateByInstanceName(String instanceName) { HazelcastInstance instance = HazelcastClient.getHazelcastClientByName(instanceName); if (instance == null) { ClientConfig clientConfig = getDefaultClientConfig(); clientConfig.setInstanceName(instanceName)...
[ "private", "HazelcastInstance", "getOrCreateByInstanceName", "(", "String", "instanceName", ")", "{", "HazelcastInstance", "instance", "=", "HazelcastClient", ".", "getHazelcastClientByName", "(", "instanceName", ")", ";", "if", "(", "instance", "==", "null", ")", "{"...
Gets an existing {@link HazelcastInstance} by {@code instanceName} or, if not found, creates a new {@link HazelcastInstance} with the default configuration and given {@code instanceName}. @param instanceName name to lookup an existing {@link HazelcastInstance} or to create a new one @return a {@link HazelcastInstance}...
[ "Gets", "an", "existing", "{", "@link", "HazelcastInstance", "}", "by", "{", "@code", "instanceName", "}", "or", "if", "not", "found", "creates", "a", "new", "{", "@link", "HazelcastInstance", "}", "with", "the", "default", "configuration", "and", "given", "...
8c4bc10515dbbfb41a33e0302c0caedf3cda1baf
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/HazelcastClientCachingProvider.java#L152-L160
train
Gets the HazelcastInstance by name.
Create a Java method that does the following: "Gets the HazelcastInstance by name.".
Of course, here is the Java code you requested: ```java private HazelcastInstance getOrCreateByInstanceName(String instanceName) { HazelcastInstance instance = HazelcastClient.getHazelcastClientByName(instanceName); if (instance == null) { ClientConfig clientConfig = getDefaultClientConfig(...
apereo/cas
support/cas-server-support-radius-core/src/main/java/org/apereo/cas/adaptors/radius/RadiusUtils.java
RadiusUtils.authenticate
public static Pair<Boolean, Optional<Map<String, Object>>> authenticate(final String username, final String password, final List<RadiusServer> servers, ...
java
public static Pair<Boolean, Optional<Map<String, Object>>> authenticate(final String username, final String password, final List<RadiusServer> servers, ...
[ "public", "static", "Pair", "<", "Boolean", ",", "Optional", "<", "Map", "<", "String", ",", "Object", ">", ">", ">", "authenticate", "(", "final", "String", "username", ",", "final", "String", "password", ",", "final", "List", "<", "RadiusServer", ">", ...
Authenticate pair. @param username the username @param password the password @param servers the servers @param failoverOnAuthenticationFailure the failover on authentication failure @param failoverOnException the failover on exception @p...
[ "Authenticate", "pair", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-radius-core/src/main/java/org/apereo/cas/adaptors/radius/RadiusUtils.java#L36-L64
train
Authenticate.
Create a Java method that does the following: "Authenticate.".
Of course, here is the Java code you requested: ```java public static Pair<Boolean, Optional<Map<String, Object>>> authenticate(final String username, final String password, ...