repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
201
func_name
stringlengths
4
126
whole_func_string
stringlengths
75
3.57k
language
stringclasses
1 value
func_code_string
stringlengths
75
3.57k
func_code_tokens
listlengths
21
599
func_documentation_string
stringlengths
61
1.95k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/provisioning/ContentBasedLocalBundleRepository.java
ContentBasedLocalBundleRepository.selectBundle
public File selectBundle(String baseLocation, final String symbolicName, final VersionRange versionRange) { readCache(); return selectResource(baseLocation, symbolicName, versionRange); }
java
public File selectBundle(String baseLocation, final String symbolicName, final VersionRange versionRange) { readCache(); return selectResource(baseLocation, symbolicName, versionRange); }
[ "public", "File", "selectBundle", "(", "String", "baseLocation", ",", "final", "String", "symbolicName", ",", "final", "VersionRange", "versionRange", ")", "{", "readCache", "(", ")", ";", "return", "selectResource", "(", "baseLocation", ",", "symbolicName", ",", ...
This method selects bundles based on the input criteria. The first parameter is the baseLocation. This can be null, the empty string, a directory, a comma separated list of directories, or a file path relative to the install. If it is a file path then that exact bundle is returned irrespective of other selection parame...
[ "This", "method", "selects", "bundles", "based", "on", "the", "input", "criteria", ".", "The", "first", "parameter", "is", "the", "baseLocation", ".", "This", "can", "be", "null", "the", "empty", "string", "a", "directory", "a", "comma", "separated", "list",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/provisioning/ContentBasedLocalBundleRepository.java#L326-L329
allengeorge/libraft
libraft-agent/src/main/java/io/libraft/agent/protocol/RaftRPC.java
RaftRPC.setupJacksonAnnotatedCommandSerializationAndDeserialization
public static <T extends Command> void setupJacksonAnnotatedCommandSerializationAndDeserialization(ObjectMapper mapper, Class<T> commandSubclassKlass) { SimpleModule module = new SimpleModule("raftrpc-jackson-command-module", new Version(0, 0, 0, "inline", "io.libraft", "raftrpc-jackson-command-module")); ...
java
public static <T extends Command> void setupJacksonAnnotatedCommandSerializationAndDeserialization(ObjectMapper mapper, Class<T> commandSubclassKlass) { SimpleModule module = new SimpleModule("raftrpc-jackson-command-module", new Version(0, 0, 0, "inline", "io.libraft", "raftrpc-jackson-command-module")); ...
[ "public", "static", "<", "T", "extends", "Command", ">", "void", "setupJacksonAnnotatedCommandSerializationAndDeserialization", "(", "ObjectMapper", "mapper", ",", "Class", "<", "T", ">", "commandSubclassKlass", ")", "{", "SimpleModule", "module", "=", "new", "SimpleM...
Setup serialization and deserialization for Jackson-annotated {@link Command} subclasses. All Jackson-annotated {@code Command} subclasses <strong>must</strong> derive from a single base class. <p/> The following <strong>is</strong> supported: <pre> Object +-- CMD_BASE +-- CMD_0 +-- CMD_1 </pre> And the following is <s...
[ "Setup", "serialization", "and", "deserialization", "for", "Jackson", "-", "annotated", "{", "@link", "Command", "}", "subclasses", ".", "All", "Jackson", "-", "annotated", "{", "@code", "Command", "}", "subclasses", "<strong", ">", "must<", "/", "strong", ">"...
train
https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-agent/src/main/java/io/libraft/agent/protocol/RaftRPC.java#L93-L100
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/repeater/RepeaterExample.java
RepeaterExample.preparePaintComponent
@Override protected void preparePaintComponent(final Request request) { if (!isInitialised()) { MyDataBean myBean = new MyDataBean(); myBean.setName("My Bean"); myBean.addBean(new SomeDataBean("blah", "more blah")); myBean.addBean(new SomeDataBean()); repeaterFields.setData(myBean); setInitialis...
java
@Override protected void preparePaintComponent(final Request request) { if (!isInitialised()) { MyDataBean myBean = new MyDataBean(); myBean.setName("My Bean"); myBean.addBean(new SomeDataBean("blah", "more blah")); myBean.addBean(new SomeDataBean()); repeaterFields.setData(myBean); setInitialis...
[ "@", "Override", "protected", "void", "preparePaintComponent", "(", "final", "Request", "request", ")", "{", "if", "(", "!", "isInitialised", "(", ")", ")", "{", "MyDataBean", "myBean", "=", "new", "MyDataBean", "(", ")", ";", "myBean", ".", "setName", "("...
Override preparepaint to initialise the data on first acecss by a user. @param request the request being responded to.
[ "Override", "preparepaint", "to", "initialise", "the", "data", "on", "first", "acecss", "by", "a", "user", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/validation/repeater/RepeaterExample.java#L90-L103
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java
KMLWriterDriver.getKMLType
private static String getKMLType(int sqlTypeId, String sqlTypeName) throws SQLException { switch (sqlTypeId) { case Types.BOOLEAN: return "bool"; case Types.DOUBLE: return "double"; case Types.FLOAT: return "float"; ...
java
private static String getKMLType(int sqlTypeId, String sqlTypeName) throws SQLException { switch (sqlTypeId) { case Types.BOOLEAN: return "bool"; case Types.DOUBLE: return "double"; case Types.FLOAT: return "float"; ...
[ "private", "static", "String", "getKMLType", "(", "int", "sqlTypeId", ",", "String", "sqlTypeName", ")", "throws", "SQLException", "{", "switch", "(", "sqlTypeId", ")", "{", "case", "Types", ".", "BOOLEAN", ":", "return", "\"bool\"", ";", "case", "Types", "....
Return the kml type representation from SQL data type @param sqlTypeId @param sqlTypeName @return @throws SQLException
[ "Return", "the", "kml", "type", "representation", "from", "SQL", "data", "type" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/kml/KMLWriterDriver.java#L377-L398
galan/verjson
src/main/java/de/galan/verjson/util/Transformations.java
Transformations.getArrayAndRemove
public static ArrayNode getArrayAndRemove(ObjectNode obj, String fieldName) { ArrayNode result = null; if (obj != null) { result = array(remove(obj, fieldName)); } return result; }
java
public static ArrayNode getArrayAndRemove(ObjectNode obj, String fieldName) { ArrayNode result = null; if (obj != null) { result = array(remove(obj, fieldName)); } return result; }
[ "public", "static", "ArrayNode", "getArrayAndRemove", "(", "ObjectNode", "obj", ",", "String", "fieldName", ")", "{", "ArrayNode", "result", "=", "null", ";", "if", "(", "obj", "!=", "null", ")", "{", "result", "=", "array", "(", "remove", "(", "obj", ",...
Removes the field from a ObjectNode and returns it as ArrayNode
[ "Removes", "the", "field", "from", "a", "ObjectNode", "and", "returns", "it", "as", "ArrayNode" ]
train
https://github.com/galan/verjson/blob/4db610fb5198fde913114ed628234f957e1c19d5/src/main/java/de/galan/verjson/util/Transformations.java#L80-L86
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/BitSet.java
BitSet.valueOf
public static BitSet valueOf(long[] longs) { int n; for (n = longs.length; n > 0 && longs[n - 1] == 0; n--) ; return new BitSet(Arrays.copyOf(longs, n)); }
java
public static BitSet valueOf(long[] longs) { int n; for (n = longs.length; n > 0 && longs[n - 1] == 0; n--) ; return new BitSet(Arrays.copyOf(longs, n)); }
[ "public", "static", "BitSet", "valueOf", "(", "long", "[", "]", "longs", ")", "{", "int", "n", ";", "for", "(", "n", "=", "longs", ".", "length", ";", "n", ">", "0", "&&", "longs", "[", "n", "-", "1", "]", "==", "0", ";", "n", "--", ")", ";...
Returns a new bit set containing all the bits in the given long array. <p>More precisely, <br>{@code BitSet.valueOf(longs).get(n) == ((longs[n/64] & (1L<<(n%64))) != 0)} <br>for all {@code n < 64 * longs.length}. <p>This method is equivalent to {@code BitSet.valueOf(LongBuffer.wrap(longs))}. @param longs a long arra...
[ "Returns", "a", "new", "bit", "set", "containing", "all", "the", "bits", "in", "the", "given", "long", "array", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/BitSet.java#L195-L200
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java
DateFormatSymbols.setZodiacNames
public void setZodiacNames(String[] zodiacNames, int context, int width) { if (context == FORMAT && width == ABBREVIATED) { shortZodiacNames = duplicate(zodiacNames); } }
java
public void setZodiacNames(String[] zodiacNames, int context, int width) { if (context == FORMAT && width == ABBREVIATED) { shortZodiacNames = duplicate(zodiacNames); } }
[ "public", "void", "setZodiacNames", "(", "String", "[", "]", "zodiacNames", ",", "int", "context", ",", "int", "width", ")", "{", "if", "(", "context", "==", "FORMAT", "&&", "width", "==", "ABBREVIATED", ")", "{", "shortZodiacNames", "=", "duplicate", "(",...
Sets calendar zodiac name strings, for example: "Rat", "Ox", "Tiger", etc. @param zodiacNames The new zodiac name strings. @param context The usage context: FORMAT, STANDALONE (currently only FORMAT is supported). @param width The name width: WIDE, ABBREVIATED, NARROW (currently only ABBREVIATED is supported).
[ "Sets", "calendar", "zodiac", "name", "strings", "for", "example", ":", "Rat", "Ox", "Tiger", "etc", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java#L1148-L1152
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java
XMLResultsParser.parseBooleanResult
static private Result parseBooleanResult(Command cmd, XMLStreamReader rdr, List<String> metadata) throws XMLStreamException, SparqlException { if (rdr.next() != CHARACTERS) { throw new SparqlException("Unexpected data in Boolean result: " + rdr.getEventType()); } boolean result = Boolean.parseB...
java
static private Result parseBooleanResult(Command cmd, XMLStreamReader rdr, List<String> metadata) throws XMLStreamException, SparqlException { if (rdr.next() != CHARACTERS) { throw new SparqlException("Unexpected data in Boolean result: " + rdr.getEventType()); } boolean result = Boolean.parseB...
[ "static", "private", "Result", "parseBooleanResult", "(", "Command", "cmd", ",", "XMLStreamReader", "rdr", ",", "List", "<", "String", ">", "metadata", ")", "throws", "XMLStreamException", ",", "SparqlException", "{", "if", "(", "rdr", ".", "next", "(", ")", ...
Parses a boolean result from the reader. The reader is expected to be on the START_ELEMENT event for the opening <boolean> tag. @param cmd The command to associate with the result. @param rdr The XML reader from which to read the result. @param metadata The metadata to include in the result. @return The parsed result.
[ "Parses", "a", "boolean", "result", "from", "the", "reader", ".", "The", "reader", "is", "expected", "to", "be", "on", "the", "START_ELEMENT", "event", "for", "the", "opening", "<boolean", ">", "tag", "." ]
train
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L174-L183
windup/windup
rules-xml/api/src/main/java/org/jboss/windup/rules/apps/xml/service/XmlFileService.java
XmlFileService.loadDocument
public Document loadDocument(GraphRewrite event, EvaluationContext context, XmlFileModel model) throws WindupException { if (model.asFile().length() == 0) { final String msg = "Failed to parse, XML file is empty: " + model.getFilePath(); LOG.log(Level.WARNING, msg); ...
java
public Document loadDocument(GraphRewrite event, EvaluationContext context, XmlFileModel model) throws WindupException { if (model.asFile().length() == 0) { final String msg = "Failed to parse, XML file is empty: " + model.getFilePath(); LOG.log(Level.WARNING, msg); ...
[ "public", "Document", "loadDocument", "(", "GraphRewrite", "event", ",", "EvaluationContext", "context", ",", "XmlFileModel", "model", ")", "throws", "WindupException", "{", "if", "(", "model", ".", "asFile", "(", ")", ".", "length", "(", ")", "==", "0", ")"...
Loads and parses the provided XML file. This will quietly fail (not throwing an {@link Exception}) and return null if it is unable to parse the provided {@link XmlFileModel}. A {@link ClassificationModel} will be created to indicate that this file failed to parse. @return Returns either the parsed {@link Document} or ...
[ "Loads", "and", "parses", "the", "provided", "XML", "file", ".", "This", "will", "quietly", "fail", "(", "not", "throwing", "an", "{", "@link", "Exception", "}", ")", "and", "return", "null", "if", "it", "is", "unable", "to", "parse", "the", "provided", ...
train
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-xml/api/src/main/java/org/jboss/windup/rules/apps/xml/service/XmlFileService.java#L66-L109
ocelotds/ocelot
ocelot-web/src/main/java/org/ocelotds/topic/TopicManagerImpl.java
TopicManagerImpl.unregisterTopicSession
@Override public int unregisterTopicSession(String topic, Session session) { if (isInconsistenceContext(topic, session)) { return 0; } logger.debug("'{}' unsubscribe to '{}'", session.getId(), topic); if (Constants.Topic.ALL.equals(topic)) { for (Map.Entry<String, Collection<Session>> entry : map....
java
@Override public int unregisterTopicSession(String topic, Session session) { if (isInconsistenceContext(topic, session)) { return 0; } logger.debug("'{}' unsubscribe to '{}'", session.getId(), topic); if (Constants.Topic.ALL.equals(topic)) { for (Map.Entry<String, Collection<Session>> entry : map....
[ "@", "Override", "public", "int", "unregisterTopicSession", "(", "String", "topic", ",", "Session", "session", ")", "{", "if", "(", "isInconsistenceContext", "(", "topic", ",", "session", ")", ")", "{", "return", "0", ";", "}", "logger", ".", "debug", "(",...
Unregister session for topic. topic 'ALL' remove session for all topics @param topic @param session @return int : number subscribers remaining
[ "Unregister", "session", "for", "topic", ".", "topic", "ALL", "remove", "session", "for", "all", "topics" ]
train
https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/topic/TopicManagerImpl.java#L88-L110
datastax/java-driver
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java
SchemaBuilder.createType
@NonNull public static CreateTypeStart createType( @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier typeName) { return new DefaultCreateType(keyspace, typeName); }
java
@NonNull public static CreateTypeStart createType( @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier typeName) { return new DefaultCreateType(keyspace, typeName); }
[ "@", "NonNull", "public", "static", "CreateTypeStart", "createType", "(", "@", "Nullable", "CqlIdentifier", "keyspace", ",", "@", "NonNull", "CqlIdentifier", "typeName", ")", "{", "return", "new", "DefaultCreateType", "(", "keyspace", ",", "typeName", ")", ";", ...
Starts a CREATE TYPE query with the given type name for the given keyspace name.
[ "Starts", "a", "CREATE", "TYPE", "query", "with", "the", "given", "type", "name", "for", "the", "given", "keyspace", "name", "." ]
train
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L330-L334
VoltDB/voltdb
src/frontend/org/voltdb/jni/ExecutionEngine.java
ExecutionEngine.endStatsCollection
protected void endStatsCollection(long cacheSize, CacheUse cacheUse) { if (m_plannerStats != null) { m_plannerStats.endStatsCollection(cacheSize, 0, cacheUse, m_partitionId); } }
java
protected void endStatsCollection(long cacheSize, CacheUse cacheUse) { if (m_plannerStats != null) { m_plannerStats.endStatsCollection(cacheSize, 0, cacheUse, m_partitionId); } }
[ "protected", "void", "endStatsCollection", "(", "long", "cacheSize", ",", "CacheUse", "cacheUse", ")", "{", "if", "(", "m_plannerStats", "!=", "null", ")", "{", "m_plannerStats", ".", "endStatsCollection", "(", "cacheSize", ",", "0", ",", "cacheUse", ",", "m_p...
Finalize collected statistics (stops timer and supplies cache statistics). @param cacheSize size of cache @param cacheUse where the plan came from
[ "Finalize", "collected", "statistics", "(", "stops", "timer", "and", "supplies", "cache", "statistics", ")", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngine.java#L1253-L1257
xmlet/XsdAsmFaster
src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsm.java
XsdAsm.generateAttributes
private void generateAttributes(List<XsdAttribute> attributeVariations, String apiName) { attributeVariations.forEach(attributeVariation -> generateAttribute(attributeVariation, apiName)); }
java
private void generateAttributes(List<XsdAttribute> attributeVariations, String apiName) { attributeVariations.forEach(attributeVariation -> generateAttribute(attributeVariation, apiName)); }
[ "private", "void", "generateAttributes", "(", "List", "<", "XsdAttribute", ">", "attributeVariations", ",", "String", "apiName", ")", "{", "attributeVariations", ".", "forEach", "(", "attributeVariation", "->", "generateAttribute", "(", "attributeVariation", ",", "api...
Generates attribute classes based on the received {@link List} of {@link XsdAttribute}. @param attributeVariations The {@link List} of {@link XsdAttribute} objects that serve as a base to class creation. @param apiName The name of the resulting fluent interface.
[ "Generates", "attribute", "classes", "based", "on", "the", "received", "{" ]
train
https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsm.java#L65-L67
stratosphere/stratosphere
stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java
GlobalConfiguration.getBooleanInternal
private boolean getBooleanInternal(final String key, final boolean defaultValue) { boolean retVal = defaultValue; synchronized (this.confData) { final String value = this.confData.get(key); if (value != null) { retVal = Boolean.parseBoolean(value); } } return retVal; }
java
private boolean getBooleanInternal(final String key, final boolean defaultValue) { boolean retVal = defaultValue; synchronized (this.confData) { final String value = this.confData.get(key); if (value != null) { retVal = Boolean.parseBoolean(value); } } return retVal; }
[ "private", "boolean", "getBooleanInternal", "(", "final", "String", "key", ",", "final", "boolean", "defaultValue", ")", "{", "boolean", "retVal", "=", "defaultValue", ";", "synchronized", "(", "this", ".", "confData", ")", "{", "final", "String", "value", "="...
Returns the value associated with the given key as a boolean. @param key the key pointing to the associated value @param defaultValue the default value which is returned in case there is no value associated with the given key @return the (default) value associated with the given key
[ "Returns", "the", "value", "associated", "with", "the", "given", "key", "as", "a", "boolean", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java#L279-L292
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
DTMDocumentImpl.appendTextChild
void appendTextChild(int m_char_current_start,int contentLength) { // create a Text Node // %TBD% may be possible to combine with appendNode()to replace the next chunk of code int w0 = TEXT_NODE; // W1: Parent int w1 = currentParent; // W2: Start position within m_char int w2 = m_char_curr...
java
void appendTextChild(int m_char_current_start,int contentLength) { // create a Text Node // %TBD% may be possible to combine with appendNode()to replace the next chunk of code int w0 = TEXT_NODE; // W1: Parent int w1 = currentParent; // W2: Start position within m_char int w2 = m_char_curr...
[ "void", "appendTextChild", "(", "int", "m_char_current_start", ",", "int", "contentLength", ")", "{", "// create a Text Node", "// %TBD% may be possible to combine with appendNode()to replace the next chunk of code", "int", "w0", "=", "TEXT_NODE", ";", "// W1: Parent", "int", "...
Append a text child at the current insertion point. Assumes that the actual content of the text has previously been appended to the m_char buffer (shared with the builder). @param m_char_current_start int Starting offset of node's content in m_char. @param contentLength int Length of node's content in m_char.
[ "Append", "a", "text", "child", "at", "the", "current", "insertion", "point", ".", "Assumes", "that", "the", "actual", "content", "of", "the", "text", "has", "previously", "been", "appended", "to", "the", "m_char", "buffer", "(", "shared", "with", "the", "...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java#L2091-L2105
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/context/CounterContext.java
CounterContext.findPositionOf
@VisibleForTesting public int findPositionOf(ByteBuffer context, CounterId id) { int headerLength = headerLength(context); int offset = context.position() + headerLength; int left = 0; int right = (context.remaining() - headerLength) / STEP_LENGTH - 1; while (right >= l...
java
@VisibleForTesting public int findPositionOf(ByteBuffer context, CounterId id) { int headerLength = headerLength(context); int offset = context.position() + headerLength; int left = 0; int right = (context.remaining() - headerLength) / STEP_LENGTH - 1; while (right >= l...
[ "@", "VisibleForTesting", "public", "int", "findPositionOf", "(", "ByteBuffer", "context", ",", "CounterId", "id", ")", "{", "int", "headerLength", "=", "headerLength", "(", "context", ")", ";", "int", "offset", "=", "context", ".", "position", "(", ")", "+"...
Finds the position of a shard with the given id within the context (via binary search).
[ "Finds", "the", "position", "of", "a", "shard", "with", "the", "given", "id", "within", "the", "context", "(", "via", "binary", "search", ")", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/context/CounterContext.java#L689-L712
alkacon/opencms-core
src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java
CmsSitemapController.createNewGallery
public void createNewGallery(final CmsUUID parentId, final int galleryTypeId, final String title) { final String parentFolder = parentId != null ? getEntryById(parentId).getSitePath() : CmsStringUtil.joinPaths(m_data.getRoot().getSitePath(), m_data.getDefaultGalleryFolder()); CmsRpcAct...
java
public void createNewGallery(final CmsUUID parentId, final int galleryTypeId, final String title) { final String parentFolder = parentId != null ? getEntryById(parentId).getSitePath() : CmsStringUtil.joinPaths(m_data.getRoot().getSitePath(), m_data.getDefaultGalleryFolder()); CmsRpcAct...
[ "public", "void", "createNewGallery", "(", "final", "CmsUUID", "parentId", ",", "final", "int", "galleryTypeId", ",", "final", "String", "title", ")", "{", "final", "String", "parentFolder", "=", "parentId", "!=", "null", "?", "getEntryById", "(", "parentId", ...
Creates a new gallery folder of the given type.<p> @param parentId the parent folder id @param galleryTypeId the folder type id @param title the folder title
[ "Creates", "a", "new", "gallery", "folder", "of", "the", "given", "type", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L511-L533
dropwizard/metrics
metrics-jersey2/src/main/java/com/codahale/metrics/jersey2/MetricsFeature.java
MetricsFeature.configure
@Override public boolean configure(FeatureContext context) { context.register(new InstrumentedResourceMethodApplicationListener(registry, clock, trackFilters)); return true; }
java
@Override public boolean configure(FeatureContext context) { context.register(new InstrumentedResourceMethodApplicationListener(registry, clock, trackFilters)); return true; }
[ "@", "Override", "public", "boolean", "configure", "(", "FeatureContext", "context", ")", "{", "context", ".", "register", "(", "new", "InstrumentedResourceMethodApplicationListener", "(", "registry", ",", "clock", ",", "trackFilters", ")", ")", ";", "return", "tr...
A call-back method called when the feature is to be enabled in a given runtime configuration scope. <p> The responsibility of the feature is to properly update the supplied runtime configuration context and return {@code true} if the feature was successfully enabled or {@code false} otherwise. <p> Note that under some ...
[ "A", "call", "-", "back", "method", "called", "when", "the", "feature", "is", "to", "be", "enabled", "in", "a", "given", "runtime", "configuration", "scope", ".", "<p", ">", "The", "responsibility", "of", "the", "feature", "is", "to", "properly", "update",...
train
https://github.com/dropwizard/metrics/blob/3c6105a0b9b4416c59e16b6b841b123052d6f57d/metrics-jersey2/src/main/java/com/codahale/metrics/jersey2/MetricsFeature.java#L57-L61
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/resources/ArtifactResource.java
ArtifactResource.updateDownloadUrl
@POST @Path("/{gavc}" + ServerAPI.GET_DOWNLOAD_URL) public Response updateDownloadUrl(@Auth final DbCredential credential, @PathParam("gavc") final String gavc, @QueryParam(ServerAPI.URL_PARAM) final String downLoadUrl){ if(!credential.getRoles().contains(AvailableRoles.DATA_UPDATER)){ throw...
java
@POST @Path("/{gavc}" + ServerAPI.GET_DOWNLOAD_URL) public Response updateDownloadUrl(@Auth final DbCredential credential, @PathParam("gavc") final String gavc, @QueryParam(ServerAPI.URL_PARAM) final String downLoadUrl){ if(!credential.getRoles().contains(AvailableRoles.DATA_UPDATER)){ throw...
[ "@", "POST", "@", "Path", "(", "\"/{gavc}\"", "+", "ServerAPI", ".", "GET_DOWNLOAD_URL", ")", "public", "Response", "updateDownloadUrl", "(", "@", "Auth", "final", "DbCredential", "credential", ",", "@", "PathParam", "(", "\"gavc\"", ")", "final", "String", "g...
Update an artifact download url. This method is call via GET <grapes_url>/artifact/<gavc>/downloadurl?url=<targetUrl> @param credential DbCredential @param gavc String @param downLoadUrl String @return Response
[ "Update", "an", "artifact", "download", "url", ".", "This", "method", "is", "call", "via", "GET", "<grapes_url", ">", "/", "artifact", "/", "<gavc", ">", "/", "downloadurl?url", "=", "<targetUrl", ">" ]
train
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/ArtifactResource.java#L329-L347
spotify/apollo
examples/spotify-api-example/src/main/java/com/spotify/apollo/example/ArtistResource.java
ArtistResource.parseTopTracks
private ArrayList<Track> parseTopTracks(String json) { ArrayList<Track> tracks = new ArrayList<>(); try { JsonNode jsonNode = this.objectMapper.readTree(json); for (JsonNode trackNode : jsonNode.get("tracks")) { JsonNode albumNode = trackNode.get("album"); String albumName = albumNod...
java
private ArrayList<Track> parseTopTracks(String json) { ArrayList<Track> tracks = new ArrayList<>(); try { JsonNode jsonNode = this.objectMapper.readTree(json); for (JsonNode trackNode : jsonNode.get("tracks")) { JsonNode albumNode = trackNode.get("album"); String albumName = albumNod...
[ "private", "ArrayList", "<", "Track", ">", "parseTopTracks", "(", "String", "json", ")", "{", "ArrayList", "<", "Track", ">", "tracks", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "{", "JsonNode", "jsonNode", "=", "this", ".", "objectMapper", "....
Parses an artist top tracks response from the <a href="https://developer.spotify.com/web-api/get-artists-top-tracks/">Spotify API</a> @param json The json response @return A list of top tracks
[ "Parses", "an", "artist", "top", "tracks", "response", "from", "the", "<a", "href", "=", "https", ":", "//", "developer", ".", "spotify", ".", "com", "/", "web", "-", "api", "/", "get", "-", "artists", "-", "top", "-", "tracks", "/", ">", "Spotify", ...
train
https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/examples/spotify-api-example/src/main/java/com/spotify/apollo/example/ArtistResource.java#L87-L103
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.manageMapIfNecessary
private Object manageMapIfNecessary(Map<Object, Object> value) { boolean containsRuntimeRefs = false; for (Entry<Object, Object> e : value.entrySet()) { Object v = e.getValue(); if (v instanceof RuntimeBeanReference) { containsRuntimeRefs = true; } ...
java
private Object manageMapIfNecessary(Map<Object, Object> value) { boolean containsRuntimeRefs = false; for (Entry<Object, Object> e : value.entrySet()) { Object v = e.getValue(); if (v instanceof RuntimeBeanReference) { containsRuntimeRefs = true; } ...
[ "private", "Object", "manageMapIfNecessary", "(", "Map", "<", "Object", ",", "Object", ">", "value", ")", "{", "boolean", "containsRuntimeRefs", "=", "false", ";", "for", "(", "Entry", "<", "Object", ",", "Object", ">", "e", ":", "value", ".", "entrySet", ...
Checks whether there are any runtime refs inside a Map and converts it to a ManagedMap if necessary @param value The current map @return A ManagedMap or a normal map
[ "Checks", "whether", "there", "are", "any", "runtime", "refs", "inside", "a", "Map", "and", "converts", "it", "to", "a", "ManagedMap", "if", "necessary" ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L564-L584
keenon/loglinear
src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java
GraphicalModel.addFactor
public VectorFactor addFactor(ConcatVectorTable featureTable, int[] neighborIndices) { assert (featureTable.getDimensions().length == neighborIndices.length); VectorFactor factor = new VectorFactor(featureTable, neighborIndices); factors.add(factor); return factor; }
java
public VectorFactor addFactor(ConcatVectorTable featureTable, int[] neighborIndices) { assert (featureTable.getDimensions().length == neighborIndices.length); VectorFactor factor = new VectorFactor(featureTable, neighborIndices); factors.add(factor); return factor; }
[ "public", "VectorFactor", "addFactor", "(", "ConcatVectorTable", "featureTable", ",", "int", "[", "]", "neighborIndices", ")", "{", "assert", "(", "featureTable", ".", "getDimensions", "(", ")", ".", "length", "==", "neighborIndices", ".", "length", ")", ";", ...
Creates an instantiated factor in this graph, with neighborIndices representing the neighbor variables by integer index. @param featureTable the feature table to use to drive the value of the factor @param neighborIndices the indices of the neighboring variables, in order @return a reference to the created factor. ...
[ "Creates", "an", "instantiated", "factor", "in", "this", "graph", "with", "neighborIndices", "representing", "the", "neighbor", "variables", "by", "integer", "index", "." ]
train
https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java#L520-L525
beihaifeiwu/dolphin
dolphin-common/src/main/java/com/freetmp/common/annotation/AnnotationUtils.java
AnnotationUtils.isAnnotationInherited
public static boolean isAnnotationInherited(Class<? extends Annotation> annotationType, Class<?> clazz) { Assert.notNull(annotationType, "Annotation type must not be null"); Assert.notNull(clazz, "Class must not be null"); return (clazz.isAnnotationPresent(annotationType) && !isAnnotationDeclaredLocally(annotatio...
java
public static boolean isAnnotationInherited(Class<? extends Annotation> annotationType, Class<?> clazz) { Assert.notNull(annotationType, "Annotation type must not be null"); Assert.notNull(clazz, "Class must not be null"); return (clazz.isAnnotationPresent(annotationType) && !isAnnotationDeclaredLocally(annotatio...
[ "public", "static", "boolean", "isAnnotationInherited", "(", "Class", "<", "?", "extends", "Annotation", ">", "annotationType", ",", "Class", "<", "?", ">", "clazz", ")", "{", "Assert", ".", "notNull", "(", "annotationType", ",", "\"Annotation type must not be nul...
Determine whether an annotation for the specified {@code annotationType} is present on the supplied {@code clazz} and is {@linkplain java.lang.annotation.Inherited inherited} (i.e., not declared locally for the class). <p>If the supplied {@code clazz} is an interface, only the interface itself will be checked. In accor...
[ "Determine", "whether", "an", "annotation", "for", "the", "specified", "{" ]
train
https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/annotation/AnnotationUtils.java#L505-L509
kiegroup/jbpmmigration
src/main/java/org/jbpm/migration/XmlUtils.java
XmlUtils.writeFile
public static void writeFile(final Document input, final File output) { final StreamResult result = new StreamResult(new StringWriter()); format(new DOMSource(input), result); try { new FileWriter(output).write(result.getWriter().toString()); } catch (final IOExcepti...
java
public static void writeFile(final Document input, final File output) { final StreamResult result = new StreamResult(new StringWriter()); format(new DOMSource(input), result); try { new FileWriter(output).write(result.getWriter().toString()); } catch (final IOExcepti...
[ "public", "static", "void", "writeFile", "(", "final", "Document", "input", ",", "final", "File", "output", ")", "{", "final", "StreamResult", "result", "=", "new", "StreamResult", "(", "new", "StringWriter", "(", ")", ")", ";", "format", "(", "new", "DOMS...
Write an XML document (formatted) to a given <code>File</code>. @param input The input XML document. @param output The intended <code>File</code>.
[ "Write", "an", "XML", "document", "(", "formatted", ")", "to", "a", "given", "<code", ">", "File<", "/", "code", ">", "." ]
train
https://github.com/kiegroup/jbpmmigration/blob/5e133e2824aa38f316a2eb061123313a7276aba0/src/main/java/org/jbpm/migration/XmlUtils.java#L144-L154
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java
HtmlTextareaRendererBase.renderTextAreaValue
protected void renderTextAreaValue(FacesContext facesContext, UIComponent uiComponent) throws IOException { ResponseWriter writer = facesContext.getResponseWriter(); Object addNewLineAtStart = uiComponent.getAttributes().get(ADD_NEW_LINE_AT_START_ATTR); if (addNewLineAtStart != null...
java
protected void renderTextAreaValue(FacesContext facesContext, UIComponent uiComponent) throws IOException { ResponseWriter writer = facesContext.getResponseWriter(); Object addNewLineAtStart = uiComponent.getAttributes().get(ADD_NEW_LINE_AT_START_ATTR); if (addNewLineAtStart != null...
[ "protected", "void", "renderTextAreaValue", "(", "FacesContext", "facesContext", ",", "UIComponent", "uiComponent", ")", "throws", "IOException", "{", "ResponseWriter", "writer", "=", "facesContext", ".", "getResponseWriter", "(", ")", ";", "Object", "addNewLineAtStart"...
Subclasses can override the writing of the "text" value of the textarea
[ "Subclasses", "can", "override", "the", "writing", "of", "the", "text", "value", "of", "the", "textarea" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java#L162-L189
LearnLib/automatalib
visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java
DOT.runDOT
public static void runDOT(File dotFile, String format, File out) throws IOException { runDOT(IOUtil.asBufferedUTF8Reader(dotFile), format, out); }
java
public static void runDOT(File dotFile, String format, File out) throws IOException { runDOT(IOUtil.asBufferedUTF8Reader(dotFile), format, out); }
[ "public", "static", "void", "runDOT", "(", "File", "dotFile", ",", "String", "format", ",", "File", "out", ")", "throws", "IOException", "{", "runDOT", "(", "IOUtil", ".", "asBufferedUTF8Reader", "(", "dotFile", ")", ",", "format", ",", "out", ")", ";", ...
Invokes the DOT utility on a file, producing an output file. Convenience method, see {@link #runDOT(Reader, String, File)}.
[ "Invokes", "the", "DOT", "utility", "on", "a", "file", "producing", "an", "output", "file", ".", "Convenience", "method", "see", "{" ]
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java#L188-L190
ehcache/ehcache3
impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java
CacheConfigurationBuilder.withSizeOfMaxObjectGraph
public CacheConfigurationBuilder<K, V> withSizeOfMaxObjectGraph(long size) { return mapServiceConfiguration(DefaultSizeOfEngineConfiguration.class, existing -> ofNullable(existing) .map(e -> new DefaultSizeOfEngineConfiguration(e.getMaxObjectSize(), e.getUnit(), size)) .orElse(new DefaultSizeOfEngineCon...
java
public CacheConfigurationBuilder<K, V> withSizeOfMaxObjectGraph(long size) { return mapServiceConfiguration(DefaultSizeOfEngineConfiguration.class, existing -> ofNullable(existing) .map(e -> new DefaultSizeOfEngineConfiguration(e.getMaxObjectSize(), e.getUnit(), size)) .orElse(new DefaultSizeOfEngineCon...
[ "public", "CacheConfigurationBuilder", "<", "K", ",", "V", ">", "withSizeOfMaxObjectGraph", "(", "long", "size", ")", "{", "return", "mapServiceConfiguration", "(", "DefaultSizeOfEngineConfiguration", ".", "class", ",", "existing", "->", "ofNullable", "(", "existing",...
Adds or updates the {@link DefaultSizeOfEngineConfiguration} with the specified object graph maximum size to the configured builder. <p> {@link SizeOfEngine} is what enables the heap tier to be sized in {@link MemoryUnit}. @param size the maximum graph size @return a new builder with the added / updated configuration
[ "Adds", "or", "updates", "the", "{", "@link", "DefaultSizeOfEngineConfiguration", "}", "with", "the", "specified", "object", "graph", "maximum", "size", "to", "the", "configured", "builder", ".", "<p", ">", "{", "@link", "SizeOfEngine", "}", "is", "what", "ena...
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L539-L543
EXIficient/exificient-core
src/main/java/com/siemens/ct/exi/core/util/xml/QNameUtilities.java
QNameUtilities.getClassName
public static String getClassName(QName qname) { try { StringBuilder className = new StringBuilder(); // e.g., {http://www.w3.org/2001/XMLSchema}decimal StringTokenizer st1 = new StringTokenizer(qname.getNamespaceURI(), "/"); // --> "http:" -> "www.w3.org" --> "2001" -> "XMLSchema" st1.nextToken(...
java
public static String getClassName(QName qname) { try { StringBuilder className = new StringBuilder(); // e.g., {http://www.w3.org/2001/XMLSchema}decimal StringTokenizer st1 = new StringTokenizer(qname.getNamespaceURI(), "/"); // --> "http:" -> "www.w3.org" --> "2001" -> "XMLSchema" st1.nextToken(...
[ "public", "static", "String", "getClassName", "(", "QName", "qname", ")", "{", "try", "{", "StringBuilder", "className", "=", "new", "StringBuilder", "(", ")", ";", "// e.g., {http://www.w3.org/2001/XMLSchema}decimal", "StringTokenizer", "st1", "=", "new", "StringToke...
Returns the className for a given qname e.g., {http://www.w3.org/2001/XMLSchema}decimal &rarr; org.w3.2001.XMLSchema.decimal @param qname qualified name @return className or null if converting is not possible
[ "Returns", "the", "className", "for", "a", "given", "qname", "e", ".", "g", ".", "{", "http", ":", "//", "www", ".", "w3", ".", "org", "/", "2001", "/", "XMLSchema", "}", "decimal", "&rarr", ";", "org", ".", "w3", ".", "2001", ".", "XMLSchema", "...
train
https://github.com/EXIficient/exificient-core/blob/b6026c5fd39e9cc3d7874caa20f084e264e0ddc7/src/main/java/com/siemens/ct/exi/core/util/xml/QNameUtilities.java#L100-L133
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java
WaveformPreviewComponent.setWaveformPreview
public void setWaveformPreview(WaveformPreview preview, TrackMetadata metadata) { updateWaveform(preview); this.duration.set(metadata.getDuration()); this.cueList.set(metadata.getCueList()); clearPlaybackState(); repaint(); }
java
public void setWaveformPreview(WaveformPreview preview, TrackMetadata metadata) { updateWaveform(preview); this.duration.set(metadata.getDuration()); this.cueList.set(metadata.getCueList()); clearPlaybackState(); repaint(); }
[ "public", "void", "setWaveformPreview", "(", "WaveformPreview", "preview", ",", "TrackMetadata", "metadata", ")", "{", "updateWaveform", "(", "preview", ")", ";", "this", ".", "duration", ".", "set", "(", "metadata", ".", "getDuration", "(", ")", ")", ";", "...
Change the waveform preview being drawn. This will be quickly overruled if a player is being monitored, but can be used in other contexts. @param preview the waveform preview to display @param metadata information about the track whose waveform we are drawing, so we can translate times into positions and display hot c...
[ "Change", "the", "waveform", "preview", "being", "drawn", ".", "This", "will", "be", "quickly", "overruled", "if", "a", "player", "is", "being", "monitored", "but", "can", "be", "used", "in", "other", "contexts", "." ]
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java#L449-L455
lucee/Lucee
core/src/main/java/lucee/runtime/converter/XMLConverter.java
XMLConverter._serializeQuery
private String _serializeQuery(Query query, Map<Object, String> done, String id) throws ConverterException { /* * <QUERY ID="1"> <COLUMNNAMES> <COLUMN NAME="a"></COLUMN> <COLUMN NAME="b"></COLUMN> </COLUMNNAMES> * * <ROWS> <ROW> <COLUMN TYPE="STRING">a1</COLUMN> <COLUMN TYPE="STRING">b1</COLUMN> </ROW> <ROW> ...
java
private String _serializeQuery(Query query, Map<Object, String> done, String id) throws ConverterException { /* * <QUERY ID="1"> <COLUMNNAMES> <COLUMN NAME="a"></COLUMN> <COLUMN NAME="b"></COLUMN> </COLUMNNAMES> * * <ROWS> <ROW> <COLUMN TYPE="STRING">a1</COLUMN> <COLUMN TYPE="STRING">b1</COLUMN> </ROW> <ROW> ...
[ "private", "String", "_serializeQuery", "(", "Query", "query", ",", "Map", "<", "Object", ",", "String", ">", "done", ",", "String", "id", ")", "throws", "ConverterException", "{", "/*\n\t * <QUERY ID=\"1\"> <COLUMNNAMES> <COLUMN NAME=\"a\"></COLUMN> <COLUMN NAME=\"b\"></CO...
serialize a Query @param query Query to serialize @param done @return serialized query @throws ConverterException
[ "serialize", "a", "Query" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/XMLConverter.java#L292-L334
google/error-prone
check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java
SuggestedFixes.removeModifiers
public static Optional<SuggestedFix> removeModifiers( Tree tree, VisitorState state, Modifier... modifiers) { Set<Modifier> toRemove = ImmutableSet.copyOf(modifiers); ModifiersTree originalModifiers = getModifiers(tree); if (originalModifiers == null) { return Optional.empty(); } return ...
java
public static Optional<SuggestedFix> removeModifiers( Tree tree, VisitorState state, Modifier... modifiers) { Set<Modifier> toRemove = ImmutableSet.copyOf(modifiers); ModifiersTree originalModifiers = getModifiers(tree); if (originalModifiers == null) { return Optional.empty(); } return ...
[ "public", "static", "Optional", "<", "SuggestedFix", ">", "removeModifiers", "(", "Tree", "tree", ",", "VisitorState", "state", ",", "Modifier", "...", "modifiers", ")", "{", "Set", "<", "Modifier", ">", "toRemove", "=", "ImmutableSet", ".", "copyOf", "(", "...
Remove modifiers from the given class, method, or field declaration.
[ "Remove", "modifiers", "from", "the", "given", "class", "method", "or", "field", "declaration", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java#L229-L237
hawkular/hawkular-apm
api/src/main/java/org/hawkular/apm/api/utils/EndpointUtil.java
EndpointUtil.decodeEndpointOperation
public static String decodeEndpointOperation(String endpoint, boolean stripped) { int ind=endpoint.indexOf('['); if (ind != -1) { if (stripped) { return endpoint.substring(ind+1, endpoint.length()-1); } return endpoint.substring(ind); } ...
java
public static String decodeEndpointOperation(String endpoint, boolean stripped) { int ind=endpoint.indexOf('['); if (ind != -1) { if (stripped) { return endpoint.substring(ind+1, endpoint.length()-1); } return endpoint.substring(ind); } ...
[ "public", "static", "String", "decodeEndpointOperation", "(", "String", "endpoint", ",", "boolean", "stripped", ")", "{", "int", "ind", "=", "endpoint", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "ind", "!=", "-", "1", ")", "{", "if", "(", "...
This method returns the operation part of the supplied endpoint. @param endpoint The endpoint @param stripped Whether brackets should be stripped @return The operation
[ "This", "method", "returns", "the", "operation", "part", "of", "the", "supplied", "endpoint", "." ]
train
https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/utils/EndpointUtil.java#L76-L85
artikcloud/artikcloud-java
src/main/java/cloud/artik/api/WhitelistingApi.java
WhitelistingApi.getRejectedRowList
public RejectedCSVRowsEnvelope getRejectedRowList(String dtid, String uploadId, Integer count, Integer offset) throws ApiException { ApiResponse<RejectedCSVRowsEnvelope> resp = getRejectedRowListWithHttpInfo(dtid, uploadId, count, offset); return resp.getData(); }
java
public RejectedCSVRowsEnvelope getRejectedRowList(String dtid, String uploadId, Integer count, Integer offset) throws ApiException { ApiResponse<RejectedCSVRowsEnvelope> resp = getRejectedRowListWithHttpInfo(dtid, uploadId, count, offset); return resp.getData(); }
[ "public", "RejectedCSVRowsEnvelope", "getRejectedRowList", "(", "String", "dtid", ",", "String", "uploadId", ",", "Integer", "count", ",", "Integer", "offset", ")", "throws", "ApiException", "{", "ApiResponse", "<", "RejectedCSVRowsEnvelope", ">", "resp", "=", "getR...
Get the list of rejected rows for an uploaded CSV file. Get the list of rejected rows for an uploaded CSV file. @param dtid Device type id related to the uploaded CSV file. (required) @param uploadId Upload id related to the uploaded CSV file. (required) @param count Max results count. (optional) @param offset Result s...
[ "Get", "the", "list", "of", "rejected", "rows", "for", "an", "uploaded", "CSV", "file", ".", "Get", "the", "list", "of", "rejected", "rows", "for", "an", "uploaded", "CSV", "file", "." ]
train
https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/WhitelistingApi.java#L526-L529
jpaoletti/java-presentation-manager
modules/jpm-core/src/main/java/jpaoletti/jpm/menu/MenuItem.java
MenuItem.parseLocation
public void parseLocation(String location, String value) { setLocationValue(value); setLocation(PresentationManager.getPm().getLocation(location)); }
java
public void parseLocation(String location, String value) { setLocationValue(value); setLocation(PresentationManager.getPm().getLocation(location)); }
[ "public", "void", "parseLocation", "(", "String", "location", ",", "String", "value", ")", "{", "setLocationValue", "(", "value", ")", ";", "setLocation", "(", "PresentationManager", ".", "getPm", "(", ")", ".", "getLocation", "(", "location", ")", ")", ";",...
Recover from the service the location object and set it and the value to this item. @param location The id to look into the conficuration file pm.locations.xml @param value The location value
[ "Recover", "from", "the", "service", "the", "location", "object", "and", "set", "it", "and", "the", "value", "to", "this", "item", "." ]
train
https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/menu/MenuItem.java#L60-L63
gallandarakhneorg/afc
advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableGraphicsContext.java
ZoomableGraphicsContext.bezierCurveTo
public void bezierCurveTo(double xc1, double yc1, double xc2, double yc2, double x1, double y1) { this.gc.bezierCurveTo( doc2fxX(xc1), doc2fxY(yc1), doc2fxX(xc2), doc2fxY(yc2), doc2fxX(x1), doc2fxY(y1)); }
java
public void bezierCurveTo(double xc1, double yc1, double xc2, double yc2, double x1, double y1) { this.gc.bezierCurveTo( doc2fxX(xc1), doc2fxY(yc1), doc2fxX(xc2), doc2fxY(yc2), doc2fxX(x1), doc2fxY(y1)); }
[ "public", "void", "bezierCurveTo", "(", "double", "xc1", ",", "double", "yc1", ",", "double", "xc2", ",", "double", "yc2", ",", "double", "x1", ",", "double", "y1", ")", "{", "this", ".", "gc", ".", "bezierCurveTo", "(", "doc2fxX", "(", "xc1", ")", "...
Adds segments to the current path to make a cubic Bezier curve. The coordinates are transformed by the current transform as they are added to the path and unaffected by subsequent changes to the transform. The current path is a path attribute used for any of the path methods as specified in the Rendering Attributes Tab...
[ "Adds", "segments", "to", "the", "current", "path", "to", "make", "a", "cubic", "Bezier", "curve", ".", "The", "coordinates", "are", "transformed", "by", "the", "current", "transform", "as", "they", "are", "added", "to", "the", "path", "and", "unaffected", ...
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableGraphicsContext.java#L1271-L1276
VoltDB/voltdb
src/frontend/org/voltdb/LightweightNTClientResponseAdapter.java
LightweightNTClientResponseAdapter.callProcedure
public void callProcedure(AuthUser user, boolean isAdmin, int timeout, ProcedureCallback cb, String procName, Object[] args) { // since we know the caller, th...
java
public void callProcedure(AuthUser user, boolean isAdmin, int timeout, ProcedureCallback cb, String procName, Object[] args) { // since we know the caller, th...
[ "public", "void", "callProcedure", "(", "AuthUser", "user", ",", "boolean", "isAdmin", ",", "int", "timeout", ",", "ProcedureCallback", "cb", ",", "String", "procName", ",", "Object", "[", "]", "args", ")", "{", "// since we know the caller, this is safe", "assert...
Used to call a procedure from NTPRocedureRunner Calls createTransaction with the proper params
[ "Used", "to", "call", "a", "procedure", "from", "NTPRocedureRunner", "Calls", "createTransaction", "with", "the", "proper", "params" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/LightweightNTClientResponseAdapter.java#L277-L315
lightblueseas/jcommons-lang
src/main/java/de/alpharogroup/lang/AnnotationExtensions.java
AnnotationExtensions.getAllClasses
public static Set<Class<?>> getAllClasses(final String packagePath, final Set<Class<? extends Annotation>> annotationClasses) throws ClassNotFoundException, IOException, URISyntaxException { return getAllAnnotatedClassesFromSet(packagePath, annotationClasses); }
java
public static Set<Class<?>> getAllClasses(final String packagePath, final Set<Class<? extends Annotation>> annotationClasses) throws ClassNotFoundException, IOException, URISyntaxException { return getAllAnnotatedClassesFromSet(packagePath, annotationClasses); }
[ "public", "static", "Set", "<", "Class", "<", "?", ">", ">", "getAllClasses", "(", "final", "String", "packagePath", ",", "final", "Set", "<", "Class", "<", "?", "extends", "Annotation", ">", ">", "annotationClasses", ")", "throws", "ClassNotFoundException", ...
Gets all the classes from the class loader that belongs to the given package path. @param packagePath the package path @param annotationClasses the annotation classes @return the all classes @throws ClassNotFoundException occurs if a given class cannot be located by the specified class loader @throws IOException Signa...
[ "Gets", "all", "the", "classes", "from", "the", "class", "loader", "that", "belongs", "to", "the", "given", "package", "path", "." ]
train
https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/AnnotationExtensions.java#L156-L161
JDBDT/jdbdt
src/main/java/org/jdbdt/DBAssert.java
DBAssert.stateAssertion
static void stateAssertion(CallInfo callInfo, DataSet expected) { DataSource source = expected.getSource(); source.setDirtyStatus(true); dataSetAssertion(callInfo, expected, source.executeQuery(callInfo, false)); }
java
static void stateAssertion(CallInfo callInfo, DataSet expected) { DataSource source = expected.getSource(); source.setDirtyStatus(true); dataSetAssertion(callInfo, expected, source.executeQuery(callInfo, false)); }
[ "static", "void", "stateAssertion", "(", "CallInfo", "callInfo", ",", "DataSet", "expected", ")", "{", "DataSource", "source", "=", "expected", ".", "getSource", "(", ")", ";", "source", ".", "setDirtyStatus", "(", "true", ")", ";", "dataSetAssertion", "(", ...
Perform a database state assertion. @param callInfo Call info. @param expected Expected data. @throws DBAssertionError If the assertion fails. @throws InvalidOperationException If the arguments are invalid.
[ "Perform", "a", "database", "state", "assertion", "." ]
train
https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DBAssert.java#L96-L102
rhuss/jolokia
agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java
AbstractServerDetector.getAttributeValue
protected String getAttributeValue(MBeanServerExecutor pMBeanServerExecutor,String pMBean,String pAttribute) { try { ObjectName oName = new ObjectName(pMBean); return getAttributeValue(pMBeanServerExecutor,oName,pAttribute); } catch (MalformedObjectNameException e) { ...
java
protected String getAttributeValue(MBeanServerExecutor pMBeanServerExecutor,String pMBean,String pAttribute) { try { ObjectName oName = new ObjectName(pMBean); return getAttributeValue(pMBeanServerExecutor,oName,pAttribute); } catch (MalformedObjectNameException e) { ...
[ "protected", "String", "getAttributeValue", "(", "MBeanServerExecutor", "pMBeanServerExecutor", ",", "String", "pMBean", ",", "String", "pAttribute", ")", "{", "try", "{", "ObjectName", "oName", "=", "new", "ObjectName", "(", "pMBean", ")", ";", "return", "getAttr...
Get the string representation of an attribute @param pMBeanServerExecutor set of MBeanServers to query. The first one wins. @param pMBean object name of MBean to lookup @param pAttribute attribute to lookup @return string value of attribute or <code>null</code> if the attribute could not be fetched
[ "Get", "the", "string", "representation", "of", "an", "attribute" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java#L74-L81
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java
SARLQuickfixProvider.fixDiscouragedAnnotationUse
@Fix(io.sarl.lang.validation.IssueCodes.USED_RESERVED_SARL_ANNOTATION) public void fixDiscouragedAnnotationUse(final Issue issue, IssueResolutionAcceptor acceptor) { AnnotationRemoveModification.accept(this, issue, acceptor); }
java
@Fix(io.sarl.lang.validation.IssueCodes.USED_RESERVED_SARL_ANNOTATION) public void fixDiscouragedAnnotationUse(final Issue issue, IssueResolutionAcceptor acceptor) { AnnotationRemoveModification.accept(this, issue, acceptor); }
[ "@", "Fix", "(", "io", ".", "sarl", ".", "lang", ".", "validation", ".", "IssueCodes", ".", "USED_RESERVED_SARL_ANNOTATION", ")", "public", "void", "fixDiscouragedAnnotationUse", "(", "final", "Issue", "issue", ",", "IssueResolutionAcceptor", "acceptor", ")", "{",...
Quick fix for the discouraged annotation uses. @param issue the issue. @param acceptor the quick fix acceptor.
[ "Quick", "fix", "for", "the", "discouraged", "annotation", "uses", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L974-L977
gocd/gocd
base/src/main/java/com/thoughtworks/go/util/DirectoryScanner.java
DirectoryScanner.accountForIncludedFile
private void accountForIncludedFile(String name, File file) { processIncluded(name, file, filesIncluded, filesExcluded, filesDeselected); }
java
private void accountForIncludedFile(String name, File file) { processIncluded(name, file, filesIncluded, filesExcluded, filesDeselected); }
[ "private", "void", "accountForIncludedFile", "(", "String", "name", ",", "File", "file", ")", "{", "processIncluded", "(", "name", ",", "file", ",", "filesIncluded", ",", "filesExcluded", ",", "filesDeselected", ")", ";", "}" ]
Process included file. @param name path of the file relative to the directory of the FileSet. @param file included File.
[ "Process", "included", "file", "." ]
train
https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/base/src/main/java/com/thoughtworks/go/util/DirectoryScanner.java#L1128-L1130
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java
ApplicationGatewaysInner.beginUpdateTagsAsync
public Observable<ApplicationGatewayInner> beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map<String, String> tags) { return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1<ServiceResponse<ApplicationGatewayInner>, Application...
java
public Observable<ApplicationGatewayInner> beginUpdateTagsAsync(String resourceGroupName, String applicationGatewayName, Map<String, String> tags) { return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName, tags).map(new Func1<ServiceResponse<ApplicationGatewayInner>, Application...
[ "public", "Observable", "<", "ApplicationGatewayInner", ">", "beginUpdateTagsAsync", "(", "String", "resourceGroupName", ",", "String", "applicationGatewayName", ",", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "return", "beginUpdateTagsWithServiceRespon...
Updates the specified application gateway tags. @param resourceGroupName The name of the resource group. @param applicationGatewayName The name of the application gateway. @param tags Resource tags. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the ApplicationGatew...
[ "Updates", "the", "specified", "application", "gateway", "tags", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java#L824-L831
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetsInner.java
AssetsInner.getAsync
public Observable<AssetInner> getAsync(String resourceGroupName, String accountName, String assetName) { return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1<ServiceResponse<AssetInner>, AssetInner>() { @Override public AssetInner call(ServiceRespon...
java
public Observable<AssetInner> getAsync(String resourceGroupName, String accountName, String assetName) { return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1<ServiceResponse<AssetInner>, AssetInner>() { @Override public AssetInner call(ServiceRespon...
[ "public", "Observable", "<", "AssetInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "assetName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "accountName", ",", "assetName",...
Get an Asset. Get the details of an Asset in the Media Services account. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @param assetName The Asset name. @throws IllegalArgumentException thrown if parameters fail the validation ...
[ "Get", "an", "Asset", ".", "Get", "the", "details", "of", "an", "Asset", "in", "the", "Media", "Services", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetsInner.java#L409-L416
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/CmsScrollBar.java
CmsScrollBar.adjustKnobHeight
private void adjustKnobHeight(int outerHeight, int innerHeight) { int result = (int)((1.0 * outerHeight * outerHeight) / innerHeight); result = result > (outerHeight - 5) ? 5 : (result < 8 ? 8 : result); m_positionValueRatio = (1.0 * (outerHeight - result)) / (innerHeight - outerHeight); ...
java
private void adjustKnobHeight(int outerHeight, int innerHeight) { int result = (int)((1.0 * outerHeight * outerHeight) / innerHeight); result = result > (outerHeight - 5) ? 5 : (result < 8 ? 8 : result); m_positionValueRatio = (1.0 * (outerHeight - result)) / (innerHeight - outerHeight); ...
[ "private", "void", "adjustKnobHeight", "(", "int", "outerHeight", ",", "int", "innerHeight", ")", "{", "int", "result", "=", "(", "int", ")", "(", "(", "1.0", "*", "outerHeight", "*", "outerHeight", ")", "/", "innerHeight", ")", ";", "result", "=", "resu...
Calculates the scroll knob height.<p> @param outerHeight the height of the scrollable element @param innerHeight the height of the scroll content
[ "Calculates", "the", "scroll", "knob", "height", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsScrollBar.java#L549-L557
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java
ServletUtil.write
public static void write(HttpServletResponse response, InputStream in, String contentType, String fileName) { final String charset = ObjectUtil.defaultIfNull(response.getCharacterEncoding(), CharsetUtil.UTF_8); response.setHeader("Content-Disposition", StrUtil.format("attachment;filename={}", URLUtil.encode(fileN...
java
public static void write(HttpServletResponse response, InputStream in, String contentType, String fileName) { final String charset = ObjectUtil.defaultIfNull(response.getCharacterEncoding(), CharsetUtil.UTF_8); response.setHeader("Content-Disposition", StrUtil.format("attachment;filename={}", URLUtil.encode(fileN...
[ "public", "static", "void", "write", "(", "HttpServletResponse", "response", ",", "InputStream", "in", ",", "String", "contentType", ",", "String", "fileName", ")", "{", "final", "String", "charset", "=", "ObjectUtil", ".", "defaultIfNull", "(", "response", ".",...
返回数据给客户端 @param response 响应对象{@link HttpServletResponse} @param in 需要返回客户端的内容 @param contentType 返回的类型 @param fileName 文件名 @since 4.1.15
[ "返回数据给客户端" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L522-L527
cycorp/api-suite
core-api/src/main/java/com/cyc/session/exception/SessionRuntimeException.java
SessionRuntimeException.fromThrowable
public static SessionRuntimeException fromThrowable(String message, Throwable cause) { return (cause instanceof SessionRuntimeException && Objects.equals(message, cause.getMessage())) ? (SessionRuntimeException) cause : new SessionRuntimeException(message, cause); }
java
public static SessionRuntimeException fromThrowable(String message, Throwable cause) { return (cause instanceof SessionRuntimeException && Objects.equals(message, cause.getMessage())) ? (SessionRuntimeException) cause : new SessionRuntimeException(message, cause); }
[ "public", "static", "SessionRuntimeException", "fromThrowable", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "SessionRuntimeException", "&&", "Objects", ".", "equals", "(", "message", ",", "cause", ".", "getM...
Converts a Throwable to a SessionRuntimeException with the specified detail message. If the Throwable is a SessionRuntimeException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new SessionRuntimeException with the det...
[ "Converts", "a", "Throwable", "to", "a", "SessionRuntimeException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "SessionRuntimeException", "and", "if", "the", "Throwable", "s", "message", "is", "identical", "to", "t...
train
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionRuntimeException.java#L66-L70
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/util/Scheduler.java
Scheduler.durationHours
public static long durationHours(LocalDateTime start,LocalDateTime end) { if(start == null || end == null) return ZERO; return Duration.between(start, end).toHours(); }
java
public static long durationHours(LocalDateTime start,LocalDateTime end) { if(start == null || end == null) return ZERO; return Duration.between(start, end).toHours(); }
[ "public", "static", "long", "durationHours", "(", "LocalDateTime", "start", ",", "LocalDateTime", "end", ")", "{", "if", "(", "start", "==", "null", "||", "end", "==", "null", ")", "return", "ZERO", ";", "return", "Duration", ".", "between", "(", "start", ...
1 Hours = 60 minutes @param start between time @param end finish time @return duration in hours
[ "1", "Hours", "=", "60", "minutes" ]
train
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Scheduler.java#L121-L127
apache/incubator-atlas
repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java
DefaultMetadataService.addTrait
@Override public void addTrait(String guid, String traitInstanceDefinition) throws AtlasException { guid = ParamChecker.notEmpty(guid, "entity id"); traitInstanceDefinition = ParamChecker.notEmpty(traitInstanceDefinition, "trait instance definition"); ITypedStruct traitIn...
java
@Override public void addTrait(String guid, String traitInstanceDefinition) throws AtlasException { guid = ParamChecker.notEmpty(guid, "entity id"); traitInstanceDefinition = ParamChecker.notEmpty(traitInstanceDefinition, "trait instance definition"); ITypedStruct traitIn...
[ "@", "Override", "public", "void", "addTrait", "(", "String", "guid", ",", "String", "traitInstanceDefinition", ")", "throws", "AtlasException", "{", "guid", "=", "ParamChecker", ".", "notEmpty", "(", "guid", ",", "\"entity id\"", ")", ";", "traitInstanceDefinitio...
Adds a new trait to an existing entity represented by a guid. @param guid globally unique identifier for the entity @param traitInstanceDefinition trait instance json that needs to be added to entity @throws AtlasException
[ "Adds", "a", "new", "trait", "to", "an", "existing", "entity", "represented", "by", "a", "guid", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java#L600-L607
emfjson/emfjson-jackson
src/main/java/org/emfjson/jackson/module/EMFModule.java
EMFModule.setupDefaultMapper
public static ObjectMapper setupDefaultMapper(JsonFactory factory) { final ObjectMapper mapper = new ObjectMapper(factory); // same as emf final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getDefault()); mapper.configure(Seriali...
java
public static ObjectMapper setupDefaultMapper(JsonFactory factory) { final ObjectMapper mapper = new ObjectMapper(factory); // same as emf final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getDefault()); mapper.configure(Seriali...
[ "public", "static", "ObjectMapper", "setupDefaultMapper", "(", "JsonFactory", "factory", ")", "{", "final", "ObjectMapper", "mapper", "=", "new", "ObjectMapper", "(", "factory", ")", ";", "// same as emf", "final", "SimpleDateFormat", "dateFormat", "=", "new", "Simp...
Returns a pre configured mapper using the EMF module and the specified jackson factory. This method can be used to work with formats others than JSON (such as YAML). @param factory @return mapper
[ "Returns", "a", "pre", "configured", "mapper", "using", "the", "EMF", "module", "and", "the", "specified", "jackson", "factory", ".", "This", "method", "can", "be", "used", "to", "work", "with", "formats", "others", "than", "JSON", "(", "such", "as", "YAML...
train
https://github.com/emfjson/emfjson-jackson/blob/5f4488d1b07d499003351606cf76ee0c4ac39964/src/main/java/org/emfjson/jackson/module/EMFModule.java#L158-L170
finmath/finmath-lib
src/main/java6/net/finmath/functions/AnalyticFormulas.java
AnalyticFormulas.sabrNormalVolatilityCurvatureApproximation
public static double sabrNormalVolatilityCurvatureApproximation(double alpha, double beta, double rho, double nu, double displacement, double underlying, double maturity) { double sigma = sabrBerestyckiNormalVolatilityApproximation(alpha, beta, rho, nu, displacement, underlying, underlying, maturity); // Apply di...
java
public static double sabrNormalVolatilityCurvatureApproximation(double alpha, double beta, double rho, double nu, double displacement, double underlying, double maturity) { double sigma = sabrBerestyckiNormalVolatilityApproximation(alpha, beta, rho, nu, displacement, underlying, underlying, maturity); // Apply di...
[ "public", "static", "double", "sabrNormalVolatilityCurvatureApproximation", "(", "double", "alpha", ",", "double", "beta", ",", "double", "rho", ",", "double", "nu", ",", "double", "displacement", ",", "double", "underlying", ",", "double", "maturity", ")", "{", ...
Return the curvature of the implied normal volatility (Bachelier volatility) under a SABR model using the approximation of Berestycki. The curvatures is the second derivative of the implied vol w.r.t. the strike, evaluated at the money. @param alpha initial value of the stochastic volatility process of the SABR model....
[ "Return", "the", "curvature", "of", "the", "implied", "normal", "volatility", "(", "Bachelier", "volatility", ")", "under", "a", "SABR", "model", "using", "the", "approximation", "of", "Berestycki", ".", "The", "curvatures", "is", "the", "second", "derivative", ...
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/functions/AnalyticFormulas.java#L1256-L1289
molgenis/molgenis
molgenis-data/src/main/java/org/molgenis/data/meta/EntityTypeRepositoryDecorator.java
EntityTypeRepositoryDecorator.removeMappedByAttributes
private void removeMappedByAttributes(Map<String, EntityType> resolvedEntityTypes) { resolvedEntityTypes .values() .stream() .flatMap(EntityType::getMappedByAttributes) .filter(attribute -> resolvedEntityTypes.containsKey(attribute.getEntity().getId())) .forEach(attribute -> ...
java
private void removeMappedByAttributes(Map<String, EntityType> resolvedEntityTypes) { resolvedEntityTypes .values() .stream() .flatMap(EntityType::getMappedByAttributes) .filter(attribute -> resolvedEntityTypes.containsKey(attribute.getEntity().getId())) .forEach(attribute -> ...
[ "private", "void", "removeMappedByAttributes", "(", "Map", "<", "String", ",", "EntityType", ">", "resolvedEntityTypes", ")", "{", "resolvedEntityTypes", ".", "values", "(", ")", ".", "stream", "(", ")", ".", "flatMap", "(", "EntityType", "::", "getMappedByAttri...
Removes the mappedBy attributes of each OneToMany pair in the supplied map of EntityTypes
[ "Removes", "the", "mappedBy", "attributes", "of", "each", "OneToMany", "pair", "in", "the", "supplied", "map", "of", "EntityTypes" ]
train
https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data/src/main/java/org/molgenis/data/meta/EntityTypeRepositoryDecorator.java#L210-L217
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java
BeetlUtil.createFileGroupTemplate
public static GroupTemplate createFileGroupTemplate(String dir, Charset charset) { return createGroupTemplate(new FileResourceLoader(dir, charset.name())); }
java
public static GroupTemplate createFileGroupTemplate(String dir, Charset charset) { return createGroupTemplate(new FileResourceLoader(dir, charset.name())); }
[ "public", "static", "GroupTemplate", "createFileGroupTemplate", "(", "String", "dir", ",", "Charset", "charset", ")", "{", "return", "createGroupTemplate", "(", "new", "FileResourceLoader", "(", "dir", ",", "charset", ".", "name", "(", ")", ")", ")", ";", "}" ...
创建文件目录的模板组 {@link GroupTemplate},配置文件使用全局默认<br> 此时自定义的配置文件可在ClassPath中放入beetl.properties配置 @param dir 目录路径(绝对路径) @param charset 读取模板文件的编码 @return {@link GroupTemplate} @since 3.2.0
[ "创建文件目录的模板组", "{", "@link", "GroupTemplate", "}", ",配置文件使用全局默认<br", ">", "此时自定义的配置文件可在ClassPath中放入beetl", ".", "properties配置" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java#L96-L98
googleads/googleads-java-lib
examples/admanager_axis/src/main/java/admanager/axis/v201902/teamservice/GetAllTeams.java
GetAllTeams.runExample
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException { // Get the TeamService. TeamServiceInterface teamService = adManagerServices.get(session, TeamServiceInterface.class); // Create a statement to select all teams. StatementBuilder ...
java
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException { // Get the TeamService. TeamServiceInterface teamService = adManagerServices.get(session, TeamServiceInterface.class); // Create a statement to select all teams. StatementBuilder ...
[ "public", "static", "void", "runExample", "(", "AdManagerServices", "adManagerServices", ",", "AdManagerSession", "session", ")", "throws", "RemoteException", "{", "// Get the TeamService.", "TeamServiceInterface", "teamService", "=", "adManagerServices", ".", "get", "(", ...
Runs the example. @param adManagerServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other errors.
[ "Runs", "the", "example", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/teamservice/GetAllTeams.java#L51-L80
eFaps/eFaps-Kernel
src/main/java/org/efaps/db/Context.java
Context.getUserAttributes
public UserAttributesSet getUserAttributes() throws EFapsException { if (containsSessionAttribute(UserAttributesSet.CONTEXTMAPKEY)) { return (UserAttributesSet) getSessionAttribute(UserAttributesSet.CONTEXTMAPKEY); } else { throw new EFapsException(Context.class, "get...
java
public UserAttributesSet getUserAttributes() throws EFapsException { if (containsSessionAttribute(UserAttributesSet.CONTEXTMAPKEY)) { return (UserAttributesSet) getSessionAttribute(UserAttributesSet.CONTEXTMAPKEY); } else { throw new EFapsException(Context.class, "get...
[ "public", "UserAttributesSet", "getUserAttributes", "(", ")", "throws", "EFapsException", "{", "if", "(", "containsSessionAttribute", "(", "UserAttributesSet", ".", "CONTEXTMAPKEY", ")", ")", "{", "return", "(", "UserAttributesSet", ")", "getSessionAttribute", "(", "U...
Method to get the UserAttributesSet of the user of this context. @return UserAttributesSet @throws EFapsException on error
[ "Method", "to", "get", "the", "UserAttributesSet", "of", "the", "user", "of", "this", "context", "." ]
train
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/Context.java#L703-L711
LearnLib/automatalib
incremental/src/main/java/net/automatalib/incremental/dfa/dag/AbstractIncrementalDFADAGBuilder.java
AbstractIncrementalDFADAGBuilder.updateSignature
protected State updateSignature(State state, Acceptance acc) { assert (state != init); StateSignature sig = state.getSignature(); if (sig.acceptance == acc) { return state; } register.remove(sig); sig.acceptance = acc; sig.updateHashCode(); ret...
java
protected State updateSignature(State state, Acceptance acc) { assert (state != init); StateSignature sig = state.getSignature(); if (sig.acceptance == acc) { return state; } register.remove(sig); sig.acceptance = acc; sig.updateHashCode(); ret...
[ "protected", "State", "updateSignature", "(", "State", "state", ",", "Acceptance", "acc", ")", "{", "assert", "(", "state", "!=", "init", ")", ";", "StateSignature", "sig", "=", "state", ".", "getSignature", "(", ")", ";", "if", "(", "sig", ".", "accepta...
Updates the signature for a given state. @param state the state @param acc the new acceptance value @return the canonical state for the updated signature
[ "Updates", "the", "signature", "for", "a", "given", "state", "." ]
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/incremental/src/main/java/net/automatalib/incremental/dfa/dag/AbstractIncrementalDFADAGBuilder.java#L246-L256
raphw/byte-buddy
byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java
Dynamic.ofInvocation
public static Dynamic ofInvocation(MethodDescription.InDefinedShape methodDescription, Object... rawArgument) { return ofInvocation(methodDescription, Arrays.asList(rawArgument)); }
java
public static Dynamic ofInvocation(MethodDescription.InDefinedShape methodDescription, Object... rawArgument) { return ofInvocation(methodDescription, Arrays.asList(rawArgument)); }
[ "public", "static", "Dynamic", "ofInvocation", "(", "MethodDescription", ".", "InDefinedShape", "methodDescription", ",", "Object", "...", "rawArgument", ")", "{", "return", "ofInvocation", "(", "methodDescription", ",", "Arrays", ".", "asList", "(", "rawArgument", ...
Represents a constant that is resolved by invoking a {@code static} factory method or a constructor. @param methodDescription The method or constructor to invoke to create the represented constant value. @param rawArgument The method's or constructor's constant arguments. @return A dynamic constant that is resol...
[ "Represents", "a", "constant", "that", "is", "resolved", "by", "invoking", "a", "{", "@code", "static", "}", "factory", "method", "or", "a", "constructor", "." ]
train
https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java#L1564-L1566
Alluxio/alluxio
underfs/wasb/src/main/java/alluxio/underfs/wasb/WasbUnderFileSystem.java
WasbUnderFileSystem.createInstance
public static WasbUnderFileSystem createInstance(AlluxioURI uri, UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) { Configuration wasbConf = createConfiguration(conf); return new WasbUnderFileSystem(uri, conf, wasbConf, alluxioConf); }
java
public static WasbUnderFileSystem createInstance(AlluxioURI uri, UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) { Configuration wasbConf = createConfiguration(conf); return new WasbUnderFileSystem(uri, conf, wasbConf, alluxioConf); }
[ "public", "static", "WasbUnderFileSystem", "createInstance", "(", "AlluxioURI", "uri", ",", "UnderFileSystemConfiguration", "conf", ",", "AlluxioConfiguration", "alluxioConf", ")", "{", "Configuration", "wasbConf", "=", "createConfiguration", "(", "conf", ")", ";", "ret...
Factory method to construct a new Wasb {@link UnderFileSystem}. @param uri the {@link AlluxioURI} for this UFS @param conf the configuration for this UFS @param alluxioConf Alluxio configuration @return a new Wasb {@link UnderFileSystem} instance
[ "Factory", "method", "to", "construct", "a", "new", "Wasb", "{", "@link", "UnderFileSystem", "}", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/wasb/src/main/java/alluxio/underfs/wasb/WasbUnderFileSystem.java#L70-L74
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java
BytecodeUtils.newLinkedHashMap
public static Expression newLinkedHashMap( Iterable<? extends Expression> keys, Iterable<? extends Expression> values) { return newMap(keys, values, ConstructorRef.LINKED_HASH_MAP_CAPACITY, LINKED_HASH_MAP_TYPE); }
java
public static Expression newLinkedHashMap( Iterable<? extends Expression> keys, Iterable<? extends Expression> values) { return newMap(keys, values, ConstructorRef.LINKED_HASH_MAP_CAPACITY, LINKED_HASH_MAP_TYPE); }
[ "public", "static", "Expression", "newLinkedHashMap", "(", "Iterable", "<", "?", "extends", "Expression", ">", "keys", ",", "Iterable", "<", "?", "extends", "Expression", ">", "values", ")", "{", "return", "newMap", "(", "keys", ",", "values", ",", "Construc...
Returns an expression that returns a new {@link LinkedHashMap} containing all the given entries.
[ "Returns", "an", "expression", "that", "returns", "a", "new", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L907-L910
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java
BuildTasksInner.beginUpdateAsync
public Observable<BuildTaskInner> beginUpdateAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskUpdateParameters buildTaskUpdateParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskUpdateParameters).map(new Func1<Servi...
java
public Observable<BuildTaskInner> beginUpdateAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskUpdateParameters buildTaskUpdateParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskUpdateParameters).map(new Func1<Servi...
[ "public", "Observable", "<", "BuildTaskInner", ">", "beginUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "registryName", ",", "String", "buildTaskName", ",", "BuildTaskUpdateParameters", "buildTaskUpdateParameters", ")", "{", "return", "beginUpdateWithServ...
Updates a build task with the specified parameters. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param buildTaskName The name of the container registry build task. @param buildTaskUpdateParameters The parameter...
[ "Updates", "a", "build", "task", "with", "the", "specified", "parameters", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java#L917-L924
OpenBEL/openbel-framework
org.openbel.framework.common/src/main/java/org/openbel/framework/common/protonetwork/model/ProtoEdgeTable.java
ProtoEdgeTable.addEdges
public void addEdges(final Integer stmt, final TableProtoEdge... newEdges) { if (stmt == null) { throw new InvalidArgument("stmt", stmt); } if (newEdges == null || newEdges.length <= 0) { throw new InvalidArgument("newEdges", newEdges); } Set<Integer> ed...
java
public void addEdges(final Integer stmt, final TableProtoEdge... newEdges) { if (stmt == null) { throw new InvalidArgument("stmt", stmt); } if (newEdges == null || newEdges.length <= 0) { throw new InvalidArgument("newEdges", newEdges); } Set<Integer> ed...
[ "public", "void", "addEdges", "(", "final", "Integer", "stmt", ",", "final", "TableProtoEdge", "...", "newEdges", ")", "{", "if", "(", "stmt", "==", "null", ")", "{", "throw", "new", "InvalidArgument", "(", "\"stmt\"", ",", "stmt", ")", ";", "}", "if", ...
Adds 1 or more {@link TableProtoEdge proto edges} to the table and associates them with the supporting {@link TableStatement statement} index. <p> There must be at least one {@link TableProtoEdge proto edge} to associate to a statement otherwise an exception is thrown. </p> @param stmt the {@link TableStatement statem...
[ "Adds", "1", "or", "more", "{", "@link", "TableProtoEdge", "proto", "edges", "}", "to", "the", "table", "and", "associates", "them", "with", "the", "supporting", "{", "@link", "TableStatement", "statement", "}", "index", ".", "<p", ">", "There", "must", "b...
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/protonetwork/model/ProtoEdgeTable.java#L127-L159
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java
ImageModerationsImpl.oCRFileInputWithServiceResponseAsync
public Observable<ServiceResponse<OCR>> oCRFileInputWithServiceResponseAsync(String language, byte[] imageStream, OCRFileInputOptionalParameter oCRFileInputOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and ca...
java
public Observable<ServiceResponse<OCR>> oCRFileInputWithServiceResponseAsync(String language, byte[] imageStream, OCRFileInputOptionalParameter oCRFileInputOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and ca...
[ "public", "Observable", "<", "ServiceResponse", "<", "OCR", ">", ">", "oCRFileInputWithServiceResponseAsync", "(", "String", "language", ",", "byte", "[", "]", "imageStream", ",", "OCRFileInputOptionalParameter", "oCRFileInputOptionalParameter", ")", "{", "if", "(", "...
Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English. @param language Language of the terms. @param imageStream The image file. @param oCRFileInputOptionalParameter the object representing the optional parameters to be set before ca...
[ "Returns", "any", "text", "found", "in", "the", "image", "for", "the", "language", "specified", ".", "If", "no", "language", "is", "specified", "in", "input", "then", "the", "detection", "defaults", "to", "English", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1291-L1305
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.bitmapToBoof
public static <T extends ImageBase<T>> void bitmapToBoof( Bitmap input , T output , byte[] storage) { if( BOverrideConvertAndroid.invokeBitmapToBoof(input,output,storage)) return; switch( output.getImageType().getFamily() ) { case GRAY: { if( output.getClass() == GrayF32.class ) bitmapToGray(input...
java
public static <T extends ImageBase<T>> void bitmapToBoof( Bitmap input , T output , byte[] storage) { if( BOverrideConvertAndroid.invokeBitmapToBoof(input,output,storage)) return; switch( output.getImageType().getFamily() ) { case GRAY: { if( output.getClass() == GrayF32.class ) bitmapToGray(input...
[ "public", "static", "<", "T", "extends", "ImageBase", "<", "T", ">", ">", "void", "bitmapToBoof", "(", "Bitmap", "input", ",", "T", "output", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "BOverrideConvertAndroid", ".", "invokeBitmapToBoof", "(", ...
Converts a {@link Bitmap} into a BoofCV image. Type is determined at runtime. @param input Bitmap image. @param output Output image. Automatically resized to match input shape. @param storage Byte array used for internal storage. If null it will be declared internally.
[ "Converts", "a", "{" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L61-L85
rythmengine/spring-rythm
src/main/java/org/rythmengine/spring/RythmEngineFactory.java
RythmEngineFactory.setEngineConfigMap
public void setEngineConfigMap(Map<String, Object> engineConfigMap) { if (engineConfigMap != null) { this.engineConfig.putAll(engineConfigMap); } }
java
public void setEngineConfigMap(Map<String, Object> engineConfigMap) { if (engineConfigMap != null) { this.engineConfig.putAll(engineConfigMap); } }
[ "public", "void", "setEngineConfigMap", "(", "Map", "<", "String", ",", "Object", ">", "engineConfigMap", ")", "{", "if", "(", "engineConfigMap", "!=", "null", ")", "{", "this", ".", "engineConfig", ".", "putAll", "(", "engineConfigMap", ")", ";", "}", "}"...
Set Rythm properties as Map, to allow for non-String values like "ds.resource.loader.instance". @see #setEngineConfig
[ "Set", "Rythm", "properties", "as", "Map", "to", "allow", "for", "non", "-", "String", "values", "like", "ds", ".", "resource", ".", "loader", ".", "instance", "." ]
train
https://github.com/rythmengine/spring-rythm/blob/a654016371c72dabaea50ac9a57626da7614d236/src/main/java/org/rythmengine/spring/RythmEngineFactory.java#L115-L119
apereo/cas
core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java
AbstractCasView.getErrorDescriptionFrom
protected String getErrorDescriptionFrom(final Map<String, Object> model) { return model.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_ERROR_DESCRIPTION).toString(); }
java
protected String getErrorDescriptionFrom(final Map<String, Object> model) { return model.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_ERROR_DESCRIPTION).toString(); }
[ "protected", "String", "getErrorDescriptionFrom", "(", "final", "Map", "<", "String", ",", "Object", ">", "model", ")", "{", "return", "model", ".", "get", "(", "CasViewConstants", ".", "MODEL_ATTRIBUTE_NAME_ERROR_DESCRIPTION", ")", ".", "toString", "(", ")", ";...
Gets error description from. @param model the model @return the error description from
[ "Gets", "error", "description", "from", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java#L96-L98
lucee/Lucee
core/src/main/java/lucee/commons/collection/HashMapPro.java
HashMapPro.put
@Override public V put(K key, V value) { if (key == null) return putForNullKey(value); int hash = hash(key); int i = indexFor(hash, table.length); for (Entry<K, V> e = table[i]; e != null; e = e.next) { Object k; if (e.hash == hash && ((k = e.key) == key || key.equals(k))) { V oldValue = e.value; ...
java
@Override public V put(K key, V value) { if (key == null) return putForNullKey(value); int hash = hash(key); int i = indexFor(hash, table.length); for (Entry<K, V> e = table[i]; e != null; e = e.next) { Object k; if (e.hash == hash && ((k = e.key) == key || key.equals(k))) { V oldValue = e.value; ...
[ "@", "Override", "public", "V", "put", "(", "K", "key", ",", "V", "value", ")", "{", "if", "(", "key", "==", "null", ")", "return", "putForNullKey", "(", "value", ")", ";", "int", "hash", "=", "hash", "(", "key", ")", ";", "int", "i", "=", "ind...
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced. @param key key with which the specified value is to be associated @param value value to be associated with the specified key @return the previous value associated with <t...
[ "Associates", "the", "specified", "value", "with", "the", "specified", "key", "in", "this", "map", ".", "If", "the", "map", "previously", "contained", "a", "mapping", "for", "the", "key", "the", "old", "value", "is", "replaced", "." ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/collection/HashMapPro.java#L460-L478
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/renderer/AbstractBundleLinkRenderer.java
AbstractBundleLinkRenderer.performGlobalBundleLinksRendering
protected void performGlobalBundleLinksRendering(BundleRendererContext ctx, Writer out, boolean debugOn) throws IOException { ResourceBundlePathsIterator resourceBundleIterator = bundler.getGlobalResourceBundlePaths(getDebugMode(debugOn), new ConditionalCommentRenderer(out), ctx.getVariants()); renderBundle...
java
protected void performGlobalBundleLinksRendering(BundleRendererContext ctx, Writer out, boolean debugOn) throws IOException { ResourceBundlePathsIterator resourceBundleIterator = bundler.getGlobalResourceBundlePaths(getDebugMode(debugOn), new ConditionalCommentRenderer(out), ctx.getVariants()); renderBundle...
[ "protected", "void", "performGlobalBundleLinksRendering", "(", "BundleRendererContext", "ctx", ",", "Writer", "out", ",", "boolean", "debugOn", ")", "throws", "IOException", "{", "ResourceBundlePathsIterator", "resourceBundleIterator", "=", "bundler", ".", "getGlobalResourc...
Performs the global bundle rendering @param ctx the context @param out the writer @param debugOn the flag indicating if we are in debug mode or not @throws IOException if an IO exception occurs
[ "Performs", "the", "global", "bundle", "rendering" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/renderer/AbstractBundleLinkRenderer.java#L221-L227
rey5137/material
material/src/main/java/com/rey/material/widget/EditText.java
EditText.onSelectionChanged
protected void onSelectionChanged(int selStart, int selEnd) { if(mInputView == null) return; if(mInputView instanceof InternalEditText) ((InternalEditText)mInputView).superOnSelectionChanged(selStart, selEnd); else if(mInputView instanceof InternalAutoCompleteTextView) ...
java
protected void onSelectionChanged(int selStart, int selEnd) { if(mInputView == null) return; if(mInputView instanceof InternalEditText) ((InternalEditText)mInputView).superOnSelectionChanged(selStart, selEnd); else if(mInputView instanceof InternalAutoCompleteTextView) ...
[ "protected", "void", "onSelectionChanged", "(", "int", "selStart", ",", "int", "selEnd", ")", "{", "if", "(", "mInputView", "==", "null", ")", "return", ";", "if", "(", "mInputView", "instanceof", "InternalEditText", ")", "(", "(", "InternalEditText", ")", "...
This method is called when the selection has changed, in case any subclasses would like to know. @param selStart The new selection start location. @param selEnd The new selection end location.
[ "This", "method", "is", "called", "when", "the", "selection", "has", "changed", "in", "case", "any", "subclasses", "would", "like", "to", "know", "." ]
train
https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/widget/EditText.java#L2609-L2622
burberius/eve-esi
src/main/java/net/troja/eve/esi/api/MailApi.java
MailApi.postCharactersCharacterIdMail
public Integer postCharactersCharacterIdMail(Integer characterId, String datasource, String token, Mail mail) throws ApiException { ApiResponse<Integer> resp = postCharactersCharacterIdMailWithHttpInfo(characterId, datasource, token, mail); return resp.getData(); }
java
public Integer postCharactersCharacterIdMail(Integer characterId, String datasource, String token, Mail mail) throws ApiException { ApiResponse<Integer> resp = postCharactersCharacterIdMailWithHttpInfo(characterId, datasource, token, mail); return resp.getData(); }
[ "public", "Integer", "postCharactersCharacterIdMail", "(", "Integer", "characterId", ",", "String", "datasource", ",", "String", "token", ",", "Mail", "mail", ")", "throws", "ApiException", "{", "ApiResponse", "<", "Integer", ">", "resp", "=", "postCharactersCharact...
Send a new mail Create and send a new mail --- SSO Scope: esi-mail.send_mail.v1 @param characterId An EVE character ID (required) @param datasource The server name you would like data from (optional, default to tranquility) @param token Access token to use if unable to set a header (optional) @param mail (optional) @r...
[ "Send", "a", "new", "mail", "Create", "and", "send", "a", "new", "mail", "---", "SSO", "Scope", ":", "esi", "-", "mail", ".", "send_mail", ".", "v1" ]
train
https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/MailApi.java#L1175-L1179
Cleveroad/AdaptiveTableLayout
library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableManager.java
AdaptiveTableManager.getColumnByXWithShift
int getColumnByXWithShift(int x, int shiftEveryStep) { checkForInit(); int sum = 0; // header offset int tempX = x - mHeaderRowWidth; if (tempX <= sum) { return 0; } for (int count = mColumnWidths.length, i = 0; i < count; i++) { int nextSu...
java
int getColumnByXWithShift(int x, int shiftEveryStep) { checkForInit(); int sum = 0; // header offset int tempX = x - mHeaderRowWidth; if (tempX <= sum) { return 0; } for (int count = mColumnWidths.length, i = 0; i < count; i++) { int nextSu...
[ "int", "getColumnByXWithShift", "(", "int", "x", ",", "int", "shiftEveryStep", ")", "{", "checkForInit", "(", ")", ";", "int", "sum", "=", "0", ";", "// header offset", "int", "tempX", "=", "x", "-", "mHeaderRowWidth", ";", "if", "(", "tempX", "<=", "sum...
Return column number which bounds contains X @param x coordinate @return column number
[ "Return", "column", "number", "which", "bounds", "contains", "X" ]
train
https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableManager.java#L224-L242
jpush/jmessage-api-java-client
src/main/java/cn/jmessage/api/sensitiveword/SensitiveWordClient.java
SensitiveWordClient.updateSensitiveWord
public ResponseWrapper updateSensitiveWord(String newWord, String oldWord) throws APIConnectionException, APIRequestException { Preconditions.checkArgument(newWord.length() <= 10, "one word's max length is 10"); Preconditions.checkArgument(oldWord.length() <= 10, "one word's max length is 10...
java
public ResponseWrapper updateSensitiveWord(String newWord, String oldWord) throws APIConnectionException, APIRequestException { Preconditions.checkArgument(newWord.length() <= 10, "one word's max length is 10"); Preconditions.checkArgument(oldWord.length() <= 10, "one word's max length is 10...
[ "public", "ResponseWrapper", "updateSensitiveWord", "(", "String", "newWord", ",", "String", "oldWord", ")", "throws", "APIConnectionException", ",", "APIRequestException", "{", "Preconditions", ".", "checkArgument", "(", "newWord", ".", "length", "(", ")", "<=", "1...
Update sensitive word @param newWord new word @param oldWord old word @return No content @throws APIConnectionException connect exception @throws APIRequestException request exception
[ "Update", "sensitive", "word" ]
train
https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/sensitiveword/SensitiveWordClient.java#L77-L85
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
SimpleDocTreeVisitor.visitReturn
@Override public R visitReturn(ReturnTree node, P p) { return defaultAction(node, p); }
java
@Override public R visitReturn(ReturnTree node, P p) { return defaultAction(node, p); }
[ "@", "Override", "public", "R", "visitReturn", "(", "ReturnTree", "node", ",", "P", "p", ")", "{", "return", "defaultAction", "(", "node", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction}
[ "{", "@inheritDoc", "}", "This", "implementation", "calls", "{", "@code", "defaultAction", "}", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L321-L324
aws/aws-sdk-java
aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/AutomationExecutionMetadata.java
AutomationExecutionMetadata.withTargetMaps
public AutomationExecutionMetadata withTargetMaps(java.util.Collection<java.util.Map<String, java.util.List<String>>> targetMaps) { setTargetMaps(targetMaps); return this; }
java
public AutomationExecutionMetadata withTargetMaps(java.util.Collection<java.util.Map<String, java.util.List<String>>> targetMaps) { setTargetMaps(targetMaps); return this; }
[ "public", "AutomationExecutionMetadata", "withTargetMaps", "(", "java", ".", "util", ".", "Collection", "<", "java", ".", "util", ".", "Map", "<", "String", ",", "java", ".", "util", ".", "List", "<", "String", ">", ">", ">", "targetMaps", ")", "{", "set...
<p> The specified key-value mapping of document parameters to target resources. </p> @param targetMaps The specified key-value mapping of document parameters to target resources. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "specified", "key", "-", "value", "mapping", "of", "document", "parameters", "to", "target", "resources", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/AutomationExecutionMetadata.java#L995-L998
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DateTimeUtils.java
DateTimeUtils.addMinutes
public static Calendar addMinutes(Calendar origin, int value) { Calendar cal = sync((Calendar) origin.clone()); cal.add(Calendar.MINUTE, value); return sync(cal); }
java
public static Calendar addMinutes(Calendar origin, int value) { Calendar cal = sync((Calendar) origin.clone()); cal.add(Calendar.MINUTE, value); return sync(cal); }
[ "public", "static", "Calendar", "addMinutes", "(", "Calendar", "origin", ",", "int", "value", ")", "{", "Calendar", "cal", "=", "sync", "(", "(", "Calendar", ")", "origin", ".", "clone", "(", ")", ")", ";", "cal", ".", "add", "(", "Calendar", ".", "M...
Add/Subtract the specified amount of minutes to the given {@link Calendar}. <p> The returned {@link Calendar} has its fields synced. </p> @param origin @param value @return @since 0.9.2
[ "Add", "/", "Subtract", "the", "specified", "amount", "of", "minutes", "to", "the", "given", "{", "@link", "Calendar", "}", "." ]
train
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DateTimeUtils.java#L319-L323
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/event/MoveOnEventHandler.java
MoveOnEventHandler.init
public void init(Record record, BaseField fldDest, BaseField fldSource, Converter convCheckMark, boolean bMoveOnNew, boolean bMoveOnValid, boolean bMoveOnSelect, boolean bMoveOnAdd, boolean bMoveOnUpdate, String strSource, boolean bDontMoveNullSource) { m_fldDest = fldDest; m_fldSource = fldSource; ...
java
public void init(Record record, BaseField fldDest, BaseField fldSource, Converter convCheckMark, boolean bMoveOnNew, boolean bMoveOnValid, boolean bMoveOnSelect, boolean bMoveOnAdd, boolean bMoveOnUpdate, String strSource, boolean bDontMoveNullSource) { m_fldDest = fldDest; m_fldSource = fldSource; ...
[ "public", "void", "init", "(", "Record", "record", ",", "BaseField", "fldDest", ",", "BaseField", "fldSource", ",", "Converter", "convCheckMark", ",", "boolean", "bMoveOnNew", ",", "boolean", "bMoveOnValid", ",", "boolean", "bMoveOnSelect", ",", "boolean", "bMoveO...
Constructor. @param pfldDest tour.field.BaseField The destination field. @param fldSource The source field. @param pCheckMark If is field if false, don't move the data. @param bMoveOnNew If true, move on new also. @param bMoveOnValid If true, move on valid also.
[ "Constructor", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/MoveOnEventHandler.java#L103-L116
kevinherron/opc-ua-stack
stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/CertificateValidationUtil.java
CertificateValidationUtil.validateHostnameOrIpAddress
public static void validateHostnameOrIpAddress(X509Certificate certificate, String hostname) throws UaException { boolean dnsNameMatches = validateSubjectAltNameField(certificate, SUBJECT_ALT_NAME_DNS_NAME, hostname::equals); boolean ipAddressMatches = validateSubjectAlt...
java
public static void validateHostnameOrIpAddress(X509Certificate certificate, String hostname) throws UaException { boolean dnsNameMatches = validateSubjectAltNameField(certificate, SUBJECT_ALT_NAME_DNS_NAME, hostname::equals); boolean ipAddressMatches = validateSubjectAlt...
[ "public", "static", "void", "validateHostnameOrIpAddress", "(", "X509Certificate", "certificate", ",", "String", "hostname", ")", "throws", "UaException", "{", "boolean", "dnsNameMatches", "=", "validateSubjectAltNameField", "(", "certificate", ",", "SUBJECT_ALT_NAME_DNS_NA...
Validate that the hostname used in the endpoint URL matches either the SubjectAltName DNSName or IPAddress in the given certificate. @param certificate the certificate to validate against. @param hostname the hostname used in the endpoint URL. @throws UaException if there is no matching DNSName or IPAddress entry.
[ "Validate", "that", "the", "hostname", "used", "in", "the", "endpoint", "URL", "matches", "either", "the", "SubjectAltName", "DNSName", "or", "IPAddress", "in", "the", "given", "certificate", "." ]
train
https://github.com/kevinherron/opc-ua-stack/blob/007f4e5c4ff102814bec17bb7c41f27e2e52f2fd/stack-core/src/main/java/com/digitalpetri/opcua/stack/core/util/CertificateValidationUtil.java#L111-L121
kiegroup/droolsjbpm-integration
kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/AbstractKieServicesClientImpl.java
AbstractKieServicesClientImpl.makeBackwardCompatibleHttpPostRequestAndCreateServiceResponse
protected <T> ServiceResponse<T> makeBackwardCompatibleHttpPostRequestAndCreateServiceResponse(String uri, Object body, Class<T> resultType, Map<String, String> headers) { logger.debug("About to send POST request to '{}' with payload '{}'", uri, body); KieServerHttpRequest request = newRequest( uri ).he...
java
protected <T> ServiceResponse<T> makeBackwardCompatibleHttpPostRequestAndCreateServiceResponse(String uri, Object body, Class<T> resultType, Map<String, String> headers) { logger.debug("About to send POST request to '{}' with payload '{}'", uri, body); KieServerHttpRequest request = newRequest( uri ).he...
[ "protected", "<", "T", ">", "ServiceResponse", "<", "T", ">", "makeBackwardCompatibleHttpPostRequestAndCreateServiceResponse", "(", "String", "uri", ",", "Object", "body", ",", "Class", "<", "T", ">", "resultType", ",", "Map", "<", "String", ",", "String", ">", ...
/* override of the regular method to allow backward compatibility for string based result of ServiceResponse
[ "/", "*", "override", "of", "the", "regular", "method", "to", "allow", "backward", "compatibility", "for", "string", "based", "result", "of", "ServiceResponse" ]
train
https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/AbstractKieServicesClientImpl.java#L758-L774
xiancloud/xian
xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java
DistributedQueue.flushPuts
@Override public boolean flushPuts(long waitTime, TimeUnit timeUnit) throws InterruptedException { long msWaitRemaining = TimeUnit.MILLISECONDS.convert(waitTime, timeUnit); synchronized(putCount) { while ( putCount.get() > 0 ) { if ( msWaitRemai...
java
@Override public boolean flushPuts(long waitTime, TimeUnit timeUnit) throws InterruptedException { long msWaitRemaining = TimeUnit.MILLISECONDS.convert(waitTime, timeUnit); synchronized(putCount) { while ( putCount.get() > 0 ) { if ( msWaitRemai...
[ "@", "Override", "public", "boolean", "flushPuts", "(", "long", "waitTime", ",", "TimeUnit", "timeUnit", ")", "throws", "InterruptedException", "{", "long", "msWaitRemaining", "=", "TimeUnit", ".", "MILLISECONDS", ".", "convert", "(", "waitTime", ",", "timeUnit", ...
Wait until any pending puts are committed @param waitTime max wait time @param timeUnit time unit @return true if the flush was successful, false if it timed out first @throws InterruptedException if thread was interrupted
[ "Wait", "until", "any", "pending", "puts", "are", "committed" ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java#L268-L290
wkgcass/Style
src/main/java/net/cassite/style/SwitchBlock.java
SwitchBlock.Case
public SwitchBlock<T, R> Case(T ca, RFunc0<R> func) { return Case(ca, $(func)); }
java
public SwitchBlock<T, R> Case(T ca, RFunc0<R> func) { return Case(ca, $(func)); }
[ "public", "SwitchBlock", "<", "T", ",", "R", ">", "Case", "(", "T", "ca", ",", "RFunc0", "<", "R", ">", "func", ")", "{", "return", "Case", "(", "ca", ",", "$", "(", "func", ")", ")", ";", "}" ]
add a Case block to the expression @param ca the object for switch-expression to match @param func function to apply when matches and return a result for expression to return @return <code>this</code>
[ "add", "a", "Case", "block", "to", "the", "expression" ]
train
https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/SwitchBlock.java#L77-L79
mygreen/super-csv-annotation
src/main/java/com/github/mygreen/supercsv/util/ArgUtils.java
ArgUtils.notEmpty
public static void notEmpty(final String arg, final String name) { if(arg == null) { throw new NullPointerException(String.format("%s should not be null.", name)); } if(arg.isEmpty()) { throw new IllegalArgumentException(String.format("%s should not be empt...
java
public static void notEmpty(final String arg, final String name) { if(arg == null) { throw new NullPointerException(String.format("%s should not be null.", name)); } if(arg.isEmpty()) { throw new IllegalArgumentException(String.format("%s should not be empt...
[ "public", "static", "void", "notEmpty", "(", "final", "String", "arg", ",", "final", "String", "name", ")", "{", "if", "(", "arg", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "String", ".", "format", "(", "\"%s should not be null.\""...
文字列が空 or nullでないかどうか検証する。 @param arg 検証対象の値 @param name 検証対象の引数の名前 @throws NullPointerException {@literal arg == null} @throws IllegalArgumentException {@literal arg.isEmpty() == true}
[ "文字列が空", "or", "nullでないかどうか検証する。" ]
train
https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/util/ArgUtils.java#L34-L42
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java
JacksonUtils.getDate
public static Date getDate(JsonNode node, String dPath, String dateTimeFormat) { return DPathUtils.getDate(node, dPath, dateTimeFormat); }
java
public static Date getDate(JsonNode node, String dPath, String dateTimeFormat) { return DPathUtils.getDate(node, dPath, dateTimeFormat); }
[ "public", "static", "Date", "getDate", "(", "JsonNode", "node", ",", "String", "dPath", ",", "String", "dateTimeFormat", ")", "{", "return", "DPathUtils", ".", "getDate", "(", "node", ",", "dPath", ",", "dateTimeFormat", ")", ";", "}" ]
Extract a date value from the target {@link JsonNode} using DPath expression. If the extracted value is a string, parse it as a {@link Date} using the specified date-time format. @param node @param dPath @param dateTimeFormat see {@link SimpleDateFormat} @return @see DPathUtils
[ "Extract", "a", "date", "value", "from", "the", "target", "{", "@link", "JsonNode", "}", "using", "DPath", "expression", ".", "If", "the", "extracted", "value", "is", "a", "string", "parse", "it", "as", "a", "{", "@link", "Date", "}", "using", "the", "...
train
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java#L220-L222
Whiley/WhileyCompiler
src/main/java/wyil/type/binding/RelaxedTypeResolver.java
RelaxedTypeResolver.selectCallableCandidate
private Binding selectCallableCandidate(Name name, List<Binding> candidates, LifetimeRelation lifetimes) { Binding best = null; Type.Callable bestType = null; boolean bestValidWinner = false; // for (int i = 0; i != candidates.size(); ++i) { Binding candidate = candidates.get(i); Type.Callable candidate...
java
private Binding selectCallableCandidate(Name name, List<Binding> candidates, LifetimeRelation lifetimes) { Binding best = null; Type.Callable bestType = null; boolean bestValidWinner = false; // for (int i = 0; i != candidates.size(); ++i) { Binding candidate = candidates.get(i); Type.Callable candidate...
[ "private", "Binding", "selectCallableCandidate", "(", "Name", "name", ",", "List", "<", "Binding", ">", "candidates", ",", "LifetimeRelation", "lifetimes", ")", "{", "Binding", "best", "=", "null", ";", "Type", ".", "Callable", "bestType", "=", "null", ";", ...
Given a list of candidate function or method declarations, determine the most precise match for the supplied argument types. The given argument types must be applicable to this function or macro declaration, and it must be a subtype of all other applicable candidates. @param candidates @param args @return
[ "Given", "a", "list", "of", "candidate", "function", "or", "method", "declarations", "determine", "the", "most", "precise", "match", "for", "the", "supplied", "argument", "types", ".", "The", "given", "argument", "types", "must", "be", "applicable", "to", "thi...
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/type/binding/RelaxedTypeResolver.java#L507-L551
xiancloud/xian
xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedPriorityQueue.java
DistributedPriorityQueue.putMulti
public void putMulti(MultiItem<T> items, int priority) throws Exception { putMulti(items, priority, 0, null); }
java
public void putMulti(MultiItem<T> items, int priority) throws Exception { putMulti(items, priority, 0, null); }
[ "public", "void", "putMulti", "(", "MultiItem", "<", "T", ">", "items", ",", "int", "priority", ")", "throws", "Exception", "{", "putMulti", "(", "items", ",", "priority", ",", "0", ",", "null", ")", ";", "}" ]
Add a set of items with the same priority into the queue. Adding is done in the background - thus, this method will return quickly.<br><br> NOTE: if an upper bound was set via {@link QueueBuilder#maxItems}, this method will block until there is available space in the queue. @param items items to add @param priority it...
[ "Add", "a", "set", "of", "items", "with", "the", "same", "priority", "into", "the", "queue", ".", "Adding", "is", "done", "in", "the", "background", "-", "thus", "this", "method", "will", "return", "quickly", ".", "<br", ">", "<br", ">", "NOTE", ":", ...
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedPriorityQueue.java#L137-L140
groovy/groovy-core
subprojects/groovy-json/src/main/java/groovy/json/JsonOutput.java
JsonOutput.writeCharSequence
private static void writeCharSequence(CharSequence seq, CharBuf buffer) { if (seq.length() > 0) { buffer.addJsonEscapedString(seq.toString()); } else { buffer.addChars(EMPTY_STRING_CHARS); } }
java
private static void writeCharSequence(CharSequence seq, CharBuf buffer) { if (seq.length() > 0) { buffer.addJsonEscapedString(seq.toString()); } else { buffer.addChars(EMPTY_STRING_CHARS); } }
[ "private", "static", "void", "writeCharSequence", "(", "CharSequence", "seq", ",", "CharBuf", "buffer", ")", "{", "if", "(", "seq", ".", "length", "(", ")", ">", "0", ")", "{", "buffer", ".", "addJsonEscapedString", "(", "seq", ".", "toString", "(", ")",...
Serializes any char sequence and writes it into specified buffer.
[ "Serializes", "any", "char", "sequence", "and", "writes", "it", "into", "specified", "buffer", "." ]
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/subprojects/groovy-json/src/main/java/groovy/json/JsonOutput.java#L304-L310
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/CardMultilineWidget.java
CardMultilineWidget.getCard
@Nullable public Card getCard() { if (validateAllFields()) { String cardNumber = mCardNumberEditText.getCardNumber(); int[] cardDate = mExpiryDateEditText.getValidDateFields(); String cvcValue = mCvcEditText.getText().toString(); Card card = new Card(cardNumb...
java
@Nullable public Card getCard() { if (validateAllFields()) { String cardNumber = mCardNumberEditText.getCardNumber(); int[] cardDate = mExpiryDateEditText.getValidDateFields(); String cvcValue = mCvcEditText.getText().toString(); Card card = new Card(cardNumb...
[ "@", "Nullable", "public", "Card", "getCard", "(", ")", "{", "if", "(", "validateAllFields", "(", ")", ")", "{", "String", "cardNumber", "=", "mCardNumberEditText", ".", "getCardNumber", "(", ")", ";", "int", "[", "]", "cardDate", "=", "mExpiryDateEditText",...
Gets a {@link Card} object from the user input, if all fields are valid. If not, returns {@code null}. @return a valid {@link Card} object based on user input, or {@code null} if any field is invalid
[ "Gets", "a", "{", "@link", "Card", "}", "object", "from", "the", "user", "input", "if", "all", "fields", "are", "valid", ".", "If", "not", "returns", "{", "@code", "null", "}", "." ]
train
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/CardMultilineWidget.java#L121-L136
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
StringGroovyMethods.getAt
public static CharSequence getAt(CharSequence text, IntRange range) { return getAt(text, (Range) range); }
java
public static CharSequence getAt(CharSequence text, IntRange range) { return getAt(text, (Range) range); }
[ "public", "static", "CharSequence", "getAt", "(", "CharSequence", "text", ",", "IntRange", "range", ")", "{", "return", "getAt", "(", "text", ",", "(", "Range", ")", "range", ")", ";", "}" ]
Support the range subscript operator for CharSequence with IntRange @param text a CharSequence @param range an IntRange @return the subsequence CharSequence @since 1.0
[ "Support", "the", "range", "subscript", "operator", "for", "CharSequence", "with", "IntRange" ]
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1265-L1267
redfish4ktc/maven-soapui-extension-plugin
src/main/java/org/ktc/soapui/maven/extension/impl/runner/SoapUIExtensionMockAsWarGenerator.java
SoapUIExtensionMockAsWarGenerator.runRunner
@Override protected boolean runRunner() throws Exception { WsdlProject project = (WsdlProject) ProjectFactoryRegistry.getProjectFactory("wsdl").createNew( getProjectFile(), getProjectPassword()); String pFile = getProjectFile(); project.getSettings().setString(ProjectSettin...
java
@Override protected boolean runRunner() throws Exception { WsdlProject project = (WsdlProject) ProjectFactoryRegistry.getProjectFactory("wsdl").createNew( getProjectFile(), getProjectPassword()); String pFile = getProjectFile(); project.getSettings().setString(ProjectSettin...
[ "@", "Override", "protected", "boolean", "runRunner", "(", ")", "throws", "Exception", "{", "WsdlProject", "project", "=", "(", "WsdlProject", ")", "ProjectFactoryRegistry", ".", "getProjectFactory", "(", "\"wsdl\"", ")", ".", "createNew", "(", "getProjectFile", "...
we should provide a PR to let us inject implementation of the MockAsWar
[ "we", "should", "provide", "a", "PR", "to", "let", "us", "inject", "implementation", "of", "the", "MockAsWar" ]
train
https://github.com/redfish4ktc/maven-soapui-extension-plugin/blob/556f0e6b2bd1db82feae0e3523a1eb0873fafebd/src/main/java/org/ktc/soapui/maven/extension/impl/runner/SoapUIExtensionMockAsWarGenerator.java#L40-L70
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/unbbayes/ShanksAgentBayesianReasoningCapability.java
ShanksAgentBayesianReasoningCapability.clearEvidence
public static void clearEvidence(ProbabilisticNetwork bn, String nodeName) throws ShanksException { ProbabilisticNode node = (ProbabilisticNode) bn.getNode(nodeName); ShanksAgentBayesianReasoningCapability.clearEvidence(bn, node); }
java
public static void clearEvidence(ProbabilisticNetwork bn, String nodeName) throws ShanksException { ProbabilisticNode node = (ProbabilisticNode) bn.getNode(nodeName); ShanksAgentBayesianReasoningCapability.clearEvidence(bn, node); }
[ "public", "static", "void", "clearEvidence", "(", "ProbabilisticNetwork", "bn", ",", "String", "nodeName", ")", "throws", "ShanksException", "{", "ProbabilisticNode", "node", "=", "(", "ProbabilisticNode", ")", "bn", ".", "getNode", "(", "nodeName", ")", ";", "S...
Clear a hard evidence fixed in a given node /** @param bn @param nodeName @throws ShanksException
[ "Clear", "a", "hard", "evidence", "fixed", "in", "a", "given", "node" ]
train
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/unbbayes/ShanksAgentBayesianReasoningCapability.java#L327-L331
phax/ph-css
ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java
CSSDataURL.getContentAsString
@Nonnull public String getContentAsString (@Nonnull final Charset aCharset) { if (m_aCharset.equals (aCharset)) { // Potentially return cached version return getContentAsString (); } return new String (m_aContent, aCharset); }
java
@Nonnull public String getContentAsString (@Nonnull final Charset aCharset) { if (m_aCharset.equals (aCharset)) { // Potentially return cached version return getContentAsString (); } return new String (m_aContent, aCharset); }
[ "@", "Nonnull", "public", "String", "getContentAsString", "(", "@", "Nonnull", "final", "Charset", "aCharset", ")", "{", "if", "(", "m_aCharset", ".", "equals", "(", "aCharset", ")", ")", "{", "// Potentially return cached version", "return", "getContentAsString", ...
Get the data content of this Data URL as String in the specified charset. No Base64 encoding is performed in this method. @param aCharset The charset to be used. May not be <code>null</code>. @return The content in a String representation using the provided charset. Never <code>null</code>.
[ "Get", "the", "data", "content", "of", "this", "Data", "URL", "as", "String", "in", "the", "specified", "charset", ".", "No", "Base64", "encoding", "is", "performed", "in", "this", "method", "." ]
train
https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java#L304-L313
springfox/springfox
springfox-spring-webmvc/src/main/java/springfox/documentation/spring/web/WebMvcPropertySourcedRequestMappingHandlerMapping.java
WebMvcPropertySourcedRequestMappingHandlerMapping.lookupHandlerMethod
@Override protected HandlerMethod lookupHandlerMethod(String urlPath, HttpServletRequest request) { logger.debug("looking up handler for path: " + urlPath); HandlerMethod handlerMethod = handlerMethods.get(urlPath); if (handlerMethod != null) { return handlerMethod; } for (String path : hand...
java
@Override protected HandlerMethod lookupHandlerMethod(String urlPath, HttpServletRequest request) { logger.debug("looking up handler for path: " + urlPath); HandlerMethod handlerMethod = handlerMethods.get(urlPath); if (handlerMethod != null) { return handlerMethod; } for (String path : hand...
[ "@", "Override", "protected", "HandlerMethod", "lookupHandlerMethod", "(", "String", "urlPath", ",", "HttpServletRequest", "request", ")", "{", "logger", ".", "debug", "(", "\"looking up handler for path: \"", "+", "urlPath", ")", ";", "HandlerMethod", "handlerMethod", ...
The lookup handler method, maps the SEOMapper method to the request URL. <p>If no mapping is found, or if the URL is disabled, it will simply drop through to the standard 404 handling.</p> @param urlPath the path to match. @param request the http servlet request. @return The HandlerMethod if one was found.
[ "The", "lookup", "handler", "method", "maps", "the", "SEOMapper", "method", "to", "the", "request", "URL", ".", "<p", ">", "If", "no", "mapping", "is", "found", "or", "if", "the", "URL", "is", "disabled", "it", "will", "simply", "drop", "through", "to", ...
train
https://github.com/springfox/springfox/blob/e40e2d6f4b345ffa35cd5c0ca7a12589036acaf7/springfox-spring-webmvc/src/main/java/springfox/documentation/spring/web/WebMvcPropertySourcedRequestMappingHandlerMapping.java#L101-L118
HadoopGenomics/Hadoop-BAM
src/main/java/org/seqdoop/hadoop_bam/util/NIOFileUtil.java
NIOFileUtil.mergeInto
static void mergeInto(List<Path> parts, OutputStream out) throws IOException { for (final Path part : parts) { Files.copy(part, out); Files.delete(part); } }
java
static void mergeInto(List<Path> parts, OutputStream out) throws IOException { for (final Path part : parts) { Files.copy(part, out); Files.delete(part); } }
[ "static", "void", "mergeInto", "(", "List", "<", "Path", ">", "parts", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "for", "(", "final", "Path", "part", ":", "parts", ")", "{", "Files", ".", "copy", "(", "part", ",", "out", ")", ";"...
Merge the given part files in order into an output stream. This deletes the parts. @param parts the part files to merge @param out the stream to write each file into, in order @throws IOException
[ "Merge", "the", "given", "part", "files", "in", "order", "into", "an", "output", "stream", ".", "This", "deletes", "the", "parts", "." ]
train
https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/util/NIOFileUtil.java#L106-L112
stratosphere/stratosphere
stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java
CliFrontend.buildProgram
protected PackagedProgram buildProgram(CommandLine line) { String[] programArgs = line.hasOption(ARGS_OPTION.getOpt()) ? line.getOptionValues(ARGS_OPTION.getOpt()) : line.getArgs(); // take the jar file from the option, or as the first trailing parameter (if available) String jarFilePath = null; if (l...
java
protected PackagedProgram buildProgram(CommandLine line) { String[] programArgs = line.hasOption(ARGS_OPTION.getOpt()) ? line.getOptionValues(ARGS_OPTION.getOpt()) : line.getArgs(); // take the jar file from the option, or as the first trailing parameter (if available) String jarFilePath = null; if (l...
[ "protected", "PackagedProgram", "buildProgram", "(", "CommandLine", "line", ")", "{", "String", "[", "]", "programArgs", "=", "line", ".", "hasOption", "(", "ARGS_OPTION", ".", "getOpt", "(", ")", ")", "?", "line", ".", "getOptionValues", "(", "ARGS_OPTION", ...
@param line @return Either a PackagedProgram (upon success), or null;
[ "@param", "line" ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/CliFrontend.java#L660-L704
r0adkll/PostOffice
library/src/main/java/com/r0adkll/postoffice/styles/EditTextStyle.java
EditTextStyle.onButtonClicked
@Override public void onButtonClicked(int which, DialogInterface dialogInterface) { switch (which){ case Dialog.BUTTON_POSITIVE: if(mListener != null) mListener.onAccepted(getText()); break; case Dialog.BUTTON_NEGATIVE: // Do nothing fo...
java
@Override public void onButtonClicked(int which, DialogInterface dialogInterface) { switch (which){ case Dialog.BUTTON_POSITIVE: if(mListener != null) mListener.onAccepted(getText()); break; case Dialog.BUTTON_NEGATIVE: // Do nothing fo...
[ "@", "Override", "public", "void", "onButtonClicked", "(", "int", "which", ",", "DialogInterface", "dialogInterface", ")", "{", "switch", "(", "which", ")", "{", "case", "Dialog", ".", "BUTTON_POSITIVE", ":", "if", "(", "mListener", "!=", "null", ")", "mList...
Called when one of the three available buttons are clicked so that this style can perform a special action such as calling a content delivery callback. @param which which button was pressed @param dialogInterface
[ "Called", "when", "one", "of", "the", "three", "available", "buttons", "are", "clicked", "so", "that", "this", "style", "can", "perform", "a", "special", "action", "such", "as", "calling", "a", "content", "delivery", "callback", "." ]
train
https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/EditTextStyle.java#L92-L102
reactor/reactor-netty
src/main/java/reactor/netty/udp/UdpServer.java
UdpServer.doOnUnbound
public final UdpServer doOnUnbound(Consumer<? super Connection> doOnUnbound) { Objects.requireNonNull(doOnUnbound, "doOnUnbound"); return new UdpServerDoOn(this, null, null, doOnUnbound); }
java
public final UdpServer doOnUnbound(Consumer<? super Connection> doOnUnbound) { Objects.requireNonNull(doOnUnbound, "doOnUnbound"); return new UdpServerDoOn(this, null, null, doOnUnbound); }
[ "public", "final", "UdpServer", "doOnUnbound", "(", "Consumer", "<", "?", "super", "Connection", ">", "doOnUnbound", ")", "{", "Objects", ".", "requireNonNull", "(", "doOnUnbound", ",", "\"doOnUnbound\"", ")", ";", "return", "new", "UdpServerDoOn", "(", "this", ...
Setup a callback called when {@link io.netty.channel.Channel} is unbound. @param doOnUnbound a consumer observing server stop event @return a new {@link UdpServer}
[ "Setup", "a", "callback", "called", "when", "{", "@link", "io", ".", "netty", ".", "channel", ".", "Channel", "}", "is", "unbound", "." ]
train
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/udp/UdpServer.java#L207-L210
cesarferreira/AndroidQuickUtils
library/src/main/java/quickutils/core/categories/image.java
image.getBitmapByImageURL
public static void getBitmapByImageURL(String imageURL, final OnEventListener callback) { new DownloadImageTask<Bitmap>(imageURL, new OnEventListener<Bitmap>() { @Override public void onSuccess(Bitmap bitmap) { callback.onSuccess(bitmap); } @Ove...
java
public static void getBitmapByImageURL(String imageURL, final OnEventListener callback) { new DownloadImageTask<Bitmap>(imageURL, new OnEventListener<Bitmap>() { @Override public void onSuccess(Bitmap bitmap) { callback.onSuccess(bitmap); } @Ove...
[ "public", "static", "void", "getBitmapByImageURL", "(", "String", "imageURL", ",", "final", "OnEventListener", "callback", ")", "{", "new", "DownloadImageTask", "<", "Bitmap", ">", "(", "imageURL", ",", "new", "OnEventListener", "<", "Bitmap", ">", "(", ")", "...
Get a bitmap by a given URL @param imageURL given URL @param callback callback
[ "Get", "a", "bitmap", "by", "a", "given", "URL" ]
train
https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/image.java#L77-L92
bmwcarit/joynr
java/messaging/bounceproxy/bounceproxy-common/src/main/java/io/joynr/messaging/bounceproxy/LongPollingMessagingDelegate.java
LongPollingMessagingDelegate.createChannel
public String createChannel(String ccid, String atmosphereTrackingId) { throwExceptionIfTrackingIdnotSet(atmosphereTrackingId); log.info("CREATE channel for cluster controller: {} trackingId: {} ", ccid, atmosphereTrackingId); Broadcaster broadcaster = null; // look for an existing bro...
java
public String createChannel(String ccid, String atmosphereTrackingId) { throwExceptionIfTrackingIdnotSet(atmosphereTrackingId); log.info("CREATE channel for cluster controller: {} trackingId: {} ", ccid, atmosphereTrackingId); Broadcaster broadcaster = null; // look for an existing bro...
[ "public", "String", "createChannel", "(", "String", "ccid", ",", "String", "atmosphereTrackingId", ")", "{", "throwExceptionIfTrackingIdnotSet", "(", "atmosphereTrackingId", ")", ";", "log", ".", "info", "(", "\"CREATE channel for cluster controller: {} trackingId: {} \"", ...
Creates a long polling channel. @param ccid the identifier of the channel @param atmosphereTrackingId the tracking ID of the channel @return the path segment for the channel. The path, appended to the base URI of the channel service, can be used to post messages to the channel.
[ "Creates", "a", "long", "polling", "channel", "." ]
train
https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/bounceproxy/bounceproxy-common/src/main/java/io/joynr/messaging/bounceproxy/LongPollingMessagingDelegate.java#L95-L133
Devskiller/jfairy
src/main/java/com/devskiller/jfairy/Bootstrap.java
Bootstrap.getFairyModuleForLocale
private static FairyModule getFairyModuleForLocale(DataMaster dataMaster, Locale locale, RandomGenerator randomGenerator) { LanguageCode code; try { code = LanguageCode.valueOf(locale.getLanguage().toUpperCase()); } catch (IllegalArgumentException e) { LOG.warn("Uknown locale " + locale); code = Languag...
java
private static FairyModule getFairyModuleForLocale(DataMaster dataMaster, Locale locale, RandomGenerator randomGenerator) { LanguageCode code; try { code = LanguageCode.valueOf(locale.getLanguage().toUpperCase()); } catch (IllegalArgumentException e) { LOG.warn("Uknown locale " + locale); code = Languag...
[ "private", "static", "FairyModule", "getFairyModuleForLocale", "(", "DataMaster", "dataMaster", ",", "Locale", "locale", ",", "RandomGenerator", "randomGenerator", ")", "{", "LanguageCode", "code", ";", "try", "{", "code", "=", "LanguageCode", ".", "valueOf", "(", ...
Support customized language config @param dataMaster master of the config @param locale The Locale to set. @param randomGenerator specific random generator @return FariyModule instance in accordance with locale
[ "Support", "customized", "language", "config" ]
train
https://github.com/Devskiller/jfairy/blob/126d1c8b1545f725afd10f969b9d27005ac520b7/src/main/java/com/devskiller/jfairy/Bootstrap.java#L121-L152
comapi/comapi-chat-sdk-android
COMAPI/chat/src/main/java/com/comapi/chat/PersistenceController.java
PersistenceController.updateStoreWithNewMessage
public Observable<Boolean> updateStoreWithNewMessage(final ChatMessage message, final ChatController.NoConversationListener noConversationListener) { return asObservable(new Executor<Boolean>() { @Override protected void execute(ChatStore store, Emitter<Boolean> emitter) { ...
java
public Observable<Boolean> updateStoreWithNewMessage(final ChatMessage message, final ChatController.NoConversationListener noConversationListener) { return asObservable(new Executor<Boolean>() { @Override protected void execute(ChatStore store, Emitter<Boolean> emitter) { ...
[ "public", "Observable", "<", "Boolean", ">", "updateStoreWithNewMessage", "(", "final", "ChatMessage", "message", ",", "final", "ChatController", ".", "NoConversationListener", "noConversationListener", ")", "{", "return", "asObservable", "(", "new", "Executor", "<", ...
Deletes temporary message and inserts provided one. If no associated conversation exists will trigger GET from server. @param message Message to save. @param noConversationListener Listener for the chat controller to get conversation if no local copy is present. @return Observable emitting result.
[ "Deletes", "temporary", "message", "and", "inserts", "provided", "one", ".", "If", "no", "associated", "conversation", "exists", "will", "trigger", "GET", "from", "server", "." ]
train
https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/PersistenceController.java#L254-L295
mirage-sql/mirage
src/main/java/com/miragesql/miragesql/SqlExecutor.java
SqlExecutor.getSingleResult
public <T> T getSingleResult(Class<T> clazz, String sql, Object[] params) { PreparedStatement stmt = null; ResultSet rs = null; try { stmt = connectionProvider.getConnection().prepareStatement(sql); setParameters(stmt, params); if (logger.isDebugEnable...
java
public <T> T getSingleResult(Class<T> clazz, String sql, Object[] params) { PreparedStatement stmt = null; ResultSet rs = null; try { stmt = connectionProvider.getConnection().prepareStatement(sql); setParameters(stmt, params); if (logger.isDebugEnable...
[ "public", "<", "T", ">", "T", "getSingleResult", "(", "Class", "<", "T", ">", "clazz", ",", "String", "sql", ",", "Object", "[", "]", "params", ")", "{", "PreparedStatement", "stmt", "=", "null", ";", "ResultSet", "rs", "=", "null", ";", "try", "{", ...
Returns a single entity from the first row of an SQL. @param <T> the entity type @param clazz the class of the entity @param sql the SQL to execute @param params the parameters to execute the SQL @return the entity from the result set. @throws SQLRuntimeException if a database access error occurs
[ "Returns", "a", "single", "entity", "from", "the", "first", "row", "of", "an", "SQL", "." ]
train
https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L228-L261
apache/incubator-atlas
common/src/main/java/org/apache/atlas/utils/ParamChecker.java
ParamChecker.notEmptyIfNotNull
public static String notEmptyIfNotNull(String value, String name, String info) { if (value == null) { return value; } if (value.trim().length() == 0) { throw new IllegalArgumentException(name + " cannot be empty" + (info == null ? "" : ", " + info)); } re...
java
public static String notEmptyIfNotNull(String value, String name, String info) { if (value == null) { return value; } if (value.trim().length() == 0) { throw new IllegalArgumentException(name + " cannot be empty" + (info == null ? "" : ", " + info)); } re...
[ "public", "static", "String", "notEmptyIfNotNull", "(", "String", "value", ",", "String", "name", ",", "String", "info", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "value", ";", "}", "if", "(", "value", ".", "trim", "(", ")", "."...
Check that a string is not empty if its not null. @param value value. @param name parameter name for the exception message. @return the given value.
[ "Check", "that", "a", "string", "is", "not", "empty", "if", "its", "not", "null", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/common/src/main/java/org/apache/atlas/utils/ParamChecker.java#L115-L124
real-logic/agrona
agrona/src/main/java/org/agrona/IoUtil.java
IoUtil.mapExistingFile
public static MappedByteBuffer mapExistingFile( final File location, final String descriptionLabel, final long offset, final long length) { return mapExistingFile(location, READ_WRITE, descriptionLabel, offset, length); }
java
public static MappedByteBuffer mapExistingFile( final File location, final String descriptionLabel, final long offset, final long length) { return mapExistingFile(location, READ_WRITE, descriptionLabel, offset, length); }
[ "public", "static", "MappedByteBuffer", "mapExistingFile", "(", "final", "File", "location", ",", "final", "String", "descriptionLabel", ",", "final", "long", "offset", ",", "final", "long", "length", ")", "{", "return", "mapExistingFile", "(", "location", ",", ...
Check that file exists, open file, and return MappedByteBuffer for only region specified as {@link java.nio.channels.FileChannel.MapMode#READ_WRITE}. <p> The file itself will be closed, but the mapping will persist. @param location of the file to map @param descriptionLabel to be associated for an exceptions @...
[ "Check", "that", "file", "exists", "open", "file", "and", "return", "MappedByteBuffer", "for", "only", "region", "specified", "as", "{", "@link", "java", ".", "nio", ".", "channels", ".", "FileChannel", ".", "MapMode#READ_WRITE", "}", ".", "<p", ">", "The", ...
train
https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/IoUtil.java#L297-L301