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
groupon/robo-remote
RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Client.java
Client.map
public JSONArray map(String query, String method_name, Object... items) throws Exception { """ Used to call a method with a list of arguments @param query @param method_name @param items @return @throws Exception """ QueryBuilder builder = new QueryBuilder(API_PORT); builder.map(query, met...
java
public JSONArray map(String query, String method_name, Object... items) throws Exception { QueryBuilder builder = new QueryBuilder(API_PORT); builder.map(query, method_name, items); return builder.execute(); }
[ "public", "JSONArray", "map", "(", "String", "query", ",", "String", "method_name", ",", "Object", "...", "items", ")", "throws", "Exception", "{", "QueryBuilder", "builder", "=", "new", "QueryBuilder", "(", "API_PORT", ")", ";", "builder", ".", "map", "(", ...
Used to call a method with a list of arguments @param query @param method_name @param items @return @throws Exception
[ "Used", "to", "call", "a", "method", "with", "a", "list", "of", "arguments" ]
train
https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Client.java#L130-L134
intendia-oss/rxjava-gwt
src/main/modified/io/reactivex/super/io/reactivex/Observable.java
Observable.takeUntil
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> takeUntil(Predicate<? super T> stopPredicate) { """ Returns an Observable that emits items emitted by the source Observable, checks the specified predicate for each item, and then completes when the condition is satisfie...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> takeUntil(Predicate<? super T> stopPredicate) { ObjectHelper.requireNonNull(stopPredicate, "predicate is null"); return RxJavaPlugins.onAssembly(new ObservableTakeUntilPredicate<T>(this, stopPredicate)); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Observable", "<", "T", ">", "takeUntil", "(", "Predicate", "<", "?", "super", "T", ">", "stopPredicate", ")", "{", "ObjectHelper", ".", "requireNon...
Returns an Observable that emits items emitted by the source Observable, checks the specified predicate for each item, and then completes when the condition is satisfied. <p> <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeUntil.p.png" alt=""> <p> The difference b...
[ "Returns", "an", "Observable", "that", "emits", "items", "emitted", "by", "the", "source", "Observable", "checks", "the", "specified", "predicate", "for", "each", "item", "and", "then", "completes", "when", "the", "condition", "is", "satisfied", ".", "<p", ">"...
train
https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Observable.java#L12945-L12950
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/utils/MiscUtil.java
MiscUtil.appendTo
public static void appendTo(Formatter formatter, int width, int precision, boolean leftJustified, String out) { """ Can be used to append a String to a formatter. @param formatter The {@link java.util.Formatter Formatter} @param width Minimum width to meet, filled with space if needed @param precision Maxi...
java
public static void appendTo(Formatter formatter, int width, int precision, boolean leftJustified, String out) { try { Appendable appendable = formatter.out(); if (precision > -1 && out.length() > precision) { appendable.append(Helpers.truncate(out,...
[ "public", "static", "void", "appendTo", "(", "Formatter", "formatter", ",", "int", "width", ",", "int", "precision", ",", "boolean", "leftJustified", ",", "String", "out", ")", "{", "try", "{", "Appendable", "appendable", "=", "formatter", ".", "out", "(", ...
Can be used to append a String to a formatter. @param formatter The {@link java.util.Formatter Formatter} @param width Minimum width to meet, filled with space if needed @param precision Maximum amount of characters to append @param leftJustified Whether or not to left-justify the value @param out The String to append
[ "Can", "be", "used", "to", "append", "a", "String", "to", "a", "formatter", "." ]
train
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/MiscUtil.java#L267-L287
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.createDocumentsWithResults
@Override public List<OCRResult> createDocumentsWithResults(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException { """ Creates documents with OCR results for given renderers at specified page iterator level. @param filenames arr...
java
@Override public List<OCRResult> createDocumentsWithResults(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException { if (filenames.length != outputbases.length) { throw new RuntimeException("The two arrays must match in...
[ "@", "Override", "public", "List", "<", "OCRResult", ">", "createDocumentsWithResults", "(", "String", "[", "]", "filenames", ",", "String", "[", "]", "outputbases", ",", "List", "<", "ITesseract", ".", "RenderedFormat", ">", "formats", ",", "int", "pageIterat...
Creates documents with OCR results for given renderers at specified page iterator level. @param filenames array of input files @param outputbases array of output filenames without extension @param formats types of renderer @return OCR results @throws TesseractException
[ "Creates", "documents", "with", "OCR", "results", "for", "given", "renderers", "at", "specified", "page", "iterator", "level", "." ]
train
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L747-L787
j256/simplecsv
src/main/java/com/j256/simplecsv/processor/CsvProcessor.java
CsvProcessor.writeHeader
public void writeHeader(BufferedWriter bufferedWriter, boolean appendLineTermination) throws IOException { """ Write the header line to the writer. @param bufferedWriter Where to write our header information. @param appendLineTermination Set to true to add the newline to the end of the line. @throws IOExcep...
java
public void writeHeader(BufferedWriter bufferedWriter, boolean appendLineTermination) throws IOException { checkEntityConfig(); bufferedWriter.write(buildHeaderLine(appendLineTermination)); }
[ "public", "void", "writeHeader", "(", "BufferedWriter", "bufferedWriter", ",", "boolean", "appendLineTermination", ")", "throws", "IOException", "{", "checkEntityConfig", "(", ")", ";", "bufferedWriter", ".", "write", "(", "buildHeaderLine", "(", "appendLineTermination"...
Write the header line to the writer. @param bufferedWriter Where to write our header information. @param appendLineTermination Set to true to add the newline to the end of the line. @throws IOException If there are any IO exceptions thrown when writing.
[ "Write", "the", "header", "line", "to", "the", "writer", "." ]
train
https://github.com/j256/simplecsv/blob/964fe53073c43e2a311341e3f8fd2c94372f60cb/src/main/java/com/j256/simplecsv/processor/CsvProcessor.java#L451-L454
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java
MLEDependencyGrammar.readData
@Override public void readData(BufferedReader in) throws IOException { """ Populates data in this DependencyGrammar from the character stream given by the Reader r. """ final String LEFT = "left"; int lineNum = 1; // all lines have one rule per line boolean doingStop = false; for...
java
@Override public void readData(BufferedReader in) throws IOException { final String LEFT = "left"; int lineNum = 1; // all lines have one rule per line boolean doingStop = false; for (String line = in.readLine(); line != null && line.length() > 0; line = in.readLine()) { try { ...
[ "@", "Override", "public", "void", "readData", "(", "BufferedReader", "in", ")", "throws", "IOException", "{", "final", "String", "LEFT", "=", "\"left\"", ";", "int", "lineNum", "=", "1", ";", "// all lines have one rule per line\r", "boolean", "doingStop", "=", ...
Populates data in this DependencyGrammar from the character stream given by the Reader r.
[ "Populates", "data", "in", "this", "DependencyGrammar", "from", "the", "character", "stream", "given", "by", "the", "Reader", "r", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java#L804-L840
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Put.java
Put.withExpressionAttributeValues
public Put withExpressionAttributeValues(java.util.Map<String, AttributeValue> expressionAttributeValues) { """ <p> One or more values that can be substituted in an expression. </p> @param expressionAttributeValues One or more values that can be substituted in an expression. @return Returns a reference to t...
java
public Put withExpressionAttributeValues(java.util.Map<String, AttributeValue> expressionAttributeValues) { setExpressionAttributeValues(expressionAttributeValues); return this; }
[ "public", "Put", "withExpressionAttributeValues", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "AttributeValue", ">", "expressionAttributeValues", ")", "{", "setExpressionAttributeValues", "(", "expressionAttributeValues", ")", ";", "return", "this", ";",...
<p> One or more values that can be substituted in an expression. </p> @param expressionAttributeValues One or more values that can be substituted in an expression. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "One", "or", "more", "values", "that", "can", "be", "substituted", "in", "an", "expression", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Put.java#L326-L329
knowm/XChange
xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v1/service/BitfinexTradeService.java
BitfinexTradeService.filterOrders
@SuppressWarnings("unchecked") private OpenOrders filterOrders(OpenOrders rawOpenOrders, OpenOrdersParams params) { """ Bitfinex API does not provide filtering option. So we should filter orders ourselves """ if (params == null) { return rawOpenOrders; } List<LimitOrder> openOrdersList = r...
java
@SuppressWarnings("unchecked") private OpenOrders filterOrders(OpenOrders rawOpenOrders, OpenOrdersParams params) { if (params == null) { return rawOpenOrders; } List<LimitOrder> openOrdersList = rawOpenOrders.getOpenOrders(); openOrdersList.removeIf(openOrder -> !params.accept(openOrder)); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "OpenOrders", "filterOrders", "(", "OpenOrders", "rawOpenOrders", ",", "OpenOrdersParams", "params", ")", "{", "if", "(", "params", "==", "null", ")", "{", "return", "rawOpenOrders", ";", "}", "List"...
Bitfinex API does not provide filtering option. So we should filter orders ourselves
[ "Bitfinex", "API", "does", "not", "provide", "filtering", "option", ".", "So", "we", "should", "filter", "orders", "ourselves" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v1/service/BitfinexTradeService.java#L70-L80
flow/caustic
api/src/main/java/com/flowpowered/caustic/api/data/VertexData.java
VertexData.addAttribute
public void addAttribute(int index, VertexAttribute attribute) { """ Adds an attribute. @param index The attribute index @param attribute The attribute to add """ attributes.put(index, attribute); nameToIndex.put(attribute.getName(), index); }
java
public void addAttribute(int index, VertexAttribute attribute) { attributes.put(index, attribute); nameToIndex.put(attribute.getName(), index); }
[ "public", "void", "addAttribute", "(", "int", "index", ",", "VertexAttribute", "attribute", ")", "{", "attributes", ".", "put", "(", "index", ",", "attribute", ")", ";", "nameToIndex", ".", "put", "(", "attribute", ".", "getName", "(", ")", ",", "index", ...
Adds an attribute. @param index The attribute index @param attribute The attribute to add
[ "Adds", "an", "attribute", "." ]
train
https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/data/VertexData.java#L92-L95
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/Mapper.java
Mapper.valueNotNull
@SuppressWarnings("unchecked") public Mapper<K, V> valueNotNull() { """ Add a constraint that verifies that the value is null. If is null, a {@link NullPointerException} is thrown. @return """ return addConstraint((MapConstraint<K, V>) ValueNotNullRestraint.INSTANCE); }
java
@SuppressWarnings("unchecked") public Mapper<K, V> valueNotNull() { return addConstraint((MapConstraint<K, V>) ValueNotNullRestraint.INSTANCE); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Mapper", "<", "K", ",", "V", ">", "valueNotNull", "(", ")", "{", "return", "addConstraint", "(", "(", "MapConstraint", "<", "K", ",", "V", ">", ")", "ValueNotNullRestraint", ".", "INSTANCE", ")...
Add a constraint that verifies that the value is null. If is null, a {@link NullPointerException} is thrown. @return
[ "Add", "a", "constraint", "that", "verifies", "that", "the", "value", "is", "null", ".", "If", "is", "null", "a", "{", "@link", "NullPointerException", "}", "is", "thrown", "." ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Mapper.java#L135-L138
flow/caustic
api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java
MeshGenerator.generateTangents
public static TFloatList generateTangents(TFloatList positions, TFloatList normals, TFloatList textures, TIntList indices) { """ Generate the tangents for the positions, normals and texture coords, according to the indices. This assumes that the positions and normals have 3 components, in the x, y, z order, and th...
java
public static TFloatList generateTangents(TFloatList positions, TFloatList normals, TFloatList textures, TIntList indices) { final TFloatList tangents = new TFloatArrayList(); generateTangents(positions, normals, textures, indices, tangents); return tangents; }
[ "public", "static", "TFloatList", "generateTangents", "(", "TFloatList", "positions", ",", "TFloatList", "normals", ",", "TFloatList", "textures", ",", "TIntList", "indices", ")", "{", "final", "TFloatList", "tangents", "=", "new", "TFloatArrayList", "(", ")", ";"...
Generate the tangents for the positions, normals and texture coords, according to the indices. This assumes that the positions and normals have 3 components, in the x, y, z order, and that the texture coords have 2, in the u, v (or s, t) order. The tangents are stored as a 4 component vector, in the x, y, z, w order. T...
[ "Generate", "the", "tangents", "for", "the", "positions", "normals", "and", "texture", "coords", "according", "to", "the", "indices", ".", "This", "assumes", "that", "the", "positions", "and", "normals", "have", "3", "components", "in", "the", "x", "y", "z",...
train
https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java#L234-L238
asterisk-java/asterisk-java
src/main/java/org/asteriskjava/live/internal/QueueManager.java
QueueManager.handleQueueMemberEvent
private void handleQueueMemberEvent(QueueMemberEvent event) { """ Called during initialization to populate the members of the queues. @param event the QueueMemberEvent received """ final AsteriskQueueImpl queue = getInternalQueueByName(event.getQueue()); if (queue == null) { ...
java
private void handleQueueMemberEvent(QueueMemberEvent event) { final AsteriskQueueImpl queue = getInternalQueueByName(event.getQueue()); if (queue == null) { logger.error("Ignored QueueEntryEvent for unknown queue " + event.getQueue()); return; } Aster...
[ "private", "void", "handleQueueMemberEvent", "(", "QueueMemberEvent", "event", ")", "{", "final", "AsteriskQueueImpl", "queue", "=", "getInternalQueueByName", "(", "event", ".", "getQueue", "(", ")", ")", ";", "if", "(", "queue", "==", "null", ")", "{", "logge...
Called during initialization to populate the members of the queues. @param event the QueueMemberEvent received
[ "Called", "during", "initialization", "to", "populate", "the", "members", "of", "the", "queues", "." ]
train
https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/live/internal/QueueManager.java#L300-L323
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/wan/impl/DistributedServiceWanEventCounters.java
DistributedServiceWanEventCounters.incrementSync
public void incrementSync(String distributedObjectName, int count) { """ Increment the number of sync events for the {@code distributedObjectName} by {@code count}. """ getOrPutIfAbsent(eventCounterMap, distributedObjectName, EVENT_COUNTER_CONSTRUCTOR_FN) .incrementSyncCount(count); ...
java
public void incrementSync(String distributedObjectName, int count) { getOrPutIfAbsent(eventCounterMap, distributedObjectName, EVENT_COUNTER_CONSTRUCTOR_FN) .incrementSyncCount(count); }
[ "public", "void", "incrementSync", "(", "String", "distributedObjectName", ",", "int", "count", ")", "{", "getOrPutIfAbsent", "(", "eventCounterMap", ",", "distributedObjectName", ",", "EVENT_COUNTER_CONSTRUCTOR_FN", ")", ".", "incrementSyncCount", "(", "count", ")", ...
Increment the number of sync events for the {@code distributedObjectName} by {@code count}.
[ "Increment", "the", "number", "of", "sync", "events", "for", "the", "{" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/wan/impl/DistributedServiceWanEventCounters.java#L54-L57
netheosgithub/pcs_api
java/src/main/java/net/netheos/pcsapi/request/CResponse.java
CResponse.asString
public String asString() { """ Extracts string from input stream @return Get the response as a String """ try { return EntityUtils.toString( entity, PcsUtils.UTF8.name() ); } catch ( IOException e ) { throw new CStorageException( "Can't get string from HTTP entity", e...
java
public String asString() { try { return EntityUtils.toString( entity, PcsUtils.UTF8.name() ); } catch ( IOException e ) { throw new CStorageException( "Can't get string from HTTP entity", e ); } }
[ "public", "String", "asString", "(", ")", "{", "try", "{", "return", "EntityUtils", ".", "toString", "(", "entity", ",", "PcsUtils", ".", "UTF8", ".", "name", "(", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "CStor...
Extracts string from input stream @return Get the response as a String
[ "Extracts", "string", "from", "input", "stream" ]
train
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/request/CResponse.java#L112-L119
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/classfile/Modifiers.java
Modifiers.setFinal
public static int setFinal(int modifier, boolean b) { """ When set final, the modifier is cleared from being an interface or abstract. """ if (b) { return (modifier | FINAL) & (~INTERFACE & ~ABSTRACT); } else { return modifier & ~FINAL; } }
java
public static int setFinal(int modifier, boolean b) { if (b) { return (modifier | FINAL) & (~INTERFACE & ~ABSTRACT); } else { return modifier & ~FINAL; } }
[ "public", "static", "int", "setFinal", "(", "int", "modifier", ",", "boolean", "b", ")", "{", "if", "(", "b", ")", "{", "return", "(", "modifier", "|", "FINAL", ")", "&", "(", "~", "INTERFACE", "&", "~", "ABSTRACT", ")", ";", "}", "else", "{", "r...
When set final, the modifier is cleared from being an interface or abstract.
[ "When", "set", "final", "the", "modifier", "is", "cleared", "from", "being", "an", "interface", "or", "abstract", "." ]
train
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/Modifiers.java#L82-L89
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java
ScriptModuleLoader.notifyArchiveRejected
protected void notifyArchiveRejected(ScriptArchive scriptArchive, ArchiveRejectedReason reason, @Nullable Throwable cause) { """ Notify listeners that a script archive was rejected by this loader @param scriptArchive archive that was rejected @param reason reason it was rejected @param cause underlying exceptio...
java
protected void notifyArchiveRejected(ScriptArchive scriptArchive, ArchiveRejectedReason reason, @Nullable Throwable cause) { for (ScriptModuleListener listener : listeners) { listener.archiveRejected(scriptArchive, reason, cause); } }
[ "protected", "void", "notifyArchiveRejected", "(", "ScriptArchive", "scriptArchive", ",", "ArchiveRejectedReason", "reason", ",", "@", "Nullable", "Throwable", "cause", ")", "{", "for", "(", "ScriptModuleListener", "listener", ":", "listeners", ")", "{", "listener", ...
Notify listeners that a script archive was rejected by this loader @param scriptArchive archive that was rejected @param reason reason it was rejected @param cause underlying exception which triggered the rejection
[ "Notify", "listeners", "that", "a", "script", "archive", "was", "rejected", "by", "this", "loader" ]
train
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java#L501-L505
matthewhorridge/owlexplanation
src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java
BlackBoxExplanationGenerator.getOccurrences
private static <E> int getOccurrences(OWLAxiom ax, Set<Explanation<E>> axiomSets) { """ Given an checker and a set of explanations this method determines how many explanations contain the checker. @param ax The checker that will be counted. @param axiomSets The explanations to count from @return the n...
java
private static <E> int getOccurrences(OWLAxiom ax, Set<Explanation<E>> axiomSets) { int count = 0; for (Explanation<E> explanation : axiomSets) { if (explanation.getAxioms().contains(ax)) { count++; } } return count; }
[ "private", "static", "<", "E", ">", "int", "getOccurrences", "(", "OWLAxiom", "ax", ",", "Set", "<", "Explanation", "<", "E", ">", ">", "axiomSets", ")", "{", "int", "count", "=", "0", ";", "for", "(", "Explanation", "<", "E", ">", "explanation", ":"...
Given an checker and a set of explanations this method determines how many explanations contain the checker. @param ax The checker that will be counted. @param axiomSets The explanations to count from @return the number of occurrences of the specified checker in the explanation
[ "Given", "an", "checker", "and", "a", "set", "of", "explanations", "this", "method", "determines", "how", "many", "explanations", "contain", "the", "checker", "." ]
train
https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java#L302-L310
jpush/jmessage-api-java-client
src/main/java/cn/jmessage/api/JMessageClient.java
JMessageClient.addChatRoomMember
public ResponseWrapper addChatRoomMember(long roomId, String... members) throws APIConnectionException, APIRequestException { """ Add members to chat room @param roomId chat room id @param members username array @return No content @throws APIConnectionException connect exception @throws APIRequ...
java
public ResponseWrapper addChatRoomMember(long roomId, String... members) throws APIConnectionException, APIRequestException { return _chatRoomClient.addChatRoomMember(roomId, members); }
[ "public", "ResponseWrapper", "addChatRoomMember", "(", "long", "roomId", ",", "String", "...", "members", ")", "throws", "APIConnectionException", ",", "APIRequestException", "{", "return", "_chatRoomClient", ".", "addChatRoomMember", "(", "roomId", ",", "members", ")...
Add members to chat room @param roomId chat room id @param members username array @return No content @throws APIConnectionException connect exception @throws APIRequestException request exception
[ "Add", "members", "to", "chat", "room" ]
train
https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L890-L893
spring-projects/spring-retry
src/main/java/org/springframework/retry/support/RetryTemplate.java
RetryTemplate.open
protected RetryContext open(RetryPolicy retryPolicy, RetryState state) { """ Delegate to the {@link RetryPolicy} having checked in the cache for an existing value if the state is not null. @param state a {@link RetryState} @param retryPolicy a {@link RetryPolicy} to delegate the context creation @return a retr...
java
protected RetryContext open(RetryPolicy retryPolicy, RetryState state) { if (state == null) { return doOpenInternal(retryPolicy); } Object key = state.getKey(); if (state.isForceRefresh()) { return doOpenInternal(retryPolicy, state); } // If there is no cache hit we can avoid the possible expense o...
[ "protected", "RetryContext", "open", "(", "RetryPolicy", "retryPolicy", ",", "RetryState", "state", ")", "{", "if", "(", "state", "==", "null", ")", "{", "return", "doOpenInternal", "(", "retryPolicy", ")", ";", "}", "Object", "key", "=", "state", ".", "ge...
Delegate to the {@link RetryPolicy} having checked in the cache for an existing value if the state is not null. @param state a {@link RetryState} @param retryPolicy a {@link RetryPolicy} to delegate the context creation @return a retry context, either a new one or the one used last time the same state was encountered
[ "Delegate", "to", "the", "{" ]
train
https://github.com/spring-projects/spring-retry/blob/e2b0555f96594c2321990d0deeac45fc44d4f123/src/main/java/org/springframework/retry/support/RetryTemplate.java#L455-L492
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java
LogUtils.getLogger
public static Logger getLogger(Class<?> cls) { """ Get a Logger with the associated default resource bundle for the class. @param cls the Class to contain the Logger @return an appropriate Logger """ //Liberty Change for CXF Begin return createLogger(cls, null, cls.getName() + cls.getClassL...
java
public static Logger getLogger(Class<?> cls) { //Liberty Change for CXF Begin return createLogger(cls, null, cls.getName() + cls.getClassLoader()); //Liberty Change for CXF End }
[ "public", "static", "Logger", "getLogger", "(", "Class", "<", "?", ">", "cls", ")", "{", "//Liberty Change for CXF Begin", "return", "createLogger", "(", "cls", ",", "null", ",", "cls", ".", "getName", "(", ")", "+", "cls", ".", "getClassLoader", "(", ")",...
Get a Logger with the associated default resource bundle for the class. @param cls the Class to contain the Logger @return an appropriate Logger
[ "Get", "a", "Logger", "with", "the", "associated", "default", "resource", "bundle", "for", "the", "class", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java#L162-L166
MenoData/Time4J
base/src/main/java/net/time4j/clock/DaytimeClock.java
DaytimeClock.getDaytimeReply
private static String getDaytimeReply( String address, int port, int timeout ) throws IOException { """ Original-Antwort eines älteren Uhrzeit-Servers holen (RFC 867) """ IOException ioe = null; Socket socket = null; StringBuilder sb = null; try { ...
java
private static String getDaytimeReply( String address, int port, int timeout ) throws IOException { IOException ioe = null; Socket socket = null; StringBuilder sb = null; try { socket = new Socket(address, port); socket.setSoTimeout(...
[ "private", "static", "String", "getDaytimeReply", "(", "String", "address", ",", "int", "port", ",", "int", "timeout", ")", "throws", "IOException", "{", "IOException", "ioe", "=", "null", ";", "Socket", "socket", "=", "null", ";", "StringBuilder", "sb", "="...
Original-Antwort eines älteren Uhrzeit-Servers holen (RFC 867)
[ "Original", "-", "Antwort", "eines", "älteren", "Uhrzeit", "-", "Servers", "holen", "(", "RFC", "867", ")" ]
train
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/clock/DaytimeClock.java#L212-L269
abel533/Mapper
core/src/main/java/tk/mybatis/mapper/mapperhelper/SqlHelper.java
SqlHelper.notAllNullParameterCheck
public static String notAllNullParameterCheck(String parameterName, Set<EntityColumn> columnSet) { """ 不是所有参数都是 null 的检查 @param parameterName 参数名 @param columnSet 需要检查的列 @return """ StringBuilder sql = new StringBuilder(); sql.append("<bind name=\"notAllNullParameterCheck\" value=\"@tk...
java
public static String notAllNullParameterCheck(String parameterName, Set<EntityColumn> columnSet) { StringBuilder sql = new StringBuilder(); sql.append("<bind name=\"notAllNullParameterCheck\" value=\"@tk.mybatis.mapper.util.OGNL@notAllNullParameterCheck("); sql.append(parameterName).append(", '"...
[ "public", "static", "String", "notAllNullParameterCheck", "(", "String", "parameterName", ",", "Set", "<", "EntityColumn", ">", "columnSet", ")", "{", "StringBuilder", "sql", "=", "new", "StringBuilder", "(", ")", ";", "sql", ".", "append", "(", "\"<bind name=\\...
不是所有参数都是 null 的检查 @param parameterName 参数名 @param columnSet 需要检查的列 @return
[ "不是所有参数都是", "null", "的检查" ]
train
https://github.com/abel533/Mapper/blob/45c3d716583cba3680e03f1f6790fab5e1f4f668/core/src/main/java/tk/mybatis/mapper/mapperhelper/SqlHelper.java#L562-L576
aol/cyclops
cyclops/src/main/java/com/oath/cyclops/util/box/MutableShort.java
MutableShort.fromExternal
public static MutableShort fromExternal(final Supplier<Short> s, final Consumer<Short> c) { """ Construct a MutableShort that gets and sets an external value using the provided Supplier and Consumer e.g. <pre> {@code MutableShort mutable = MutableShort.fromExternal(()->!this.value,val->!this.value); } </pr...
java
public static MutableShort fromExternal(final Supplier<Short> s, final Consumer<Short> c) { return new MutableShort() { @Override public short getAsShort() { return s.get(); } @Override public Short get() { return getAs...
[ "public", "static", "MutableShort", "fromExternal", "(", "final", "Supplier", "<", "Short", ">", "s", ",", "final", "Consumer", "<", "Short", ">", "c", ")", "{", "return", "new", "MutableShort", "(", ")", "{", "@", "Override", "public", "short", "getAsShor...
Construct a MutableShort that gets and sets an external value using the provided Supplier and Consumer e.g. <pre> {@code MutableShort mutable = MutableShort.fromExternal(()->!this.value,val->!this.value); } </pre> @param s Supplier of an external value @param c Consumer that sets an external value @return MutableSho...
[ "Construct", "a", "MutableShort", "that", "gets", "and", "sets", "an", "external", "value", "using", "the", "provided", "Supplier", "and", "Consumer" ]
train
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/com/oath/cyclops/util/box/MutableShort.java#L81-L99
aspectran/aspectran
web/src/main/java/com/aspectran/web/service/DefaultServletHttpRequestHandler.java
DefaultServletHttpRequestHandler.handle
public boolean handle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { """ Process the actual dispatching. @param request current HTTP servlet request @param response current HTTP servlet response @return true, if successful @throws ServletException...
java
public boolean handle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (defaultServletName != null) { RequestDispatcher rd = servletContext.getNamedDispatcher(defaultServletName); if (rd == null) { throw new I...
[ "public", "boolean", "handle", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "if", "(", "defaultServletName", "!=", "null", ")", "{", "RequestDispatcher", "rd", "=", "servlet...
Process the actual dispatching. @param request current HTTP servlet request @param response current HTTP servlet response @return true, if successful @throws ServletException the servlet exception @throws IOException if an input or output error occurs while the servlet is handling the HTTP request
[ "Process", "the", "actual", "dispatching", "." ]
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/service/DefaultServletHttpRequestHandler.java#L116-L129
comapi/comapi-chat-sdk-android
COMAPI/chat/src/main/java/com/comapi/chat/PersistenceController.java
PersistenceController.deleteConversations
public Observable<Boolean> deleteConversations(List<ChatConversationBase> conversationsToDelete) { """ Delete conversations from the store. @param conversationsToDelete List of conversations to delete. @return Observable emitting result. """ return asObservable(new Executor<Boolean>() { ...
java
public Observable<Boolean> deleteConversations(List<ChatConversationBase> conversationsToDelete) { return asObservable(new Executor<Boolean>() { @Override void execute(ChatStore store, Emitter<Boolean> emitter) { store.beginTransaction(); boolean isSuccess...
[ "public", "Observable", "<", "Boolean", ">", "deleteConversations", "(", "List", "<", "ChatConversationBase", ">", "conversationsToDelete", ")", "{", "return", "asObservable", "(", "new", "Executor", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "void", ...
Delete conversations from the store. @param conversationsToDelete List of conversations to delete. @return Observable emitting result.
[ "Delete", "conversations", "from", "the", "store", "." ]
train
https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/PersistenceController.java#L575-L589
ngageoint/geopackage-android-map
geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java
GoogleMapShapeConverter.toPolyhedralSurface
public PolyhedralSurface toPolyhedralSurface( List<com.google.android.gms.maps.model.Polygon> polygonList, boolean hasZ, boolean hasM) { """ Convert a list of {@link Polygon} to a {@link PolyhedralSurface} @param polygonList polygon list @param hasZ has z flag @param hasM ...
java
public PolyhedralSurface toPolyhedralSurface( List<com.google.android.gms.maps.model.Polygon> polygonList, boolean hasZ, boolean hasM) { PolyhedralSurface polyhedralSurface = new PolyhedralSurface(hasZ, hasM); for (com.google.android.gms.maps.model.Polygon mapPolygon : polygonL...
[ "public", "PolyhedralSurface", "toPolyhedralSurface", "(", "List", "<", "com", ".", "google", ".", "android", ".", "gms", ".", "maps", ".", "model", ".", "Polygon", ">", "polygonList", ",", "boolean", "hasZ", ",", "boolean", "hasM", ")", "{", "PolyhedralSurf...
Convert a list of {@link Polygon} to a {@link PolyhedralSurface} @param polygonList polygon list @param hasZ has z flag @param hasM has m flag @return polyhedral surface
[ "Convert", "a", "list", "of", "{", "@link", "Polygon", "}", "to", "a", "{", "@link", "PolyhedralSurface", "}" ]
train
https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1220-L1232
rhuss/jolokia
agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/AbstractBaseCommand.java
AbstractBaseCommand.loadAgent
protected void loadAgent(Object pVm, OptionsAndArgs pOpts,String ... pAdditionalOpts) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { """ Execute {@link com.sun.tools.attach.VirtualMachine#loadAgent(String, String)} via reflection @param pVm the VirtualMachine object, typeless ...
java
protected void loadAgent(Object pVm, OptionsAndArgs pOpts,String ... pAdditionalOpts) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Class clazz = pVm.getClass(); Method method = clazz.getMethod("loadAgent",String.class, String.class); String args = pOpts.toAge...
[ "protected", "void", "loadAgent", "(", "Object", "pVm", ",", "OptionsAndArgs", "pOpts", ",", "String", "...", "pAdditionalOpts", ")", "throws", "NoSuchMethodException", ",", "InvocationTargetException", ",", "IllegalAccessException", "{", "Class", "clazz", "=", "pVm",...
Execute {@link com.sun.tools.attach.VirtualMachine#loadAgent(String, String)} via reflection @param pVm the VirtualMachine object, typeless @param pOpts options from where to extract the agent path and options @param pAdditionalOpts optional additional options to be appended to the agent options. Must be a CSV string.
[ "Execute", "{", "@link", "com", ".", "sun", ".", "tools", ".", "attach", ".", "VirtualMachine#loadAgent", "(", "String", "String", ")", "}", "via", "reflection" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/AbstractBaseCommand.java#L65-L73
threerings/nenya
core/src/main/java/com/threerings/media/image/ImageUtil.java
ImageUtil.recolorImage
public static BufferedImage recolorImage (BufferedImage image, Colorization[] zations) { """ Recolors the supplied image using the supplied colorizations. """ ColorModel cm = image.getColorModel(); if (!(cm instanceof IndexColorModel)) { throw new RuntimeException(Logger.format( ...
java
public static BufferedImage recolorImage (BufferedImage image, Colorization[] zations) { ColorModel cm = image.getColorModel(); if (!(cm instanceof IndexColorModel)) { throw new RuntimeException(Logger.format( "Unable to recolor images with non-index color model", "cm", c...
[ "public", "static", "BufferedImage", "recolorImage", "(", "BufferedImage", "image", ",", "Colorization", "[", "]", "zations", ")", "{", "ColorModel", "cm", "=", "image", ".", "getColorModel", "(", ")", ";", "if", "(", "!", "(", "cm", "instanceof", "IndexColo...
Recolors the supplied image using the supplied colorizations.
[ "Recolors", "the", "supplied", "image", "using", "the", "supplied", "colorizations", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L114-L165
h2oai/h2o-3
h2o-core/src/main/java/water/util/ReflectionUtils.java
ReflectionUtils.findMethodParameterClass
public static Class findMethodParameterClass(Method method, int parm) { """ Reflection helper which returns the actual class for a method's parameter. """ Class[] clzes = method.getParameterTypes(); if (clzes.length <= parm) throw H2O.fail("Asked for the class of parameter number: " + parm + " o...
java
public static Class findMethodParameterClass(Method method, int parm) { Class[] clzes = method.getParameterTypes(); if (clzes.length <= parm) throw H2O.fail("Asked for the class of parameter number: " + parm + " of method: " + method + ", which only has: " + clzes.length + " parameters."); return cl...
[ "public", "static", "Class", "findMethodParameterClass", "(", "Method", "method", ",", "int", "parm", ")", "{", "Class", "[", "]", "clzes", "=", "method", ".", "getParameterTypes", "(", ")", ";", "if", "(", "clzes", ".", "length", "<=", "parm", ")", "thr...
Reflection helper which returns the actual class for a method's parameter.
[ "Reflection", "helper", "which", "returns", "the", "actual", "class", "for", "a", "method", "s", "parameter", "." ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/ReflectionUtils.java#L46-L53
raphw/byte-buddy
byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java
ElementMatchers.takesGenericArgument
public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArgument(int index, ElementMatcher<? super TypeDescription.Generic> matcher) { """ Matches {@link MethodDescription}s that define a given generic type as a parameter at the given index. @param index The index of the parameter. ...
java
public static <T extends MethodDescription> ElementMatcher.Junction<T> takesGenericArgument(int index, ElementMatcher<? super TypeDescription.Generic> matcher) { return takesGenericArguments(new CollectionElementMatcher<TypeDescription.Generic>(index, matcher)); }
[ "public", "static", "<", "T", "extends", "MethodDescription", ">", "ElementMatcher", ".", "Junction", "<", "T", ">", "takesGenericArgument", "(", "int", "index", ",", "ElementMatcher", "<", "?", "super", "TypeDescription", ".", "Generic", ">", "matcher", ")", ...
Matches {@link MethodDescription}s that define a given generic type as a parameter at the given index. @param index The index of the parameter. @param matcher A matcher for the generic type the matched method is expected to define as a parameter type. @param <T> The type of the matched object. @return An element...
[ "Matches", "{", "@link", "MethodDescription", "}", "s", "that", "define", "a", "given", "generic", "type", "as", "a", "parameter", "at", "the", "given", "index", "." ]
train
https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java#L1182-L1184
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.implies
public static Boolean implies(Boolean left, Boolean right) { """ Logical implication of two boolean operators @param left left operator @param right right operator @return result of logical implication @since 1.8.3 """ return !left || Boolean.TRUE.equals(right); }
java
public static Boolean implies(Boolean left, Boolean right) { return !left || Boolean.TRUE.equals(right); }
[ "public", "static", "Boolean", "implies", "(", "Boolean", "left", ",", "Boolean", "right", ")", "{", "return", "!", "left", "||", "Boolean", ".", "TRUE", ".", "equals", "(", "right", ")", ";", "}" ]
Logical implication of two boolean operators @param left left operator @param right right operator @return result of logical implication @since 1.8.3
[ "Logical", "implication", "of", "two", "boolean", "operators" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16621-L16623
selendroid/selendroid
selendroid-standalone/src/main/java/io/selendroid/standalone/server/model/SelendroidStandaloneDriver.java
SelendroidStandaloneDriver.augmentApp
private AndroidApp augmentApp(AndroidApp app, SelendroidCapabilities desiredCapabilities) { """ Augment the application with parameters from {@code desiredCapabilities} @param app to be augmented @param desiredCapabilities configuration requested for this session """ if (desiredCapabili...
java
private AndroidApp augmentApp(AndroidApp app, SelendroidCapabilities desiredCapabilities) { if (desiredCapabilities.getLaunchActivity() != null) { app.setMainActivity(desiredCapabilities.getLaunchActivity()); } return app; }
[ "private", "AndroidApp", "augmentApp", "(", "AndroidApp", "app", ",", "SelendroidCapabilities", "desiredCapabilities", ")", "{", "if", "(", "desiredCapabilities", ".", "getLaunchActivity", "(", ")", "!=", "null", ")", "{", "app", ".", "setMainActivity", "(", "desi...
Augment the application with parameters from {@code desiredCapabilities} @param app to be augmented @param desiredCapabilities configuration requested for this session
[ "Augment", "the", "application", "with", "parameters", "from", "{", "@code", "desiredCapabilities", "}" ]
train
https://github.com/selendroid/selendroid/blob/a32c1a96c973b80c14a588b1075f084201f7fe94/selendroid-standalone/src/main/java/io/selendroid/standalone/server/model/SelendroidStandaloneDriver.java#L503-L508
ocpsoft/common
api/src/main/java/org/ocpsoft/common/util/Strings.java
Strings.areEqual
public static boolean areEqual(final String left, final String right) { """ Return true if the given {@link String} instances are equal, or if both {@link String} instances are null. """ if ((left == null) && (right == null)) { return true; } else if ((left == null) || (right =...
java
public static boolean areEqual(final String left, final String right) { if ((left == null) && (right == null)) { return true; } else if ((left == null) || (right == null)) { return false; } return left.equals(right); }
[ "public", "static", "boolean", "areEqual", "(", "final", "String", "left", ",", "final", "String", "right", ")", "{", "if", "(", "(", "left", "==", "null", ")", "&&", "(", "right", "==", "null", ")", ")", "{", "return", "true", ";", "}", "else", "i...
Return true if the given {@link String} instances are equal, or if both {@link String} instances are null.
[ "Return", "true", "if", "the", "given", "{" ]
train
https://github.com/ocpsoft/common/blob/ae926dfd6f9af278786520faee7ee3c2f1f52ca1/api/src/main/java/org/ocpsoft/common/util/Strings.java#L34-L45
google/error-prone
core/src/main/java/com/google/errorprone/bugpatterns/JUnit3FloatingPointComparisonWithoutDelta.java
JUnit3FloatingPointComparisonWithoutDelta.unboxedTypeOrType
private Type unboxedTypeOrType(VisitorState state, Type type) { """ Gets the unboxed type, or the original type if it is not unboxable. """ Types types = state.getTypes(); return types.unboxedTypeOrType(type); }
java
private Type unboxedTypeOrType(VisitorState state, Type type) { Types types = state.getTypes(); return types.unboxedTypeOrType(type); }
[ "private", "Type", "unboxedTypeOrType", "(", "VisitorState", "state", ",", "Type", "type", ")", "{", "Types", "types", "=", "state", ".", "getTypes", "(", ")", ";", "return", "types", ".", "unboxedTypeOrType", "(", "type", ")", ";", "}" ]
Gets the unboxed type, or the original type if it is not unboxable.
[ "Gets", "the", "unboxed", "type", "or", "the", "original", "type", "if", "it", "is", "not", "unboxable", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/JUnit3FloatingPointComparisonWithoutDelta.java#L141-L144
apache/spark
launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java
CommandBuilderUtils.findJarsDir
static String findJarsDir(String sparkHome, String scalaVersion, boolean failIfNotFound) { """ Find the location of the Spark jars dir, depending on whether we're looking at a build or a distribution directory. """ // TODO: change to the correct directory once the assembly build is changed. File libdi...
java
static String findJarsDir(String sparkHome, String scalaVersion, boolean failIfNotFound) { // TODO: change to the correct directory once the assembly build is changed. File libdir = new File(sparkHome, "jars"); if (!libdir.isDirectory()) { libdir = new File(sparkHome, String.format("assembly/target/sc...
[ "static", "String", "findJarsDir", "(", "String", "sparkHome", ",", "String", "scalaVersion", ",", "boolean", "failIfNotFound", ")", "{", "// TODO: change to the correct directory once the assembly build is changed.", "File", "libdir", "=", "new", "File", "(", "sparkHome", ...
Find the location of the Spark jars dir, depending on whether we're looking at a build or a distribution directory.
[ "Find", "the", "location", "of", "the", "Spark", "jars", "dir", "depending", "on", "whether", "we", "re", "looking", "at", "a", "build", "or", "a", "distribution", "directory", "." ]
train
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java#L316-L329
op4j/op4j
src/main/java/org/op4j/Op.java
Op.onArrayFor
public static <T> Level0ArrayOperator<Calendar[],Calendar> onArrayFor(final Calendar... elements) { """ <p> Creates an array with the specified elements and an <i>operation expression</i> on it. </p> @param elements the elements of the array being created @return an operator, ready for chaining """ ...
java
public static <T> Level0ArrayOperator<Calendar[],Calendar> onArrayFor(final Calendar... elements) { return onArrayOf(Types.CALENDAR, VarArgsUtil.asRequiredObjectArray(elements)); }
[ "public", "static", "<", "T", ">", "Level0ArrayOperator", "<", "Calendar", "[", "]", ",", "Calendar", ">", "onArrayFor", "(", "final", "Calendar", "...", "elements", ")", "{", "return", "onArrayOf", "(", "Types", ".", "CALENDAR", ",", "VarArgsUtil", ".", "...
<p> Creates an array with the specified elements and an <i>operation expression</i> on it. </p> @param elements the elements of the array being created @return an operator, ready for chaining
[ "<p", ">", "Creates", "an", "array", "with", "the", "specified", "elements", "and", "an", "<i", ">", "operation", "expression<", "/", "i", ">", "on", "it", ".", "<", "/", "p", ">" ]
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L1023-L1025
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/JFapUtils.java
JFapUtils.debugSummaryMessage
public static void debugSummaryMessage(TraceComponent callersTrace, Connection connection, ConversationImpl conversation, String remark) { """ Generate a JFAPSUMMARY message in trace. It is a good idea for the caller to check the main trace TraceComponent.isAnyTracingEnabled() before calling this method. The d...
java
public static void debugSummaryMessage(TraceComponent callersTrace, Connection connection, ConversationImpl conversation, String remark) { //Use a request number of -1 to distinguish from valid request numbers which are non-negative. debugSummaryMessage(callersTrace, connection, conversation, remark, -1)...
[ "public", "static", "void", "debugSummaryMessage", "(", "TraceComponent", "callersTrace", ",", "Connection", "connection", ",", "ConversationImpl", "conversation", ",", "String", "remark", ")", "{", "//Use a request number of -1 to distinguish from valid request numbers which are...
Generate a JFAPSUMMARY message in trace. It is a good idea for the caller to check the main trace TraceComponent.isAnyTracingEnabled() before calling this method. The data output by this message can be searched for in several ways: <nl> <li>Searching on JFAPSUMMARY will output all segments sent and received</li> <li...
[ "Generate", "a", "JFAPSUMMARY", "message", "in", "trace", ".", "It", "is", "a", "good", "idea", "for", "the", "caller", "to", "check", "the", "main", "trace", "TraceComponent", ".", "isAnyTracingEnabled", "()", "before", "calling", "this", "method", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/JFapUtils.java#L258-L262
apiman/apiman
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/ApimanLauncher.java
ApimanLauncher.handleDeployFailed
@Override public void handleDeployFailed(Vertx vertx, String mainVerticle, DeploymentOptions deploymentOptions, Throwable cause) { """ A deployment failure has been encountered. You can override this method to customize the behavior. By default it closes the `vertx` instance. @param vertx the v...
java
@Override public void handleDeployFailed(Vertx vertx, String mainVerticle, DeploymentOptions deploymentOptions, Throwable cause) { // Default behaviour is to close Vert.x if the deploy failed vertx.close(); }
[ "@", "Override", "public", "void", "handleDeployFailed", "(", "Vertx", "vertx", ",", "String", "mainVerticle", ",", "DeploymentOptions", "deploymentOptions", ",", "Throwable", "cause", ")", "{", "// Default behaviour is to close Vert.x if the deploy failed", "vertx", ".", ...
A deployment failure has been encountered. You can override this method to customize the behavior. By default it closes the `vertx` instance. @param vertx the vert.x instance @param mainVerticle the verticle @param deploymentOptions the verticle deployment options @param cause the cause of...
[ "A", "deployment", "failure", "has", "been", "encountered", ".", "You", "can", "override", "this", "method", "to", "customize", "the", "behavior", ".", "By", "default", "it", "closes", "the", "vertx", "instance", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/ApimanLauncher.java#L109-L113
remkop/picocli
src/main/java/picocli/groovy/PicocliBaseScript.java
PicocliBaseScript.handleParameterException
public Object handleParameterException(ParameterException pe, String[] args) { """ If a ParameterException occurs during {@link #parseScriptArguments(CommandLine, String[])} then this method gets called to report the problem. The default behavior is to show the exception message using {@link #printErrorMessage(S...
java
public Object handleParameterException(ParameterException pe, String[] args) { printErrorMessage(String.format("args: %s%n%s", Arrays.toString(args), pe.getMessage())); printHelpMessage(pe.getCommandLine()); return 1; }
[ "public", "Object", "handleParameterException", "(", "ParameterException", "pe", ",", "String", "[", "]", "args", ")", "{", "printErrorMessage", "(", "String", ".", "format", "(", "\"args: %s%n%s\"", ",", "Arrays", ".", "toString", "(", "args", ")", ",", "pe",...
If a ParameterException occurs during {@link #parseScriptArguments(CommandLine, String[])} then this method gets called to report the problem. The default behavior is to show the exception message using {@link #printErrorMessage(String)}, then call {@link #printHelpMessage(CommandLine)}. The return value becomes the re...
[ "If", "a", "ParameterException", "occurs", "during", "{", "@link", "#parseScriptArguments", "(", "CommandLine", "String", "[]", ")", "}", "then", "this", "method", "gets", "called", "to", "report", "the", "problem", ".", "The", "default", "behavior", "is", "to...
train
https://github.com/remkop/picocli/blob/3c5384f0d12817401d1921c3013c1282e2edcab2/src/main/java/picocli/groovy/PicocliBaseScript.java#L241-L245
liferay/com-liferay-commerce
commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountPersistenceImpl.java
CommerceAccountPersistenceImpl.fetchByC_ERC
@Override public CommerceAccount fetchByC_ERC(long companyId, String externalReferenceCode) { """ Returns the commerce account where companyId = &#63; and externalReferenceCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param companyId the company ID @param extern...
java
@Override public CommerceAccount fetchByC_ERC(long companyId, String externalReferenceCode) { return fetchByC_ERC(companyId, externalReferenceCode, true); }
[ "@", "Override", "public", "CommerceAccount", "fetchByC_ERC", "(", "long", "companyId", ",", "String", "externalReferenceCode", ")", "{", "return", "fetchByC_ERC", "(", "companyId", ",", "externalReferenceCode", ",", "true", ")", ";", "}" ]
Returns the commerce account where companyId = &#63; and externalReferenceCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param companyId the company ID @param externalReferenceCode the external reference code @return the matching commerce account, or <code>null</code> if a ...
[ "Returns", "the", "commerce", "account", "where", "companyId", "=", "&#63", ";", "and", "externalReferenceCode", "=", "&#63", ";", "or", "returns", "<code", ">", "null<", "/", "code", ">", "if", "it", "could", "not", "be", "found", ".", "Uses", "the", "f...
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountPersistenceImpl.java#L1947-L1951
snowflakedb/snowflake-jdbc
src/main/java/net/snowflake/client/core/ResultUtil.java
ResultUtil.getSFTime
static public SFTime getSFTime(String obj, int scale, SFSession session) throws SFException { """ Convert a time internal value (scaled number of seconds + fractional seconds) into an SFTime. <p> Example: getSFTime("123.456", 5) returns an SFTime for 00:02:03.45600. @param obj time object @param scale...
java
static public SFTime getSFTime(String obj, int scale, SFSession session) throws SFException { try { return TimeUtil.getSFTime(obj, scale); } catch (IllegalArgumentException ex) { throw (SFException) IncidentUtil.generateIncidentV2WithException( session, new SFExce...
[ "static", "public", "SFTime", "getSFTime", "(", "String", "obj", ",", "int", "scale", ",", "SFSession", "session", ")", "throws", "SFException", "{", "try", "{", "return", "TimeUtil", ".", "getSFTime", "(", "obj", ",", "scale", ")", ";", "}", "catch", "(...
Convert a time internal value (scaled number of seconds + fractional seconds) into an SFTime. <p> Example: getSFTime("123.456", 5) returns an SFTime for 00:02:03.45600. @param obj time object @param scale time scale @param session session object @return snowflake time object @throws SFException if time is invali...
[ "Convert", "a", "time", "internal", "value", "(", "scaled", "number", "of", "seconds", "+", "fractional", "seconds", ")", "into", "an", "SFTime", ".", "<p", ">", "Example", ":", "getSFTime", "(", "123", ".", "456", "5", ")", "returns", "an", "SFTime", ...
train
https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/ResultUtil.java#L738-L754
sksamuel/scrimage
scrimage-filters/src/main/java/thirdparty/jhlabs/math/NoiseInstance.java
NoiseInstance.turbulence3
public float turbulence3(float x, float y, float z, float octaves) { """ Compute turbulence using Perlin noise. @param x the x value @param y the y value @param octaves number of octaves of turbulence @return turbulence value at (x,y) """ float t = 0.0f; for (float f = 1.0f; ...
java
public float turbulence3(float x, float y, float z, float octaves) { float t = 0.0f; for (float f = 1.0f; f <= octaves; f *= 2) t += Math.abs(noise3(f * x, f * y, f * z)) / f; return t; }
[ "public", "float", "turbulence3", "(", "float", "x", ",", "float", "y", ",", "float", "z", ",", "float", "octaves", ")", "{", "float", "t", "=", "0.0f", ";", "for", "(", "float", "f", "=", "1.0f", ";", "f", "<=", "octaves", ";", "f", "*=", "2", ...
Compute turbulence using Perlin noise. @param x the x value @param y the y value @param octaves number of octaves of turbulence @return turbulence value at (x,y)
[ "Compute", "turbulence", "using", "Perlin", "noise", "." ]
train
https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/math/NoiseInstance.java#L68-L74
killbilling/recurly-java-library
src/main/java/com/ning/billing/recurly/RecurlyClient.java
RecurlyClient.getChildAccounts
public Accounts getChildAccounts(final String accountCode) { """ Get Child Accounts <p> Returns information about a the child accounts of an account. @param accountCode recurly account id @return Accounts on success, null otherwise """ return doGET(Account.ACCOUNT_RESOURCE + "/" + accountCode + "...
java
public Accounts getChildAccounts(final String accountCode) { return doGET(Account.ACCOUNT_RESOURCE + "/" + accountCode + "/child_accounts", Accounts.class, new QueryParams()); }
[ "public", "Accounts", "getChildAccounts", "(", "final", "String", "accountCode", ")", "{", "return", "doGET", "(", "Account", ".", "ACCOUNT_RESOURCE", "+", "\"/\"", "+", "accountCode", "+", "\"/child_accounts\"", ",", "Accounts", ".", "class", ",", "new", "Query...
Get Child Accounts <p> Returns information about a the child accounts of an account. @param accountCode recurly account id @return Accounts on success, null otherwise
[ "Get", "Child", "Accounts", "<p", ">", "Returns", "information", "about", "a", "the", "child", "accounts", "of", "an", "account", "." ]
train
https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L361-L363
telly/groundy
library/src/main/java/com/telly/groundy/TaskResult.java
TaskResult.add
public TaskResult add(String key, Serializable value) { """ Inserts a Serializable 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 Serializable object, or null """ mBundle.putSerializab...
java
public TaskResult add(String key, Serializable value) { mBundle.putSerializable(key, value); return this; }
[ "public", "TaskResult", "add", "(", "String", "key", ",", "Serializable", "value", ")", "{", "mBundle", ".", "putSerializable", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a Serializable 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 Serializable object, or null
[ "Inserts", "a", "Serializable", "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/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L263-L266
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.addIntentWithServiceResponseAsync
public Observable<ServiceResponse<UUID>> addIntentWithServiceResponseAsync(UUID appId, String versionId, AddIntentOptionalParameter addIntentOptionalParameter) { """ Adds an intent classifier to the application. @param appId The application ID. @param versionId The version ID. @param addIntentOptionalParamete...
java
public Observable<ServiceResponse<UUID>> addIntentWithServiceResponseAsync(UUID appId, String versionId, AddIntentOptionalParameter addIntentOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null....
[ "public", "Observable", "<", "ServiceResponse", "<", "UUID", ">", ">", "addIntentWithServiceResponseAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "AddIntentOptionalParameter", "addIntentOptionalParameter", ")", "{", "if", "(", "this", ".", "client", ...
Adds an intent classifier to the application. @param appId The application ID. @param versionId The version ID. @param addIntentOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the obser...
[ "Adds", "an", "intent", "classifier", "to", "the", "application", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L628-L641
mgledi/DRUMS
src/main/java/com/unister/semweb/drums/util/KeyUtils.java
KeyUtils.generateHashFunction
public static String generateHashFunction(byte[] min, byte[] max, int buckets, String suffix, String prefix) throws Exception { """ Generates a {@link RangeHashFunction}. @param min the minimal value to expect @param max the maximal value to expect @param buckets the number of buckets @param ...
java
public static String generateHashFunction(byte[] min, byte[] max, int buckets, String suffix, String prefix) throws Exception { String[] Sbuckets = new String[buckets]; for (int i = 0; i < buckets; i++) { Sbuckets[i] = i + ""; } return generateRangeHashFunct...
[ "public", "static", "String", "generateHashFunction", "(", "byte", "[", "]", "min", ",", "byte", "[", "]", "max", ",", "int", "buckets", ",", "String", "suffix", ",", "String", "prefix", ")", "throws", "Exception", "{", "String", "[", "]", "Sbuckets", "=...
Generates a {@link RangeHashFunction}. @param min the minimal value to expect @param max the maximal value to expect @param buckets the number of buckets @param suffix the suffix for all files @param prefix a prefix for all files @return String representation of the the RangeHashFunction @throws Exception
[ "Generates", "a", "{", "@link", "RangeHashFunction", "}", "." ]
train
https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/util/KeyUtils.java#L127-L134
structlogging/structlogger
structlogger/src/main/java/com/github/structlogging/processor/service/POJOService.java
POJOService.addConstructorParameter
private void addConstructorParameter(final MethodSpec.Builder constructorBuilder, final String attributeName, final TypeName type) { """ adds attribute to constructor @param constructorBuilder constructor to modify @param attributeName name of attribute to be added @param type type of attribute to be added ...
java
private void addConstructorParameter(final MethodSpec.Builder constructorBuilder, final String attributeName, final TypeName type) { constructorBuilder.addParameter(type, attributeName, Modifier.FINAL); constructorBuilder.addCode("this." + attributeName + "=" + attributeName + ";"); }
[ "private", "void", "addConstructorParameter", "(", "final", "MethodSpec", ".", "Builder", "constructorBuilder", ",", "final", "String", "attributeName", ",", "final", "TypeName", "type", ")", "{", "constructorBuilder", ".", "addParameter", "(", "type", ",", "attribu...
adds attribute to constructor @param constructorBuilder constructor to modify @param attributeName name of attribute to be added @param type type of attribute to be added
[ "adds", "attribute", "to", "constructor" ]
train
https://github.com/structlogging/structlogger/blob/1fcca4e962ef53cbdb94bd72cb556de7f5f9469f/structlogger/src/main/java/com/github/structlogging/processor/service/POJOService.java#L192-L195
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/wires/MagnetManager.java
MagnetManager.createMagnets
public Magnets createMagnets(final WiresShape wiresShape, final Direction[] requestedCardinals) { """ Right now it only works with provided FOUR or EIGHT cardinals, anything else will break WiresConnector autoconnection @param wiresShape @param requestedCardinals @return """ final IPrimitive<?> pr...
java
public Magnets createMagnets(final WiresShape wiresShape, final Direction[] requestedCardinals) { final IPrimitive<?> primTarget = wiresShape.getGroup(); final Point2DArray points = getWiresIntersectionPoints(wiresShape, requestedCardinals); final ControlHandleList list = new ControlHandleLi...
[ "public", "Magnets", "createMagnets", "(", "final", "WiresShape", "wiresShape", ",", "final", "Direction", "[", "]", "requestedCardinals", ")", "{", "final", "IPrimitive", "<", "?", ">", "primTarget", "=", "wiresShape", ".", "getGroup", "(", ")", ";", "final",...
Right now it only works with provided FOUR or EIGHT cardinals, anything else will break WiresConnector autoconnection @param wiresShape @param requestedCardinals @return
[ "Right", "now", "it", "only", "works", "with", "provided", "FOUR", "or", "EIGHT", "cardinals", "anything", "else", "will", "break", "WiresConnector", "autoconnection" ]
train
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/wires/MagnetManager.java#L111-L138
fuinorg/event-store-commons
spi/src/main/java/org/fuin/esc/spi/Data.java
Data.valueOf
public static Data valueOf(final String type, final Object obj) { """ Creates a new instance from a given object. @param type Name of the type. @param obj Object to convert. @return Either JSON or XML UTF-8 encoded content without a version. """ return new Data(type, mimeType(obj), content(ob...
java
public static Data valueOf(final String type, final Object obj) { return new Data(type, mimeType(obj), content(obj)); }
[ "public", "static", "Data", "valueOf", "(", "final", "String", "type", ",", "final", "Object", "obj", ")", "{", "return", "new", "Data", "(", "type", ",", "mimeType", "(", "obj", ")", ",", "content", "(", "obj", ")", ")", ";", "}" ]
Creates a new instance from a given object. @param type Name of the type. @param obj Object to convert. @return Either JSON or XML UTF-8 encoded content without a version.
[ "Creates", "a", "new", "instance", "from", "a", "given", "object", "." ]
train
https://github.com/fuinorg/event-store-commons/blob/ea175582d8cda2b5a6d2fe52bbb2f1c183eee77c/spi/src/main/java/org/fuin/esc/spi/Data.java#L223-L225
SonarOpenCommunity/sonar-cxx
cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/JsonCompilationDatabase.java
JsonCompilationDatabase.parse
public static void parse(CxxConfiguration config, File compileCommandsFile) throws IOException { """ Set up the given CxxConfiguration from the JSON compilation database @param config @param compileCommandsFile @throws IOException """ LOG.debug("Parsing 'JSON Compilation Database' format"); Obje...
java
public static void parse(CxxConfiguration config, File compileCommandsFile) throws IOException { LOG.debug("Parsing 'JSON Compilation Database' format"); ObjectMapper mapper = new ObjectMapper(); mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); mapper.enable(DeserializationFeature.US...
[ "public", "static", "void", "parse", "(", "CxxConfiguration", "config", ",", "File", "compileCommandsFile", ")", "throws", "IOException", "{", "LOG", ".", "debug", "(", "\"Parsing 'JSON Compilation Database' format\"", ")", ";", "ObjectMapper", "mapper", "=", "new", ...
Set up the given CxxConfiguration from the JSON compilation database @param config @param compileCommandsFile @throws IOException
[ "Set", "up", "the", "given", "CxxConfiguration", "from", "the", "JSON", "compilation", "database" ]
train
https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/JsonCompilationDatabase.java#L54-L89
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThemeUtil.java
ThemeUtil.getText
public static CharSequence getText(@NonNull final Context context, @AttrRes final int resourceId) { """ Obtains the text, which corresponds to a specific resource id, from a context's theme. If the given resource id is invalid, a {@link NotFoundException} will be thrown. ...
java
public static CharSequence getText(@NonNull final Context context, @AttrRes final int resourceId) { return getText(context, -1, resourceId); }
[ "public", "static", "CharSequence", "getText", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "AttrRes", "final", "int", "resourceId", ")", "{", "return", "getText", "(", "context", ",", "-", "1", ",", "resourceId", ")", ";", "}" ]
Obtains the text, which corresponds to a specific resource id, from a context's theme. If the given resource id is invalid, a {@link NotFoundException} will be thrown. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param resourceId The resour...
[ "Obtains", "the", "text", "which", "corresponds", "to", "a", "specific", "resource", "id", "from", "a", "context", "s", "theme", ".", "If", "the", "given", "resource", "id", "is", "invalid", "a", "{", "@link", "NotFoundException", "}", "will", "be", "throw...
train
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L257-L260
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.removeString
public void removeString(String str) { """ Removes a String from the MDAG. @param str the String to be removed from the MDAG """ if (sourceNode != null) { //Split the _transition path corresponding to str to ensure that //any other _transition paths sharing nodes with...
java
public void removeString(String str) { if (sourceNode != null) { //Split the _transition path corresponding to str to ensure that //any other _transition paths sharing nodes with it are not affected splitTransitionPath(sourceNode, str); //Remove from ...
[ "public", "void", "removeString", "(", "String", "str", ")", "{", "if", "(", "sourceNode", "!=", "null", ")", "{", "//Split the _transition path corresponding to str to ensure that", "//any other _transition paths sharing nodes with it are not affected", "splitTransitionPath", "(...
Removes a String from the MDAG. @param str the String to be removed from the MDAG
[ "Removes", "a", "String", "from", "the", "MDAG", "." ]
train
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L364-L412
ical4j/ical4j
src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java
CalendarParserImpl.assertToken
private int assertToken(final StreamTokenizer tokeniser, Reader in, final int token) throws IOException, ParserException { """ Asserts that the next token in the stream matches the specified token. @param tokeniser stream tokeniser to perform assertion on @param token expected token @return in...
java
private int assertToken(final StreamTokenizer tokeniser, Reader in, final int token) throws IOException, ParserException { int ntok = nextToken(tokeniser, in); if (ntok != token) { throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, tokeniser.ttype), ...
[ "private", "int", "assertToken", "(", "final", "StreamTokenizer", "tokeniser", ",", "Reader", "in", ",", "final", "int", "token", ")", "throws", "IOException", ",", "ParserException", "{", "int", "ntok", "=", "nextToken", "(", "tokeniser", ",", "in", ")", ";...
Asserts that the next token in the stream matches the specified token. @param tokeniser stream tokeniser to perform assertion on @param token expected token @return int value of the ttype field of the tokeniser @throws IOException when unable to read from stream @throws ParserException when next token in the s...
[ "Asserts", "that", "the", "next", "token", "in", "the", "stream", "matches", "the", "specified", "token", "." ]
train
https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java#L462-L474
jwtk/jjwt
api/src/main/java/io/jsonwebtoken/lang/Strings.java
Strings.pathEquals
public static boolean pathEquals(String path1, String path2) { """ Compare two paths after normalization of them. @param path1 first path for comparison @param path2 second path for comparison @return whether the two paths are equivalent after normalization """ return cleanPath(path1).equals(cleanPa...
java
public static boolean pathEquals(String path1, String path2) { return cleanPath(path1).equals(cleanPath(path2)); }
[ "public", "static", "boolean", "pathEquals", "(", "String", "path1", ",", "String", "path2", ")", "{", "return", "cleanPath", "(", "path1", ")", ".", "equals", "(", "cleanPath", "(", "path2", ")", ")", ";", "}" ]
Compare two paths after normalization of them. @param path1 first path for comparison @param path2 second path for comparison @return whether the two paths are equivalent after normalization
[ "Compare", "two", "paths", "after", "normalization", "of", "them", "." ]
train
https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Strings.java#L659-L661
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/servlet/JawrRequestHandler.java
JawrRequestHandler.initResourceBundleHandler
protected ResourceBundleHandler initResourceBundleHandler() { """ Initialize the resource bundle handler @return the resource bundle handler """ ResourceBundleHandler rsHandler = null; if (jawrConfig.getUseBundleMapping() && StringUtils.isNotEmpty(jawrConfig.getJawrWorkingDirectory())) { rsHandler = ...
java
protected ResourceBundleHandler initResourceBundleHandler() { ResourceBundleHandler rsHandler = null; if (jawrConfig.getUseBundleMapping() && StringUtils.isNotEmpty(jawrConfig.getJawrWorkingDirectory())) { rsHandler = new ServletContextResourceBundleHandler(servletContext, jawrConfig.getJawrWorkingDirectory(), ...
[ "protected", "ResourceBundleHandler", "initResourceBundleHandler", "(", ")", "{", "ResourceBundleHandler", "rsHandler", "=", "null", ";", "if", "(", "jawrConfig", ".", "getUseBundleMapping", "(", ")", "&&", "StringUtils", ".", "isNotEmpty", "(", "jawrConfig", ".", "...
Initialize the resource bundle handler @return the resource bundle handler
[ "Initialize", "the", "resource", "bundle", "handler" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/servlet/JawrRequestHandler.java#L600-L610
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/spatial/CTLuMoranScatterplotOutlier.java
CTLuMoranScatterplotOutlier.run
public OutlierResult run(Database database, Relation<N> nrel, Relation<? extends NumberVector> relation) { """ Main method. @param database Database @param nrel Neighborhood relation @param relation Data relation (1d!) @return Outlier detection result """ final NeighborSetPredicate npred = getNeighbo...
java
public OutlierResult run(Database database, Relation<N> nrel, Relation<? extends NumberVector> relation) { final NeighborSetPredicate npred = getNeighborSetPredicateFactory().instantiate(database, nrel); // Compute the global mean and variance MeanVariance globalmv = new MeanVariance(); for(DBIDIter id...
[ "public", "OutlierResult", "run", "(", "Database", "database", ",", "Relation", "<", "N", ">", "nrel", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ")", "{", "final", "NeighborSetPredicate", "npred", "=", "getNeighborSetPredicateFactory",...
Main method. @param database Database @param nrel Neighborhood relation @param relation Data relation (1d!) @return Outlier detection result
[ "Main", "method", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/spatial/CTLuMoranScatterplotOutlier.java#L102-L150
wwadge/bonecp
bonecp/src/main/java/com/jolbox/bonecp/StatementHandle.java
StatementHandle.queryTimerEnd
protected void queryTimerEnd(String sql, long queryStartTime) { """ Call the onQueryExecuteTimeLimitExceeded hook if necessary @param sql sql statement that took too long @param queryStartTime time when query was started. """ if ((this.queryExecuteTimeLimit != 0) && (this.connectionHook != null)){ ...
java
protected void queryTimerEnd(String sql, long queryStartTime) { if ((this.queryExecuteTimeLimit != 0) && (this.connectionHook != null)){ long timeElapsed = (System.nanoTime() - queryStartTime); if (timeElapsed > this.queryExecuteTimeLimit){ this.connectionHook.onQueryExecuteTimeLimitExceeded(...
[ "protected", "void", "queryTimerEnd", "(", "String", "sql", ",", "long", "queryStartTime", ")", "{", "if", "(", "(", "this", ".", "queryExecuteTimeLimit", "!=", "0", ")", "&&", "(", "this", ".", "connectionHook", "!=", "null", ")", ")", "{", "long", "tim...
Call the onQueryExecuteTimeLimitExceeded hook if necessary @param sql sql statement that took too long @param queryStartTime time when query was started.
[ "Call", "the", "onQueryExecuteTimeLimitExceeded", "hook", "if", "necessary" ]
train
https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/StatementHandle.java#L274-L290
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/service/RaftServiceContext.java
RaftServiceContext.sequenceCommand
private OperationResult sequenceCommand(long index, long sequence, RaftSession session) { """ Loads and returns a cached command result according to the sequence number. """ OperationResult result = session.getResult(sequence); if (result == null) { log.debug("Missing command result at index {}",...
java
private OperationResult sequenceCommand(long index, long sequence, RaftSession session) { OperationResult result = session.getResult(sequence); if (result == null) { log.debug("Missing command result at index {}", index); } return result; }
[ "private", "OperationResult", "sequenceCommand", "(", "long", "index", ",", "long", "sequence", ",", "RaftSession", "session", ")", "{", "OperationResult", "result", "=", "session", ".", "getResult", "(", "sequence", ")", ";", "if", "(", "result", "==", "null"...
Loads and returns a cached command result according to the sequence number.
[ "Loads", "and", "returns", "a", "cached", "command", "result", "according", "to", "the", "sequence", "number", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/service/RaftServiceContext.java#L521-L527
googleapis/google-cloud-java
google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java
CloudTasksClient.cancelLease
public final Task cancelLease(TaskName name, Timestamp scheduleTime) { """ Cancel a pull task's lease. <p>The worker can use this method to cancel a task's lease by setting its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] to now. This will make the task available to be leased to the next cal...
java
public final Task cancelLease(TaskName name, Timestamp scheduleTime) { CancelLeaseRequest request = CancelLeaseRequest.newBuilder() .setName(name == null ? null : name.toString()) .setScheduleTime(scheduleTime) .build(); return cancelLease(request); }
[ "public", "final", "Task", "cancelLease", "(", "TaskName", "name", ",", "Timestamp", "scheduleTime", ")", "{", "CancelLeaseRequest", "request", "=", "CancelLeaseRequest", ".", "newBuilder", "(", ")", ".", "setName", "(", "name", "==", "null", "?", "null", ":",...
Cancel a pull task's lease. <p>The worker can use this method to cancel a task's lease by setting its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] to now. This will make the task available to be leased to the next caller of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. <p>Sample co...
[ "Cancel", "a", "pull", "task", "s", "lease", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java#L2504-L2512
Ordinastie/MalisisCore
src/main/java/net/malisis/core/util/chunklistener/ChunkListener.java
ChunkListener.callPostListener
public boolean callPostListener(Chunk chunk, BlockPos listener, BlockPos modified, IBlockState oldState, IBlockState newState) { """ Calls IBlockListener.Pre#onBlockSet(World, BlockPos, BlockPos, IBlockState, IBlockState) for the listener {@link BlockPos}. @param chunk the chunk @param listener the listener @...
java
public boolean callPostListener(Chunk chunk, BlockPos listener, BlockPos modified, IBlockState oldState, IBlockState newState) { IBlockListener.Post bl = IComponent.getComponent(IBlockListener.Post.class, chunk.getWorld().getBlockState(listener).getBlock()); bl.onBlockSet(chunk.getWorld(), listener, modified, oldS...
[ "public", "boolean", "callPostListener", "(", "Chunk", "chunk", ",", "BlockPos", "listener", ",", "BlockPos", "modified", ",", "IBlockState", "oldState", ",", "IBlockState", "newState", ")", "{", "IBlockListener", ".", "Post", "bl", "=", "IComponent", ".", "getC...
Calls IBlockListener.Pre#onBlockSet(World, BlockPos, BlockPos, IBlockState, IBlockState) for the listener {@link BlockPos}. @param chunk the chunk @param listener the listener @param modified the modified @param oldState the old state @param newState the new state @return true, if successful
[ "Calls", "IBlockListener", ".", "Pre#onBlockSet", "(", "World", "BlockPos", "BlockPos", "IBlockState", "IBlockState", ")", "for", "the", "listener", "{", "@link", "BlockPos", "}", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunklistener/ChunkListener.java#L109-L114
junit-team/junit4
src/main/java/org/junit/runners/BlockJUnit4ClassRunner.java
BlockJUnit4ClassRunner.possiblyExpectingExceptions
protected Statement possiblyExpectingExceptions(FrameworkMethod method, Object test, Statement next) { """ Returns a {@link Statement}: if {@code method}'s {@code @Test} annotation has the {@link Test#expected()} attribute, return normally only if {@code next} throws an exception of the correct type,...
java
protected Statement possiblyExpectingExceptions(FrameworkMethod method, Object test, Statement next) { Test annotation = method.getAnnotation(Test.class); Class<? extends Throwable> expectedExceptionClass = getExpectedException(annotation); return expectedExceptionClass != null ? new...
[ "protected", "Statement", "possiblyExpectingExceptions", "(", "FrameworkMethod", "method", ",", "Object", "test", ",", "Statement", "next", ")", "{", "Test", "annotation", "=", "method", ".", "getAnnotation", "(", "Test", ".", "class", ")", ";", "Class", "<", ...
Returns a {@link Statement}: if {@code method}'s {@code @Test} annotation has the {@link Test#expected()} attribute, return normally only if {@code next} throws an exception of the correct type, and throw an exception otherwise.
[ "Returns", "a", "{" ]
train
https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runners/BlockJUnit4ClassRunner.java#L343-L348
jenkinsci/java-client-api
jenkins-client/src/main/java/com/offbytwo/jenkins/client/JenkinsHttpClient.java
JenkinsHttpClient.addAuthentication
protected static HttpClientBuilder addAuthentication(final HttpClientBuilder builder, final URI uri, final String username, String password) { """ Add authentication to supplied builder. @param builder the builder to configure @param uri the server URI @param username the username @par...
java
protected static HttpClientBuilder addAuthentication(final HttpClientBuilder builder, final URI uri, final String username, String password) { if (isNotBlank(username)) { CredentialsProvider provider = new BasicCredentialsProvider(); AuthScope scope = new AuthSco...
[ "protected", "static", "HttpClientBuilder", "addAuthentication", "(", "final", "HttpClientBuilder", "builder", ",", "final", "URI", "uri", ",", "final", "String", "username", ",", "String", "password", ")", "{", "if", "(", "isNotBlank", "(", "username", ")", ")"...
Add authentication to supplied builder. @param builder the builder to configure @param uri the server URI @param username the username @param password the password @return the passed in builder
[ "Add", "authentication", "to", "supplied", "builder", "." ]
train
https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/client/JenkinsHttpClient.java#L457-L470
m9aertner/PBKDF2
src/main/java/de/rtner/security/auth/spi/SimplePBKDF2.java
SimplePBKDF2.verifyKeyFormatted
public boolean verifyKeyFormatted(String formatted, String candidatePassword) { """ Verification function. @param formatted &quot;salt:iteration-count:derived-key&quot; (depends on effective formatter). This value should come from server-side storage. @param candidatePassword The password that is checked a...
java
public boolean verifyKeyFormatted(String formatted, String candidatePassword) { // Parameter as member of Engine was not the smartest design decision back then... PBKDF2Parameters p = getParameters(); PBKDF2Parameters q = new PBKDF2Parameters(); q.hashAlgorithm = p.hashAlgorithm; q.hashCharset = p.hashCharse...
[ "public", "boolean", "verifyKeyFormatted", "(", "String", "formatted", ",", "String", "candidatePassword", ")", "{", "// Parameter as member of Engine was not the smartest design decision back then...", "PBKDF2Parameters", "p", "=", "getParameters", "(", ")", ";", "PBKDF2Parame...
Verification function. @param formatted &quot;salt:iteration-count:derived-key&quot; (depends on effective formatter). This value should come from server-side storage. @param candidatePassword The password that is checked against the formatted reference data. This value will usually be supplied by the &quot;user&quot;...
[ "Verification", "function", "." ]
train
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/security/auth/spi/SimplePBKDF2.java#L154-L170
square/phrase
src/main/java/com/squareup/phrase/ListPhrase.java
ListPhrase.join
@NonNull public <T> CharSequence join(@NonNull Iterable<T> items, @Nullable Formatter<T> formatter) { """ A list of objects, converting them to {@code Strings} by passing them to {@link Formatter#format(Object)}. @throws IllegalArgumentException if any of the list elements are null or empty strings. ...
java
@NonNull public <T> CharSequence join(@NonNull Iterable<T> items, @Nullable Formatter<T> formatter) { checkNotNullOrEmpty(items); return joinIterableWithSize(items, getSize(items), formatter); }
[ "@", "NonNull", "public", "<", "T", ">", "CharSequence", "join", "(", "@", "NonNull", "Iterable", "<", "T", ">", "items", ",", "@", "Nullable", "Formatter", "<", "T", ">", "formatter", ")", "{", "checkNotNullOrEmpty", "(", "items", ")", ";", "return", ...
A list of objects, converting them to {@code Strings} by passing them to {@link Formatter#format(Object)}. @throws IllegalArgumentException if any of the list elements are null or empty strings.
[ "A", "list", "of", "objects", "converting", "them", "to", "{", "@code", "Strings", "}", "by", "passing", "them", "to", "{", "@link", "Formatter#format", "(", "Object", ")", "}", "." ]
train
https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/ListPhrase.java#L126-L130
Whiley/WhileyCompiler
src/main/java/wyil/interpreter/Interpreter.java
Interpreter.executeFail
private Status executeFail(Stmt.Fail stmt, CallStack frame, EnclosingScope scope) { """ Execute a fail statement at a given point in the function or method body. This will generate a runtime fault. @param stmt --- The fail statement to execute @param frame --- The current stack frame @return """ thro...
java
private Status executeFail(Stmt.Fail stmt, CallStack frame, EnclosingScope scope) { throw new AssertionError("Runtime fault occurred"); }
[ "private", "Status", "executeFail", "(", "Stmt", ".", "Fail", "stmt", ",", "CallStack", "frame", ",", "EnclosingScope", "scope", ")", "{", "throw", "new", "AssertionError", "(", "\"Runtime fault occurred\"", ")", ";", "}" ]
Execute a fail statement at a given point in the function or method body. This will generate a runtime fault. @param stmt --- The fail statement to execute @param frame --- The current stack frame @return
[ "Execute", "a", "fail", "statement", "at", "a", "given", "point", "in", "the", "function", "or", "method", "body", ".", "This", "will", "generate", "a", "runtime", "fault", "." ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L366-L368
NordicSemiconductor/Android-DFU-Library
dfu/src/main/java/no/nordicsemi/android/dfu/SecureDfuImpl.java
SecureDfuImpl.setObjectSize
private void setObjectSize(@NonNull final byte[] data, final int value) { """ Sets the object size in correct position of the data array. @param data control point data packet @param value Object size in bytes. """ data[2] = (byte) (value & 0xFF); data[3] = (byte) ((value >> 8) & 0xFF); data[4] = (b...
java
private void setObjectSize(@NonNull final byte[] data, final int value) { data[2] = (byte) (value & 0xFF); data[3] = (byte) ((value >> 8) & 0xFF); data[4] = (byte) ((value >> 16) & 0xFF); data[5] = (byte) ((value >> 24) & 0xFF); }
[ "private", "void", "setObjectSize", "(", "@", "NonNull", "final", "byte", "[", "]", "data", ",", "final", "int", "value", ")", "{", "data", "[", "2", "]", "=", "(", "byte", ")", "(", "value", "&", "0xFF", ")", ";", "data", "[", "3", "]", "=", "...
Sets the object size in correct position of the data array. @param data control point data packet @param value Object size in bytes.
[ "Sets", "the", "object", "size", "in", "correct", "position", "of", "the", "data", "array", "." ]
train
https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/SecureDfuImpl.java#L737-L742
feedzai/pdb
src/main/java/com/feedzai/commons/sql/abstraction/util/AESHelper.java
AESHelper.encryptToFile
public static void encryptToFile(String path, byte[] buf, String key) { """ Encrypts the byte[] to a file. @param path The destination path. @param buf The buffer. @param key The key. """ try { FileOutputStream fos = new FileOutputStream(path); fos.write(encrypt(buf, key)...
java
public static void encryptToFile(String path, byte[] buf, String key) { try { FileOutputStream fos = new FileOutputStream(path); fos.write(encrypt(buf, key).getBytes()); fos.close(); } catch (final Exception e) { logger.warn("Could not encrypt to file {}",...
[ "public", "static", "void", "encryptToFile", "(", "String", "path", ",", "byte", "[", "]", "buf", ",", "String", "key", ")", "{", "try", "{", "FileOutputStream", "fos", "=", "new", "FileOutputStream", "(", "path", ")", ";", "fos", ".", "write", "(", "e...
Encrypts the byte[] to a file. @param path The destination path. @param buf The buffer. @param key The key.
[ "Encrypts", "the", "byte", "[]", "to", "a", "file", "." ]
train
https://github.com/feedzai/pdb/blob/fe07ca08417e0ddcd620a36aa1fdbca7f338be98/src/main/java/com/feedzai/commons/sql/abstraction/util/AESHelper.java#L142-L150
landawn/AbacusUtil
src/com/landawn/abacus/util/f.java
f.flatOp
public static <E extends Exception> void flatOp(final short[][] a, Try.Consumer<short[], E> op) throws E { """ flatten -> execute {@code op} -> set values back. <pre> <code> f.flatOp(a, t -> N.sort(t)); </code> </pre> @param a @param op @throws E """ if (N.isNullOrEmpty(a)) { re...
java
public static <E extends Exception> void flatOp(final short[][] a, Try.Consumer<short[], E> op) throws E { if (N.isNullOrEmpty(a)) { return; } final short[] tmp = flatten(a); op.accept(tmp); int idx = 0; for (short[] e : a) { if (N....
[ "public", "static", "<", "E", "extends", "Exception", ">", "void", "flatOp", "(", "final", "short", "[", "]", "[", "]", "a", ",", "Try", ".", "Consumer", "<", "short", "[", "]", ",", "E", ">", "op", ")", "throws", "E", "{", "if", "(", "N", ".",...
flatten -> execute {@code op} -> set values back. <pre> <code> f.flatOp(a, t -> N.sort(t)); </code> </pre> @param a @param op @throws E
[ "flatten", "-", ">", "execute", "{", "@code", "op", "}", "-", ">", "set", "values", "back", ".", "<pre", ">", "<code", ">", "f", ".", "flatOp", "(", "a", "t", "-", ">", "N", ".", "sort", "(", "t", "))", ";", "<", "/", "code", ">", "<", "/",...
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/f.java#L5293-L5310
pierre/serialization
thrift/src/main/java/com/ning/metrics/serialization/event/ThriftToThriftEnvelopeEvent.java
ThriftToThriftEnvelopeEvent.extractEvent
public static <T extends Serializable> ThriftEnvelopeEvent extractEvent(final String eventName, final T thriftObject) { """ Given a generic thrift object (class generated by the thrift compiler), create a ThriftEnvelopeEvent. The event timestamp defaults to now(). @param eventName Thrift schema name @param...
java
public static <T extends Serializable> ThriftEnvelopeEvent extractEvent(final String eventName, final T thriftObject) { return extractEvent(eventName, new DateTime(), thriftObject); }
[ "public", "static", "<", "T", "extends", "Serializable", ">", "ThriftEnvelopeEvent", "extractEvent", "(", "final", "String", "eventName", ",", "final", "T", "thriftObject", ")", "{", "return", "extractEvent", "(", "eventName", ",", "new", "DateTime", "(", ")", ...
Given a generic thrift object (class generated by the thrift compiler), create a ThriftEnvelopeEvent. The event timestamp defaults to now(). @param eventName Thrift schema name @param thriftObject Thrift instance @param <T> any Thrift class generated by the thrift compiler @return ThriftEnvelopeEvent which...
[ "Given", "a", "generic", "thrift", "object", "(", "class", "generated", "by", "the", "thrift", "compiler", ")", "create", "a", "ThriftEnvelopeEvent", ".", "The", "event", "timestamp", "defaults", "to", "now", "()", "." ]
train
https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/thrift/src/main/java/com/ning/metrics/serialization/event/ThriftToThriftEnvelopeEvent.java#L41-L44
pravega/pravega
client/src/main/java/io/pravega/client/stream/notifications/NotificationSystem.java
NotificationSystem.removeListener
@Synchronized public <T extends Notification> void removeListener(final String type, final Listener<T> listener) { """ Remove Listener of a given notification type. @param <T> Type of notification. @param type Type of notification listener. @param listener Listener to be removed. """ ...
java
@Synchronized public <T extends Notification> void removeListener(final String type, final Listener<T> listener) { map.get(type).removeIf(e -> e.getListener().equals(listener)); }
[ "@", "Synchronized", "public", "<", "T", "extends", "Notification", ">", "void", "removeListener", "(", "final", "String", "type", ",", "final", "Listener", "<", "T", ">", "listener", ")", "{", "map", ".", "get", "(", "type", ")", ".", "removeIf", "(", ...
Remove Listener of a given notification type. @param <T> Type of notification. @param type Type of notification listener. @param listener Listener to be removed.
[ "Remove", "Listener", "of", "a", "given", "notification", "type", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/notifications/NotificationSystem.java#L63-L66
UrielCh/ovh-java-sdk
ovh-java-sdk-veeamCloudConnect/src/main/java/net/minidev/ovh/api/ApiOvhVeeamCloudConnect.java
ApiOvhVeeamCloudConnect.serviceName_backupRepository_inventoryName_GET
public OvhBackupRepository serviceName_backupRepository_inventoryName_GET(String serviceName, String inventoryName) throws IOException { """ Get this object properties REST: GET /veeamCloudConnect/{serviceName}/backupRepository/{inventoryName} @param serviceName [required] Domain of the service @param invento...
java
public OvhBackupRepository serviceName_backupRepository_inventoryName_GET(String serviceName, String inventoryName) throws IOException { String qPath = "/veeamCloudConnect/{serviceName}/backupRepository/{inventoryName}"; StringBuilder sb = path(qPath, serviceName, inventoryName); String resp = exec(qPath, "GET", ...
[ "public", "OvhBackupRepository", "serviceName_backupRepository_inventoryName_GET", "(", "String", "serviceName", ",", "String", "inventoryName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/veeamCloudConnect/{serviceName}/backupRepository/{inventoryName}\"", ";", ...
Get this object properties REST: GET /veeamCloudConnect/{serviceName}/backupRepository/{inventoryName} @param serviceName [required] Domain of the service @param inventoryName [required] The inventory name of your backup repository
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-veeamCloudConnect/src/main/java/net/minidev/ovh/api/ApiOvhVeeamCloudConnect.java#L87-L92
buschmais/extended-objects
spi/src/main/java/com/buschmais/xo/spi/reflection/ClassHelper.java
ClassHelper.getType
public static <T> Class<T> getType(String name) { """ Load a class. @param name The class name. @param <T> The expected class type. @return The class. """ Class<T> type; try { type = (Class<T>) Class.forName(name); } catch (ClassNotFoundException e) { thro...
java
public static <T> Class<T> getType(String name) { Class<T> type; try { type = (Class<T>) Class.forName(name); } catch (ClassNotFoundException e) { throw new XOException("Cannot find class with name '" + name + "'", e); } return type; }
[ "public", "static", "<", "T", ">", "Class", "<", "T", ">", "getType", "(", "String", "name", ")", "{", "Class", "<", "T", ">", "type", ";", "try", "{", "type", "=", "(", "Class", "<", "T", ">", ")", "Class", ".", "forName", "(", "name", ")", ...
Load a class. @param name The class name. @param <T> The expected class type. @return The class.
[ "Load", "a", "class", "." ]
train
https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/spi/src/main/java/com/buschmais/xo/spi/reflection/ClassHelper.java#L31-L39
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java
DiagnosticsInner.listSiteDetectorResponsesSlotWithServiceResponseAsync
public Observable<ServiceResponse<Page<DetectorResponseInner>>> listSiteDetectorResponsesSlotWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String slot) { """ List Site Detector Responses. List Site Detector Responses. @param resourceGroupName Name of the resource group t...
java
public Observable<ServiceResponse<Page<DetectorResponseInner>>> listSiteDetectorResponsesSlotWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String slot) { return listSiteDetectorResponsesSlotSinglePageAsync(resourceGroupName, siteName, slot) .concatMap(new Func...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "DetectorResponseInner", ">", ">", ">", "listSiteDetectorResponsesSlotWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "siteName", ",", "final", "String", "s...
List Site Detector Responses. List Site Detector Responses. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param slot Slot Name @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;DetectorRes...
[ "List", "Site", "Detector", "Responses", ".", "List", "Site", "Detector", "Responses", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java#L2108-L2120
boncey/Flickr4Java
src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java
GeoInterface.setPerms
public void setPerms(String photoId, GeoPermissions perms) throws FlickrException { """ Set the permission for who may view the geo data associated with a photo. This method requires authentication with 'write' permission. @param photoId The id of the photo to set permissions for. @param perms Permissions...
java
public void setPerms(String photoId, GeoPermissions perms) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_SET_PERMS); parameters.put("photo_id", photoId); parameters.put("is_public", perms.isPublic() ? "1" : "0...
[ "public", "void", "setPerms", "(", "String", "photoId", ",", "GeoPermissions", "perms", ")", "throws", "FlickrException", "{", "Map", "<", "String", ",", "Object", ">", "parameters", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", ...
Set the permission for who may view the geo data associated with a photo. This method requires authentication with 'write' permission. @param photoId The id of the photo to set permissions for. @param perms Permissions, who can see the geo data of this photo @throws FlickrException
[ "Set", "the", "permission", "for", "who", "may", "view", "the", "geo", "data", "associated", "with", "a", "photo", "." ]
train
https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java#L194-L210
JodaOrg/joda-time-jsptags
src/main/java/org/joda/time/contrib/jsptag/Util.java
Util.findMatch
private static ResourceBundle findMatch(String basename, Locale pref) { """ Gets the resource bundle with the given base name and preferred locale. This method calls java.util.ResourceBundle.getBundle(), but ignores its return value unless its locale represents an exact or language match with the given prefer...
java
private static ResourceBundle findMatch(String basename, Locale pref) { ResourceBundle match = null; try { ResourceBundle bundle = ResourceBundle.getBundle(basename, pref, Thread.currentThread().getContextClassLoader()); Locale avail = bundle.getLocale(); ...
[ "private", "static", "ResourceBundle", "findMatch", "(", "String", "basename", ",", "Locale", "pref", ")", "{", "ResourceBundle", "match", "=", "null", ";", "try", "{", "ResourceBundle", "bundle", "=", "ResourceBundle", ".", "getBundle", "(", "basename", ",", ...
Gets the resource bundle with the given base name and preferred locale. This method calls java.util.ResourceBundle.getBundle(), but ignores its return value unless its locale represents an exact or language match with the given preferred locale. @param basename the resource bundle base name @param pref the preferred ...
[ "Gets", "the", "resource", "bundle", "with", "the", "given", "base", "name", "and", "preferred", "locale", "." ]
train
https://github.com/JodaOrg/joda-time-jsptags/blob/69008a813568cb6f3e37ea7a80f8b1f2070edf14/src/main/java/org/joda/time/contrib/jsptag/Util.java#L586-L634
validator/validator
src/nu/validator/gnu/xml/aelfred2/XmlParser.java
XmlParser.fatal
private void fatal(String message, char textFound, String textExpected) throws SAXException { """ Report a serious error. @param message The error message. @param textFound The text that caused the error (or null). """ fatal(message, Character.valueOf(textFound).toString(), textExpect...
java
private void fatal(String message, char textFound, String textExpected) throws SAXException { fatal(message, Character.valueOf(textFound).toString(), textExpected); }
[ "private", "void", "fatal", "(", "String", "message", ",", "char", "textFound", ",", "String", "textExpected", ")", "throws", "SAXException", "{", "fatal", "(", "message", ",", "Character", ".", "valueOf", "(", "textFound", ")", ".", "toString", "(", ")", ...
Report a serious error. @param message The error message. @param textFound The text that caused the error (or null).
[ "Report", "a", "serious", "error", "." ]
train
https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L578-L581
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java
TypeExtractor.materializeTypeVariable
private static Type materializeTypeVariable(ArrayList<Type> typeHierarchy, TypeVariable<?> typeVar) { """ Tries to find a concrete value (Class, ParameterizedType etc. ) for a TypeVariable by traversing the type hierarchy downwards. If a value could not be found it will return the most bottom type variable in the...
java
private static Type materializeTypeVariable(ArrayList<Type> typeHierarchy, TypeVariable<?> typeVar) { TypeVariable<?> inTypeTypeVar = typeVar; // iterate thru hierarchy from top to bottom until type variable gets a class assigned for (int i = typeHierarchy.size() - 1; i >= 0; i--) { Type curT = typeHierarchy.g...
[ "private", "static", "Type", "materializeTypeVariable", "(", "ArrayList", "<", "Type", ">", "typeHierarchy", ",", "TypeVariable", "<", "?", ">", "typeVar", ")", "{", "TypeVariable", "<", "?", ">", "inTypeTypeVar", "=", "typeVar", ";", "// iterate thru hierarchy fr...
Tries to find a concrete value (Class, ParameterizedType etc. ) for a TypeVariable by traversing the type hierarchy downwards. If a value could not be found it will return the most bottom type variable in the hierarchy.
[ "Tries", "to", "find", "a", "concrete", "value", "(", "Class", "ParameterizedType", "etc", ".", ")", "for", "a", "TypeVariable", "by", "traversing", "the", "type", "hierarchy", "downwards", ".", "If", "a", "value", "could", "not", "be", "found", "it", "wil...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java#L1591-L1624
zaproxy/zaproxy
src/org/zaproxy/zap/extension/script/ExtensionScript.java
ExtensionScript.isSavedInDir
private static boolean isSavedInDir(ScriptWrapper scriptWrapper, File directory) { """ Tells whether or not the given script is saved in the given directory. @param scriptWrapper the script to check. @param directory the directory where to check. @return {@code true} if the script is saved in the given direct...
java
private static boolean isSavedInDir(ScriptWrapper scriptWrapper, File directory) { File file = scriptWrapper.getFile(); if (file == null) { return false; } return file.getParentFile().equals(directory); }
[ "private", "static", "boolean", "isSavedInDir", "(", "ScriptWrapper", "scriptWrapper", ",", "File", "directory", ")", "{", "File", "file", "=", "scriptWrapper", ".", "getFile", "(", ")", ";", "if", "(", "file", "==", "null", ")", "{", "return", "false", ";...
Tells whether or not the given script is saved in the given directory. @param scriptWrapper the script to check. @param directory the directory where to check. @return {@code true} if the script is saved in the given directory, {@code false} otherwise.
[ "Tells", "whether", "or", "not", "the", "given", "script", "is", "saved", "in", "the", "given", "directory", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L968-L974
jenkinsci/ssh-slaves-plugin
src/main/java/hudson/plugins/sshslaves/SSHLauncher.java
SSHLauncher.getSessionOutcomeMessage
private String getSessionOutcomeMessage(Session session, boolean isConnectionLost) throws InterruptedException { """ Find the exit code or exit status, which are differentiated in SSH protocol. """ session.waitForCondition(ChannelCondition.EXIT_STATUS | ChannelCondition.EXIT_SIGNAL, 3000); Int...
java
private String getSessionOutcomeMessage(Session session, boolean isConnectionLost) throws InterruptedException { session.waitForCondition(ChannelCondition.EXIT_STATUS | ChannelCondition.EXIT_SIGNAL, 3000); Integer exitCode = session.getExitStatus(); if (exitCode != null) return "Sla...
[ "private", "String", "getSessionOutcomeMessage", "(", "Session", "session", ",", "boolean", "isConnectionLost", ")", "throws", "InterruptedException", "{", "session", ".", "waitForCondition", "(", "ChannelCondition", ".", "EXIT_STATUS", "|", "ChannelCondition", ".", "EX...
Find the exit code or exit status, which are differentiated in SSH protocol.
[ "Find", "the", "exit", "code", "or", "exit", "status", "which", "are", "differentiated", "in", "SSH", "protocol", "." ]
train
https://github.com/jenkinsci/ssh-slaves-plugin/blob/95f528730fc1e01b25983459927b7516ead3ee00/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L1026-L1041
pippo-java/pippo
pippo-core/src/main/java/ro/pippo/core/route/RouteDispatcher.java
RouteDispatcher.onPostDispatch
protected void onPostDispatch(Request request, Response response) { """ Executes onPostDispatch of registered route post-dispatch listeners. @param request @param response """ application.getRoutePostDispatchListeners().onPostDispatch(request, response); }
java
protected void onPostDispatch(Request request, Response response) { application.getRoutePostDispatchListeners().onPostDispatch(request, response); }
[ "protected", "void", "onPostDispatch", "(", "Request", "request", ",", "Response", "response", ")", "{", "application", ".", "getRoutePostDispatchListeners", "(", ")", ".", "onPostDispatch", "(", "request", ",", "response", ")", ";", "}" ]
Executes onPostDispatch of registered route post-dispatch listeners. @param request @param response
[ "Executes", "onPostDispatch", "of", "registered", "route", "post", "-", "dispatch", "listeners", "." ]
train
https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/route/RouteDispatcher.java#L184-L186
h2oai/h2o-3
h2o-core/src/main/java/water/H2ONode.java
H2ONode.sendMessage
public final void sendMessage(ByteBuffer bb, byte msg_priority) { """ null if Node was removed from cloud or we didn't need to communicate with it yet """ UDP_TCP_SendThread sendThread = _sendThread; if (sendThread == null) { // Sending threads are created lazily. // This is because we will...
java
public final void sendMessage(ByteBuffer bb, byte msg_priority) { UDP_TCP_SendThread sendThread = _sendThread; if (sendThread == null) { // Sending threads are created lazily. // This is because we will intern all client nodes including the ones that have nothing to do with the cluster. // By ...
[ "public", "final", "void", "sendMessage", "(", "ByteBuffer", "bb", ",", "byte", "msg_priority", ")", "{", "UDP_TCP_SendThread", "sendThread", "=", "_sendThread", ";", "if", "(", "sendThread", "==", "null", ")", "{", "// Sending threads are created lazily.", "// This...
null if Node was removed from cloud or we didn't need to communicate with it yet
[ "null", "if", "Node", "was", "removed", "from", "cloud", "or", "we", "didn", "t", "need", "to", "communicate", "with", "it", "yet" ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2ONode.java#L417-L434
kite-sdk/kite
kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/DataModelUtil.java
DataModelUtil.getWriterSchema
public static <E> Schema getWriterSchema(Class<E> type, Schema schema) { """ Get the writer schema based on the given type and dataset schema. @param <E> The entity type @param type The Java class of the entity type @param schema The {@link Schema} for the entity @return The reader schema based on the given ...
java
public static <E> Schema getWriterSchema(Class<E> type, Schema schema) { Schema writerSchema = schema; GenericData dataModel = getDataModelForType(type); if (dataModel instanceof AllowNulls) { // assume fields are non-null by default to avoid schema conflicts dataModel = ReflectData.get(); }...
[ "public", "static", "<", "E", ">", "Schema", "getWriterSchema", "(", "Class", "<", "E", ">", "type", ",", "Schema", "schema", ")", "{", "Schema", "writerSchema", "=", "schema", ";", "GenericData", "dataModel", "=", "getDataModelForType", "(", "type", ")", ...
Get the writer schema based on the given type and dataset schema. @param <E> The entity type @param type The Java class of the entity type @param schema The {@link Schema} for the entity @return The reader schema based on the given type and writer schema
[ "Get", "the", "writer", "schema", "based", "on", "the", "given", "type", "and", "dataset", "schema", "." ]
train
https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/DataModelUtil.java#L192-L205
NoraUi/NoraUi
src/main/java/com/github/noraui/application/steps/CommonSteps.java
CommonSteps.waitStalenessOf
@Conditioned @Lorsque("Je patiente la disparition de '(.*)-(.*)' avec un timeout de '(.*)' secondes[\\.|\\?]") @Then("I wait staleness of '(.*)-(.*)' with timeout of '(.*)' seconds[\\.|\\?]") public void waitStalenessOf(String page, String element, int time, List<GherkinStepCondition> conditions) throws ...
java
@Conditioned @Lorsque("Je patiente la disparition de '(.*)-(.*)' avec un timeout de '(.*)' secondes[\\.|\\?]") @Then("I wait staleness of '(.*)-(.*)' with timeout of '(.*)' seconds[\\.|\\?]") public void waitStalenessOf(String page, String element, int time, List<GherkinStepCondition> conditions) throws ...
[ "@", "Conditioned", "@", "Lorsque", "(", "\"Je patiente la disparition de '(.*)-(.*)' avec un timeout de '(.*)' secondes[\\\\.|\\\\?]\"", ")", "@", "Then", "(", "\"I wait staleness of '(.*)-(.*)' with timeout of '(.*)' seconds[\\\\.|\\\\?]\"", ")", "public", "void", "waitStalenessOf", ...
Waits staleness of element with timeout of x seconds. @param page The concerned page of field @param element is key of PageElement concerned @param time is custom timeout @param conditions list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}). @throws Technica...
[ "Waits", "staleness", "of", "element", "with", "timeout", "of", "x", "seconds", "." ]
train
https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L110-L116
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.dedicated_server_serviceName_backupStorage_duration_GET
public OvhOrder dedicated_server_serviceName_backupStorage_duration_GET(String serviceName, String duration, OvhBackupStorageCapacityEnum capacity) throws IOException { """ Get prices and contracts information REST: GET /order/dedicated/server/{serviceName}/backupStorage/{duration} @param capacity [required] T...
java
public OvhOrder dedicated_server_serviceName_backupStorage_duration_GET(String serviceName, String duration, OvhBackupStorageCapacityEnum capacity) throws IOException { String qPath = "/order/dedicated/server/{serviceName}/backupStorage/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); query(sb,...
[ "public", "OvhOrder", "dedicated_server_serviceName_backupStorage_duration_GET", "(", "String", "serviceName", ",", "String", "duration", ",", "OvhBackupStorageCapacityEnum", "capacity", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/dedicated/server/{serv...
Get prices and contracts information REST: GET /order/dedicated/server/{serviceName}/backupStorage/{duration} @param capacity [required] The capacity in gigabytes of your backup storage @param serviceName [required] The internal name of your dedicated server @param duration [required] Duration
[ "Get", "prices", "and", "contracts", "information" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2452-L2458
lightblueseas/swing-components
src/main/java/de/alpharogroup/swing/components/factories/JComponentFactory.java
JComponentFactory.newHelpSet
public static HelpSet newHelpSet(final String directoryPath, final String filename) throws HelpSetException { """ Factory method for create new {@link HelpSet} object. @param directoryPath the directory path @param filename the filename @return the new {@link HelpSet} object @throws HelpSetException is ...
java
public static HelpSet newHelpSet(final String directoryPath, final String filename) throws HelpSetException { String absolutePath = directoryPath + filename; URL hsURL = ClassExtensions.getResource(absolutePath); HelpSet hs = new HelpSet(ClassExtensions.getClassLoader(), hsURL); return hs; }
[ "public", "static", "HelpSet", "newHelpSet", "(", "final", "String", "directoryPath", ",", "final", "String", "filename", ")", "throws", "HelpSetException", "{", "String", "absolutePath", "=", "directoryPath", "+", "filename", ";", "URL", "hsURL", "=", "ClassExten...
Factory method for create new {@link HelpSet} object. @param directoryPath the directory path @param filename the filename @return the new {@link HelpSet} object @throws HelpSetException is thrown if there are problems parsing the {@link HelpSet} object.
[ "Factory", "method", "for", "create", "new", "{", "@link", "HelpSet", "}", "object", "." ]
train
https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/components/factories/JComponentFactory.java#L141-L148
prestodb/presto
presto-hive/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java
SemiTransactionalHiveMetastore.deleteRecursivelyIfExists
private static boolean deleteRecursivelyIfExists(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path) { """ Attempts to remove the file or empty directory. @return true if the location no longer exists """ FileSystem fileSystem; try { fileSystem = hdfsEnvironment.getF...
java
private static boolean deleteRecursivelyIfExists(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path) { FileSystem fileSystem; try { fileSystem = hdfsEnvironment.getFileSystem(context, path); } catch (IOException ignored) { return false; } ...
[ "private", "static", "boolean", "deleteRecursivelyIfExists", "(", "HdfsContext", "context", ",", "HdfsEnvironment", "hdfsEnvironment", ",", "Path", "path", ")", "{", "FileSystem", "fileSystem", ";", "try", "{", "fileSystem", "=", "hdfsEnvironment", ".", "getFileSystem...
Attempts to remove the file or empty directory. @return true if the location no longer exists
[ "Attempts", "to", "remove", "the", "file", "or", "empty", "directory", "." ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-hive/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java#L1863-L1874
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBWrapper.java
EJBWrapper.addDefaultHashCodeMethod
private static void addDefaultHashCodeMethod(ClassWriter cw, String implClassName) { """ Adds the default definition for the Object.hashCode method. @param cw ASM ClassWriter to add the method to. @param implClassName name of the wrapper class being generated. """ if (TraceComponent.isAnyTracingEna...
java
private static void addDefaultHashCodeMethod(ClassWriter cw, String implClassName) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, INDENT + "adding method : hashCode ()I"); // ----------------------------------------------------------------------- ...
[ "private", "static", "void", "addDefaultHashCodeMethod", "(", "ClassWriter", "cw", ",", "String", "implClassName", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug"...
Adds the default definition for the Object.hashCode method. @param cw ASM ClassWriter to add the method to. @param implClassName name of the wrapper class being generated.
[ "Adds", "the", "default", "definition", "for", "the", "Object", ".", "hashCode", "method", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBWrapper.java#L672-L698
j-easy/easy-random
easy-random-core/src/main/java/org/jeasy/random/ExclusionChecker.java
ExclusionChecker.shouldBeExcluded
public boolean shouldBeExcluded(final Class<?> type, final RandomizerContext context) { """ Given the current randomization context, should the type be excluded from being populated ? @param type the type to check @param context the current randomization context @return true if the type should be excluded, fa...
java
public boolean shouldBeExcluded(final Class<?> type, final RandomizerContext context) { Set<Predicate<Class<?>>> typeExclusionPredicates = context.getParameters().getTypeExclusionPredicates(); for (Predicate<Class<?>> typeExclusionPredicate : typeExclusionPredicates) { if (typeExclusionPredi...
[ "public", "boolean", "shouldBeExcluded", "(", "final", "Class", "<", "?", ">", "type", ",", "final", "RandomizerContext", "context", ")", "{", "Set", "<", "Predicate", "<", "Class", "<", "?", ">", ">", ">", "typeExclusionPredicates", "=", "context", ".", "...
Given the current randomization context, should the type be excluded from being populated ? @param type the type to check @param context the current randomization context @return true if the type should be excluded, false otherwise
[ "Given", "the", "current", "randomization", "context", "should", "the", "type", "be", "excluded", "from", "being", "populated", "?" ]
train
https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/ExclusionChecker.java#L70-L78
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/helper/tool/ToolUtils.java
ToolUtils.getDidYouMeanString
public static String getDidYouMeanString(Collection<String> available, String it) { """ Finds strings similar to a string the user has entered and then generates a "Did you mean one of these" message @param available all possibilities @param it the string the user has entered @return the "Did you mean..." stri...
java
public static String getDidYouMeanString(Collection<String> available, String it) { String message = ""; Collection<String> mins = Levenshtein.findSimilar(available, it); if (mins.size() > 0) { if (mins.size() == 1) { message += "Did you mean this?"; } else { message += "Did you mean one of these...
[ "public", "static", "String", "getDidYouMeanString", "(", "Collection", "<", "String", ">", "available", ",", "String", "it", ")", "{", "String", "message", "=", "\"\"", ";", "Collection", "<", "String", ">", "mins", "=", "Levenshtein", ".", "findSimilar", "...
Finds strings similar to a string the user has entered and then generates a "Did you mean one of these" message @param available all possibilities @param it the string the user has entered @return the "Did you mean..." string
[ "Finds", "strings", "similar", "to", "a", "string", "the", "user", "has", "entered", "and", "then", "generates", "a", "Did", "you", "mean", "one", "of", "these", "message" ]
train
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/helper/tool/ToolUtils.java#L37-L53
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/common/Similarity.java
Similarity.tanimotoCoefficient
public static double tanimotoCoefficient(double[] a, double[] b) { """ Returns the Tanimoto coefficient of the two {@code double} array instances. @throws IllegalArgumentException when the length of the two arrays are not the same. """ return tanimotoCoefficient(Vectors.asVector(a), Vectors.asVecto...
java
public static double tanimotoCoefficient(double[] a, double[] b) { return tanimotoCoefficient(Vectors.asVector(a), Vectors.asVector(b)); }
[ "public", "static", "double", "tanimotoCoefficient", "(", "double", "[", "]", "a", ",", "double", "[", "]", "b", ")", "{", "return", "tanimotoCoefficient", "(", "Vectors", ".", "asVector", "(", "a", ")", ",", "Vectors", ".", "asVector", "(", "b", ")", ...
Returns the Tanimoto coefficient of the two {@code double} array instances. @throws IllegalArgumentException when the length of the two arrays are not the same.
[ "Returns", "the", "Tanimoto", "coefficient", "of", "the", "two", "{", "@code", "double", "}", "array", "instances", "." ]
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/Similarity.java#L2287-L2289
httl/httl
httl/src/main/java/httl/spi/engines/DefaultEngine.java
DefaultEngine.getResource
public Resource getResource(String name, Locale locale, String encoding) throws IOException { """ Get resource. @param name - resource name @param locale - resource locale @param encoding - resource encoding @return resource instance @throws IOException - If an I/O error occurs @see #getEngine() ...
java
public Resource getResource(String name, Locale locale, String encoding) throws IOException { name = UrlUtils.cleanName(name); locale = cleanLocale(locale); return loadResource(name, locale, encoding); }
[ "public", "Resource", "getResource", "(", "String", "name", ",", "Locale", "locale", ",", "String", "encoding", ")", "throws", "IOException", "{", "name", "=", "UrlUtils", ".", "cleanName", "(", "name", ")", ";", "locale", "=", "cleanLocale", "(", "locale", ...
Get resource. @param name - resource name @param locale - resource locale @param encoding - resource encoding @return resource instance @throws IOException - If an I/O error occurs @see #getEngine()
[ "Get", "resource", "." ]
train
https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/engines/DefaultEngine.java#L300-L304
hdecarne/java-default
src/main/java/de/carne/io/IOUtil.java
IOUtil.copyBuffer
public static int copyBuffer(OutputStream dst, ByteBuffer buffer) throws IOException { """ Copies all available bytes from a {@linkplain ByteBuffer} to a {@linkplain OutputStream}. @param dst the {@linkplain OutputStream} to copy to. @param buffer the {@linkplain ByteBuffer} to copy from. @return the number o...
java
public static int copyBuffer(OutputStream dst, ByteBuffer buffer) throws IOException { int remaining = buffer.remaining(); int copied = 0; if (remaining > 0) { if (buffer.hasArray()) { byte[] bufferArray = buffer.array(); int bufferArrayOffset = buffer.arrayOffset(); int bufferPosition = buffer.po...
[ "public", "static", "int", "copyBuffer", "(", "OutputStream", "dst", ",", "ByteBuffer", "buffer", ")", "throws", "IOException", "{", "int", "remaining", "=", "buffer", ".", "remaining", "(", ")", ";", "int", "copied", "=", "0", ";", "if", "(", "remaining",...
Copies all available bytes from a {@linkplain ByteBuffer} to a {@linkplain OutputStream}. @param dst the {@linkplain OutputStream} to copy to. @param buffer the {@linkplain ByteBuffer} to copy from. @return the number of copied bytes. @throws IOException if an I/O error occurs.
[ "Copies", "all", "available", "bytes", "from", "a", "{", "@linkplain", "ByteBuffer", "}", "to", "a", "{", "@linkplain", "OutputStream", "}", "." ]
train
https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/io/IOUtil.java#L208-L229
netty/netty
codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java
LengthFieldBasedFrameDecoder.extractFrame
protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length) { """ Extract the sub-region of the specified buffer. <p> If you are sure that the frame and its content are not accessed after the current {@link #decode(ChannelHandlerContext, ByteBuf)} call returns, you can even...
java
protected ByteBuf extractFrame(ChannelHandlerContext ctx, ByteBuf buffer, int index, int length) { return buffer.retainedSlice(index, length); }
[ "protected", "ByteBuf", "extractFrame", "(", "ChannelHandlerContext", "ctx", ",", "ByteBuf", "buffer", ",", "int", "index", ",", "int", "length", ")", "{", "return", "buffer", ".", "retainedSlice", "(", "index", ",", "length", ")", ";", "}" ]
Extract the sub-region of the specified buffer. <p> If you are sure that the frame and its content are not accessed after the current {@link #decode(ChannelHandlerContext, ByteBuf)} call returns, you can even avoid memory copy by returning the sliced sub-region (i.e. <tt>return buffer.slice(index, length)</tt>). It's o...
[ "Extract", "the", "sub", "-", "region", "of", "the", "specified", "buffer", ".", "<p", ">", "If", "you", "are", "sure", "that", "the", "frame", "and", "its", "content", "are", "not", "accessed", "after", "the", "current", "{" ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java#L507-L509
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java
ElementsExceptionsFactory.newComparisonException
public static ComparisonException newComparisonException(String message, Object... args) { """ Constructs and initializes a new {@link ComparisonException} with the given {@link String message} formatted with the given {@link Object[] arguments}. @param message {@link String} describing the {@link ComparisonEx...
java
public static ComparisonException newComparisonException(String message, Object... args) { return newComparisonException(null, message, args); }
[ "public", "static", "ComparisonException", "newComparisonException", "(", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "newComparisonException", "(", "null", ",", "message", ",", "args", ")", ";", "}" ]
Constructs and initializes a new {@link ComparisonException} with the given {@link String message} formatted with the given {@link Object[] arguments}. @param message {@link String} describing the {@link ComparisonException exception}. @param args {@link Object[] arguments} used to replace format placeholders in the {...
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "ComparisonException", "}", "with", "the", "given", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", "Object", "[]", "arguments", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L299-L301
gresrun/jesque
src/main/java/net/greghaines/jesque/client/AbstractClient.java
AbstractClient.doPriorityEnqueue
public static void doPriorityEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) { """ Helper method that encapsulates the minimum logic for adding a high priority job to a queue. @param jedis the connection to Redis @param namespace the Resque namespace @param queu...
java
public static void doPriorityEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) { jedis.sadd(JesqueUtils.createKey(namespace, QUEUES), queue); jedis.lpush(JesqueUtils.createKey(namespace, QUEUE, queue), jobJson); }
[ "public", "static", "void", "doPriorityEnqueue", "(", "final", "Jedis", "jedis", ",", "final", "String", "namespace", ",", "final", "String", "queue", ",", "final", "String", "jobJson", ")", "{", "jedis", ".", "sadd", "(", "JesqueUtils", ".", "createKey", "(...
Helper method that encapsulates the minimum logic for adding a high priority job to a queue. @param jedis the connection to Redis @param namespace the Resque namespace @param queue the Resque queue name @param jobJson the job serialized as JSON
[ "Helper", "method", "that", "encapsulates", "the", "minimum", "logic", "for", "adding", "a", "high", "priority", "job", "to", "a", "queue", "." ]
train
https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/client/AbstractClient.java#L256-L259
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
ClassWriterImpl.getClassLinks
private Content getClassLinks(LinkInfoImpl.Kind context, Collection<?> list) { """ Get links to the given classes. @param context the id of the context where the link will be printed @param list the list of classes @return a content tree for the class list """ Object[] typeList = list.toArray(); ...
java
private Content getClassLinks(LinkInfoImpl.Kind context, Collection<?> list) { Object[] typeList = list.toArray(); Content dd = new HtmlTree(HtmlTag.DD); boolean isFirst = true; for (Object item : typeList) { if (!isFirst) { Content separator = new StringConte...
[ "private", "Content", "getClassLinks", "(", "LinkInfoImpl", ".", "Kind", "context", ",", "Collection", "<", "?", ">", "list", ")", "{", "Object", "[", "]", "typeList", "=", "list", ".", "toArray", "(", ")", ";", "Content", "dd", "=", "new", "HtmlTree", ...
Get links to the given classes. @param context the id of the context where the link will be printed @param list the list of classes @return a content tree for the class list
[ "Get", "links", "to", "the", "given", "classes", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java#L590-L611
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/logging/MyfacesLogger.java
MyfacesLogger.logp
public void logp(Level level, String sourceClass, String sourceMethod, String msg) { """ Log a message, specifying source class and method, with no arguments. <p> If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. <...
java
public void logp(Level level, String sourceClass, String sourceMethod, String msg) { if (isLoggable(level)) { MyfacesLogRecord lr = new MyfacesLogRecord(level, msg); lr.setSourceClassName(sourceClass); lr.setSourceMethodName(sourceMethod); doLog(lr); ...
[ "public", "void", "logp", "(", "Level", "level", ",", "String", "sourceClass", ",", "String", "sourceMethod", ",", "String", "msg", ")", "{", "if", "(", "isLoggable", "(", "level", ")", ")", "{", "MyfacesLogRecord", "lr", "=", "new", "MyfacesLogRecord", "(...
Log a message, specifying source class and method, with no arguments. <p> If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. <p> @param level One of the message level identifiers, e.g. SEVERE @param sourceClass name of ...
[ "Log", "a", "message", "specifying", "source", "class", "and", "method", "with", "no", "arguments", ".", "<p", ">", "If", "the", "logger", "is", "currently", "enabled", "for", "the", "given", "message", "level", "then", "the", "given", "message", "is", "fo...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/logging/MyfacesLogger.java#L455-L464
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/AppFramework.java
AppFramework.findObject
public synchronized Object findObject(Class<?> clazz, Object previousInstance) { """ Finds a registered object belonging to the specified class. @param clazz Returned object must be assignment-compatible with this class. @param previousInstance Previous instance returned by this call. Search will start with th...
java
public synchronized Object findObject(Class<?> clazz, Object previousInstance) { int i = previousInstance == null ? -1 : MiscUtil.indexOfInstance(registeredObjects, previousInstance); for (i++; i < registeredObjects.size(); i++) { Object object = registeredObjects.get(i); ...
[ "public", "synchronized", "Object", "findObject", "(", "Class", "<", "?", ">", "clazz", ",", "Object", "previousInstance", ")", "{", "int", "i", "=", "previousInstance", "==", "null", "?", "-", "1", ":", "MiscUtil", ".", "indexOfInstance", "(", "registeredOb...
Finds a registered object belonging to the specified class. @param clazz Returned object must be assignment-compatible with this class. @param previousInstance Previous instance returned by this call. Search will start with the entry that follows this one in the list. If this parameter is null, the search starts at th...
[ "Finds", "a", "registered", "object", "belonging", "to", "the", "specified", "class", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/AppFramework.java#L177-L189
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.putAsync
public CompletableFuture<Object> putAsync(@DelegatesTo(HttpConfig.class) final Closure closure) { """ Executes an asynchronous PUT request on the configured URI (an asynchronous alias to the `put(Closure)` method), with additional configuration provided by the configuration closure. [source,groovy] ---- def ...
java
public CompletableFuture<Object> putAsync(@DelegatesTo(HttpConfig.class) final Closure closure) { return CompletableFuture.supplyAsync(() -> put(closure), getExecutor()); }
[ "public", "CompletableFuture", "<", "Object", ">", "putAsync", "(", "@", "DelegatesTo", "(", "HttpConfig", ".", "class", ")", "final", "Closure", "closure", ")", "{", "return", "CompletableFuture", ".", "supplyAsync", "(", "(", ")", "->", "put", "(", "closur...
Executes an asynchronous PUT request on the configured URI (an asynchronous alias to the `put(Closure)` method), with additional configuration provided by the configuration closure. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = 'http://localhost:10101' } def result = http.putAsync(){ request.ur...
[ "Executes", "an", "asynchronous", "PUT", "request", "on", "the", "configured", "URI", "(", "an", "asynchronous", "alias", "to", "the", "put", "(", "Closure", ")", "method", ")", "with", "additional", "configuration", "provided", "by", "the", "configuration", "...
train
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L999-L1001
lamydev/Android-Notification
core/src/zemin/notification/NotificationBoardCallback.java
NotificationBoardCallback.onClickRowView
public void onClickRowView(NotificationBoard board, RowView rowView, NotificationEntry entry) { """ Called when a row view has been clicked. @param board @param rowView @param entry """ if (DBG) Log.v(TAG, "onClickRowView - " + entry.ID); }
java
public void onClickRowView(NotificationBoard board, RowView rowView, NotificationEntry entry) { if (DBG) Log.v(TAG, "onClickRowView - " + entry.ID); }
[ "public", "void", "onClickRowView", "(", "NotificationBoard", "board", ",", "RowView", "rowView", ",", "NotificationEntry", "entry", ")", "{", "if", "(", "DBG", ")", "Log", ".", "v", "(", "TAG", ",", "\"onClickRowView - \"", "+", "entry", ".", "ID", ")", "...
Called when a row view has been clicked. @param board @param rowView @param entry
[ "Called", "when", "a", "row", "view", "has", "been", "clicked", "." ]
train
https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationBoardCallback.java#L206-L208