repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
SimpleDocTreeVisitor.visitDeprecated
@Override public R visitDeprecated(DeprecatedTree node, P p) { """ {@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction} """ return defaultAction(node, p); }
java
@Override public R visitDeprecated(DeprecatedTree node, P p) { return defaultAction(node, p); }
[ "@", "Override", "public", "R", "visitDeprecated", "(", "DeprecatedTree", "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#L141-L144
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java
ExampleFeatureSurf.easy
public static void easy( GrayF32 image ) { """ Use generalized interfaces for working with SURF. This removes much of the drudgery, but also reduces flexibility and slightly increases memory and computational requirements. @param image Input image type. DOES NOT NEED TO BE GrayF32, GrayU8 works too """ ...
java
public static void easy( GrayF32 image ) { // create the detector and descriptors DetectDescribePoint<GrayF32,BrightFeature> surf = FactoryDetectDescribe. surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null,GrayF32.class); // specify the image to process surf.detect(image); System.out.p...
[ "public", "static", "void", "easy", "(", "GrayF32", "image", ")", "{", "// create the detector and descriptors", "DetectDescribePoint", "<", "GrayF32", ",", "BrightFeature", ">", "surf", "=", "FactoryDetectDescribe", ".", "surfStable", "(", "new", "ConfigFastHessian", ...
Use generalized interfaces for working with SURF. This removes much of the drudgery, but also reduces flexibility and slightly increases memory and computational requirements. @param image Input image type. DOES NOT NEED TO BE GrayF32, GrayU8 works too
[ "Use", "generalized", "interfaces", "for", "working", "with", "SURF", ".", "This", "removes", "much", "of", "the", "drudgery", "but", "also", "reduces", "flexibility", "and", "slightly", "increases", "memory", "and", "computational", "requirements", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleFeatureSurf.java#L59-L69
fommil/matrix-toolkits-java
src/main/java/no/uib/cipr/matrix/sparse/Arrays.java
Arrays.binarySearchSmaller
public static int binarySearchSmaller(int[] index, int key, int begin, int end) { """ Searches for a key in a sorted array, and returns an index to an element which is smaller than or equal key. @param index Sorted array of integers @param key Search for something equal or greater @param begin ...
java
public static int binarySearchSmaller(int[] index, int key, int begin, int end) { return binarySearchInterval(index, key, begin, end, false); }
[ "public", "static", "int", "binarySearchSmaller", "(", "int", "[", "]", "index", ",", "int", "key", ",", "int", "begin", ",", "int", "end", ")", "{", "return", "binarySearchInterval", "(", "index", ",", "key", ",", "begin", ",", "end", ",", "false", ")...
Searches for a key in a sorted array, and returns an index to an element which is smaller than or equal key. @param index Sorted array of integers @param key Search for something equal or greater @param begin Start posisiton in the index @param end One past the end position in the index @return begin-1 if nothing smal...
[ "Searches", "for", "a", "key", "in", "a", "sorted", "array", "and", "returns", "an", "index", "to", "an", "element", "which", "is", "smaller", "than", "or", "equal", "key", "." ]
train
https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/sparse/Arrays.java#L86-L89
filestack/filestack-android
filestack/src/main/java/com/filestack/android/internal/Util.java
Util.createPictureFile
public static File createPictureFile(Context context) throws IOException { """ Create a file with a path appropriate to save a photo. Uses directory internal to app. """ Locale locale = Locale.getDefault(); String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", locale).format(new Date()); ...
java
public static File createPictureFile(Context context) throws IOException { Locale locale = Locale.getDefault(); String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", locale).format(new Date()); String fileName = "JPEG_" + timeStamp + "_"; // Store in normal camera directory ...
[ "public", "static", "File", "createPictureFile", "(", "Context", "context", ")", "throws", "IOException", "{", "Locale", "locale", "=", "Locale", ".", "getDefault", "(", ")", ";", "String", "timeStamp", "=", "new", "SimpleDateFormat", "(", "\"yyyyMMdd_HHmmss\"", ...
Create a file with a path appropriate to save a photo. Uses directory internal to app.
[ "Create", "a", "file", "with", "a", "path", "appropriate", "to", "save", "a", "photo", ".", "Uses", "directory", "internal", "to", "app", "." ]
train
https://github.com/filestack/filestack-android/blob/8dafa1cb5c77542c351d631be0742717b5a9d45d/filestack/src/main/java/com/filestack/android/internal/Util.java#L168-L175
mercadopago/dx-java
src/main/java/com/mercadopago/core/MPCache.java
MPCache.getMapCache
private static HashMap<String, MPApiResponse> getMapCache() { """ Auxiliar method. It returns a Map with cached responses from the soft references variable. If the map does not exists, its instantiated and then returned. @return HashMap object """ if (cache == null || cache.get() == null) { ...
java
private static HashMap<String, MPApiResponse> getMapCache() { if (cache == null || cache.get() == null) { cache = new SoftReference(new HashMap<String, MPApiResponse>()); } return cache.get(); }
[ "private", "static", "HashMap", "<", "String", ",", "MPApiResponse", ">", "getMapCache", "(", ")", "{", "if", "(", "cache", "==", "null", "||", "cache", ".", "get", "(", ")", "==", "null", ")", "{", "cache", "=", "new", "SoftReference", "(", "new", "...
Auxiliar method. It returns a Map with cached responses from the soft references variable. If the map does not exists, its instantiated and then returned. @return HashMap object
[ "Auxiliar", "method", ".", "It", "returns", "a", "Map", "with", "cached", "responses", "from", "the", "soft", "references", "variable", ".", "If", "the", "map", "does", "not", "exists", "its", "instantiated", "and", "then", "returned", "." ]
train
https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCache.java#L22-L27
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MembershipManager.java
MembershipManager.getMissingMember
MemberImpl getMissingMember(Address address, String uuid) { """ Returns the missing member using either its {@code UUID} or its {@code Address} depending on Hot Restart is enabled or not. @param address Address of the missing member @param uuid Uuid of the missing member @return the missing member """ ...
java
MemberImpl getMissingMember(Address address, String uuid) { Map<Object, MemberImpl> m = missingMembersRef.get(); return isHotRestartEnabled() ? m.get(uuid) : m.get(address); }
[ "MemberImpl", "getMissingMember", "(", "Address", "address", ",", "String", "uuid", ")", "{", "Map", "<", "Object", ",", "MemberImpl", ">", "m", "=", "missingMembersRef", ".", "get", "(", ")", ";", "return", "isHotRestartEnabled", "(", ")", "?", "m", ".", ...
Returns the missing member using either its {@code UUID} or its {@code Address} depending on Hot Restart is enabled or not. @param address Address of the missing member @param uuid Uuid of the missing member @return the missing member
[ "Returns", "the", "missing", "member", "using", "either", "its", "{", "@code", "UUID", "}", "or", "its", "{", "@code", "Address", "}", "depending", "on", "Hot", "Restart", "is", "enabled", "or", "not", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MembershipManager.java#L966-L969
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseUtil.java
BpmnParseUtil.parseInputParameterElement
public static void parseInputParameterElement(Element inputParameterElement, IoMapping ioMapping) { """ Parses a input parameter and adds it to the {@link IoMapping}. @param inputParameterElement the input parameter element @param ioMapping the mapping to add the element @throws BpmnParseException if the inpu...
java
public static void parseInputParameterElement(Element inputParameterElement, IoMapping ioMapping) { String nameAttribute = inputParameterElement.attribute("name"); if(nameAttribute == null || nameAttribute.isEmpty()) { throw new BpmnParseException("Missing attribute 'name' for inputParameter", inputParame...
[ "public", "static", "void", "parseInputParameterElement", "(", "Element", "inputParameterElement", ",", "IoMapping", "ioMapping", ")", "{", "String", "nameAttribute", "=", "inputParameterElement", ".", "attribute", "(", "\"name\"", ")", ";", "if", "(", "nameAttribute"...
Parses a input parameter and adds it to the {@link IoMapping}. @param inputParameterElement the input parameter element @param ioMapping the mapping to add the element @throws BpmnParseException if the input parameter element is malformed
[ "Parses", "a", "input", "parameter", "and", "adds", "it", "to", "the", "{", "@link", "IoMapping", "}", "." ]
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseUtil.java#L117-L127
mgormley/pacaya
src/main/java/edu/jhu/pacaya/parse/dep/edmonds/SparseGraph.java
SparseGraph.addEdge
public void addEdge(int from, int to) { """ Add an edge from node <code>from</code> to node <code>to</code>. @param from @param to """ Set<Integer> outEdges = edges.get(from); if (outEdges == null) { outEdges = new TreeSet<Integer>(); edges.put(from, outEdges); ...
java
public void addEdge(int from, int to) { Set<Integer> outEdges = edges.get(from); if (outEdges == null) { outEdges = new TreeSet<Integer>(); edges.put(from, outEdges); } outEdges.add(to); }
[ "public", "void", "addEdge", "(", "int", "from", ",", "int", "to", ")", "{", "Set", "<", "Integer", ">", "outEdges", "=", "edges", ".", "get", "(", "from", ")", ";", "if", "(", "outEdges", "==", "null", ")", "{", "outEdges", "=", "new", "TreeSet", ...
Add an edge from node <code>from</code> to node <code>to</code>. @param from @param to
[ "Add", "an", "edge", "from", "node", "<code", ">", "from<", "/", "code", ">", "to", "node", "<code", ">", "to<", "/", "code", ">", "." ]
train
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/dep/edmonds/SparseGraph.java#L34-L41
soi-toolkit/soi-toolkit-mule
commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/monitor/MonitorEndpointHelper.java
MonitorEndpointHelper.pingJmsBackoutQueue
public static String pingJmsBackoutQueue(MuleContext muleContext, String muleJmsConnectorName, String queueName) { """ Verify access to a JMS backout queue by browsing the backout queue and ensure that no messages exists. @param muleJmsConnectorName @param queueName @return """ try { if (isQueu...
java
public static String pingJmsBackoutQueue(MuleContext muleContext, String muleJmsConnectorName, String queueName) { try { if (isQueueEmpty(muleContext, muleJmsConnectorName, queueName)) { return OK_PREFIX + ": The queue " + queueName + " in the queue manager " + muleJmsConnectorName + " is empty"; ...
[ "public", "static", "String", "pingJmsBackoutQueue", "(", "MuleContext", "muleContext", ",", "String", "muleJmsConnectorName", ",", "String", "queueName", ")", "{", "try", "{", "if", "(", "isQueueEmpty", "(", "muleContext", ",", "muleJmsConnectorName", ",", "queueNa...
Verify access to a JMS backout queue by browsing the backout queue and ensure that no messages exists. @param muleJmsConnectorName @param queueName @return
[ "Verify", "access", "to", "a", "JMS", "backout", "queue", "by", "browsing", "the", "backout", "queue", "and", "ensure", "that", "no", "messages", "exists", "." ]
train
https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/monitor/MonitorEndpointHelper.java#L153-L165
spotify/scio
scio-cassandra/cassandra2/src/main/java/org/apache/cassandra/db/DeletionInfo.java
DeletionInfo.updateAllTimestamp
public void updateAllTimestamp(long timestamp) { """ Updates all the timestamp of the deletion contained in this DeletionInfo to be {@code timestamp}. """ if (topLevel.markedForDeleteAt != Long.MIN_VALUE) topLevel = new DeletionTime(timestamp, topLevel.localDeletionTime); if (ranges != null) ...
java
public void updateAllTimestamp(long timestamp) { if (topLevel.markedForDeleteAt != Long.MIN_VALUE) topLevel = new DeletionTime(timestamp, topLevel.localDeletionTime); if (ranges != null) ranges.updateAllTimestamp(timestamp); }
[ "public", "void", "updateAllTimestamp", "(", "long", "timestamp", ")", "{", "if", "(", "topLevel", ".", "markedForDeleteAt", "!=", "Long", ".", "MIN_VALUE", ")", "topLevel", "=", "new", "DeletionTime", "(", "timestamp", ",", "topLevel", ".", "localDeletionTime",...
Updates all the timestamp of the deletion contained in this DeletionInfo to be {@code timestamp}.
[ "Updates", "all", "the", "timestamp", "of", "the", "deletion", "contained", "in", "this", "DeletionInfo", "to", "be", "{" ]
train
https://github.com/spotify/scio/blob/ed9a44428251b0c6834aad231b463d8eda418471/scio-cassandra/cassandra2/src/main/java/org/apache/cassandra/db/DeletionInfo.java#L361-L368
OpenTSDB/opentsdb
src/uid/UniqueId.java
UniqueId.suggestAsync
public Deferred<List<String>> suggestAsync(final String search, final int max_results) { """ Attempts to find suggestions of names given a search term. @param search The search term (possibly empty). @return A list of known valid names that have UIDs that sort of match the search term. If the search ter...
java
public Deferred<List<String>> suggestAsync(final String search, final int max_results) { return new SuggestCB(search, max_results).search(); }
[ "public", "Deferred", "<", "List", "<", "String", ">", ">", "suggestAsync", "(", "final", "String", "search", ",", "final", "int", "max_results", ")", "{", "return", "new", "SuggestCB", "(", "search", ",", "max_results", ")", ".", "search", "(", ")", ";"...
Attempts to find suggestions of names given a search term. @param search The search term (possibly empty). @return A list of known valid names that have UIDs that sort of match the search term. If the search term is empty, returns the first few terms. @throws HBaseException if there was a problem getting suggestions f...
[ "Attempts", "to", "find", "suggestions", "of", "names", "given", "a", "search", "term", "." ]
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/uid/UniqueId.java#L1014-L1017
foundation-runtime/service-directory
2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryServers.java
DirectoryServers.validateServer
private boolean validateServer(String host, int port) { """ Validate the host and port. @param host the host string. @param port the port number. @return true for success. """ if(host==null || host.isEmpty()){ return false; } if(port <=0 || port > 65535){ ...
java
private boolean validateServer(String host, int port){ if(host==null || host.isEmpty()){ return false; } if(port <=0 || port > 65535){ return false; } return true; }
[ "private", "boolean", "validateServer", "(", "String", "host", ",", "int", "port", ")", "{", "if", "(", "host", "==", "null", "||", "host", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "port", "<=", "0", "||", "port",...
Validate the host and port. @param host the host string. @param port the port number. @return true for success.
[ "Validate", "the", "host", "and", "port", "." ]
train
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryServers.java#L147-L155
hal/core
gui/src/main/java/org/jboss/as/console/client/widgets/forms/EntityAdapter.java
EntityAdapter.fromChangeset
public ModelNode fromChangeset(Map<String, Object> changeSet, ModelNode address, ModelNode... extraSteps) { """ Turns a changeset into a composite write attribute operation. @param changeSet @param address the entity address @return composite operation """ ModelNode protoType = new ModelNode();...
java
public ModelNode fromChangeset(Map<String, Object> changeSet, ModelNode address, ModelNode... extraSteps) { ModelNode protoType = new ModelNode(); protoType.get(ADDRESS).set(address.get(ADDRESS)); protoType.get(OP).set(WRITE_ATTRIBUTE_OPERATION); ModelNode operation = new Mo...
[ "public", "ModelNode", "fromChangeset", "(", "Map", "<", "String", ",", "Object", ">", "changeSet", ",", "ModelNode", "address", ",", "ModelNode", "...", "extraSteps", ")", "{", "ModelNode", "protoType", "=", "new", "ModelNode", "(", ")", ";", "protoType", "...
Turns a changeset into a composite write attribute operation. @param changeSet @param address the entity address @return composite operation
[ "Turns", "a", "changeset", "into", "a", "composite", "write", "attribute", "operation", "." ]
train
https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/widgets/forms/EntityAdapter.java#L531-L587
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java
ZonedDateTime.ofInstant
public static ZonedDateTime ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) { """ Obtains an instance of {@code ZonedDateTime} from the instant formed by combining the local date-time and offset. <p> This creates a zoned date-time by {@link LocalDateTime#toInstant(ZoneOffset) combining} ...
java
public static ZonedDateTime ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) { Objects.requireNonNull(localDateTime, "localDateTime"); Objects.requireNonNull(offset, "offset"); Objects.requireNonNull(zone, "zone"); if (zone.getRules().isValidOffset(localDateTime, of...
[ "public", "static", "ZonedDateTime", "ofInstant", "(", "LocalDateTime", "localDateTime", ",", "ZoneOffset", "offset", ",", "ZoneId", "zone", ")", "{", "Objects", ".", "requireNonNull", "(", "localDateTime", ",", "\"localDateTime\"", ")", ";", "Objects", ".", "requ...
Obtains an instance of {@code ZonedDateTime} from the instant formed by combining the local date-time and offset. <p> This creates a zoned date-time by {@link LocalDateTime#toInstant(ZoneOffset) combining} the {@code LocalDateTime} and {@code ZoneOffset}. This combination uniquely specifies an instant without ambiguity...
[ "Obtains", "an", "instance", "of", "{", "@code", "ZonedDateTime", "}", "from", "the", "instant", "formed", "by", "combining", "the", "local", "date", "-", "time", "and", "offset", ".", "<p", ">", "This", "creates", "a", "zoned", "date", "-", "time", "by"...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java#L426-L434
ocelotds/ocelot
ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java
DataServiceVisitorJsBuilder.writeJavadocComment
void writeJavadocComment(String methodComment, Writer writer) throws IOException { """ write js documentation from javadoc @param methodComment @param writer @throws IOException """ // From javadoc if (methodComment != null) { methodComment = methodComment.split("@")[0]; int lastIndexOf = meth...
java
void writeJavadocComment(String methodComment, Writer writer) throws IOException { // From javadoc if (methodComment != null) { methodComment = methodComment.split("@")[0]; int lastIndexOf = methodComment.lastIndexOf("\n"); if (lastIndexOf >= 0) { methodComment = methodComment.substring(0, lastIn...
[ "void", "writeJavadocComment", "(", "String", "methodComment", ",", "Writer", "writer", ")", "throws", "IOException", "{", "// From javadoc\r", "if", "(", "methodComment", "!=", "null", ")", "{", "methodComment", "=", "methodComment", ".", "split", "(", "\"@\"", ...
write js documentation from javadoc @param methodComment @param writer @throws IOException
[ "write", "js", "documentation", "from", "javadoc" ]
train
https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java#L154-L165
google/j2objc
jre_emul/Classes/com/google/j2objc/net/IosHttpURLConnection.java
IosHttpURLConnection.addHeader
private void addHeader(String k, String v) { """ /*-[ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest *))completionHandler { if (self->instanceFollowRe...
java
private void addHeader(String k, String v) { if (k != null && (k.equalsIgnoreCase("Set-Cookie") || k.equalsIgnoreCase("Set-Cookie2"))) { CookieSplitter cs = new CookieSplitter(v); while (cs.hasNext()) { headers.add(new HeaderEntry(k, cs.next())); } } else { headers.add(new Header...
[ "private", "void", "addHeader", "(", "String", "k", ",", "String", "v", ")", "{", "if", "(", "k", "!=", "null", "&&", "(", "k", ".", "equalsIgnoreCase", "(", "\"Set-Cookie\"", ")", "||", "k", ".", "equalsIgnoreCase", "(", "\"Set-Cookie2\"", ")", ")", "...
/*-[ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest *))completionHandler { if (self->instanceFollowRedirects_ && [response.URL.scheme isEqualToString:request.URL...
[ "/", "*", "-", "[", "-", "(", "void", ")", "URLSession", ":", "(", "NSURLSession", "*", ")", "session", "task", ":", "(", "NSURLSessionTask", "*", ")", "task", "willPerformHTTPRedirection", ":", "(", "NSHTTPURLResponse", "*", ")", "response", "newRequest", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/Classes/com/google/j2objc/net/IosHttpURLConnection.java#L786-L795
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java
BindM2MBuilder.isMethodAlreadyDefined
private boolean isMethodAlreadyDefined(M2MEntity entity, final String methodName) { """ analyze DAO definition to check if method is already defined. @param entity the entity @param methodName the method name @return true, if is method already defined """ final One<Boolean> found = new One<Boolean>(f...
java
private boolean isMethodAlreadyDefined(M2MEntity entity, final String methodName) { final One<Boolean> found = new One<Boolean>(false); SqlBuilderHelper.forEachMethods(entity.daoElement, new MethodFoundListener() { @Override public void onMethod(ExecutableElement executableMethod) { if (executableMethod...
[ "private", "boolean", "isMethodAlreadyDefined", "(", "M2MEntity", "entity", ",", "final", "String", "methodName", ")", "{", "final", "One", "<", "Boolean", ">", "found", "=", "new", "One", "<", "Boolean", ">", "(", "false", ")", ";", "SqlBuilderHelper", ".",...
analyze DAO definition to check if method is already defined. @param entity the entity @param methodName the method name @return true, if is method already defined
[ "analyze", "DAO", "definition", "to", "check", "if", "method", "is", "already", "defined", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java#L313-L328
QSFT/Doradus
doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java
ApplicationDefinition.setOption
public void setOption(String optName, String optValue) { """ Set the option with the given name to the given value. If the option value is null, the option is "unset". If the option has an existing value, it is replaced. @param optName Name of option to set (case-sensitive). @param optValue New value of op...
java
public void setOption(String optName, String optValue) { if (optValue == null) { m_optionMap.remove(optName); } else { m_optionMap.put(optName, optValue.trim()); } }
[ "public", "void", "setOption", "(", "String", "optName", ",", "String", "optValue", ")", "{", "if", "(", "optValue", "==", "null", ")", "{", "m_optionMap", ".", "remove", "(", "optName", ")", ";", "}", "else", "{", "m_optionMap", ".", "put", "(", "optN...
Set the option with the given name to the given value. If the option value is null, the option is "unset". If the option has an existing value, it is replaced. @param optName Name of option to set (case-sensitive). @param optValue New value of option or null to "unset".
[ "Set", "the", "option", "with", "the", "given", "name", "to", "the", "given", "value", ".", "If", "the", "option", "value", "is", "null", "the", "option", "is", "unset", ".", "If", "the", "option", "has", "an", "existing", "value", "it", "is", "replace...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L302-L308
looly/hutool
hutool-core/src/main/java/cn/hutool/core/convert/Convert.java
Convert.hexToStr
public static String hexToStr(String hexStr, Charset charset) { """ 十六进制转换字符串 @param hexStr Byte字符串(Byte之间无分隔符 如:[616C6B]) @param charset 编码 {@link Charset} @return 对应的字符串 @see HexUtil#decodeHexStr(String, Charset) @since 4.1.11 """ return HexUtil.decodeHexStr(hexStr, charset); }
java
public static String hexToStr(String hexStr, Charset charset) { return HexUtil.decodeHexStr(hexStr, charset); }
[ "public", "static", "String", "hexToStr", "(", "String", "hexStr", ",", "Charset", "charset", ")", "{", "return", "HexUtil", ".", "decodeHexStr", "(", "hexStr", ",", "charset", ")", ";", "}" ]
十六进制转换字符串 @param hexStr Byte字符串(Byte之间无分隔符 如:[616C6B]) @param charset 编码 {@link Charset} @return 对应的字符串 @see HexUtil#decodeHexStr(String, Charset) @since 4.1.11
[ "十六进制转换字符串" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L744-L746
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
EnvironmentInformation.getRevisionInformation
public static RevisionInformation getRevisionInformation() { """ Returns the code revision (commit and commit date) of Flink, as generated by the Maven builds. @return The code revision. """ String revision = UNKNOWN; String commitDate = UNKNOWN; try (InputStream propFile = EnvironmentInformation.clas...
java
public static RevisionInformation getRevisionInformation() { String revision = UNKNOWN; String commitDate = UNKNOWN; try (InputStream propFile = EnvironmentInformation.class.getClassLoader().getResourceAsStream(".version.properties")) { if (propFile != null) { Properties properties = new Properties(); ...
[ "public", "static", "RevisionInformation", "getRevisionInformation", "(", ")", "{", "String", "revision", "=", "UNKNOWN", ";", "String", "commitDate", "=", "UNKNOWN", ";", "try", "(", "InputStream", "propFile", "=", "EnvironmentInformation", ".", "class", ".", "ge...
Returns the code revision (commit and commit date) of Flink, as generated by the Maven builds. @return The code revision.
[ "Returns", "the", "code", "revision", "(", "commit", "and", "commit", "date", ")", "of", "Flink", "as", "generated", "by", "the", "Maven", "builds", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java#L59-L80
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/ListQueueTagsResult.java
ListQueueTagsResult.withTags
public ListQueueTagsResult withTags(java.util.Map<String, String> tags) { """ <p> The list of all tags added to the specified queue. </p> @param tags The list of all tags added to the specified queue. @return Returns a reference to this object so that method calls can be chained together. """ se...
java
public ListQueueTagsResult withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "ListQueueTagsResult", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> The list of all tags added to the specified queue. </p> @param tags The list of all tags added to the specified queue. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "list", "of", "all", "tags", "added", "to", "the", "specified", "queue", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/ListQueueTagsResult.java#L71-L74
GoogleCloudPlatform/appengine-pipelines
java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java
PipelineManager.startNewPipeline
public static String startNewPipeline( JobSetting[] settings, Job<?> jobInstance, Object... params) { """ Creates and launches a new Pipeline <p> Creates the root Job with its associated Barriers and Slots and saves them to the data store. All slots in the root job are immediately filled with the values ...
java
public static String startNewPipeline( JobSetting[] settings, Job<?> jobInstance, Object... params) { UpdateSpec updateSpec = new UpdateSpec(null); Job<?> rootJobInstance = jobInstance; // If rootJobInstance has exceptionHandler it has to be wrapped to ensure that root job // ends up in finalized ...
[ "public", "static", "String", "startNewPipeline", "(", "JobSetting", "[", "]", "settings", ",", "Job", "<", "?", ">", "jobInstance", ",", "Object", "...", "params", ")", "{", "UpdateSpec", "updateSpec", "=", "new", "UpdateSpec", "(", "null", ")", ";", "Job...
Creates and launches a new Pipeline <p> Creates the root Job with its associated Barriers and Slots and saves them to the data store. All slots in the root job are immediately filled with the values of the parameters to this method, and {@link HandleSlotFilledTask HandleSlotFilledTasks} are enqueued for each of the fil...
[ "Creates", "and", "launches", "a", "new", "Pipeline", "<p", ">", "Creates", "the", "root", "Job", "with", "its", "associated", "Barriers", "and", "Slots", "and", "saves", "them", "to", "the", "data", "store", ".", "All", "slots", "in", "the", "root", "jo...
train
https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L93-L113
sagiegurari/fax4j
src/main/java/org/fax4j/spi/comm/AbstractFaxModemAdapter.java
AbstractFaxModemAdapter.submitFaxJob
public void submitFaxJob(FaxJob faxJob,CommPortAdapter adapter) { """ This function will submit a new fax job.<br> The fax job ID may be populated by this method in the provided fax job object. @param faxJob The fax job object containing the needed information @param adapter The COMM port adapter "...
java
public void submitFaxJob(FaxJob faxJob,CommPortAdapter adapter) { if(faxJob==null) { throw new FaxException("Fax job not provided."); } if(adapter==null) { throw new FaxException("COMM port adapter not provided."); } //submit fax job ...
[ "public", "void", "submitFaxJob", "(", "FaxJob", "faxJob", ",", "CommPortAdapter", "adapter", ")", "{", "if", "(", "faxJob", "==", "null", ")", "{", "throw", "new", "FaxException", "(", "\"Fax job not provided.\"", ")", ";", "}", "if", "(", "adapter", "==", ...
This function will submit a new fax job.<br> The fax job ID may be populated by this method in the provided fax job object. @param faxJob The fax job object containing the needed information @param adapter The COMM port adapter
[ "This", "function", "will", "submit", "a", "new", "fax", "job", ".", "<br", ">", "The", "fax", "job", "ID", "may", "be", "populated", "by", "this", "method", "in", "the", "provided", "fax", "job", "object", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/comm/AbstractFaxModemAdapter.java#L67-L81
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java
HtmlTree.TABLE
public static HtmlTree TABLE(HtmlStyle styleClass, String summary, Content body) { """ Generates a Table tag with style class and summary attributes and some content. @param styleClass style of the table @param summary summary for the table @param body content for the table @return an HtmlTree object for the...
java
public static HtmlTree TABLE(HtmlStyle styleClass, String summary, Content body) { HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body)); if (styleClass != null) htmltree.addStyle(styleClass); htmltree.addAttr(HtmlAttr.SUMMARY, nullCheck(summary)); return htmltree;...
[ "public", "static", "HtmlTree", "TABLE", "(", "HtmlStyle", "styleClass", ",", "String", "summary", ",", "Content", "body", ")", "{", "HtmlTree", "htmltree", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "TABLE", ",", "nullCheck", "(", "body", ")", ")", ";",...
Generates a Table tag with style class and summary attributes and some content. @param styleClass style of the table @param summary summary for the table @param body content for the table @return an HtmlTree object for the TABLE tag
[ "Generates", "a", "Table", "tag", "with", "style", "class", "and", "summary", "attributes", "and", "some", "content", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L751-L757
Erudika/para
para-client/src/main/java/com/erudika/para/client/ParaClient.java
ParaClient.noSpaces
public String noSpaces(String str, String replaceWith) { """ Converts spaces to dashes. @param str a string with spaces @param replaceWith a string to replace spaces with @return a string with dashes """ MultivaluedMap<String, String> params = new MultivaluedHashMap<>(); params.putSingle("string", str);...
java
public String noSpaces(String str, String replaceWith) { MultivaluedMap<String, String> params = new MultivaluedHashMap<>(); params.putSingle("string", str); params.putSingle("replacement", replaceWith); return getEntity(invokeGet("utils/nospaces", params), String.class); }
[ "public", "String", "noSpaces", "(", "String", "str", ",", "String", "replaceWith", ")", "{", "MultivaluedMap", "<", "String", ",", "String", ">", "params", "=", "new", "MultivaluedHashMap", "<>", "(", ")", ";", "params", ".", "putSingle", "(", "\"string\"",...
Converts spaces to dashes. @param str a string with spaces @param replaceWith a string to replace spaces with @return a string with dashes
[ "Converts", "spaces", "to", "dashes", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L1209-L1214
CloudSlang/cs-actions
cs-powershell/src/main/java/io/cloudslang/content/utils/WSManUtils.java
WSManUtils.verifyScriptExecutionStatus
public static void verifyScriptExecutionStatus(final Map<String, String> resultMap) { """ Checks the scriptExitCode value of the script execution and fails the operation if exit code is different than zero. @param resultMap """ if (ZERO_SCRIPT_EXIT_CODE.equals(resultMap.get(SCRIPT_EXIT_CODE))) { ...
java
public static void verifyScriptExecutionStatus(final Map<String, String> resultMap) { if (ZERO_SCRIPT_EXIT_CODE.equals(resultMap.get(SCRIPT_EXIT_CODE))) { resultMap.put(RETURN_CODE, RETURN_CODE_SUCCESS); } else { resultMap.put(RETURN_CODE, RETURN_CODE_FAILURE); } }
[ "public", "static", "void", "verifyScriptExecutionStatus", "(", "final", "Map", "<", "String", ",", "String", ">", "resultMap", ")", "{", "if", "(", "ZERO_SCRIPT_EXIT_CODE", ".", "equals", "(", "resultMap", ".", "get", "(", "SCRIPT_EXIT_CODE", ")", ")", ")", ...
Checks the scriptExitCode value of the script execution and fails the operation if exit code is different than zero. @param resultMap
[ "Checks", "the", "scriptExitCode", "value", "of", "the", "script", "execution", "and", "fails", "the", "operation", "if", "exit", "code", "is", "different", "than", "zero", "." ]
train
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/utils/WSManUtils.java#L162-L168
litsec/swedish-eid-shibboleth-base
shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/service/impl/SignSupportServiceImpl.java
SignSupportServiceImpl.getAuthenticationContext
protected AuthenticationContext getAuthenticationContext(ProfileRequestContext<?, ?> context) throws ExternalAutenticationErrorCodeException { """ Utility method that returns the {@code AuthenticationContext}. @param context the profile context @return the {@code AuthenticationContext} @throws External...
java
protected AuthenticationContext getAuthenticationContext(ProfileRequestContext<?, ?> context) throws ExternalAutenticationErrorCodeException { AuthenticationContext authnContext = authenticationContextLookupStrategy.apply(context); if (authnContext == null) { log.error("No AuthenticationContext avai...
[ "protected", "AuthenticationContext", "getAuthenticationContext", "(", "ProfileRequestContext", "<", "?", ",", "?", ">", "context", ")", "throws", "ExternalAutenticationErrorCodeException", "{", "AuthenticationContext", "authnContext", "=", "authenticationContextLookupStrategy", ...
Utility method that returns the {@code AuthenticationContext}. @param context the profile context @return the {@code AuthenticationContext} @throws ExternalAutenticationErrorCodeException if the context is not available
[ "Utility", "method", "that", "returns", "the", "{", "@code", "AuthenticationContext", "}", "." ]
train
https://github.com/litsec/swedish-eid-shibboleth-base/blob/aaaa467ff61f07d7dfa31627fb36851a37da6804/shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/service/impl/SignSupportServiceImpl.java#L494-L502
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacterNameIterator.java
UCharacterNameIterator.iterateSingleGroup
private boolean iterateSingleGroup(ValueIterator.Element result, int limit) { """ Group name iteration, iterate all the names in the current 32-group and returns the first codepoint that has a valid name. @param result stores the result codepoint and name @param limit last codepoint + 1 in range to search @ret...
java
private boolean iterateSingleGroup(ValueIterator.Element result, int limit) { synchronized(GROUP_OFFSETS_) { synchronized(GROUP_LENGTHS_) { int index = m_name_.getGroupLengths(m_groupIndex_, GROUP_OFFSETS_, GROUP_LENGTHS_); whil...
[ "private", "boolean", "iterateSingleGroup", "(", "ValueIterator", ".", "Element", "result", ",", "int", "limit", ")", "{", "synchronized", "(", "GROUP_OFFSETS_", ")", "{", "synchronized", "(", "GROUP_LENGTHS_", ")", "{", "int", "index", "=", "m_name_", ".", "g...
Group name iteration, iterate all the names in the current 32-group and returns the first codepoint that has a valid name. @param result stores the result codepoint and name @param limit last codepoint + 1 in range to search @return false if a codepoint with a name is found in group and we can bail from further iterati...
[ "Group", "name", "iteration", "iterate", "all", "the", "names", "in", "the", "current", "32", "-", "group", "and", "returns", "the", "first", "codepoint", "that", "has", "a", "valid", "name", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacterNameIterator.java#L236-L261
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/RegionFooterHeader.java
RegionFooterHeader.appendXMLToMasterStyle
@Override public void appendXMLToMasterStyle(final XMLUtil util, final Appendable appendable) throws IOException { """ Used in file styles.xml, in <office:master-styles>,<style:master-page />. @throws IOException If an I/O error occurs """ RegionFooterHeader .appendRe...
java
@Override public void appendXMLToMasterStyle(final XMLUtil util, final Appendable appendable) throws IOException { RegionFooterHeader .appendRegionXMLToMasterStyle(util, appendable, this.leftRegion, "region-left"); RegionFooterHeader .appendRegionXMLToMast...
[ "@", "Override", "public", "void", "appendXMLToMasterStyle", "(", "final", "XMLUtil", "util", ",", "final", "Appendable", "appendable", ")", "throws", "IOException", "{", "RegionFooterHeader", ".", "appendRegionXMLToMasterStyle", "(", "util", ",", "appendable", ",", ...
Used in file styles.xml, in <office:master-styles>,<style:master-page />. @throws IOException If an I/O error occurs
[ "Used", "in", "file", "styles", ".", "xml", "in", "<office", ":", "master", "-", "styles", ">", "<style", ":", "master", "-", "page", "/", ">", "." ]
train
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/RegionFooterHeader.java#L92-L101
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/concurrent/SimpleReadWriteLock.java
SimpleReadWriteLock.writeLockedThrowing
public <T, EXTYPE extends Exception> T writeLockedThrowing (@Nonnull final IThrowingSupplier <? extends T, EXTYPE> aCallable) throws EXTYPE { """ Execute the provided callable in a write lock. Note: no nullable/non-nullable can be assumed. @param aCallable Callable to be executed. May not be <code>null</code>...
java
public <T, EXTYPE extends Exception> T writeLockedThrowing (@Nonnull final IThrowingSupplier <? extends T, EXTYPE> aCallable) throws EXTYPE { writeLock ().lock (); try { return aCallable.get (); } finally { writeLock ().unlock (); } }
[ "public", "<", "T", ",", "EXTYPE", "extends", "Exception", ">", "T", "writeLockedThrowing", "(", "@", "Nonnull", "final", "IThrowingSupplier", "<", "?", "extends", "T", ",", "EXTYPE", ">", "aCallable", ")", "throws", "EXTYPE", "{", "writeLock", "(", ")", "...
Execute the provided callable in a write lock. Note: no nullable/non-nullable can be assumed. @param aCallable Callable to be executed. May not be <code>null</code>. @return The return value of the callable. May be <code>null</code>. @throws EXTYPE If the callable throws the exception @param <T> Return type @param <EX...
[ "Execute", "the", "provided", "callable", "in", "a", "write", "lock", ".", "Note", ":", "no", "nullable", "/", "non", "-", "nullable", "can", "be", "assumed", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/concurrent/SimpleReadWriteLock.java#L312-L323
casbin/jcasbin
src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java
ManagementEnforcer.removeNamedGroupingPolicy
public boolean removeNamedGroupingPolicy(String ptype, List<String> params) { """ removeNamedGroupingPolicy removes a role inheritance rule from the current named policy. @param ptype the policy type, can be "g", "g2", "g3", .. @param params the "g" policy rule. @return succeeds or not. """ boolea...
java
public boolean removeNamedGroupingPolicy(String ptype, List<String> params) { boolean ruleRemoved = removePolicy("g", ptype, params); if (autoBuildRoleLinks) { buildRoleLinks(); } return ruleRemoved; }
[ "public", "boolean", "removeNamedGroupingPolicy", "(", "String", "ptype", ",", "List", "<", "String", ">", "params", ")", "{", "boolean", "ruleRemoved", "=", "removePolicy", "(", "\"g\"", ",", "ptype", ",", "params", ")", ";", "if", "(", "autoBuildRoleLinks", ...
removeNamedGroupingPolicy removes a role inheritance rule from the current named policy. @param ptype the policy type, can be "g", "g2", "g3", .. @param params the "g" policy rule. @return succeeds or not.
[ "removeNamedGroupingPolicy", "removes", "a", "role", "inheritance", "rule", "from", "the", "current", "named", "policy", "." ]
train
https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java#L509-L516
infinispan/infinispan
counter/src/main/java/org/infinispan/counter/configuration/CounterConfigurationSerializer.java
CounterConfigurationSerializer.serializeConfigurations
public void serializeConfigurations(OutputStream os, List<AbstractCounterConfiguration> configs) throws XMLStreamException { """ It serializes a {@link List} of {@link AbstractCounterConfiguration} to an {@link OutputStream}. @param os the {@link OutputStream} to write to. @param configs the {@link List...
java
public void serializeConfigurations(OutputStream os, List<AbstractCounterConfiguration> configs) throws XMLStreamException { BufferedOutputStream output = new BufferedOutputStream(os); XMLStreamWriter subWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(output); XMLExtendedStreamW...
[ "public", "void", "serializeConfigurations", "(", "OutputStream", "os", ",", "List", "<", "AbstractCounterConfiguration", ">", "configs", ")", "throws", "XMLStreamException", "{", "BufferedOutputStream", "output", "=", "new", "BufferedOutputStream", "(", "os", ")", ";...
It serializes a {@link List} of {@link AbstractCounterConfiguration} to an {@link OutputStream}. @param os the {@link OutputStream} to write to. @param configs the {@link List} if {@link AbstractCounterConfiguration}. @throws XMLStreamException if xml is malformed
[ "It", "serializes", "a", "{" ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/counter/src/main/java/org/infinispan/counter/configuration/CounterConfigurationSerializer.java#L38-L49
VoltDB/voltdb
src/frontend/org/voltdb/importclient/kinesis/KinesisStreamImporterConfig.java
KinesisStreamImporterConfig.getProperty
public static String getProperty(Properties props, String propertyName, String defaultValue) { """ get property value. If no value is available, throw IllegalArgumentException @param props The properties @param propertyName property name @param defaultValue The default value @return property value """ ...
java
public static String getProperty(Properties props, String propertyName, String defaultValue) { String value = props.getProperty(propertyName, defaultValue).trim(); if (value.isEmpty()) { throw new IllegalArgumentException( "Property " + propertyName + " is missing in Kine...
[ "public", "static", "String", "getProperty", "(", "Properties", "props", ",", "String", "propertyName", ",", "String", "defaultValue", ")", "{", "String", "value", "=", "props", ".", "getProperty", "(", "propertyName", ",", "defaultValue", ")", ".", "trim", "(...
get property value. If no value is available, throw IllegalArgumentException @param props The properties @param propertyName property name @param defaultValue The default value @return property value
[ "get", "property", "value", ".", "If", "no", "value", "is", "available", "throw", "IllegalArgumentException" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importclient/kinesis/KinesisStreamImporterConfig.java#L216-L223
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.hasNullPKField
public boolean hasNullPKField(ClassDescriptor cld, Object obj) { """ Detect if the given object has a PK field represents a 'null' value. """ FieldDescriptor[] fields = cld.getPkFields(); boolean hasNull = false; // an unmaterialized proxy object can never have nullified PK's ...
java
public boolean hasNullPKField(ClassDescriptor cld, Object obj) { FieldDescriptor[] fields = cld.getPkFields(); boolean hasNull = false; // an unmaterialized proxy object can never have nullified PK's IndirectionHandler handler = ProxyHelper.getIndirectionHandler(obj); i...
[ "public", "boolean", "hasNullPKField", "(", "ClassDescriptor", "cld", ",", "Object", "obj", ")", "{", "FieldDescriptor", "[", "]", "fields", "=", "cld", ".", "getPkFields", "(", ")", ";", "boolean", "hasNull", "=", "false", ";", "// an unmaterialized proxy objec...
Detect if the given object has a PK field represents a 'null' value.
[ "Detect", "if", "the", "given", "object", "has", "a", "PK", "field", "represents", "a", "null", "value", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L286-L304
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java
SpiderTransaction.deleteAllObjectsColumn
public void deleteAllObjectsColumn(TableDefinition tableDef, String objID, int shardNo) { """ Delete the "all objects" column with the given object ID from the given table. @param tableDef {@link TableDefinition} of object's owning table. @param objID ID of object being deleted. @param shardNo Shard nu...
java
public void deleteAllObjectsColumn(TableDefinition tableDef, String objID, int shardNo) { String rowKey = ALL_OBJECTS_ROW_KEY; if (shardNo > 0) { rowKey = shardNo + "/" + ALL_OBJECTS_ROW_KEY; } deleteColumn(SpiderService.termsStoreName(tableDef), rowKey, objID); }
[ "public", "void", "deleteAllObjectsColumn", "(", "TableDefinition", "tableDef", ",", "String", "objID", ",", "int", "shardNo", ")", "{", "String", "rowKey", "=", "ALL_OBJECTS_ROW_KEY", ";", "if", "(", "shardNo", ">", "0", ")", "{", "rowKey", "=", "shardNo", ...
Delete the "all objects" column with the given object ID from the given table. @param tableDef {@link TableDefinition} of object's owning table. @param objID ID of object being deleted. @param shardNo Shard number of object being deleted. @see #addAllObjectsColumn(TableDefinition, String, int)
[ "Delete", "the", "all", "objects", "column", "with", "the", "given", "object", "ID", "from", "the", "given", "table", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L381-L387
Angads25/android-filepicker
app/src/main/java/com/github/angads25/filepickerdemo/MainActivity.java
MainActivity.onRequestPermissionsResult
@Override public void onRequestPermissionsResult(int requestCode,@NonNull String permissions[],@NonNull int[] grantResults) { """ Add this method to show Dialog when the required permission has been granted to the app. """ switch (requestCode) { case FilePickerDialog.EXTERNAL_READ_PERMI...
java
@Override public void onRequestPermissionsResult(int requestCode,@NonNull String permissions[],@NonNull int[] grantResults) { switch (requestCode) { case FilePickerDialog.EXTERNAL_READ_PERMISSION_GRANT: { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION...
[ "@", "Override", "public", "void", "onRequestPermissionsResult", "(", "int", "requestCode", ",", "@", "NonNull", "String", "permissions", "[", "]", ",", "@", "NonNull", "int", "[", "]", "grantResults", ")", "{", "switch", "(", "requestCode", ")", "{", "case"...
Add this method to show Dialog when the required permission has been granted to the app.
[ "Add", "this", "method", "to", "show", "Dialog", "when", "the", "required", "permission", "has", "been", "granted", "to", "the", "app", "." ]
train
https://github.com/Angads25/android-filepicker/blob/46fd8825e6d88c69462078a0300d905739a803ea/app/src/main/java/com/github/angads25/filepickerdemo/MainActivity.java#L217-L233
google/j2objc
jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java
BigDecimal.divideAndRound
private static BigDecimal divideAndRound(BigInteger bdividend, BigInteger bdivisor, int scale, int roundingMode, int preferredScale) { """ Internally used for division operation for division {@code BigInteger} by {@code BigInteger}. The returned {@code BigDecimal} obj...
java
private static BigDecimal divideAndRound(BigInteger bdividend, BigInteger bdivisor, int scale, int roundingMode, int preferredScale) { boolean isRemainderZero; // record remainder is zero or not int qsign; // quotient sign // Descend into mutables for...
[ "private", "static", "BigDecimal", "divideAndRound", "(", "BigInteger", "bdividend", ",", "BigInteger", "bdivisor", ",", "int", "scale", ",", "int", "roundingMode", ",", "int", "preferredScale", ")", "{", "boolean", "isRemainderZero", ";", "// record remainder is zero...
Internally used for division operation for division {@code BigInteger} by {@code BigInteger}. The returned {@code BigDecimal} object is the quotient whose scale is set to the passed in scale. If the remainder is not zero, it will be rounded based on the passed in roundingMode. Also, if the remainder is zero and the las...
[ "Internally", "used", "for", "division", "operation", "for", "division", "{" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4320-L4348
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/periodic/GVRPeriodicEngine.java
GVRPeriodicEngine.runAfter
public PeriodicEvent runAfter(Runnable task, float delay) { """ Run a task once, after a delay. @param task Task to run. @param delay Unit is seconds. @return An interface that lets you query the status; cancel; or reschedule the event. """ validateDelay(delay); return new Event(task, d...
java
public PeriodicEvent runAfter(Runnable task, float delay) { validateDelay(delay); return new Event(task, delay); }
[ "public", "PeriodicEvent", "runAfter", "(", "Runnable", "task", ",", "float", "delay", ")", "{", "validateDelay", "(", "delay", ")", ";", "return", "new", "Event", "(", "task", ",", "delay", ")", ";", "}" ]
Run a task once, after a delay. @param task Task to run. @param delay Unit is seconds. @return An interface that lets you query the status; cancel; or reschedule the event.
[ "Run", "a", "task", "once", "after", "a", "delay", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/periodic/GVRPeriodicEngine.java#L120-L123
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/reflection/EntityClassReader.java
EntityClassReader.getClassReaderFor
public static synchronized EntityClassReader getClassReaderFor(Class entityClass, String geometryPropertyName, String idPropertyName) { """ Factorymethod that returns the reader for a given entity class which allows for easy access to properties of an object of an unknown class. Although any class can be given to...
java
public static synchronized EntityClassReader getClassReaderFor(Class entityClass, String geometryPropertyName, String idPropertyName) { if (entityClass == null) { return null; } String entryKey = "" + geometryPropertyName + "|" + idPropertyName; Map<String, EntityClassReader>...
[ "public", "static", "synchronized", "EntityClassReader", "getClassReaderFor", "(", "Class", "entityClass", ",", "String", "geometryPropertyName", ",", "String", "idPropertyName", ")", "{", "if", "(", "entityClass", "==", "null", ")", "{", "return", "null", ";", "}...
Factorymethod that returns the reader for a given entity class which allows for easy access to properties of an object of an unknown class. Although any class can be given to the reader, the reader is made specifically for features. <br> A feature has two <i>special</i> properties, which do not appear in the list of pr...
[ "Factorymethod", "that", "returns", "the", "reader", "for", "a", "given", "entity", "class", "which", "allows", "for", "easy", "access", "to", "properties", "of", "an", "object", "of", "an", "unknown", "class", ".", "Although", "any", "class", "can", "be", ...
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/reflection/EntityClassReader.java#L222-L236
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java
DomainsInner.updateOwnershipIdentifierAsync
public Observable<DomainOwnershipIdentifierInner> updateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) { """ Creates an ownership identifier for a domain or updates identifier details for an existing identifer. Creates a...
java
public Observable<DomainOwnershipIdentifierInner> updateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) { return updateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIden...
[ "public", "Observable", "<", "DomainOwnershipIdentifierInner", ">", "updateOwnershipIdentifierAsync", "(", "String", "resourceGroupName", ",", "String", "domainName", ",", "String", "name", ",", "DomainOwnershipIdentifierInner", "domainOwnershipIdentifier", ")", "{", "return"...
Creates an ownership identifier for a domain or updates identifier details for an existing identifer. Creates an ownership identifier for a domain or updates identifier details for an existing identifer. @param resourceGroupName Name of the resource group to which the resource belongs. @param domainName Name of domain...
[ "Creates", "an", "ownership", "identifier", "for", "a", "domain", "or", "updates", "identifier", "details", "for", "an", "existing", "identifer", ".", "Creates", "an", "ownership", "identifier", "for", "a", "domain", "or", "updates", "identifier", "details", "fo...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java#L1754-L1761
NoraUi/NoraUi
src/main/java/com/github/noraui/application/steps/CommonSteps.java
CommonSteps.updateRadioList
@Et("Je mets à jour la liste radio '(.*)-(.*)' avec '(.*)' à partir de ces valeurs:") @And("I update radio list '(.*)-(.*)' with '(.*)' from these values:") public void updateRadioList(String page, String elementName, String valueKeyOrKey, Map<String, String> printedValues) throws TechnicalException, FailureE...
java
@Et("Je mets à jour la liste radio '(.*)-(.*)' avec '(.*)' à partir de ces valeurs:") @And("I update radio list '(.*)-(.*)' with '(.*)' from these values:") public void updateRadioList(String page, String elementName, String valueKeyOrKey, Map<String, String> printedValues) throws TechnicalException, FailureE...
[ "@", "Et", "(", "\"Je mets à jour la liste radio '(.*)-(.*)' avec '(.*)' à partir de ces valeurs:\")\r", "", "@", "And", "(", "\"I update radio list '(.*)-(.*)' with '(.*)' from these values:\"", ")", "public", "void", "updateRadioList", "(", "String", "page", ",", "String", "ele...
Updates the value of html radio element with conditions using a map of keys/printed values. @param page The concerned page of elementName @param elementName is target element @param valueKeyOrKey Is valueKey (valueKey or input in context (after a save)) @param printedValues is the display value @throws TechnicalExcept...
[ "Updates", "the", "value", "of", "html", "radio", "element", "with", "conditions", "using", "a", "map", "of", "keys", "/", "printed", "values", "." ]
train
https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L867-L871
sniggle/simple-pgp
simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/PGPMessageSigner.java
PGPMessageSigner.verifyMessage
@Override public boolean verifyMessage(InputStream publicKeyOfSender, InputStream message, InputStream signatureStream) { """ @see MessageSigner#verifyMessage(InputStream, InputStream, InputStream) @param publicKeyOfSender the public key of the sender of the message @param message the message / data to ver...
java
@Override public boolean verifyMessage(InputStream publicKeyOfSender, InputStream message, InputStream signatureStream) { LOGGER.trace("verifyMessage(InputStream, InputStream, InputStream)"); LOGGER.trace("Public Key: {}, Data: {}, Signature: {}", publicKeyOfSender == null ? "not set" : "set", message...
[ "@", "Override", "public", "boolean", "verifyMessage", "(", "InputStream", "publicKeyOfSender", ",", "InputStream", "message", ",", "InputStream", "signatureStream", ")", "{", "LOGGER", ".", "trace", "(", "\"verifyMessage(InputStream, InputStream, InputStream)\"", ")", ";...
@see MessageSigner#verifyMessage(InputStream, InputStream, InputStream) @param publicKeyOfSender the public key of the sender of the message @param message the message / data to verify @param signatureStream the (detached) signature @return
[ "@see", "MessageSigner#verifyMessage", "(", "InputStream", "InputStream", "InputStream", ")" ]
train
https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/PGPMessageSigner.java#L41-L89
amaembo/streamex
src/main/java/one/util/streamex/AbstractStreamEx.java
AbstractStreamEx.toSetAndThen
public <R> R toSetAndThen(Function<? super Set<T>, R> finisher) { """ Creates a {@link Set} containing the elements of this stream, then performs finishing transformation and returns its result. There are no guarantees on the type, serializability or thread-safety of the {@code Set} created. <p> This is a t...
java
public <R> R toSetAndThen(Function<? super Set<T>, R> finisher) { if (context.fjp != null) return context.terminate(() -> finisher.apply(toSet())); return finisher.apply(toSet()); }
[ "public", "<", "R", ">", "R", "toSetAndThen", "(", "Function", "<", "?", "super", "Set", "<", "T", ">", ",", "R", ">", "finisher", ")", "{", "if", "(", "context", ".", "fjp", "!=", "null", ")", "return", "context", ".", "terminate", "(", "(", ")"...
Creates a {@link Set} containing the elements of this stream, then performs finishing transformation and returns its result. There are no guarantees on the type, serializability or thread-safety of the {@code Set} created. <p> This is a terminal operation. @param <R> the result type @param finisher a function to be a...
[ "Creates", "a", "{", "@link", "Set", "}", "containing", "the", "elements", "of", "this", "stream", "then", "performs", "finishing", "transformation", "and", "returns", "its", "result", ".", "There", "are", "no", "guarantees", "on", "the", "type", "serializabil...
train
https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/AbstractStreamEx.java#L1291-L1295
sarl/sarl
contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java
PyExpressionGenerator._generate
@SuppressWarnings("static-method") protected XExpression _generate(XClosure closure, IAppendable it, IExtraLanguageGeneratorContext context) { """ Generate the given object. @param closure the closure. @param it the target for the generated content. @param context the context. @return the closure. """ ...
java
@SuppressWarnings("static-method") protected XExpression _generate(XClosure closure, IAppendable it, IExtraLanguageGeneratorContext context) { if (it.hasName(closure)) { appendReturnIfExpectedReturnedExpression(it, context); it.append(it.getName(closure)).append("()"); //$NON-NLS-1$ } return closure; }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "protected", "XExpression", "_generate", "(", "XClosure", "closure", ",", "IAppendable", "it", ",", "IExtraLanguageGeneratorContext", "context", ")", "{", "if", "(", "it", ".", "hasName", "(", "closure", ")",...
Generate the given object. @param closure the closure. @param it the target for the generated content. @param context the context. @return the closure.
[ "Generate", "the", "given", "object", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L281-L288
xvik/generics-resolver
src/main/java/ru/vyarus/java/generics/resolver/util/GenericsResolutionUtils.java
GenericsResolutionUtils.fillOuterGenerics
public static LinkedHashMap<String, Type> fillOuterGenerics( final Type type, final LinkedHashMap<String, Type> generics, final Map<Class<?>, LinkedHashMap<String, Type>> knownGenerics) { """ Inner class could reference outer class generics and so this generics must be included ...
java
public static LinkedHashMap<String, Type> fillOuterGenerics( final Type type, final LinkedHashMap<String, Type> generics, final Map<Class<?>, LinkedHashMap<String, Type>> knownGenerics) { final LinkedHashMap<String, Type> res; final Type outer = TypeUtils.getOuter(typ...
[ "public", "static", "LinkedHashMap", "<", "String", ",", "Type", ">", "fillOuterGenerics", "(", "final", "Type", "type", ",", "final", "LinkedHashMap", "<", "String", ",", "Type", ">", "generics", ",", "final", "Map", "<", "Class", "<", "?", ">", ",", "L...
Inner class could reference outer class generics and so this generics must be included into class context. <p> Outer generics could be included into declaration like {@code Outer<String>.Inner field}. In this case incoming type should be {@link ParameterizedType} with generified owner. <p> When provided type is simply ...
[ "Inner", "class", "could", "reference", "outer", "class", "generics", "and", "so", "this", "generics", "must", "be", "included", "into", "class", "context", ".", "<p", ">", "Outer", "generics", "could", "be", "included", "into", "declaration", "like", "{", "...
train
https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/GenericsResolutionUtils.java#L298-L335
JodaOrg/joda-time
src/main/java/org/joda/time/convert/ReadableInstantConverter.java
ReadableInstantConverter.getChronology
public Chronology getChronology(Object object, DateTimeZone zone) { """ Gets the chronology, which is taken from the ReadableInstant. If the chronology on the instant is null, the ISOChronology in the specified time zone is used. If the chronology on the instant is not in the specified zone, it is adapted. ...
java
public Chronology getChronology(Object object, DateTimeZone zone) { Chronology chrono = ((ReadableInstant) object).getChronology(); if (chrono == null) { return ISOChronology.getInstance(zone); } DateTimeZone chronoZone = chrono.getZone(); if (chronoZone != zone) { ...
[ "public", "Chronology", "getChronology", "(", "Object", "object", ",", "DateTimeZone", "zone", ")", "{", "Chronology", "chrono", "=", "(", "(", "ReadableInstant", ")", "object", ")", ".", "getChronology", "(", ")", ";", "if", "(", "chrono", "==", "null", "...
Gets the chronology, which is taken from the ReadableInstant. If the chronology on the instant is null, the ISOChronology in the specified time zone is used. If the chronology on the instant is not in the specified zone, it is adapted. @param object the ReadableInstant to convert, must not be null @param zone the sp...
[ "Gets", "the", "chronology", "which", "is", "taken", "from", "the", "ReadableInstant", ".", "If", "the", "chronology", "on", "the", "instant", "is", "null", "the", "ISOChronology", "in", "the", "specified", "time", "zone", "is", "used", ".", "If", "the", "...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadableInstantConverter.java#L57-L70
Azure/azure-sdk-for-java
containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java
OpenShiftManagedClustersInner.getByResourceGroup
public OpenShiftManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { """ Gets a OpenShift managed cluster. Gets the details of the managed OpenShift cluster with a specified resource group and name. @param resourceGroupName The name of the resource group. @param resourceName...
java
public OpenShiftManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body(); }
[ "public", "OpenShiftManagedClusterInner", "getByResourceGroup", "(", "String", "resourceGroupName", ",", "String", "resourceName", ")", "{", "return", "getByResourceGroupWithServiceResponseAsync", "(", "resourceGroupName", ",", "resourceName", ")", ".", "toBlocking", "(", "...
Gets a OpenShift managed cluster. Gets the details of the managed OpenShift cluster with a specified resource group and name. @param resourceGroupName The name of the resource group. @param resourceName The name of the OpenShift managed cluster resource. @throws IllegalArgumentException thrown if parameters fail the v...
[ "Gets", "a", "OpenShift", "managed", "cluster", ".", "Gets", "the", "details", "of", "the", "managed", "OpenShift", "cluster", "with", "a", "specified", "resource", "group", "and", "name", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java#L355-L357
Azure/azure-sdk-for-java
common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/LocationPollStrategy.java
LocationPollStrategy.tryToCreate
static PollStrategy tryToCreate(RestProxy restProxy, SwaggerMethodParser methodParser, HttpRequest originalHttpRequest, HttpResponse httpResponse, long delayInMilliseconds) { """ Try to create a new LocationOperationPollStrategy object that will poll the provided location URL. If the provided HttpResponse doesn't...
java
static PollStrategy tryToCreate(RestProxy restProxy, SwaggerMethodParser methodParser, HttpRequest originalHttpRequest, HttpResponse httpResponse, long delayInMilliseconds) { final String locationUrl = getHeader(httpResponse); URL pollUrl = null; if (locationUrl != null && !locationUrl.isEmpty(...
[ "static", "PollStrategy", "tryToCreate", "(", "RestProxy", "restProxy", ",", "SwaggerMethodParser", "methodParser", ",", "HttpRequest", "originalHttpRequest", ",", "HttpResponse", "httpResponse", ",", "long", "delayInMilliseconds", ")", "{", "final", "String", "locationUr...
Try to create a new LocationOperationPollStrategy object that will poll the provided location URL. If the provided HttpResponse doesn't have a Location header or the header is empty, then null will be returned. @param originalHttpRequest The original HTTP request. @param methodParser The method parser that describes th...
[ "Try", "to", "create", "a", "new", "LocationOperationPollStrategy", "object", "that", "will", "poll", "the", "provided", "location", "URL", ".", "If", "the", "provided", "HttpResponse", "doesn", "t", "have", "a", "Location", "header", "or", "the", "header", "i...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/LocationPollStrategy.java#L121-L147
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java
StreamGraph.addVirtualPartitionNode
public void addVirtualPartitionNode(Integer originalId, Integer virtualId, StreamPartitioner<?> partitioner) { """ Adds a new virtual node that is used to connect a downstream vertex to an input with a certain partitioning. <p>When adding an edge from the virtual node to a downstream node the connection will b...
java
public void addVirtualPartitionNode(Integer originalId, Integer virtualId, StreamPartitioner<?> partitioner) { if (virtualPartitionNodes.containsKey(virtualId)) { throw new IllegalStateException("Already has virtual partition node with id " + virtualId); } virtualPartitionNodes.put(virtualId, new Tuple2<...
[ "public", "void", "addVirtualPartitionNode", "(", "Integer", "originalId", ",", "Integer", "virtualId", ",", "StreamPartitioner", "<", "?", ">", "partitioner", ")", "{", "if", "(", "virtualPartitionNodes", ".", "containsKey", "(", "virtualId", ")", ")", "{", "th...
Adds a new virtual node that is used to connect a downstream vertex to an input with a certain partitioning. <p>When adding an edge from the virtual node to a downstream node the connection will be made to the original node, but with the partitioning given here. @param originalId ID of the node that should be connect...
[ "Adds", "a", "new", "virtual", "node", "that", "is", "used", "to", "connect", "a", "downstream", "vertex", "to", "an", "input", "with", "a", "certain", "partitioning", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L347-L355
ogaclejapan/SmartTabLayout
utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java
Bundler.putSizeF
@TargetApi(21) public Bundler putSizeF(String key, SizeF value) { """ Inserts a SizeF value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a SizeF object, or null @return this """ bundle.pu...
java
@TargetApi(21) public Bundler putSizeF(String key, SizeF value) { bundle.putSizeF(key, value); return this; }
[ "@", "TargetApi", "(", "21", ")", "public", "Bundler", "putSizeF", "(", "String", "key", ",", "SizeF", "value", ")", "{", "bundle", ".", "putSizeF", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a SizeF value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a SizeF object, or null @return this
[ "Inserts", "a", "SizeF", "value", "into", "the", "mapping", "of", "this", "Bundle", "replacing", "any", "existing", "value", "for", "the", "given", "key", ".", "Either", "key", "or", "value", "may", "be", "null", "." ]
train
https://github.com/ogaclejapan/SmartTabLayout/blob/712e81a92f1e12a3c33dcbda03d813e0162e8589/utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java#L167-L171
tuenti/SmsRadar
library/src/main/java/com/tuenti/smsradar/SmsRadar.java
SmsRadar.initializeSmsRadarService
public static void initializeSmsRadarService(Context context, SmsListener smsListener) { """ Starts the service and store the listener to be notified when a new incoming or outgoing sms be processed inside the SMS content provider @param context used to start the service @param smsListener to notify when the ...
java
public static void initializeSmsRadarService(Context context, SmsListener smsListener) { SmsRadar.smsListener = smsListener; Intent intent = new Intent(context, SmsRadarService.class); context.startService(intent); }
[ "public", "static", "void", "initializeSmsRadarService", "(", "Context", "context", ",", "SmsListener", "smsListener", ")", "{", "SmsRadar", ".", "smsListener", "=", "smsListener", ";", "Intent", "intent", "=", "new", "Intent", "(", "context", ",", "SmsRadarServic...
Starts the service and store the listener to be notified when a new incoming or outgoing sms be processed inside the SMS content provider @param context used to start the service @param smsListener to notify when the sms content provider gets a new sms
[ "Starts", "the", "service", "and", "store", "the", "listener", "to", "be", "notified", "when", "a", "new", "incoming", "or", "outgoing", "sms", "be", "processed", "inside", "the", "SMS", "content", "provider" ]
train
https://github.com/tuenti/SmsRadar/blob/598553c69c474634a1d4041a39f015f0b4c33a6d/library/src/main/java/com/tuenti/smsradar/SmsRadar.java#L39-L43
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/TextModerationsImpl.java
TextModerationsImpl.screenTextWithServiceResponseAsync
public Observable<ServiceResponse<Screen>> screenTextWithServiceResponseAsync(String textContentType, byte[] textContent, ScreenTextOptionalParameter screenTextOptionalParameter) { """ Detect profanity and match against custom and shared blacklists. Detects profanity in more than 100 languages and match against c...
java
public Observable<ServiceResponse<Screen>> screenTextWithServiceResponseAsync(String textContentType, byte[] textContent, ScreenTextOptionalParameter screenTextOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is required an...
[ "public", "Observable", "<", "ServiceResponse", "<", "Screen", ">", ">", "screenTextWithServiceResponseAsync", "(", "String", "textContentType", ",", "byte", "[", "]", "textContent", ",", "ScreenTextOptionalParameter", "screenTextOptionalParameter", ")", "{", "if", "(",...
Detect profanity and match against custom and shared blacklists. Detects profanity in more than 100 languages and match against custom and shared blacklists. @param textContentType The content type. Possible values include: 'text/plain', 'text/html', 'text/xml', 'text/markdown' @param textContent Content to screen. @p...
[ "Detect", "profanity", "and", "match", "against", "custom", "and", "shared", "blacklists", ".", "Detects", "profanity", "in", "more", "than", "100", "languages", "and", "match", "against", "custom", "and", "shared", "blacklists", "." ]
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/TextModerationsImpl.java#L132-L149
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/api/PhotosCommentsApi.java
PhotosCommentsApi.getRecentForContacts
public Photos getRecentForContacts(String dateLastComment, List<String> contactsFilter, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page) throws JinxException { """ Return the list of photos belonging to your contacts that have been commented on recently. <br> This method requires authentication ...
java
public Photos getRecentForContacts(String dateLastComment, List<String> contactsFilter, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page) throws JinxException { Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.photos.comments.getRecentForContacts"); if (!JinxUtils.i...
[ "public", "Photos", "getRecentForContacts", "(", "String", "dateLastComment", ",", "List", "<", "String", ">", "contactsFilter", ",", "EnumSet", "<", "JinxConstants", ".", "PhotoExtras", ">", "extras", ",", "int", "perPage", ",", "int", "page", ")", "throws", ...
Return the list of photos belonging to your contacts that have been commented on recently. <br> This method requires authentication with 'read' permission. @param dateLastComment (Optional) Limits the results to photos that have been commented on since this date. The date should be in the form of a Unix timestamp. The...
[ "Return", "the", "list", "of", "photos", "belonging", "to", "your", "contacts", "that", "have", "been", "commented", "on", "recently", ".", "<br", ">", "This", "method", "requires", "authentication", "with", "read", "permission", "." ]
train
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosCommentsApi.java#L151-L170
Atmosphere/atmosphere-samples
samples/meteor-chat/src/main/java/org/atmosphere/samples/chat/MeteorChat.java
MeteorChat.doGet
@Override public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException { """ Create a {@link Meteor} and use it to suspend the response. @param req An {@link HttpServletRequest} @param res An {@link HttpServletResponse} """ // Set the logger level to TRACE to see what's...
java
@Override public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException { // Set the logger level to TRACE to see what's happening. Meteor.build(req).addListener(new AtmosphereResourceEventListenerAdapter()); }
[ "@", "Override", "public", "void", "doGet", "(", "HttpServletRequest", "req", ",", "HttpServletResponse", "res", ")", "throws", "IOException", "{", "// Set the logger level to TRACE to see what's happening.", "Meteor", ".", "build", "(", "req", ")", ".", "addListener", ...
Create a {@link Meteor} and use it to suspend the response. @param req An {@link HttpServletRequest} @param res An {@link HttpServletResponse}
[ "Create", "a", "{", "@link", "Meteor", "}", "and", "use", "it", "to", "suspend", "the", "response", "." ]
train
https://github.com/Atmosphere/atmosphere-samples/blob/2b33c0c7a73b3f9b4597cb52ce5602834b80af99/samples/meteor-chat/src/main/java/org/atmosphere/samples/chat/MeteorChat.java#L51-L55
alkacon/opencms-core
src/org/opencms/xml/CmsXmlEntityResolver.java
CmsXmlEntityResolver.getCacheKeyForCurrentProject
private String getCacheKeyForCurrentProject(String systemId) { """ Returns a cache key for the given system id (filename) based on the status of the internal CmsObject.<p> @param systemId the system id (filename) to get the cache key for @return the cache key for the system id """ // check the ...
java
private String getCacheKeyForCurrentProject(String systemId) { // check the project boolean project = (m_cms != null) ? m_cms.getRequestContext().getCurrentProject().isOnlineProject() : false; // remove opencms:// prefix if (systemId.startsWith(OPENCMS_SCHEME)) { systemId =...
[ "private", "String", "getCacheKeyForCurrentProject", "(", "String", "systemId", ")", "{", "// check the project", "boolean", "project", "=", "(", "m_cms", "!=", "null", ")", "?", "m_cms", ".", "getRequestContext", "(", ")", ".", "getCurrentProject", "(", ")", "....
Returns a cache key for the given system id (filename) based on the status of the internal CmsObject.<p> @param systemId the system id (filename) to get the cache key for @return the cache key for the system id
[ "Returns", "a", "cache", "key", "for", "the", "given", "system", "id", "(", "filename", ")", "based", "on", "the", "status", "of", "the", "internal", "CmsObject", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlEntityResolver.java#L525-L536
ag-gipp/MathMLTools
mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/MathPlag.java
MathPlag.compareIdenticalMathML
public static List<Match> compareIdenticalMathML(String refMathML, String compMathML) throws MathNodeException { """ Compare two MathML formulas against each other. The MathML string will be transformed into a {@link CMMLInfo} document and then to a {@link MathNode} tree. <br/> The formulas are compared to find...
java
public static List<Match> compareIdenticalMathML(String refMathML, String compMathML) throws MathNodeException { // switch from a string > CMMLInfo document > MathNode tree MathNode refMathNode; MathNode compMathNode; try { refMathNode = MathNodeGenerator.generateMathNode(new...
[ "public", "static", "List", "<", "Match", ">", "compareIdenticalMathML", "(", "String", "refMathML", ",", "String", "compMathML", ")", "throws", "MathNodeException", "{", "// switch from a string > CMMLInfo document > MathNode tree", "MathNode", "refMathNode", ";", "MathNod...
Compare two MathML formulas against each other. The MathML string will be transformed into a {@link CMMLInfo} document and then to a {@link MathNode} tree. <br/> The formulas are compared to find identical structures. @param refMathML Reference MathML string (must contain pMML and cMML) @param compMathML Comparison M...
[ "Compare", "two", "MathML", "formulas", "against", "each", "other", ".", "The", "MathML", "string", "will", "be", "transformed", "into", "a", "{", "@link", "CMMLInfo", "}", "document", "and", "then", "to", "a", "{", "@link", "MathNode", "}", "tree", ".", ...
train
https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/MathPlag.java#L45-L60
jhunters/jprotobuf
src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java
ProtobufIDLProxy.createSingle
public static IDLProxyObject createSingle(String data, boolean debug, boolean isUniName) { """ Creates the single. @param data the data @param debug the debug @param isUniName the is uni name @return the IDL proxy object """ return createSingle(data, debug, null, isUniName); }
java
public static IDLProxyObject createSingle(String data, boolean debug, boolean isUniName) { return createSingle(data, debug, null, isUniName); }
[ "public", "static", "IDLProxyObject", "createSingle", "(", "String", "data", ",", "boolean", "debug", ",", "boolean", "isUniName", ")", "{", "return", "createSingle", "(", "data", ",", "debug", ",", "null", ",", "isUniName", ")", ";", "}" ]
Creates the single. @param data the data @param debug the debug @param isUniName the is uni name @return the IDL proxy object
[ "Creates", "the", "single", "." ]
train
https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1109-L1111
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/view/ViewQuery.java
ViewQuery.includeDocs
public ViewQuery includeDocs(boolean includeDocs, Class<? extends Document<?>> target) { """ Proactively load the full document for the row returned. This only works if reduce is false, since with reduce the original document ID is not included anymore. The order could be changed if one of the document takes...
java
public ViewQuery includeDocs(boolean includeDocs, Class<? extends Document<?>> target) { this.includeDocs = includeDocs; this.retainOrder = false; this.includeDocsTarget = target; return this; }
[ "public", "ViewQuery", "includeDocs", "(", "boolean", "includeDocs", ",", "Class", "<", "?", "extends", "Document", "<", "?", ">", ">", "target", ")", "{", "this", ".", "includeDocs", "=", "includeDocs", ";", "this", ".", "retainOrder", "=", "false", ";", ...
Proactively load the full document for the row returned. This only works if reduce is false, since with reduce the original document ID is not included anymore. The order could be changed if one of the document takes longer to load than the others (see {@link #includeDocsOrdered(boolean, Class)} if you want to enforc...
[ "Proactively", "load", "the", "full", "document", "for", "the", "row", "returned", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/view/ViewQuery.java#L204-L209
jmeetsma/Iglu-Common
src/main/java/org/ijsberg/iglu/access/StandardRequest.java
StandardRequest.setAttribute
public void setAttribute(Object key, Object value) { """ Stores object during the lifespan of the request. Use with care. @param key @param value """ if (attributes == null) { attributes = new HashMap(5); } attributes.put(key, value); }
java
public void setAttribute(Object key, Object value) { if (attributes == null) { attributes = new HashMap(5); } attributes.put(key, value); }
[ "public", "void", "setAttribute", "(", "Object", "key", ",", "Object", "value", ")", "{", "if", "(", "attributes", "==", "null", ")", "{", "attributes", "=", "new", "HashMap", "(", "5", ")", ";", "}", "attributes", ".", "put", "(", "key", ",", "value...
Stores object during the lifespan of the request. Use with care. @param key @param value
[ "Stores", "object", "during", "the", "lifespan", "of", "the", "request", ".", "Use", "with", "care", "." ]
train
https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/access/StandardRequest.java#L119-L124
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java
SourceLineAnnotation.fromVisitedInstruction
@Nonnull public static SourceLineAnnotation fromVisitedInstruction(ClassContext classContext, MethodGen methodGen, String sourceFile, @Nonnull InstructionHandle handle) { """ Factory method for creating a source line annotation describing the source line number for a visited instruction. @param...
java
@Nonnull public static SourceLineAnnotation fromVisitedInstruction(ClassContext classContext, MethodGen methodGen, String sourceFile, @Nonnull InstructionHandle handle) { LineNumberTable table = methodGen.getLineNumberTable(methodGen.getConstantPool()); String className = methodGen.getCl...
[ "@", "Nonnull", "public", "static", "SourceLineAnnotation", "fromVisitedInstruction", "(", "ClassContext", "classContext", ",", "MethodGen", "methodGen", ",", "String", "sourceFile", ",", "@", "Nonnull", "InstructionHandle", "handle", ")", "{", "LineNumberTable", "table...
Factory method for creating a source line annotation describing the source line number for a visited instruction. @param classContext the ClassContext @param methodGen the MethodGen object representing the method @param handle the InstructionHandle containing the visited instruction @return the SourceLineAnnotation, o...
[ "Factory", "method", "for", "creating", "a", "source", "line", "annotation", "describing", "the", "source", "line", "number", "for", "a", "visited", "instruction", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L578-L592
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java
Expressions.asBoolean
public static BooleanExpression asBoolean(Expression<Boolean> expr) { """ Create a new BooleanExpression @param expr Expression of type Boolean @return new BooleanExpression """ Expression<Boolean> underlyingMixin = ExpressionUtils.extract(expr); if (underlyingMixin instanceof PathImpl) { ...
java
public static BooleanExpression asBoolean(Expression<Boolean> expr) { Expression<Boolean> underlyingMixin = ExpressionUtils.extract(expr); if (underlyingMixin instanceof PathImpl) { return new BooleanPath((PathImpl<Boolean>) underlyingMixin); } else if (underlyingMixin instanceof Pre...
[ "public", "static", "BooleanExpression", "asBoolean", "(", "Expression", "<", "Boolean", ">", "expr", ")", "{", "Expression", "<", "Boolean", ">", "underlyingMixin", "=", "ExpressionUtils", ".", "extract", "(", "expr", ")", ";", "if", "(", "underlyingMixin", "...
Create a new BooleanExpression @param expr Expression of type Boolean @return new BooleanExpression
[ "Create", "a", "new", "BooleanExpression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L1861-L1881
vdmeer/skb-java-base
src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java
SkbShellFactory.newShell
public static SkbShell newShell(String id, MessageRenderer renderer, boolean useConsole) { """ Returns a new shell with given identifier and console flag. @param id new shell with identifier @param renderer a renderer for help messages @param useConsole flag to use (true) or not to use (false) console, of false...
java
public static SkbShell newShell(String id, MessageRenderer renderer, boolean useConsole){ return new AbstractShell(id, renderer, useConsole); }
[ "public", "static", "SkbShell", "newShell", "(", "String", "id", ",", "MessageRenderer", "renderer", ",", "boolean", "useConsole", ")", "{", "return", "new", "AbstractShell", "(", "id", ",", "renderer", ",", "useConsole", ")", ";", "}" ]
Returns a new shell with given identifier and console flag. @param id new shell with identifier @param renderer a renderer for help messages @param useConsole flag to use (true) or not to use (false) console, of false then no output will happen @return new shell
[ "Returns", "a", "new", "shell", "with", "given", "identifier", "and", "console", "flag", "." ]
train
https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java#L96-L98
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java
DateUtil.beginOfWeek
public static Calendar beginOfWeek(Calendar calendar, boolean isMondayAsFirstDay) { """ 获取某周的开始时间,周一定为一周的开始时间 @param calendar 日期 {@link Calendar} @param isMondayAsFirstDay 是否周一做为一周的第一天(false表示周日做为第一天) @return {@link Calendar} @since 3.1.2 """ if(isMondayAsFirstDay) { calendar.setFirstDayOfWeek(Cal...
java
public static Calendar beginOfWeek(Calendar calendar, boolean isMondayAsFirstDay) { if(isMondayAsFirstDay) { calendar.setFirstDayOfWeek(Calendar.MONDAY); } return truncate(calendar, DateField.WEEK_OF_MONTH); }
[ "public", "static", "Calendar", "beginOfWeek", "(", "Calendar", "calendar", ",", "boolean", "isMondayAsFirstDay", ")", "{", "if", "(", "isMondayAsFirstDay", ")", "{", "calendar", ".", "setFirstDayOfWeek", "(", "Calendar", ".", "MONDAY", ")", ";", "}", "return", ...
获取某周的开始时间,周一定为一周的开始时间 @param calendar 日期 {@link Calendar} @param isMondayAsFirstDay 是否周一做为一周的第一天(false表示周日做为第一天) @return {@link Calendar} @since 3.1.2
[ "获取某周的开始时间,周一定为一周的开始时间" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L897-L902
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_server.java
syslog_server.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ syslog_server_responses result = (syslog_server_responses) service.get_...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { syslog_server_responses result = (syslog_server_responses) service.get_payload_formatter().string_to_resource(syslog_server_responses.class, response); if(result.errorcode != 0) { if (result.error...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "syslog_server_responses", "result", "=", "(", "syslog_server_responses", ")", "service", ".", "get_payload_fo...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_server.java#L554-L571
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigEvaluator.java
ConfigEvaluator.resolveStringValue
private String resolveStringValue(Object rawValue, ExtendedAttributeDefinition attrDef, EvaluationContext context, boolean ignoreWarnings) throws ConfigEvaluatorException { """ Resolve a raw value to a String, and process it so that it can be evaluated. """ if (rawValue instanceof String) { ...
java
private String resolveStringValue(Object rawValue, ExtendedAttributeDefinition attrDef, EvaluationContext context, boolean ignoreWarnings) throws ConfigEvaluatorException { if (rawValue instanceof String) { return processString((String) rawValue, attrDef, context, ignoreWarnings); } else if ...
[ "private", "String", "resolveStringValue", "(", "Object", "rawValue", ",", "ExtendedAttributeDefinition", "attrDef", ",", "EvaluationContext", "context", ",", "boolean", "ignoreWarnings", ")", "throws", "ConfigEvaluatorException", "{", "if", "(", "rawValue", "instanceof",...
Resolve a raw value to a String, and process it so that it can be evaluated.
[ "Resolve", "a", "raw", "value", "to", "a", "String", "and", "process", "it", "so", "that", "it", "can", "be", "evaluated", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigEvaluator.java#L916-L926
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java
AvatarZooKeeperClient.getPrimarySsId
public Long getPrimarySsId(String address, boolean sync) throws IOException, KeeperException, InterruptedException, ClassNotFoundException { """ Retrieves the current session id for the cluster from zookeeper. @param address the address of the cluster @param sync whether or not to perform a sync before...
java
public Long getPrimarySsId(String address, boolean sync) throws IOException, KeeperException, InterruptedException, ClassNotFoundException { Stat stat = new Stat(); String node = getSsIdNode(address); byte[] data = getNodeData(node, stat, false, sync); if (data == null) { return null; } ...
[ "public", "Long", "getPrimarySsId", "(", "String", "address", ",", "boolean", "sync", ")", "throws", "IOException", ",", "KeeperException", ",", "InterruptedException", ",", "ClassNotFoundException", "{", "Stat", "stat", "=", "new", "Stat", "(", ")", ";", "Strin...
Retrieves the current session id for the cluster from zookeeper. @param address the address of the cluster @param sync whether or not to perform a sync before read @throws IOException @throws KeeperException @throws InterruptedException
[ "Retrieves", "the", "current", "session", "id", "for", "the", "cluster", "from", "zookeeper", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZooKeeperClient.java#L329-L338
ebean-orm/querybean-agent-now-merged-into-ebean-agent-
src/main/java/io/ebean/typequery/agent/AgentManifestReader.java
AgentManifestReader.readManifests
private AgentManifestReader readManifests(ClassLoader classLoader, String path) throws IOException { """ Read all the specific manifest files and return the set of packages containing type query beans. """ Enumeration<URL> resources = classLoader.getResources(path); while (resources.hasMoreElements()) ...
java
private AgentManifestReader readManifests(ClassLoader classLoader, String path) throws IOException { Enumeration<URL> resources = classLoader.getResources(path); while (resources.hasMoreElements()) { URL url = resources.nextElement(); try { addResource(url.openStream()); } catch (IOExc...
[ "private", "AgentManifestReader", "readManifests", "(", "ClassLoader", "classLoader", ",", "String", "path", ")", "throws", "IOException", "{", "Enumeration", "<", "URL", ">", "resources", "=", "classLoader", ".", "getResources", "(", "path", ")", ";", "while", ...
Read all the specific manifest files and return the set of packages containing type query beans.
[ "Read", "all", "the", "specific", "manifest", "files", "and", "return", "the", "set", "of", "packages", "containing", "type", "query", "beans", "." ]
train
https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/AgentManifestReader.java#L68-L80
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/component/button/ButtonRenderer.java
ButtonRenderer.getStyleClasses
private static String getStyleClasses(Button button, boolean isResponsive) { """ Collects the CSS classes of the button. @return the CSS classes (separated by a space). """ StringBuilder sb; sb = new StringBuilder(40); // optimize int sb.append("btn"); String size = button.getSize(); if (size != n...
java
private static String getStyleClasses(Button button, boolean isResponsive) { StringBuilder sb; sb = new StringBuilder(40); // optimize int sb.append("btn"); String size = button.getSize(); if (size != null) { sb.append(" btn-").append(size); } String look = button.getLook(); if (look != null) { s...
[ "private", "static", "String", "getStyleClasses", "(", "Button", "button", ",", "boolean", "isResponsive", ")", "{", "StringBuilder", "sb", ";", "sb", "=", "new", "StringBuilder", "(", "40", ")", ";", "// optimize int", "sb", ".", "append", "(", "\"btn\"", "...
Collects the CSS classes of the button. @return the CSS classes (separated by a space).
[ "Collects", "the", "CSS", "classes", "of", "the", "button", "." ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/button/ButtonRenderer.java#L372-L401
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java
Geometry.setBounds
public static final void setBounds(UIObject o, Rect bounds) { """ Sets the bounds of a UIObject, moving and sizing to match the bounds specified. Currently used for the itemhover and useful for other absolutely positioned elements. """ setPosition(o, bounds); setSize(o, bounds); }
java
public static final void setBounds(UIObject o, Rect bounds) { setPosition(o, bounds); setSize(o, bounds); }
[ "public", "static", "final", "void", "setBounds", "(", "UIObject", "o", ",", "Rect", "bounds", ")", "{", "setPosition", "(", "o", ",", "bounds", ")", ";", "setSize", "(", "o", ",", "bounds", ")", ";", "}" ]
Sets the bounds of a UIObject, moving and sizing to match the bounds specified. Currently used for the itemhover and useful for other absolutely positioned elements.
[ "Sets", "the", "bounds", "of", "a", "UIObject", "moving", "and", "sizing", "to", "match", "the", "bounds", "specified", ".", "Currently", "used", "for", "the", "itemhover", "and", "useful", "for", "other", "absolutely", "positioned", "elements", "." ]
train
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/util/Geometry.java#L89-L92
ibm-bluemix-mobile-services/bms-clientsdk-android-push
lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/api/MFPPush.java
MFPPush.initialize
public void initialize(Context context, String appGUID, String pushClientSecret) { """ MFPPush Intitialization method with clientSecret and Push App GUID. <p/> @param context this is the Context of the application from getApplicationContext() @param appGUID The unique ID of the Push service ...
java
public void initialize(Context context, String appGUID, String pushClientSecret) { this.initialize(context,appGUID,pushClientSecret,null); }
[ "public", "void", "initialize", "(", "Context", "context", ",", "String", "appGUID", ",", "String", "pushClientSecret", ")", "{", "this", ".", "initialize", "(", "context", ",", "appGUID", ",", "pushClientSecret", ",", "null", ")", ";", "}" ]
MFPPush Intitialization method with clientSecret and Push App GUID. <p/> @param context this is the Context of the application from getApplicationContext() @param appGUID The unique ID of the Push service instance that the application must connect to. @param pushClientSecret ClientSecret from the pus...
[ "MFPPush", "Intitialization", "method", "with", "clientSecret", "and", "Push", "App", "GUID", ".", "<p", "/", ">" ]
train
https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-push/blob/26c048637e81a6942004693919558f3d9aa8c674/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/api/MFPPush.java#L241-L243
antlrjavaparser/antlr-java-parser
src/main/java/com/github/antlrjavaparser/ASTHelper.java
ASTHelper.createNameExpr
public static NameExpr createNameExpr(String qualifiedName) { """ Creates a new {@link NameExpr} from a qualified name.<br> The qualified name can contains "." (dot) characters. @param qualifiedName qualified name @return instanceof {@link NameExpr} """ String[] split = qualifiedName.split("\\.")...
java
public static NameExpr createNameExpr(String qualifiedName) { String[] split = qualifiedName.split("\\."); NameExpr ret = new NameExpr(split[0]); for (int i = 1; i < split.length; i++) { ret = new QualifiedNameExpr(ret, split[i]); } return ret; }
[ "public", "static", "NameExpr", "createNameExpr", "(", "String", "qualifiedName", ")", "{", "String", "[", "]", "split", "=", "qualifiedName", ".", "split", "(", "\"\\\\.\"", ")", ";", "NameExpr", "ret", "=", "new", "NameExpr", "(", "split", "[", "0", "]",...
Creates a new {@link NameExpr} from a qualified name.<br> The qualified name can contains "." (dot) characters. @param qualifiedName qualified name @return instanceof {@link NameExpr}
[ "Creates", "a", "new", "{", "@link", "NameExpr", "}", "from", "a", "qualified", "name", ".", "<br", ">", "The", "qualified", "name", "can", "contains", ".", "(", "dot", ")", "characters", "." ]
train
https://github.com/antlrjavaparser/antlr-java-parser/blob/077160deb44d952c40c442800abd91af7e6fe006/src/main/java/com/github/antlrjavaparser/ASTHelper.java#L85-L92
epam/parso
src/main/java/com/epam/parso/impl/SasFileParser.java
SasFileParser.processSubheaderPointers
private SubheaderPointer processSubheaderPointers(long subheaderPointerOffset, int subheaderPointerIndex) throws IOException { """ The function to read the pointer with the subheaderPointerIndex index from the list of {@link SubheaderPointer} located at the subheaderPointerOffset offset. @param sub...
java
private SubheaderPointer processSubheaderPointers(long subheaderPointerOffset, int subheaderPointerIndex) throws IOException { int intOrLongLength = sasFileProperties.isU64() ? BYTES_IN_LONG : BYTES_IN_INT; int subheaderPointerLength = sasFileProperties.isU64() ? SUBHEADER_POINTER_LENGTH_X64...
[ "private", "SubheaderPointer", "processSubheaderPointers", "(", "long", "subheaderPointerOffset", ",", "int", "subheaderPointerIndex", ")", "throws", "IOException", "{", "int", "intOrLongLength", "=", "sasFileProperties", ".", "isU64", "(", ")", "?", "BYTES_IN_LONG", ":...
The function to read the pointer with the subheaderPointerIndex index from the list of {@link SubheaderPointer} located at the subheaderPointerOffset offset. @param subheaderPointerOffset the offset before the list of {@link SubheaderPointer}. @param subheaderPointerIndex the index of the subheader pointer being read...
[ "The", "function", "to", "read", "the", "pointer", "with", "the", "subheaderPointerIndex", "index", "from", "the", "list", "of", "{", "@link", "SubheaderPointer", "}", "located", "at", "the", "subheaderPointerOffset", "offset", "." ]
train
https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L457-L474
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java
DateFormat.getDateInstance
static final public DateFormat getDateInstance(Calendar cal, int dateStyle) { """ Creates a {@link DateFormat} object for the default locale that can be used to format dates in the calendar system specified by <code>cal</code>. <p> @param cal The calendar system for which a date format is desired. @param d...
java
static final public DateFormat getDateInstance(Calendar cal, int dateStyle) { return getDateInstance(cal, dateStyle, ULocale.getDefault(Category.FORMAT)); }
[ "static", "final", "public", "DateFormat", "getDateInstance", "(", "Calendar", "cal", ",", "int", "dateStyle", ")", "{", "return", "getDateInstance", "(", "cal", ",", "dateStyle", ",", "ULocale", ".", "getDefault", "(", "Category", ".", "FORMAT", ")", ")", "...
Creates a {@link DateFormat} object for the default locale that can be used to format dates in the calendar system specified by <code>cal</code>. <p> @param cal The calendar system for which a date format is desired. @param dateStyle The type of date format desired. This can be {@link DateFormat#SHORT}, {@link Date...
[ "Creates", "a", "{", "@link", "DateFormat", "}", "object", "for", "the", "default", "locale", "that", "can", "be", "used", "to", "format", "dates", "in", "the", "calendar", "system", "specified", "by", "<code", ">", "cal<", "/", "code", ">", ".", "<p", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1903-L1905
wcm-io/wcm-io-wcm
commons/src/main/java/io/wcm/wcm/commons/util/Template.java
Template.forTemplatePath
public static TemplatePathInfo forTemplatePath(@NotNull String templatePath, @NotNull TemplatePathInfo @NotNull... templates) { """ Lookup a template by the given template path. @param templatePath Path of template @param templates Templates @return The {@link TemplatePathInfo} instance or null for unknown temp...
java
public static TemplatePathInfo forTemplatePath(@NotNull String templatePath, @NotNull TemplatePathInfo @NotNull... templates) { if (templatePath == null || templates == null || templates.length == 0) { return null; } for (TemplatePathInfo template : templates) { if (StringUtils.equals(template.g...
[ "public", "static", "TemplatePathInfo", "forTemplatePath", "(", "@", "NotNull", "String", "templatePath", ",", "@", "NotNull", "TemplatePathInfo", "@", "NotNull", ".", ".", ".", "templates", ")", "{", "if", "(", "templatePath", "==", "null", "||", "templates", ...
Lookup a template by the given template path. @param templatePath Path of template @param templates Templates @return The {@link TemplatePathInfo} instance or null for unknown template paths
[ "Lookup", "a", "template", "by", "the", "given", "template", "path", "." ]
train
https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/util/Template.java#L117-L127
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/LocaleUtils.java
LocaleUtils.matchesFilter
public static boolean matchesFilter(String key, List<String> filters) { """ Determines whether a key matches any of the set filters. @param key the property key @param filters @return true if the key matches any of the set filters. """ boolean rets = (null == filters); if (!rets) { for (Iterator<S...
java
public static boolean matchesFilter(String key, List<String> filters) { boolean rets = (null == filters); if (!rets) { for (Iterator<String> it = filters.iterator(); it.hasNext() && !rets;) rets = key.startsWith(it.next()); } return rets; }
[ "public", "static", "boolean", "matchesFilter", "(", "String", "key", ",", "List", "<", "String", ">", "filters", ")", "{", "boolean", "rets", "=", "(", "null", "==", "filters", ")", ";", "if", "(", "!", "rets", ")", "{", "for", "(", "Iterator", "<",...
Determines whether a key matches any of the set filters. @param key the property key @param filters @return true if the key matches any of the set filters.
[ "Determines", "whether", "a", "key", "matches", "any", "of", "the", "set", "filters", "." ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/LocaleUtils.java#L55-L63
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java
FileInputFormat.decorateInputStream
protected FSDataInputStream decorateInputStream(FSDataInputStream inputStream, FileInputSplit fileSplit) throws Throwable { """ This method allows to wrap/decorate the raw {@link FSDataInputStream} for a certain file split, e.g., for decoding. When overriding this method, also consider adapting {@link FileInputFo...
java
protected FSDataInputStream decorateInputStream(FSDataInputStream inputStream, FileInputSplit fileSplit) throws Throwable { // Wrap stream in a extracting (decompressing) stream if file ends with a known compression file extension. InflaterInputStreamFactory<?> inflaterInputStreamFactory = getInflaterInputStreamFac...
[ "protected", "FSDataInputStream", "decorateInputStream", "(", "FSDataInputStream", "inputStream", ",", "FileInputSplit", "fileSplit", ")", "throws", "Throwable", "{", "// Wrap stream in a extracting (decompressing) stream if file ends with a known compression file extension.", "InflaterI...
This method allows to wrap/decorate the raw {@link FSDataInputStream} for a certain file split, e.g., for decoding. When overriding this method, also consider adapting {@link FileInputFormat#testForUnsplittable} if your stream decoration renders the input file unsplittable. Also consider calling existing superclass imp...
[ "This", "method", "allows", "to", "wrap", "/", "decorate", "the", "raw", "{", "@link", "FSDataInputStream", "}", "for", "a", "certain", "file", "split", "e", ".", "g", ".", "for", "decoding", ".", "When", "overriding", "this", "method", "also", "consider",...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java#L844-L852
yegor256/takes
src/main/java/org/takes/facets/auth/TkAuth.java
TkAuth.act
private Response act(final Request req, final Identity identity) throws IOException { """ Make take. @param req Request @param identity Identity @return Take @throws IOException If fails """ Request wrap = new RqWithoutHeader(req, this.header); if (!identity.equals(Identity.ANONYMOU...
java
private Response act(final Request req, final Identity identity) throws IOException { Request wrap = new RqWithoutHeader(req, this.header); if (!identity.equals(Identity.ANONYMOUS)) { wrap = new RqWithAuth(identity, this.header, wrap); } return this.pass.exit(this.ori...
[ "private", "Response", "act", "(", "final", "Request", "req", ",", "final", "Identity", "identity", ")", "throws", "IOException", "{", "Request", "wrap", "=", "new", "RqWithoutHeader", "(", "req", ",", "this", ".", "header", ")", ";", "if", "(", "!", "id...
Make take. @param req Request @param identity Identity @return Take @throws IOException If fails
[ "Make", "take", "." ]
train
https://github.com/yegor256/takes/blob/a4f4d939c8f8e0af190025716ad7f22b7de40e70/src/main/java/org/takes/facets/auth/TkAuth.java#L101-L108
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/Projection.java
Projection.fromPixels
public IGeoPoint fromPixels(final int pPixelX, final int pPixelY, final GeoPoint pReuse, boolean forceWrap) { """ * note: if {@link MapView#setHorizontalMapRepetitionEnabled(boolean)} or {@link MapView#setVerticalMapRepetitionEnabled(boolean)} is false, then this can return values that beyond the max extents of ...
java
public IGeoPoint fromPixels(final int pPixelX, final int pPixelY, final GeoPoint pReuse, boolean forceWrap) { //reverting https://github.com/osmdroid/osmdroid/issues/459 //due to relapse of https://github.com/osmdroid/osmdroid/issues/507 //reverted functionality is now on the method fromPixelsRotationSensitive ...
[ "public", "IGeoPoint", "fromPixels", "(", "final", "int", "pPixelX", ",", "final", "int", "pPixelY", ",", "final", "GeoPoint", "pReuse", ",", "boolean", "forceWrap", ")", "{", "//reverting https://github.com/osmdroid/osmdroid/issues/459", "//due to relapse of https://github...
* note: if {@link MapView#setHorizontalMapRepetitionEnabled(boolean)} or {@link MapView#setVerticalMapRepetitionEnabled(boolean)} is false, then this can return values that beyond the max extents of the world. This may or may not be desired. <a href="https://github.com/osmdroid/osmdroid/pull/722">https://github.com/osm...
[ "*", "note", ":", "if", "{" ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L179-L186
google/error-prone
check_api/src/main/java/com/google/errorprone/matchers/Matchers.java
Matchers.compoundAssignment
public static CompoundAssignment compoundAssignment( Set<Kind> operators, Matcher<ExpressionTree> receiverMatcher, Matcher<ExpressionTree> expressionMatcher) { """ Matches a compound assignment operator AST node which matches a given left-operand matcher, a given right-operand matcher, and is on...
java
public static CompoundAssignment compoundAssignment( Set<Kind> operators, Matcher<ExpressionTree> receiverMatcher, Matcher<ExpressionTree> expressionMatcher) { return new CompoundAssignment(operators, receiverMatcher, expressionMatcher); }
[ "public", "static", "CompoundAssignment", "compoundAssignment", "(", "Set", "<", "Kind", ">", "operators", ",", "Matcher", "<", "ExpressionTree", ">", "receiverMatcher", ",", "Matcher", "<", "ExpressionTree", ">", "expressionMatcher", ")", "{", "return", "new", "C...
Matches a compound assignment operator AST node which matches a given left-operand matcher, a given right-operand matcher, and is one of a set of compound assignment operators. Does not match compound assignment operators. @param operators Which compound assignment operators to match against. @param receiverMatcher Th...
[ "Matches", "a", "compound", "assignment", "operator", "AST", "node", "which", "matches", "a", "given", "left", "-", "operand", "matcher", "a", "given", "right", "-", "operand", "matcher", "and", "is", "one", "of", "a", "set", "of", "compound", "assignment", ...
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L272-L277
otto-de/edison-hal
src/main/java/de/otto/edison/hal/paging/NumberedPaging.java
NumberedPaging.calcLastPage
private int calcLastPage(int total, int pageSize) { """ Returns the number of the last page, if the total number of items is known. @param total total number of items @param pageSize the current page size @return page number of the last page """ if (total == 0) { return firstPage; ...
java
private int calcLastPage(int total, int pageSize) { if (total == 0) { return firstPage; } else { final int zeroBasedPageNo = total % pageSize > 0 ? total / pageSize : total / pageSize - 1; return firstPage + zeroBasedPageNo; ...
[ "private", "int", "calcLastPage", "(", "int", "total", ",", "int", "pageSize", ")", "{", "if", "(", "total", "==", "0", ")", "{", "return", "firstPage", ";", "}", "else", "{", "final", "int", "zeroBasedPageNo", "=", "total", "%", "pageSize", ">", "0", ...
Returns the number of the last page, if the total number of items is known. @param total total number of items @param pageSize the current page size @return page number of the last page
[ "Returns", "the", "number", "of", "the", "last", "page", "if", "the", "total", "number", "of", "items", "is", "known", "." ]
train
https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/paging/NumberedPaging.java#L321-L330
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java
TheMovieDbApi.postMovieRating
public StatusCode postMovieRating(int movieId, int rating, String sessionId, String guestSessionId) throws MovieDbException { """ This method lets users rate a movie. A valid session id or guest session id is required. @param sessionId sessionId @param movieId movieId @param rating rating @param guestSess...
java
public StatusCode postMovieRating(int movieId, int rating, String sessionId, String guestSessionId) throws MovieDbException { return tmdbMovies.postMovieRating(movieId, rating, sessionId, guestSessionId); }
[ "public", "StatusCode", "postMovieRating", "(", "int", "movieId", ",", "int", "rating", ",", "String", "sessionId", ",", "String", "guestSessionId", ")", "throws", "MovieDbException", "{", "return", "tmdbMovies", ".", "postMovieRating", "(", "movieId", ",", "ratin...
This method lets users rate a movie. A valid session id or guest session id is required. @param sessionId sessionId @param movieId movieId @param rating rating @param guestSessionId guestSessionId @return @throws MovieDbException exception
[ "This", "method", "lets", "users", "rate", "a", "movie", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L1057-L1059
jMotif/SAX
src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java
HOTSAXImplementation.hashToFreqEntries
@Deprecated private static ArrayList<FrequencyTableEntry> hashToFreqEntries( HashMap<String, ArrayList<Integer>> hash) { """ Translates the hash table into sortable array of substrings. @param hash @return """ ArrayList<FrequencyTableEntry> res = new ArrayList<FrequencyTableEntry>(); for (E...
java
@Deprecated private static ArrayList<FrequencyTableEntry> hashToFreqEntries( HashMap<String, ArrayList<Integer>> hash) { ArrayList<FrequencyTableEntry> res = new ArrayList<FrequencyTableEntry>(); for (Entry<String, ArrayList<Integer>> e : hash.entrySet()) { char[] payload = e.getKey().toCharArray(...
[ "@", "Deprecated", "private", "static", "ArrayList", "<", "FrequencyTableEntry", ">", "hashToFreqEntries", "(", "HashMap", "<", "String", ",", "ArrayList", "<", "Integer", ">", ">", "hash", ")", "{", "ArrayList", "<", "FrequencyTableEntry", ">", "res", "=", "n...
Translates the hash table into sortable array of substrings. @param hash @return
[ "Translates", "the", "hash", "table", "into", "sortable", "array", "of", "substrings", "." ]
train
https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java#L651-L663
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/From.java
From.groupBy
@NonNull @Override public GroupBy groupBy(@NonNull Expression... expressions) { """ Creates and chains a GroupBy object to group the query result. @param expressions The group by expression. @return The GroupBy object that represents the GROUP BY clause of the query. """ if (expressions == ...
java
@NonNull @Override public GroupBy groupBy(@NonNull Expression... expressions) { if (expressions == null) { throw new IllegalArgumentException("expressions cannot be null."); } return new GroupBy(this, Arrays.asList(expressions)); }
[ "@", "NonNull", "@", "Override", "public", "GroupBy", "groupBy", "(", "@", "NonNull", "Expression", "...", "expressions", ")", "{", "if", "(", "expressions", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"expressions cannot be null.\""...
Creates and chains a GroupBy object to group the query result. @param expressions The group by expression. @return The GroupBy object that represents the GROUP BY clause of the query.
[ "Creates", "and", "chains", "a", "GroupBy", "object", "to", "group", "the", "query", "result", "." ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/From.java#L88-L95
linkedin/dexmaker
dexmaker/src/main/java/com/android/dx/Code.java
Code.instanceOfType
public void instanceOfType(Local<?> target, Local<?> source, TypeId<?> type) { """ Tests if the value in {@code source} is assignable to {@code type}. If it is, {@code target} is assigned to 1; otherwise {@code target} is assigned to 0. """ addInstruction(new ThrowingCstInsn(Rops.INSTANCE_OF, sourceP...
java
public void instanceOfType(Local<?> target, Local<?> source, TypeId<?> type) { addInstruction(new ThrowingCstInsn(Rops.INSTANCE_OF, sourcePosition, RegisterSpecList.make(source.spec()), catches, type.constant)); moveResult(target, true); }
[ "public", "void", "instanceOfType", "(", "Local", "<", "?", ">", "target", ",", "Local", "<", "?", ">", "source", ",", "TypeId", "<", "?", ">", "type", ")", "{", "addInstruction", "(", "new", "ThrowingCstInsn", "(", "Rops", ".", "INSTANCE_OF", ",", "so...
Tests if the value in {@code source} is assignable to {@code type}. If it is, {@code target} is assigned to 1; otherwise {@code target} is assigned to 0.
[ "Tests", "if", "the", "value", "in", "{" ]
train
https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L718-L722
atomix/copycat
server/src/main/java/io/atomix/copycat/server/storage/system/MetaStore.java
MetaStore.deleteConfigurationFromMetadataBuffer
private FileBuffer deleteConfigurationFromMetadataBuffer(File metaFile, FileBuffer buffer) { """ Note: used in backward compatibility code with pre 1.2.6 release. This can be removed in later releases. """ long term = buffer.readLong(0); int vote = buffer.readInt(8); buffer.close(); try { ...
java
private FileBuffer deleteConfigurationFromMetadataBuffer(File metaFile, FileBuffer buffer) { long term = buffer.readLong(0); int vote = buffer.readInt(8); buffer.close(); try { Files.delete(metaFile.toPath()); } catch (IOException ex) { throw new RuntimeException(String.format("Failed...
[ "private", "FileBuffer", "deleteConfigurationFromMetadataBuffer", "(", "File", "metaFile", ",", "FileBuffer", "buffer", ")", "{", "long", "term", "=", "buffer", ".", "readLong", "(", "0", ")", ";", "int", "vote", "=", "buffer", ".", "readInt", "(", "8", ")",...
Note: used in backward compatibility code with pre 1.2.6 release. This can be removed in later releases.
[ "Note", ":", "used", "in", "backward", "compatibility", "code", "with", "pre", "1", ".", "2", ".", "6", "release", ".", "This", "can", "be", "removed", "in", "later", "releases", "." ]
train
https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/storage/system/MetaStore.java#L97-L114
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java
MasterWorkerInfo.updateUsedBytes
public void updateUsedBytes(String tierAlias, long usedBytesOnTier) { """ Sets the used space of the worker in bytes. @param tierAlias alias of storage tier @param usedBytesOnTier used bytes on certain storage tier """ mUsedBytes += usedBytesOnTier - mUsedBytesOnTiers.get(tierAlias); mUsedBytesOnTi...
java
public void updateUsedBytes(String tierAlias, long usedBytesOnTier) { mUsedBytes += usedBytesOnTier - mUsedBytesOnTiers.get(tierAlias); mUsedBytesOnTiers.put(tierAlias, usedBytesOnTier); }
[ "public", "void", "updateUsedBytes", "(", "String", "tierAlias", ",", "long", "usedBytesOnTier", ")", "{", "mUsedBytes", "+=", "usedBytesOnTier", "-", "mUsedBytesOnTiers", ".", "get", "(", "tierAlias", ")", ";", "mUsedBytesOnTiers", ".", "put", "(", "tierAlias", ...
Sets the used space of the worker in bytes. @param tierAlias alias of storage tier @param usedBytesOnTier used bytes on certain storage tier
[ "Sets", "the", "used", "space", "of", "the", "worker", "in", "bytes", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java#L439-L442
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java
PropertiesConfigHelper.getProperty
public String getProperty(String key, String defaultValue) { """ Returns the value of a property, or the default value if no value is defined @param key the key of the property @param defaultValue the default value @return the value of a property, or the default value if no value is defined """ retu...
java
public String getProperty(String key, String defaultValue) { return props.getProperty(prefix + key, defaultValue); }
[ "public", "String", "getProperty", "(", "String", "key", ",", "String", "defaultValue", ")", "{", "return", "props", ".", "getProperty", "(", "prefix", "+", "key", ",", "defaultValue", ")", ";", "}" ]
Returns the value of a property, or the default value if no value is defined @param key the key of the property @param defaultValue the default value @return the value of a property, or the default value if no value is defined
[ "Returns", "the", "value", "of", "a", "property", "or", "the", "default", "value", "if", "no", "value", "is", "defined" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java#L288-L290
hibernate/hibernate-ogm
neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/http/dialect/impl/HttpNeo4jEntityQueries.java
HttpNeo4jEntityQueries.findEntities
public ClosableIterator<NodeWithEmbeddedNodes> findEntities(HttpNeo4jClient executionEngine, EntityKey[] keys, Long txId) { """ Find the nodes corresponding to an array of entity keys. @param executionEngine the {@link HttpNeo4jClient} used to run the query @param keys an array of keys identifying the nodes to...
java
public ClosableIterator<NodeWithEmbeddedNodes> findEntities(HttpNeo4jClient executionEngine, EntityKey[] keys, Long txId) { if ( singlePropertyKey ) { return singlePropertyIdFindEntities( executionEngine, keys, txId ); } else { return multiPropertiesIdFindEntities( executionEngine, keys, txId ); } }
[ "public", "ClosableIterator", "<", "NodeWithEmbeddedNodes", ">", "findEntities", "(", "HttpNeo4jClient", "executionEngine", ",", "EntityKey", "[", "]", "keys", ",", "Long", "txId", ")", "{", "if", "(", "singlePropertyKey", ")", "{", "return", "singlePropertyIdFindEn...
Find the nodes corresponding to an array of entity keys. @param executionEngine the {@link HttpNeo4jClient} used to run the query @param keys an array of keys identifying the nodes to return @return the list of nodes representing the entities
[ "Find", "the", "nodes", "corresponding", "to", "an", "array", "of", "entity", "keys", "." ]
train
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/http/dialect/impl/HttpNeo4jEntityQueries.java#L204-L211
ThreeTen/threetenbp
src/main/java/org/threeten/bp/chrono/HijrahDate.java
HijrahDate.getMonthOfYear
private static int getMonthOfYear(int dayOfYear, int year) { """ Returns month-of-year. 0-based. @param dayOfYear day-of-year @param year a year @return month-of-year """ Integer[] newMonths = getAdjustedMonthDays(year); if (dayOfYear >= 0) { for (int i = 0; i < newMonths.l...
java
private static int getMonthOfYear(int dayOfYear, int year) { Integer[] newMonths = getAdjustedMonthDays(year); if (dayOfYear >= 0) { for (int i = 0; i < newMonths.length; i++) { if (dayOfYear < newMonths[i].intValue()) { return i - 1; } ...
[ "private", "static", "int", "getMonthOfYear", "(", "int", "dayOfYear", ",", "int", "year", ")", "{", "Integer", "[", "]", "newMonths", "=", "getAdjustedMonthDays", "(", "year", ")", ";", "if", "(", "dayOfYear", ">=", "0", ")", "{", "for", "(", "int", "...
Returns month-of-year. 0-based. @param dayOfYear day-of-year @param year a year @return month-of-year
[ "Returns", "month", "-", "of", "-", "year", ".", "0", "-", "based", "." ]
train
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1055-L1076
selenide/selenide
statics/src/main/java/com/codeborne/selenide/Screenshots.java
Screenshots.takeScreenShot
public static File takeScreenShot(WebElement iframe, WebElement element) { """ Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be present @return a temporary file, not guaranteed to be stored after tests complete. """ return scr...
java
public static File takeScreenShot(WebElement iframe, WebElement element) { return screenshots.takeScreenshot(driver(), iframe, element); }
[ "public", "static", "File", "takeScreenShot", "(", "WebElement", "iframe", ",", "WebElement", "element", ")", "{", "return", "screenshots", ".", "takeScreenshot", "(", "driver", "(", ")", ",", "iframe", ",", "element", ")", ";", "}" ]
Take screenshot of WebElement/SelenideElement in iframe for partially visible WebElement/Selenide horizontal scroll bar will be present @return a temporary file, not guaranteed to be stored after tests complete.
[ "Take", "screenshot", "of", "WebElement", "/", "SelenideElement", "in", "iframe", "for", "partially", "visible", "WebElement", "/", "Selenide", "horizontal", "scroll", "bar", "will", "be", "present" ]
train
https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/statics/src/main/java/com/codeborne/selenide/Screenshots.java#L49-L51
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/modelresolver/impl/AbstractPropertyResolver.java
AbstractPropertyResolver.getEndIndexOfNextProperty
private int getEndIndexOfNextProperty(final String str, final int startIndex) { """ A helper method to the get the index of the '}' character in the given String str with a valid property substitution. A valid property looks like ${batch.property} @param str The string to search. @param startIndex The inde...
java
private int getEndIndexOfNextProperty(final String str, final int startIndex) { if (str == null) { return -1; } final int startPropIndex = str.indexOf("${", startIndex); // we didn't find a property in this string if (startPropIndex == -1) { return -1; } final int endPropIndex = str.indexOf("}", ...
[ "private", "int", "getEndIndexOfNextProperty", "(", "final", "String", "str", ",", "final", "int", "startIndex", ")", "{", "if", "(", "str", "==", "null", ")", "{", "return", "-", "1", ";", "}", "final", "int", "startPropIndex", "=", "str", ".", "indexOf...
A helper method to the get the index of the '}' character in the given String str with a valid property substitution. A valid property looks like ${batch.property} @param str The string to search. @param startIndex The index in str to start the search. @return The index of the '}' character or -1 if no valid property ...
[ "A", "helper", "method", "to", "the", "get", "the", "index", "of", "the", "}", "character", "in", "the", "given", "String", "str", "with", "a", "valid", "property", "substitution", ".", "A", "valid", "property", "looks", "like", "$", "{", "batch", ".", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/modelresolver/impl/AbstractPropertyResolver.java#L269-L290
streamsets/datacollector-api
src/main/java/com/streamsets/pipeline/api/impl/Utils.java
Utils.checkNotNull
public static <T> T checkNotNull(@Nullable T value, Object varName) { """ Ensures that an object reference passed as a parameter to the calling method is not null. @param value an object reference @param varName the variable name to use in an exception message if the check fails @return the non-null reference...
java
public static <T> T checkNotNull(@Nullable T value, Object varName) { if (value == null) { throw new NullPointerException(format("{} cannot be null", varName)); } return value; }
[ "public", "static", "<", "T", ">", "T", "checkNotNull", "(", "@", "Nullable", "T", "value", ",", "Object", "varName", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "format", "(", "\"{} cannot be null\"",...
Ensures that an object reference passed as a parameter to the calling method is not null. @param value an object reference @param varName the variable name to use in an exception message if the check fails @return the non-null reference that was validated @throws NullPointerException if {@code value} is null
[ "Ensures", "that", "an", "object", "reference", "passed", "as", "a", "parameter", "to", "the", "calling", "method", "is", "not", "null", "." ]
train
https://github.com/streamsets/datacollector-api/blob/ac832a97bea2fcef11f50fac6746e85019adad58/src/main/java/com/streamsets/pipeline/api/impl/Utils.java#L55-L60
EdwardRaff/JSAT
JSAT/src/jsat/distributions/kernels/BaseL2Kernel.java
BaseL2Kernel.getSqrdNorm
protected double getSqrdNorm(int i, List<? extends Vec> vecs, List<Double> cache) { """ Returns the squared L<sup>2</sup> norm of the given point from the cache @param i the index in the vector list to get the squared norm from @param vecs the list of vectors that make the collection @param cache the cache of v...
java
protected double getSqrdNorm(int i, List<? extends Vec> vecs, List<Double> cache) { return cache.get(i); }
[ "protected", "double", "getSqrdNorm", "(", "int", "i", ",", "List", "<", "?", "extends", "Vec", ">", "vecs", ",", "List", "<", "Double", ">", "cache", ")", "{", "return", "cache", ".", "get", "(", "i", ")", ";", "}" ]
Returns the squared L<sup>2</sup> norm of the given point from the cache @param i the index in the vector list to get the squared norm from @param vecs the list of vectors that make the collection @param cache the cache of values for each vector in the collection @return the squared norm ||x<sub>i</sub>||<sup>2</sup>
[ "Returns", "the", "squared", "L<sup", ">", "2<", "/", "sup", ">", "norm", "of", "the", "given", "point", "from", "the", "cache" ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/BaseL2Kernel.java#L59-L62
raydac/netbeans-mmd-plugin
mind-map/scia-reto/src/main/java/com/igormaznitsa/sciareto/ui/FileListPanel.java
FileListPanel.initComponents
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { """ This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerat...
java
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane2 = new javax.swing.JScrollPane(); tableFiles = new javax.swing.JTable(); jPanel1 = new javax.swing.JPanel(); jHtmlLabel1 = new com.igo...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "// <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents", "private", "void", "initComponents", "(", ")", "{", "jScrollPane2", "=", "new", "javax", ".", "swing", ".", "JScrollPane", "(",...
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
[ "This", "method", "is", "called", "from", "within", "the", "constructor", "to", "initialize", "the", "form", ".", "WARNING", ":", "Do", "NOT", "modify", "this", "code", ".", "The", "content", "of", "this", "method", "is", "always", "regenerated", "by", "th...
train
https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/scia-reto/src/main/java/com/igormaznitsa/sciareto/ui/FileListPanel.java#L156-L190
alkacon/opencms-core
src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java
CmsJspCategoryAccessBean.getSubCategories
public Map<String, CmsJspCategoryAccessBean> getSubCategories() { """ Returns a map from a category path to the wrapper of all the sub-categories of the category with the path given as key. @return a map from a category path to all sub-categories of the path's category. """ if (m_subCategories == n...
java
public Map<String, CmsJspCategoryAccessBean> getSubCategories() { if (m_subCategories == null) { m_subCategories = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() { @SuppressWarnings("synthetic-access") public Object transform(Object pathPrefix) { ...
[ "public", "Map", "<", "String", ",", "CmsJspCategoryAccessBean", ">", "getSubCategories", "(", ")", "{", "if", "(", "m_subCategories", "==", "null", ")", "{", "m_subCategories", "=", "CmsCollectionsGenericWrapper", ".", "createLazyMap", "(", "new", "Transformer", ...
Returns a map from a category path to the wrapper of all the sub-categories of the category with the path given as key. @return a map from a category path to all sub-categories of the path's category.
[ "Returns", "a", "map", "from", "a", "category", "path", "to", "the", "wrapper", "of", "all", "the", "sub", "-", "categories", "of", "the", "category", "with", "the", "path", "given", "as", "key", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java#L178-L192
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/bagofwords/vectorizer/TfidfVectorizer.java
TfidfVectorizer.vectorize
@Override public DataSet vectorize(InputStream is, String label) { """ Text coming from an input stream considered as one document @param is the input stream to read from @param label the label to assign @return a dataset with a applyTransformToDestination of weights(relative to impl; could be word cou...
java
@Override public DataSet vectorize(InputStream is, String label) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); String line = ""; StringBuilder builder = new StringBuilder(); while ((line = reader.readLine()) != null) {...
[ "@", "Override", "public", "DataSet", "vectorize", "(", "InputStream", "is", ",", "String", "label", ")", "{", "try", "{", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "is", ",", "\"UTF-8\"", ")", ")", ";", ...
Text coming from an input stream considered as one document @param is the input stream to read from @param label the label to assign @return a dataset with a applyTransformToDestination of weights(relative to impl; could be word counts or tfidf scores)
[ "Text", "coming", "from", "an", "input", "stream", "considered", "as", "one", "document" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/bagofwords/vectorizer/TfidfVectorizer.java#L58-L71
danieldk/dictomaton
src/main/java/eu/danieldk/dictomaton/DictionaryImpl.java
DictionaryImpl.findTransition
protected int findTransition(int state, char c) { """ Find the transition for the given character in the given state. Since the transitions are ordered by character, we can use a binary search. @param state @param c @return """ int start = d_stateOffsets.get(state); int end = transitionsU...
java
protected int findTransition(int state, char c) { int start = d_stateOffsets.get(state); int end = transitionsUpperBound(state) - 1; // Binary search while (end >= start) { int mid = start + ((end - start) / 2); if (d_transitionChars[mid] > c) en...
[ "protected", "int", "findTransition", "(", "int", "state", ",", "char", "c", ")", "{", "int", "start", "=", "d_stateOffsets", ".", "get", "(", "state", ")", ";", "int", "end", "=", "transitionsUpperBound", "(", "state", ")", "-", "1", ";", "// Binary sea...
Find the transition for the given character in the given state. Since the transitions are ordered by character, we can use a binary search. @param state @param c @return
[ "Find", "the", "transition", "for", "the", "given", "character", "in", "the", "given", "state", ".", "Since", "the", "transitions", "are", "ordered", "by", "character", "we", "can", "use", "a", "binary", "search", "." ]
train
https://github.com/danieldk/dictomaton/blob/c0a3ae2d407ebd88023ea2d0f02a4882b0492df0/src/main/java/eu/danieldk/dictomaton/DictionaryImpl.java#L293-L310
landawn/AbacusUtil
src/com/landawn/abacus/util/DynamoDBExecutor.java
DynamoDBExecutor.toUpdateItem
public static Map<String, AttributeValueUpdate> toUpdateItem(final Object entity) { """ Only the dirty properties will be set to the result Map if the specified entity is a dirty marker entity. @param entity @return """ return toUpdateItem(entity, NamingPolicy.LOWER_CAMEL_CASE); }
java
public static Map<String, AttributeValueUpdate> toUpdateItem(final Object entity) { return toUpdateItem(entity, NamingPolicy.LOWER_CAMEL_CASE); }
[ "public", "static", "Map", "<", "String", ",", "AttributeValueUpdate", ">", "toUpdateItem", "(", "final", "Object", "entity", ")", "{", "return", "toUpdateItem", "(", "entity", ",", "NamingPolicy", ".", "LOWER_CAMEL_CASE", ")", ";", "}" ]
Only the dirty properties will be set to the result Map if the specified entity is a dirty marker entity. @param entity @return
[ "Only", "the", "dirty", "properties", "will", "be", "set", "to", "the", "result", "Map", "if", "the", "specified", "entity", "is", "a", "dirty", "marker", "entity", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DynamoDBExecutor.java#L710-L712
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java
XMLUtil.getElementFromPath
@Pure private static Element getElementFromPath(Node document, boolean caseSensitive, int idxStart, String... path) { """ Replies the node that corresponds to the specified path. <p>The path is an ordered list of tag's names and ended by the name of the desired node. @param document is the XML document to ...
java
@Pure private static Element getElementFromPath(Node document, boolean caseSensitive, int idxStart, String... path) { assert document != null : AssertMessages.notNullParameter(0); if (path != null && (path.length - idxStart) >= 1) { final NodeList nodes = document.getChildNodes(); final int len = nodes.getLe...
[ "@", "Pure", "private", "static", "Element", "getElementFromPath", "(", "Node", "document", ",", "boolean", "caseSensitive", ",", "int", "idxStart", ",", "String", "...", "path", ")", "{", "assert", "document", "!=", "null", ":", "AssertMessages", ".", "notNul...
Replies the node that corresponds to the specified path. <p>The path is an ordered list of tag's names and ended by the name of the desired node. @param document is the XML document to explore. @param caseSensitive indicates of the {@code path}'s components are case sensitive. @param idxStart is the index of the firs...
[ "Replies", "the", "node", "that", "corresponds", "to", "the", "specified", "path", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1350-L1374
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newScrollPanelY
public static ScrollPanel newScrollPanelY (Widget contents, int maxHeight) { """ Wraps the supplied contents in a scroll panel with the specified maximum height. """ ScrollPanel panel = new ScrollPanel(contents); DOM.setStyleAttribute(panel.getElement(), "maxHeight", maxHeight + "px"); ...
java
public static ScrollPanel newScrollPanelY (Widget contents, int maxHeight) { ScrollPanel panel = new ScrollPanel(contents); DOM.setStyleAttribute(panel.getElement(), "maxHeight", maxHeight + "px"); return panel; }
[ "public", "static", "ScrollPanel", "newScrollPanelY", "(", "Widget", "contents", ",", "int", "maxHeight", ")", "{", "ScrollPanel", "panel", "=", "new", "ScrollPanel", "(", "contents", ")", ";", "DOM", ".", "setStyleAttribute", "(", "panel", ".", "getElement", ...
Wraps the supplied contents in a scroll panel with the specified maximum height.
[ "Wraps", "the", "supplied", "contents", "in", "a", "scroll", "panel", "with", "the", "specified", "maximum", "height", "." ]
train
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L129-L134