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
landawn/AbacusUtil
src/com/landawn/abacus/util/Fraction.java
Fraction.mulPosAndCheck
private static int mulPosAndCheck(final int x, final int y) { """ Multiply two non-negative integers, checking for overflow. @param x a non-negative factor @param y a non-negative factor @return the product <code>x*y</code> @throws ArithmeticException if the result can not be represented as an int """...
java
private static int mulPosAndCheck(final int x, final int y) { /* assert x>=0 && y>=0; */ final long m = (long) x * (long) y; if (m > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: mulPos"); } return (int) m; }
[ "private", "static", "int", "mulPosAndCheck", "(", "final", "int", "x", ",", "final", "int", "y", ")", "{", "/* assert x>=0 && y>=0; */", "final", "long", "m", "=", "(", "long", ")", "x", "*", "(", "long", ")", "y", ";", "if", "(", "m", ">", "Integer...
Multiply two non-negative integers, checking for overflow. @param x a non-negative factor @param y a non-negative factor @return the product <code>x*y</code> @throws ArithmeticException if the result can not be represented as an int
[ "Multiply", "two", "non", "-", "negative", "integers", "checking", "for", "overflow", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fraction.java#L780-L787
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/BaseWorkflowExecutor.java
BaseWorkflowExecutor.workflowResult
protected static WorkflowStatusDataResult workflowResult( boolean status, String statusString, ControlBehavior behavior, WFSharedContext sharedContext ) { """ @param status success/failure @param statusString status string @param behavior control beha...
java
protected static WorkflowStatusDataResult workflowResult( boolean status, String statusString, ControlBehavior behavior, WFSharedContext sharedContext ) { return new BaseWorkflowStatusResult(status, statusString, behavior, sharedContext); }
[ "protected", "static", "WorkflowStatusDataResult", "workflowResult", "(", "boolean", "status", ",", "String", "statusString", ",", "ControlBehavior", "behavior", ",", "WFSharedContext", "sharedContext", ")", "{", "return", "new", "BaseWorkflowStatusResult", "(", "status",...
@param status success/failure @param statusString status string @param behavior control behavior @return result with the given input
[ "@param", "status", "success", "/", "failure", "@param", "statusString", "status", "string", "@param", "behavior", "control", "behavior" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/BaseWorkflowExecutor.java#L74-L82
Netflix/concurrency-limits
concurrency-limits-servlet/src/main/java/com/netflix/concurrency/limits/servlet/ServletLimiterBuilder.java
ServletLimiterBuilder.partitionByUserPrincipal
public ServletLimiterBuilder partitionByUserPrincipal(Function<Principal, String> principalToGroup) { """ Partition the limit by {@link Principal}. Percentages of the limit are partitioned to named groups. Group membership is derived from the provided mapping function. @param principalToGroup Mapping function f...
java
public ServletLimiterBuilder partitionByUserPrincipal(Function<Principal, String> principalToGroup) { return partitionResolver(request -> Optional.ofNullable(request.getUserPrincipal()).map(principalToGroup).orElse(null)); }
[ "public", "ServletLimiterBuilder", "partitionByUserPrincipal", "(", "Function", "<", "Principal", ",", "String", ">", "principalToGroup", ")", "{", "return", "partitionResolver", "(", "request", "->", "Optional", ".", "ofNullable", "(", "request", ".", "getUserPrincip...
Partition the limit by {@link Principal}. Percentages of the limit are partitioned to named groups. Group membership is derived from the provided mapping function. @param principalToGroup Mapping function from {@link Principal} to a named group. @return Chainable builder
[ "Partition", "the", "limit", "by", "{" ]
train
https://github.com/Netflix/concurrency-limits/blob/5ae2be4fea9848af6f63c7b5632af30c494e7373/concurrency-limits-servlet/src/main/java/com/netflix/concurrency/limits/servlet/ServletLimiterBuilder.java#L46-L48
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java
ModuleIndexWriter.addIndexContents
protected void addIndexContents(Collection<ModuleElement> modules, String title, String tableSummary, Content body) { """ Adds module index contents. @param title the title of the section @param tableSummary summary for the table @param body the document tree to which the index contents will be added """ ...
java
protected void addIndexContents(Collection<ModuleElement> modules, String title, String tableSummary, Content body) { HtmlTree htmltree = (configuration.allowTag(HtmlTag.NAV)) ? HtmlTree.NAV() : new HtmlTree(HtmlTag.DIV); htmltree.addStyle(HtmlStyle.indexNav); Htm...
[ "protected", "void", "addIndexContents", "(", "Collection", "<", "ModuleElement", ">", "modules", ",", "String", "title", ",", "String", "tableSummary", ",", "Content", "body", ")", "{", "HtmlTree", "htmltree", "=", "(", "configuration", ".", "allowTag", "(", ...
Adds module index contents. @param title the title of the section @param tableSummary summary for the table @param body the document tree to which the index contents will be added
[ "Adds", "module", "index", "contents", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java#L122-L135
Azure/azure-sdk-for-java
privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java
PrivateZonesInner.getByResourceGroupAsync
public Observable<PrivateZoneInner> getByResourceGroupAsync(String resourceGroupName, String privateZoneName) { """ Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone. @param resourceGroupName The name of the resource group. @param priv...
java
public Observable<PrivateZoneInner> getByResourceGroupAsync(String resourceGroupName, String privateZoneName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateZoneName).map(new Func1<ServiceResponse<PrivateZoneInner>, PrivateZoneInner>() { @Override public Pr...
[ "public", "Observable", "<", "PrivateZoneInner", ">", "getByResourceGroupAsync", "(", "String", "resourceGroupName", ",", "String", "privateZoneName", ")", "{", "return", "getByResourceGroupWithServiceResponseAsync", "(", "resourceGroupName", ",", "privateZoneName", ")", "....
Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone. @param resourceGroupName The name of the resource group. @param privateZoneName The name of the Private DNS zone (without a terminating dot). @throws IllegalArgumentException thrown if paramet...
[ "Gets", "a", "Private", "DNS", "zone", ".", "Retrieves", "the", "zone", "properties", "but", "not", "the", "virtual", "networks", "links", "or", "the", "record", "sets", "within", "the", "zone", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java#L1160-L1167
Clivern/Racter
src/main/java/com/clivern/racter/senders/templates/MessageTemplate.java
MessageTemplate.setAttachment
public void setAttachment(String type, String url, Boolean is_reusable) { """ Set Attachment @param type the attachment type @param url the attachment url @param is_reusable whether to be reusable or not """ this.message_attachment.put("type", type); this.message_attachment.put("url", url)...
java
public void setAttachment(String type, String url, Boolean is_reusable) { this.message_attachment.put("type", type); this.message_attachment.put("url", url); this.message_attachment.put("is_reusable", String.valueOf(is_reusable)); }
[ "public", "void", "setAttachment", "(", "String", "type", ",", "String", "url", ",", "Boolean", "is_reusable", ")", "{", "this", ".", "message_attachment", ".", "put", "(", "\"type\"", ",", "type", ")", ";", "this", ".", "message_attachment", ".", "put", "...
Set Attachment @param type the attachment type @param url the attachment url @param is_reusable whether to be reusable or not
[ "Set", "Attachment" ]
train
https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/MessageTemplate.java#L102-L107
Cornutum/tcases
tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java
SystemInputJson.asValidCondition
private static ICondition asValidCondition( JsonObject json) { """ Returns the condition definition represented by the given JSON object. """ try { return asCondition( json); } catch( SystemInputException e) { throw new SystemInputException( "Invalid condition", e); ...
java
private static ICondition asValidCondition( JsonObject json) { try { return asCondition( json); } catch( SystemInputException e) { throw new SystemInputException( "Invalid condition", e); } }
[ "private", "static", "ICondition", "asValidCondition", "(", "JsonObject", "json", ")", "{", "try", "{", "return", "asCondition", "(", "json", ")", ";", "}", "catch", "(", "SystemInputException", "e", ")", "{", "throw", "new", "SystemInputException", "(", "\"In...
Returns the condition definition represented by the given JSON object.
[ "Returns", "the", "condition", "definition", "represented", "by", "the", "given", "JSON", "object", "." ]
train
https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java#L385-L395
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java
MathUtil.binomialCoefficient
public static long binomialCoefficient(long n, long k) { """ Binomial coefficient, also known as "n choose k". @param n Total number of samples. n &gt; 0 @param k Number of elements to choose. <code>n &gt;= k</code>, <code>k &gt;= 0</code> @return n! / (k! * (n-k)!) """ final long m = Math.max(k, n -...
java
public static long binomialCoefficient(long n, long k) { final long m = Math.max(k, n - k); double temp = 1; for(long i = n, j = 1; i > m; i--, j++) { temp = temp * i / j; } return (long) temp; }
[ "public", "static", "long", "binomialCoefficient", "(", "long", "n", ",", "long", "k", ")", "{", "final", "long", "m", "=", "Math", ".", "max", "(", "k", ",", "n", "-", "k", ")", ";", "double", "temp", "=", "1", ";", "for", "(", "long", "i", "=...
Binomial coefficient, also known as "n choose k". @param n Total number of samples. n &gt; 0 @param k Number of elements to choose. <code>n &gt;= k</code>, <code>k &gt;= 0</code> @return n! / (k! * (n-k)!)
[ "Binomial", "coefficient", "also", "known", "as", "n", "choose", "k", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java#L237-L244
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java
Apptentive.sendAttachmentFile
public static void sendAttachmentFile(final byte[] content, final String mimeType) { """ Sends a file to the server. This file will be visible in the conversation view on the server, but will not be shown in the client's Message Center. A local copy of this file will be made until the message is transmitted, at w...
java
public static void sendAttachmentFile(final byte[] content, final String mimeType) { dispatchConversationTask(new ConversationDispatchTask() { @Override protected boolean execute(Conversation conversation) { ByteArrayInputStream is = null; try { is = new ByteArrayInputStream(content); sendAtta...
[ "public", "static", "void", "sendAttachmentFile", "(", "final", "byte", "[", "]", "content", ",", "final", "String", "mimeType", ")", "{", "dispatchConversationTask", "(", "new", "ConversationDispatchTask", "(", ")", "{", "@", "Override", "protected", "boolean", ...
Sends a file to the server. This file will be visible in the conversation view on the server, but will not be shown in the client's Message Center. A local copy of this file will be made until the message is transmitted, at which point the temporary file will be deleted. @param content A byte array of the file conten...
[ "Sends", "a", "file", "to", "the", "server", ".", "This", "file", "will", "be", "visible", "in", "the", "conversation", "view", "on", "the", "server", "but", "will", "not", "be", "shown", "in", "the", "client", "s", "Message", "Center", ".", "A", "loca...
train
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L1122-L1136
joniles/mpxj
src/main/java/net/sf/mpxj/Resource.java
Resource.selectField
private ResourceField selectField(ResourceField[] fields, int index) { """ Maps a field index to a ResourceField instance. @param fields array of fields used as the basis for the mapping. @param index required field index @return ResourceField instance """ if (index < 1 || index > fields.length) ...
java
private ResourceField selectField(ResourceField[] fields, int index) { if (index < 1 || index > fields.length) { throw new IllegalArgumentException(index + " is not a valid field index"); } return (fields[index - 1]); }
[ "private", "ResourceField", "selectField", "(", "ResourceField", "[", "]", "fields", ",", "int", "index", ")", "{", "if", "(", "index", "<", "1", "||", "index", ">", "fields", ".", "length", ")", "{", "throw", "new", "IllegalArgumentException", "(", "index...
Maps a field index to a ResourceField instance. @param fields array of fields used as the basis for the mapping. @param index required field index @return ResourceField instance
[ "Maps", "a", "field", "index", "to", "a", "ResourceField", "instance", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L2317-L2324
apache/groovy
subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java
DateTimeExtensions.rightShift
public static TemporalAmount rightShift(final Temporal self, Temporal other) { """ Returns a {@link java.time.Duration} or {@link java.time.Period} between this (inclusive) and the {@code other} {@link java.time.temporal.Temporal} (exclusive). <p> A Period will be returned for types {@link java.time.Year}, {@li...
java
public static TemporalAmount rightShift(final Temporal self, Temporal other) { if (!self.getClass().equals(other.getClass())) { throw new GroovyRuntimeException("Temporal arguments must be of the same type."); } switch ((ChronoUnit) defaultUnitFor(self)) { case YEARS: ...
[ "public", "static", "TemporalAmount", "rightShift", "(", "final", "Temporal", "self", ",", "Temporal", "other", ")", "{", "if", "(", "!", "self", ".", "getClass", "(", ")", ".", "equals", "(", "other", ".", "getClass", "(", ")", ")", ")", "{", "throw",...
Returns a {@link java.time.Duration} or {@link java.time.Period} between this (inclusive) and the {@code other} {@link java.time.temporal.Temporal} (exclusive). <p> A Period will be returned for types {@link java.time.Year}, {@link java.time.YearMonth}, and {@link java.time.chrono.ChronoLocalDate}; otherwise, a Duratio...
[ "Returns", "a", "{", "@link", "java", ".", "time", ".", "Duration", "}", "or", "{", "@link", "java", ".", "time", ".", "Period", "}", "between", "this", "(", "inclusive", ")", "and", "the", "{", "@code", "other", "}", "{", "@link", "java", ".", "ti...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L265-L279
osglworks/java-mvc
src/main/java/org/osgl/mvc/result/MethodNotAllowed.java
MethodNotAllowed.of
public static MethodNotAllowed of(int errorCode) { """ Returns a static MethodNotAllowed instance and set the {@link #payload} thread local with error code and default message. When calling the instance on {@link #getMessage()} method, it will return whatever stored in the {@link #payload} thread local @pa...
java
public static MethodNotAllowed of(int errorCode) { if (_localizedErrorMsg()) { return of(errorCode, defaultMessage(METHOD_NOT_ALLOWED)); } else { touchPayload().errorCode(errorCode); return _INSTANCE; } }
[ "public", "static", "MethodNotAllowed", "of", "(", "int", "errorCode", ")", "{", "if", "(", "_localizedErrorMsg", "(", ")", ")", "{", "return", "of", "(", "errorCode", ",", "defaultMessage", "(", "METHOD_NOT_ALLOWED", ")", ")", ";", "}", "else", "{", "touc...
Returns a static MethodNotAllowed instance and set the {@link #payload} thread local with error code and default message. When calling the instance on {@link #getMessage()} method, it will return whatever stored in the {@link #payload} thread local @param errorCode the app defined error code @return a static MethodNo...
[ "Returns", "a", "static", "MethodNotAllowed", "instance", "and", "set", "the", "{", "@link", "#payload", "}", "thread", "local", "with", "error", "code", "and", "default", "message", "." ]
train
https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/MethodNotAllowed.java#L167-L174
JodaOrg/joda-time
src/main/java/org/joda/time/convert/NullConverter.java
NullConverter.setInto
public void setInto(ReadWritableInterval writableInterval, Object object, Chronology chrono) { """ Extracts interval endpoint values from an object of this converter's type, and sets them into the given ReadWritableInterval. @param writableInterval interval to get modified, not null @param object the object ...
java
public void setInto(ReadWritableInterval writableInterval, Object object, Chronology chrono) { writableInterval.setChronology(chrono); long now = DateTimeUtils.currentTimeMillis(); writableInterval.setInterval(now, now); }
[ "public", "void", "setInto", "(", "ReadWritableInterval", "writableInterval", ",", "Object", "object", ",", "Chronology", "chrono", ")", "{", "writableInterval", ".", "setChronology", "(", "chrono", ")", ";", "long", "now", "=", "DateTimeUtils", ".", "currentTimeM...
Extracts interval endpoint values from an object of this converter's type, and sets them into the given ReadWritableInterval. @param writableInterval interval to get modified, not null @param object the object to convert, which is null @param chrono the chronology to use, may be null @throws NullPointerException if ...
[ "Extracts", "interval", "endpoint", "values", "from", "an", "object", "of", "this", "converter", "s", "type", "and", "sets", "them", "into", "the", "given", "ReadWritableInterval", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/NullConverter.java#L82-L86
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/Table.java
Table.checkColumnsMatch
void checkColumnsMatch(int[] col, Table other, int[] othercol) { """ Match two valid, equal length, columns arrays for type of columns @param col column array from this Table @param other the other Table object @param othercol column array from the other Table """ for (int i = 0; i < col.length; ...
java
void checkColumnsMatch(int[] col, Table other, int[] othercol) { for (int i = 0; i < col.length; i++) { Type type = colTypes[col[i]]; Type otherType = other.colTypes[othercol[i]]; if (type.typeComparisonGroup != otherType.typeComparisonGroup) { throw Er...
[ "void", "checkColumnsMatch", "(", "int", "[", "]", "col", ",", "Table", "other", ",", "int", "[", "]", "othercol", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "col", ".", "length", ";", "i", "++", ")", "{", "Type", "type", "=", ...
Match two valid, equal length, columns arrays for type of columns @param col column array from this Table @param other the other Table object @param othercol column array from the other Table
[ "Match", "two", "valid", "equal", "length", "columns", "arrays", "for", "type", "of", "columns" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L963-L973
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java
HttpChannelConfig.parseMaxPersist
private void parseMaxPersist(Map<Object, Object> props) { """ Check the input configuration for the maximum allowed requests per socket setting. @param props """ // -1 means unlimited // 0..1 means 1 // X means X Object value = props.get(HttpConfigConstants.PROPNAME_MAX_PERS...
java
private void parseMaxPersist(Map<Object, Object> props) { // -1 means unlimited // 0..1 means 1 // X means X Object value = props.get(HttpConfigConstants.PROPNAME_MAX_PERSIST); if (null != value) { try { this.maxPersistRequest = minLimit(convertInteger...
[ "private", "void", "parseMaxPersist", "(", "Map", "<", "Object", ",", "Object", ">", "props", ")", "{", "// -1 means unlimited", "// 0..1 means 1", "// X means X", "Object", "value", "=", "props", ".", "get", "(", "HttpConfigConstants", ".", "PROPNAME_MAX_PERSIST", ...
Check the input configuration for the maximum allowed requests per socket setting. @param props
[ "Check", "the", "input", "configuration", "for", "the", "maximum", "allowed", "requests", "per", "socket", "setting", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L508-L526
hawkular/hawkular-agent
hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java
JBossASClient.createWriteAttributeRequest
public static ModelNode createWriteAttributeRequest(String attributeName, String attributeValue, Address address) { """ Convienence method that allows you to create request that writes a single attribute's string value to a resource. @param attributeName the name of the attribute whose value is to be written ...
java
public static ModelNode createWriteAttributeRequest(String attributeName, String attributeValue, Address address) { final ModelNode op = createRequest(WRITE_ATTRIBUTE, address); op.get(NAME).set(attributeName); setPossibleExpression(op, VALUE, attributeValue); return op; }
[ "public", "static", "ModelNode", "createWriteAttributeRequest", "(", "String", "attributeName", ",", "String", "attributeValue", ",", "Address", "address", ")", "{", "final", "ModelNode", "op", "=", "createRequest", "(", "WRITE_ATTRIBUTE", ",", "address", ")", ";", ...
Convienence method that allows you to create request that writes a single attribute's string value to a resource. @param attributeName the name of the attribute whose value is to be written @param attributeValue the attribute value that is to be written @param address identifies the resource @return the request
[ "Convienence", "method", "that", "allows", "you", "to", "create", "request", "that", "writes", "a", "single", "attribute", "s", "string", "value", "to", "a", "resource", "." ]
train
https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L111-L116
azkaban/azkaban
azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java
FlowRunner.propagateStatusAndAlert
private void propagateStatusAndAlert(final ExecutableFlowBase base, final Status status) { """ Recursively propagate status to parent flow. Alert on first error of the flow in new AZ dispatching design. @param base the base flow @param status the status to be propagated """ if (!Status.isStatusFinishe...
java
private void propagateStatusAndAlert(final ExecutableFlowBase base, final Status status) { if (!Status.isStatusFinished(base.getStatus()) && base.getStatus() != Status.KILLING) { this.logger.info("Setting " + base.getNestedId() + " to " + status); boolean shouldAlert = false; if (base.getStatus() ...
[ "private", "void", "propagateStatusAndAlert", "(", "final", "ExecutableFlowBase", "base", ",", "final", "Status", "status", ")", "{", "if", "(", "!", "Status", ".", "isStatusFinished", "(", "base", ".", "getStatus", "(", ")", ")", "&&", "base", ".", "getStat...
Recursively propagate status to parent flow. Alert on first error of the flow in new AZ dispatching design. @param base the base flow @param status the status to be propagated
[ "Recursively", "propagate", "status", "to", "parent", "flow", ".", "Alert", "on", "first", "error", "of", "the", "flow", "in", "new", "AZ", "dispatching", "design", "." ]
train
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java#L646-L664
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/ResourceAssignmentFactory.java
ResourceAssignmentFactory.createTimephasedData
private void createTimephasedData(ProjectFile file, ResourceAssignment assignment, List<TimephasedWork> timephasedPlanned, List<TimephasedWork> timephasedComplete) { """ Method used to create missing timephased data. @param file project file @param assignment resource assignment @param timephasedPlanned plann...
java
private void createTimephasedData(ProjectFile file, ResourceAssignment assignment, List<TimephasedWork> timephasedPlanned, List<TimephasedWork> timephasedComplete) { if (timephasedPlanned.isEmpty() && timephasedComplete.isEmpty()) { Duration totalMinutes = assignment.getWork().convertUnits(TimeU...
[ "private", "void", "createTimephasedData", "(", "ProjectFile", "file", ",", "ResourceAssignment", "assignment", ",", "List", "<", "TimephasedWork", ">", "timephasedPlanned", ",", "List", "<", "TimephasedWork", ">", "timephasedComplete", ")", "{", "if", "(", "timepha...
Method used to create missing timephased data. @param file project file @param assignment resource assignment @param timephasedPlanned planned timephased data @param timephasedComplete complete timephased data
[ "Method", "used", "to", "create", "missing", "timephased", "data", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/ResourceAssignmentFactory.java#L313-L365
Javacord/Javacord
javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java
ServerUpdater.setIcon
public ServerUpdater setIcon(BufferedImage icon, String fileType) { """ Queues the icon to be updated. @param icon The new icon of the server. @param fileType The type of the icon, e.g. "png" or "jpg". @return The current instance in order to chain call methods. """ delegate.setIcon(icon, fileType...
java
public ServerUpdater setIcon(BufferedImage icon, String fileType) { delegate.setIcon(icon, fileType); return this; }
[ "public", "ServerUpdater", "setIcon", "(", "BufferedImage", "icon", ",", "String", "fileType", ")", "{", "delegate", ".", "setIcon", "(", "icon", ",", "fileType", ")", ";", "return", "this", ";", "}" ]
Queues the icon to be updated. @param icon The new icon of the server. @param fileType The type of the icon, e.g. "png" or "jpg". @return The current instance in order to chain call methods.
[ "Queues", "the", "icon", "to", "be", "updated", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L157-L160
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
StreamExecutionEnvironment.addDefaultKryoSerializer
public <T extends Serializer<?> & Serializable>void addDefaultKryoSerializer(Class<?> type, T serializer) { """ Adds a new Kryo default serializer to the Runtime. <p>Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes b...
java
public <T extends Serializer<?> & Serializable>void addDefaultKryoSerializer(Class<?> type, T serializer) { config.addDefaultKryoSerializer(type, serializer); }
[ "public", "<", "T", "extends", "Serializer", "<", "?", ">", "&", "Serializable", ">", "void", "addDefaultKryoSerializer", "(", "Class", "<", "?", ">", "type", ",", "T", "serializer", ")", "{", "config", ".", "addDefaultKryoSerializer", "(", "type", ",", "s...
Adds a new Kryo default serializer to the Runtime. <p>Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes by java serialization. @param type The class of the types serialized with the given serializer. @param serializer The ser...
[ "Adds", "a", "new", "Kryo", "default", "serializer", "to", "the", "Runtime", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L554-L556
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.replaceOnceIgnoreCase
public static String replaceOnceIgnoreCase(final String text, final String searchString, final String replacement) { """ <p>Case insensitively replaces a String with another String inside a larger String, once.</p> <p>A {@code null} reference passed to this method is a no-op.</p> <pre> StringUtils.replaceOn...
java
public static String replaceOnceIgnoreCase(final String text, final String searchString, final String replacement) { return replaceIgnoreCase(text, searchString, replacement, 1); }
[ "public", "static", "String", "replaceOnceIgnoreCase", "(", "final", "String", "text", ",", "final", "String", "searchString", ",", "final", "String", "replacement", ")", "{", "return", "replaceIgnoreCase", "(", "text", ",", "searchString", ",", "replacement", ","...
<p>Case insensitively replaces a String with another String inside a larger String, once.</p> <p>A {@code null} reference passed to this method is a no-op.</p> <pre> StringUtils.replaceOnceIgnoreCase(null, *, *) = null StringUtils.replaceOnceIgnoreCase("", *, *) = "" StringUtils.replaceOnceIgnoreCase(...
[ "<p", ">", "Case", "insensitively", "replaces", "a", "String", "with", "another", "String", "inside", "a", "larger", "String", "once", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L5195-L5197
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Clicker.java
Clicker.clickOn
public <T extends TextView> void clickOn(Class<T> viewClass, String nameRegex) { """ Clicks on a {@code View} of a specific class, with a given text. @param viewClass what kind of {@code View} to click, e.g. {@code Button.class} or {@code TextView.class} @param nameRegex the name of the view presented to the u...
java
public <T extends TextView> void clickOn(Class<T> viewClass, String nameRegex) { T viewToClick = (T) waiter.waitForText(viewClass, nameRegex, 0, Timeout.getSmallTimeout(), true, true, false); if (viewToClick != null) { clickOnScreen(viewToClick); } else { ArrayList <T> allTextViews = RobotiumUtils.removeIn...
[ "public", "<", "T", "extends", "TextView", ">", "void", "clickOn", "(", "Class", "<", "T", ">", "viewClass", ",", "String", "nameRegex", ")", "{", "T", "viewToClick", "=", "(", "T", ")", "waiter", ".", "waitForText", "(", "viewClass", ",", "nameRegex", ...
Clicks on a {@code View} of a specific class, with a given text. @param viewClass what kind of {@code View} to click, e.g. {@code Button.class} or {@code TextView.class} @param nameRegex the name of the view presented to the user. The parameter <strong>will</strong> be interpreted as a regular expression.
[ "Clicks", "on", "a", "{", "@code", "View", "}", "of", "a", "specific", "class", "with", "a", "given", "text", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L472-L485
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java
HttpHeaderMap.addHeader
public void addHeader (@Nonnull @Nonempty final String sName, @Nullable final String sValue) { """ Add the passed header as is. @param sName Header name. May neither be <code>null</code> nor empty. @param sValue The value to be set. May be <code>null</code> in which case nothing happens. """ if (sVa...
java
public void addHeader (@Nonnull @Nonempty final String sName, @Nullable final String sValue) { if (sValue != null) _addHeader (sName, sValue); }
[ "public", "void", "addHeader", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sName", ",", "@", "Nullable", "final", "String", "sValue", ")", "{", "if", "(", "sValue", "!=", "null", ")", "_addHeader", "(", "sName", ",", "sValue", ")", ";", "...
Add the passed header as is. @param sName Header name. May neither be <code>null</code> nor empty. @param sValue The value to be set. May be <code>null</code> in which case nothing happens.
[ "Add", "the", "passed", "header", "as", "is", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java#L205-L209
casmi/casmi
src/main/java/casmi/graphics/object/Camera.java
Camera.setEye
public void setEye(double eyeX, double eyeY, double eyeZ) { """ Sets the eye position of this Camera. @param eyeX The x-coordinate for the eye. @param eyeY The y-coordinate for the eye. @param eyeZ The z-coordinate for the eye. """ this.eyeX = eyeX; this.eyeY = eyeY; this.eyeZ =...
java
public void setEye(double eyeX, double eyeY, double eyeZ) { this.eyeX = eyeX; this.eyeY = eyeY; this.eyeZ = eyeZ; }
[ "public", "void", "setEye", "(", "double", "eyeX", ",", "double", "eyeY", ",", "double", "eyeZ", ")", "{", "this", ".", "eyeX", "=", "eyeX", ";", "this", ".", "eyeY", "=", "eyeY", ";", "this", ".", "eyeZ", "=", "eyeZ", ";", "}" ]
Sets the eye position of this Camera. @param eyeX The x-coordinate for the eye. @param eyeY The y-coordinate for the eye. @param eyeZ The z-coordinate for the eye.
[ "Sets", "the", "eye", "position", "of", "this", "Camera", "." ]
train
https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/object/Camera.java#L147-L151
redbox-mint/redbox
plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java
FormDataParser.getArray
private static JSONArray getArray(JsonObject object, String key) throws IOException { """ Get a child JSON Array from an incoming JSON object. If the child does not exist it will be created. @param object The incoming object we are to look inside @param key The child node we are looking for @retu...
java
private static JSONArray getArray(JsonObject object, String key) throws IOException { // Get the existing one if (object.containsKey(key)) { Object existing = object.get(key); if (!(existing instanceof JSONArray)) { throw new IOException("Invalid field...
[ "private", "static", "JSONArray", "getArray", "(", "JsonObject", "object", ",", "String", "key", ")", "throws", "IOException", "{", "// Get the existing one", "if", "(", "object", ".", "containsKey", "(", "key", ")", ")", "{", "Object", "existing", "=", "objec...
Get a child JSON Array from an incoming JSON object. If the child does not exist it will be created. @param object The incoming object we are to look inside @param key The child node we are looking for @return JSONArray The child we found or created @throws IOException if there is a type mismatch on existing data
[ "Get", "a", "child", "JSON", "Array", "from", "an", "incoming", "JSON", "object", ".", "If", "the", "child", "does", "not", "exist", "it", "will", "be", "created", "." ]
train
https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L271-L289
smartsheet-platform/smartsheet-java-sdk
src/main/java/com/smartsheet/api/internal/PassthroughResourcesImpl.java
PassthroughResourcesImpl.getRequest
public String getRequest(String endpoint, HashMap<String, Object> parameters) throws SmartsheetException { """ Issue an HTTP GET request. @param endpoint the API endpoint @param parameters optional list of resource parameters @return a JSON response string @throws IllegalArgumentException if any argument is ...
java
public String getRequest(String endpoint, HashMap<String, Object> parameters) throws SmartsheetException { return passthroughRequest(HttpMethod.GET, endpoint, null, parameters); }
[ "public", "String", "getRequest", "(", "String", "endpoint", ",", "HashMap", "<", "String", ",", "Object", ">", "parameters", ")", "throws", "SmartsheetException", "{", "return", "passthroughRequest", "(", "HttpMethod", ".", "GET", ",", "endpoint", ",", "null", ...
Issue an HTTP GET request. @param endpoint the API endpoint @param parameters optional list of resource parameters @return a JSON response string @throws IllegalArgumentException if any argument is null or empty string @throws InvalidRequestException if there is any problem with the REST API request @throws Authorizat...
[ "Issue", "an", "HTTP", "GET", "request", "." ]
train
https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/PassthroughResourcesImpl.java#L60-L62
elki-project/elki
elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java
DBIDUtil.newPair
public static DBIDPair newPair(DBIDRef id1, DBIDRef id2) { """ Make a DBID pair. @param id1 first ID @param id2 second ID @return DBID pair """ return DBIDFactory.FACTORY.newPair(id1, id2); }
java
public static DBIDPair newPair(DBIDRef id1, DBIDRef id2) { return DBIDFactory.FACTORY.newPair(id1, id2); }
[ "public", "static", "DBIDPair", "newPair", "(", "DBIDRef", "id1", ",", "DBIDRef", "id2", ")", "{", "return", "DBIDFactory", ".", "FACTORY", ".", "newPair", "(", "id1", ",", "id2", ")", ";", "}" ]
Make a DBID pair. @param id1 first ID @param id2 second ID @return DBID pair
[ "Make", "a", "DBID", "pair", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L467-L469
Jasig/uPortal
uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceCompositeGroupService.java
ReferenceCompositeGroupService.getEntity
@Override public IEntity getEntity(String key, Class type, String svcName) throws GroupsException { """ Returns an <code>IEntity</code> representing a portal entity. This does not guarantee that the entity actually exists. """ IIndividualGroupService svc = null; if (svcName == null) { ...
java
@Override public IEntity getEntity(String key, Class type, String svcName) throws GroupsException { IIndividualGroupService svc = null; if (svcName == null) { svc = getDefaultService(); } else { try { Name n = GroupService.parseServiceName(svcName); ...
[ "@", "Override", "public", "IEntity", "getEntity", "(", "String", "key", ",", "Class", "type", ",", "String", "svcName", ")", "throws", "GroupsException", "{", "IIndividualGroupService", "svc", "=", "null", ";", "if", "(", "svcName", "==", "null", ")", "{", ...
Returns an <code>IEntity</code> representing a portal entity. This does not guarantee that the entity actually exists.
[ "Returns", "an", "<code", ">", "IEntity<", "/", "code", ">", "representing", "a", "portal", "entity", ".", "This", "does", "not", "guarantee", "that", "the", "entity", "actually", "exists", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceCompositeGroupService.java#L115-L129
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.topp
public static <T extends Comparable<T>> List<T> topp(final T[] a, final int fromIndex, final int toIndex, final int n) { """ The present order is kept in the result list. @param a @param fromIndex @param toIndex @param n @return """ return topp(a, fromIndex, toIndex, n, N.NATURAL_ORDER); }
java
public static <T extends Comparable<T>> List<T> topp(final T[] a, final int fromIndex, final int toIndex, final int n) { return topp(a, fromIndex, toIndex, n, N.NATURAL_ORDER); }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "T", ">", ">", "List", "<", "T", ">", "topp", "(", "final", "T", "[", "]", "a", ",", "final", "int", "fromIndex", ",", "final", "int", "toIndex", ",", "final", "int", "n", ")", "{", "ret...
The present order is kept in the result list. @param a @param fromIndex @param toIndex @param n @return
[ "The", "present", "order", "is", "kept", "in", "the", "result", "list", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L17491-L17493
ibm-bluemix-mobile-services/bms-clientsdk-android-push
lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/api/MFPPushNotificationDismissHandler.java
MFPPushNotificationDismissHandler.onReceive
@Override public void onReceive(Context context, Intent intent) { """ This method is called when a notification is dimissed or cleared from the notification tray. @param context This is the context of the application @param intent Intent which invoked this receiver """ String messageId = int...
java
@Override public void onReceive(Context context, Intent intent) { String messageId = intent.getStringExtra(ID); MFPPush.getInstance().changeStatus(messageId, MFPPushNotificationStatus.DISMISSED); }
[ "@", "Override", "public", "void", "onReceive", "(", "Context", "context", ",", "Intent", "intent", ")", "{", "String", "messageId", "=", "intent", ".", "getStringExtra", "(", "ID", ")", ";", "MFPPush", ".", "getInstance", "(", ")", ".", "changeStatus", "(...
This method is called when a notification is dimissed or cleared from the notification tray. @param context This is the context of the application @param intent Intent which invoked this receiver
[ "This", "method", "is", "called", "when", "a", "notification", "is", "dimissed", "or", "cleared", "from", "the", "notification", "tray", "." ]
train
https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-push/blob/26c048637e81a6942004693919558f3d9aa8c674/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/api/MFPPushNotificationDismissHandler.java#L35-L39
xerial/snappy-java
src/main/java/org/xerial/snappy/Snappy.java
Snappy.uncompressString
public static String uncompressString(byte[] input, String encoding) throws IOException, UnsupportedEncodingException { """ Uncompress the input as a String of the given encoding @param input @param encoding @return the uncompressed data @throws IOException @throws UnsupportedEncodin...
java
public static String uncompressString(byte[] input, String encoding) throws IOException, UnsupportedEncodingException { byte[] uncompressed = uncompress(input); return new String(uncompressed, encoding); }
[ "public", "static", "String", "uncompressString", "(", "byte", "[", "]", "input", ",", "String", "encoding", ")", "throws", "IOException", ",", "UnsupportedEncodingException", "{", "byte", "[", "]", "uncompressed", "=", "uncompress", "(", "input", ")", ";", "r...
Uncompress the input as a String of the given encoding @param input @param encoding @return the uncompressed data @throws IOException @throws UnsupportedEncodingException
[ "Uncompress", "the", "input", "as", "a", "String", "of", "the", "given", "encoding" ]
train
https://github.com/xerial/snappy-java/blob/9df6ed7bbce88186c82f2e7cdcb7b974421b3340/src/main/java/org/xerial/snappy/Snappy.java#L883-L889
aws/aws-sdk-java
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddShapes.java
AddShapes.getDefaultTimeFormatIfNull
protected String getDefaultTimeFormatIfNull(Member c2jMemberDefinition, Map<String, Shape> allC2jShapes, String protocolString, Shape parentShape) { """ Get default timestamp format if the provided timestamp format is null or empty. - All timestamp values serialized in HTTP headers are formatted using rfc822 by...
java
protected String getDefaultTimeFormatIfNull(Member c2jMemberDefinition, Map<String, Shape> allC2jShapes, String protocolString, Shape parentShape) { String timestampFormat = c2jMemberDefinition.getTimestampFormat(); if (!StringUtils.isNullOrEmpty(timestampFormat)) { failIfInCollection(c2jMe...
[ "protected", "String", "getDefaultTimeFormatIfNull", "(", "Member", "c2jMemberDefinition", ",", "Map", "<", "String", ",", "Shape", ">", "allC2jShapes", ",", "String", "protocolString", ",", "Shape", "parentShape", ")", "{", "String", "timestampFormat", "=", "c2jMem...
Get default timestamp format if the provided timestamp format is null or empty. - All timestamp values serialized in HTTP headers are formatted using rfc822 by default. - All timestamp values serialized in query strings are formatted using iso8601 by default. - The default timestamp formats per protocol for structured...
[ "Get", "default", "timestamp", "format", "if", "the", "provided", "timestamp", "format", "is", "null", "or", "empty", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddShapes.java#L247-L289
dita-ot/dita-ot
src/main/java/org/dita/dost/util/FileUtils.java
FileUtils.directoryContains
public static boolean directoryContains(final File directory, final File child) { """ Determines whether the parent directory contains the child element (a file or directory) @param directory the file to consider as the parent @param child the file to consider as the child @return true is the candidate leaf i...
java
public static boolean directoryContains(final File directory, final File child) { final File d = new File(normalize(directory.getAbsolutePath())); final File c = new File(normalize(child.getAbsolutePath())); if (d.equals(c)) { return false; } else { return c.getPa...
[ "public", "static", "boolean", "directoryContains", "(", "final", "File", "directory", ",", "final", "File", "child", ")", "{", "final", "File", "d", "=", "new", "File", "(", "normalize", "(", "directory", ".", "getAbsolutePath", "(", ")", ")", ")", ";", ...
Determines whether the parent directory contains the child element (a file or directory) @param directory the file to consider as the parent @param child the file to consider as the child @return true is the candidate leaf is under by the specified composite, otherwise false
[ "Determines", "whether", "the", "parent", "directory", "contains", "the", "child", "element", "(", "a", "file", "or", "directory", ")" ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FileUtils.java#L609-L617
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/Descriptor.java
Descriptor.fromFilename
public static Pair<Descriptor,String> fromFilename(File directory, String name, boolean skipComponent) { """ Filename of the form "<ksname>-<cfname>-[tmp-][<version>-]<gen>-<component>" @param directory The directory of the SSTable files @param name The name of the SSTable file @param skipComponent true if th...
java
public static Pair<Descriptor,String> fromFilename(File directory, String name, boolean skipComponent) { // tokenize the filename StringTokenizer st = new StringTokenizer(name, String.valueOf(separator)); String nexttok; // all filenames must start with keyspace and column family ...
[ "public", "static", "Pair", "<", "Descriptor", ",", "String", ">", "fromFilename", "(", "File", "directory", ",", "String", "name", ",", "boolean", "skipComponent", ")", "{", "// tokenize the filename", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", ...
Filename of the form "<ksname>-<cfname>-[tmp-][<version>-]<gen>-<component>" @param directory The directory of the SSTable files @param name The name of the SSTable file @param skipComponent true if the name param should not be parsed for a component tag @return A Descriptor for the SSTable, and the Component remaind...
[ "Filename", "of", "the", "form", "<ksname", ">", "-", "<cfname", ">", "-", "[", "tmp", "-", "]", "[", "<version", ">", "-", "]", "<gen", ">", "-", "<component", ">" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/Descriptor.java#L247-L284
betfair/cougar
cougar-framework/cougar-marshalling-impl/src/main/java/com/betfair/cougar/marshalling/impl/databinding/json/JSONBindingFactory.java
JSONBindingFactory.applyNumericRangeBugfixes
private static void applyNumericRangeBugfixes(ObjectMapper mapper) { """ Fixes problem in Jackson's StdDeserializer. with _parseInteger and _parseLong. The provided implementation allowed out-of-range numbers to be shoe-horned into types, ignoring under/overflow. E.g. 21474836470 would be deserialized into an In...
java
private static void applyNumericRangeBugfixes(ObjectMapper mapper) { // Create a custom module SimpleModule customModule = new SimpleModule("CustomModule", new Version(1, 0, 0, null, null, null)); // Register a deserializer for Integer that overrides default buggy version customModule.ad...
[ "private", "static", "void", "applyNumericRangeBugfixes", "(", "ObjectMapper", "mapper", ")", "{", "// Create a custom module", "SimpleModule", "customModule", "=", "new", "SimpleModule", "(", "\"CustomModule\"", ",", "new", "Version", "(", "1", ",", "0", ",", "0", ...
Fixes problem in Jackson's StdDeserializer. with _parseInteger and _parseLong. The provided implementation allowed out-of-range numbers to be shoe-horned into types, ignoring under/overflow. E.g. 21474836470 would be deserialized into an Integer as -10. E.g. 92233720368547758080 would be deserialized into a Long as 0.
[ "Fixes", "problem", "in", "Jackson", "s", "StdDeserializer", ".", "with", "_parseInteger", "and", "_parseLong", ".", "The", "provided", "implementation", "allowed", "out", "-", "of", "-", "range", "numbers", "to", "be", "shoe", "-", "horned", "into", "types", ...
train
https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/cougar-marshalling-impl/src/main/java/com/betfair/cougar/marshalling/impl/databinding/json/JSONBindingFactory.java#L77-L91
primefaces-extensions/core
src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java
SheetColumn.validateRequired
protected boolean validateRequired(final FacesContext context, final Object newValue) { """ Validates the value against the required flags on this column. @param context the FacesContext @param newValue the new value for this column @return true if passes validation, otherwise valse """ // If our ...
java
protected boolean validateRequired(final FacesContext context, final Object newValue) { // If our value is valid, enforce the required property if present if (isValid() && isRequired() && isEmpty(newValue)) { final String requiredMessageStr = getRequiredMessage(); FacesMessage me...
[ "protected", "boolean", "validateRequired", "(", "final", "FacesContext", "context", ",", "final", "Object", "newValue", ")", "{", "// If our value is valid, enforce the required property if present", "if", "(", "isValid", "(", ")", "&&", "isRequired", "(", ")", "&&", ...
Validates the value against the required flags on this column. @param context the FacesContext @param newValue the new value for this column @return true if passes validation, otherwise valse
[ "Validates", "the", "value", "against", "the", "required", "flags", "on", "this", "column", "." ]
train
https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetColumn.java#L674-L700
treasure-data/td-client-java
src/main/java/com/treasuredata/client/TDClientConfig.java
TDClientConfig.readTDConf
public static Properties readTDConf() { """ Read apikey, user (e-mail address) and password from $HOME/.td/td.conf @return @throws IOException """ Properties p = new Properties(); File file = new File(System.getProperty("user.home", "./"), String.format(".td/td.conf")); if (!file.ex...
java
public static Properties readTDConf() { Properties p = new Properties(); File file = new File(System.getProperty("user.home", "./"), String.format(".td/td.conf")); if (!file.exists()) { logger.warn(String.format("config file %s is not found", file)); return p; ...
[ "public", "static", "Properties", "readTDConf", "(", ")", "{", "Properties", "p", "=", "new", "Properties", "(", ")", ";", "File", "file", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.home\"", ",", "\"./\"", ")", ",", "String", "."...
Read apikey, user (e-mail address) and password from $HOME/.td/td.conf @return @throws IOException
[ "Read", "apikey", "user", "(", "e", "-", "mail", "address", ")", "and", "password", "from", "$HOME", "/", ".", "td", "/", "td", ".", "conf" ]
train
https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDClientConfig.java#L241-L250
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java
ConditionalCheck.notNegative
@Throws(IllegalNegativeArgumentException.class) public static void notNegative(final boolean condition, final int value, @Nullable final String name) { """ Ensures that an integer reference passed as a parameter to the calling method is not smaller than {@code 0}. @param condition condition must be {@code tru...
java
@Throws(IllegalNegativeArgumentException.class) public static void notNegative(final boolean condition, final int value, @Nullable final String name) { if (condition) { Check.notNegative(value, name); } }
[ "@", "Throws", "(", "IllegalNegativeArgumentException", ".", "class", ")", "public", "static", "void", "notNegative", "(", "final", "boolean", "condition", ",", "final", "int", "value", ",", "@", "Nullable", "final", "String", "name", ")", "{", "if", "(", "c...
Ensures that an integer reference passed as a parameter to the calling method is not smaller than {@code 0}. @param condition condition must be {@code true}^ so that the check will be performed @param value a number @param name name of the number reference (in source code) @throws IllegalNullArgumentException if the ...
[ "Ensures", "that", "an", "integer", "reference", "passed", "as", "a", "parameter", "to", "the", "calling", "method", "is", "not", "smaller", "than", "{", "@code", "0", "}", "." ]
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L1979-L1984
mapbox/mapbox-java
services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java
FeatureCollection.fromFeatures
public static FeatureCollection fromFeatures(@NonNull Feature[] features, @Nullable BoundingBox bbox) { """ Create a new instance of this class by giving the feature collection an array of {@link Feature}s. The array of features itself isn't null but it can be empty ...
java
public static FeatureCollection fromFeatures(@NonNull Feature[] features, @Nullable BoundingBox bbox) { return new FeatureCollection(TYPE, bbox, Arrays.asList(features)); }
[ "public", "static", "FeatureCollection", "fromFeatures", "(", "@", "NonNull", "Feature", "[", "]", "features", ",", "@", "Nullable", "BoundingBox", "bbox", ")", "{", "return", "new", "FeatureCollection", "(", "TYPE", ",", "bbox", ",", "Arrays", ".", "asList", ...
Create a new instance of this class by giving the feature collection an array of {@link Feature}s. The array of features itself isn't null but it can be empty and have a length of 0. @param features an array of features @param bbox optionally include a bbox definition as a double array @return a new instance of th...
[ "Create", "a", "new", "instance", "of", "this", "class", "by", "giving", "the", "feature", "collection", "an", "array", "of", "{", "@link", "Feature", "}", "s", ".", "The", "array", "of", "features", "itself", "isn", "t", "null", "but", "it", "can", "b...
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java#L109-L112
apereo/cas
support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/logout/TerminateSessionAction.java
TerminateSessionAction.destroyApplicationSession
protected void destroyApplicationSession(final HttpServletRequest request, final HttpServletResponse response) { """ Destroy application session. Also kills all delegated authn profiles via pac4j. @param request the request @param response the response """ LOGGER.trace("Destroying application ses...
java
protected void destroyApplicationSession(final HttpServletRequest request, final HttpServletResponse response) { LOGGER.trace("Destroying application session"); val context = new J2EContext(request, response, new J2ESessionStore()); val manager = new ProfileManager<>(context, context.getSessionS...
[ "protected", "void", "destroyApplicationSession", "(", "final", "HttpServletRequest", "request", ",", "final", "HttpServletResponse", "response", ")", "{", "LOGGER", ".", "trace", "(", "\"Destroying application session\"", ")", ";", "val", "context", "=", "new", "J2EC...
Destroy application session. Also kills all delegated authn profiles via pac4j. @param request the request @param response the response
[ "Destroy", "application", "session", ".", "Also", "kills", "all", "delegated", "authn", "profiles", "via", "pac4j", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/logout/TerminateSessionAction.java#L135-L149
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getQuagganInfo
public void getQuagganInfo(String[] ids, Callback<List<Map<String, String>>> callback) throws GuildWars2Exception, NullPointerException { """ For more info on quaggans API go <a href="https://wiki.guildwars2.com/wiki/API:2/quaggans">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)}...
java
public void getQuagganInfo(String[] ids, Callback<List<Map<String, String>>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getQuagganInfo(processIds(ids)).enqueue(callback); }
[ "public", "void", "getQuagganInfo", "(", "String", "[", "]", "ids", ",", "Callback", "<", "List", "<", "Map", "<", "String", ",", "String", ">", ">", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "("...
For more info on quaggans API go <a href="https://wiki.guildwars2.com/wiki/API:2/quaggans">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param ids list of quaggan id(s) @param callback callback tha...
[ "For", "more", "info", "on", "quaggans", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "quaggans", ">", "here<", "/", "a", ">", "<br", "/", ">", "Give", "user", ...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2219-L2222
brunocvcunha/inutils4j
src/main/java/org/brunocvcunha/inutils4j/MyStringUtils.java
MyStringUtils.getContent
public static String getContent(String stringUrl) { """ Returns content for the given URL @param stringUrl URL @return Response content """ if (stringUrl.equalsIgnoreCase("clipboard")) { try { return getFromClipboard(); } catch (Exception e) { //it's ok. } } retu...
java
public static String getContent(String stringUrl) { if (stringUrl.equalsIgnoreCase("clipboard")) { try { return getFromClipboard(); } catch (Exception e) { //it's ok. } } return getContent(stringUrl, null); }
[ "public", "static", "String", "getContent", "(", "String", "stringUrl", ")", "{", "if", "(", "stringUrl", ".", "equalsIgnoreCase", "(", "\"clipboard\"", ")", ")", "{", "try", "{", "return", "getFromClipboard", "(", ")", ";", "}", "catch", "(", "Exception", ...
Returns content for the given URL @param stringUrl URL @return Response content
[ "Returns", "content", "for", "the", "given", "URL" ]
train
https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/MyStringUtils.java#L987-L996
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java
ExpressRouteCrossConnectionPeeringsInner.beginCreateOrUpdateAsync
public Observable<ExpressRouteCrossConnectionPeeringInner> beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { """ Creates or updates a peering in the specified ExpressRouteCrossConnection. @param resourc...
java
public Observable<ExpressRouteCrossConnectionPeeringInner> beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName, String peeringName, ExpressRouteCrossConnectionPeeringInner peeringParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, crossConnectionName, pe...
[ "public", "Observable", "<", "ExpressRouteCrossConnectionPeeringInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "crossConnectionName", ",", "String", "peeringName", ",", "ExpressRouteCrossConnectionPeeringInner", "peeringParameters", ")...
Creates or updates a peering in the specified ExpressRouteCrossConnection. @param resourceGroupName The name of the resource group. @param crossConnectionName The name of the ExpressRouteCrossConnection. @param peeringName The name of the peering. @param peeringParameters Parameters supplied to the create or update Ex...
[ "Creates", "or", "updates", "a", "peering", "in", "the", "specified", "ExpressRouteCrossConnection", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java#L594-L601
Red5/red5-io
src/main/java/org/red5/io/object/Serializer.java
Serializer.writeArrayType
@SuppressWarnings("all") protected static boolean writeArrayType(Output out, Object arrType) { """ Writes array (or collection) out as output Arrays, Collections, etc @param out Output object @param arrType Array or collection type @return <tt>true</tt> if the object has been written, otherwise <tt>fals...
java
@SuppressWarnings("all") protected static boolean writeArrayType(Output out, Object arrType) { log.trace("writeArrayType"); if (arrType instanceof Collection) { out.writeArray((Collection<Object>) arrType); } else if (arrType instanceof Iterator) { writeIterator(out, ...
[ "@", "SuppressWarnings", "(", "\"all\"", ")", "protected", "static", "boolean", "writeArrayType", "(", "Output", "out", ",", "Object", "arrType", ")", "{", "log", ".", "trace", "(", "\"writeArrayType\"", ")", ";", "if", "(", "arrType", "instanceof", "Collectio...
Writes array (or collection) out as output Arrays, Collections, etc @param out Output object @param arrType Array or collection type @return <tt>true</tt> if the object has been written, otherwise <tt>false</tt>
[ "Writes", "array", "(", "or", "collection", ")", "out", "as", "output", "Arrays", "Collections", "etc" ]
train
https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/object/Serializer.java#L253-L268
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/outlier/MixtureModelOutlierScaling.java
MixtureModelOutlierScaling.calcP_i
protected static double calcP_i(double f, double mu, double sigma) { """ Compute p_i (Gaussian distribution, outliers) @param f value @param mu Mu parameter @param sigma Sigma parameter @return probability """ final double fmu = f - mu; return ONEBYSQRT2PI / sigma * FastMath.exp(fmu * fmu / (-2 *...
java
protected static double calcP_i(double f, double mu, double sigma) { final double fmu = f - mu; return ONEBYSQRT2PI / sigma * FastMath.exp(fmu * fmu / (-2 * sigma * sigma)); }
[ "protected", "static", "double", "calcP_i", "(", "double", "f", ",", "double", "mu", ",", "double", "sigma", ")", "{", "final", "double", "fmu", "=", "f", "-", "mu", ";", "return", "ONEBYSQRT2PI", "/", "sigma", "*", "FastMath", ".", "exp", "(", "fmu", ...
Compute p_i (Gaussian distribution, outliers) @param f value @param mu Mu parameter @param sigma Sigma parameter @return probability
[ "Compute", "p_i", "(", "Gaussian", "distribution", "outliers", ")" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/outlier/MixtureModelOutlierScaling.java#L103-L106
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java
CPDefinitionOptionValueRelPersistenceImpl.removeByUUID_G
@Override public CPDefinitionOptionValueRel removeByUUID_G(String uuid, long groupId) throws NoSuchCPDefinitionOptionValueRelException { """ Removes the cp definition option value rel where uuid = &#63; and groupId = &#63; from the database. @param uuid the uuid @param groupId the group ID @return the cp d...
java
@Override public CPDefinitionOptionValueRel removeByUUID_G(String uuid, long groupId) throws NoSuchCPDefinitionOptionValueRelException { CPDefinitionOptionValueRel cpDefinitionOptionValueRel = findByUUID_G(uuid, groupId); return remove(cpDefinitionOptionValueRel); }
[ "@", "Override", "public", "CPDefinitionOptionValueRel", "removeByUUID_G", "(", "String", "uuid", ",", "long", "groupId", ")", "throws", "NoSuchCPDefinitionOptionValueRelException", "{", "CPDefinitionOptionValueRel", "cpDefinitionOptionValueRel", "=", "findByUUID_G", "(", "uu...
Removes the cp definition option value rel where uuid = &#63; and groupId = &#63; from the database. @param uuid the uuid @param groupId the group ID @return the cp definition option value rel that was removed
[ "Removes", "the", "cp", "definition", "option", "value", "rel", "where", "uuid", "=", "&#63", ";", "and", "groupId", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L823-L830
codelibs/fess
src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java
FessMessages.addConstraintsDecimalMaxMessage
public FessMessages addConstraintsDecimalMaxMessage(String property, String value) { """ Add the created action message for the key 'constraints.DecimalMax.message' with parameters. <pre> message: {item} must be less than ${inclusive == true ? 'or equal to ' : ''}{value}. </pre> @param property The property na...
java
public FessMessages addConstraintsDecimalMaxMessage(String property, String value) { assertPropertyNotNull(property); add(property, new UserMessage(CONSTRAINTS_DecimalMax_MESSAGE, value)); return this; }
[ "public", "FessMessages", "addConstraintsDecimalMaxMessage", "(", "String", "property", ",", "String", "value", ")", "{", "assertPropertyNotNull", "(", "property", ")", ";", "add", "(", "property", ",", "new", "UserMessage", "(", "CONSTRAINTS_DecimalMax_MESSAGE", ",",...
Add the created action message for the key 'constraints.DecimalMax.message' with parameters. <pre> message: {item} must be less than ${inclusive == true ? 'or equal to ' : ''}{value}. </pre> @param property The property name for the message. (NotNull) @param value The parameter value for message. (NotNull) @return this...
[ "Add", "the", "created", "action", "message", "for", "the", "key", "constraints", ".", "DecimalMax", ".", "message", "with", "parameters", ".", "<pre", ">", "message", ":", "{", "item", "}", "must", "be", "less", "than", "$", "{", "inclusive", "==", "tru...
train
https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L636-L640
yanzhenjie/AndPermission
support/src/main/java/com/yanzhenjie/permission/AndPermission.java
AndPermission.hasAlwaysDeniedPermission
public static boolean hasAlwaysDeniedPermission(android.app.Fragment fragment, String... deniedPermissions) { """ Some privileges permanently disabled, may need to set up in the execute. @param fragment {@link android.app.Fragment}. @param deniedPermissions one or more permissions. @return true, other wise ...
java
public static boolean hasAlwaysDeniedPermission(android.app.Fragment fragment, String... deniedPermissions) { return hasAlwaysDeniedPermission(new FragmentSource(fragment), deniedPermissions); }
[ "public", "static", "boolean", "hasAlwaysDeniedPermission", "(", "android", ".", "app", ".", "Fragment", "fragment", ",", "String", "...", "deniedPermissions", ")", "{", "return", "hasAlwaysDeniedPermission", "(", "new", "FragmentSource", "(", "fragment", ")", ",", ...
Some privileges permanently disabled, may need to set up in the execute. @param fragment {@link android.app.Fragment}. @param deniedPermissions one or more permissions. @return true, other wise is false.
[ "Some", "privileges", "permanently", "disabled", "may", "need", "to", "set", "up", "in", "the", "execute", "." ]
train
https://github.com/yanzhenjie/AndPermission/blob/bbfaaecdb8ecf0f2aa270d80c0b88d022dddda7c/support/src/main/java/com/yanzhenjie/permission/AndPermission.java#L178-L180
alkacon/opencms-core
src/org/opencms/search/documents/CmsDocumentDependency.java
CmsDocumentDependency.removeFromContext
protected static void removeFromContext(CmsObject cms, CmsPublishedResource pubRes) { """ Removes the dependency object for a published resource from the OpenCms runtime context.<p> <b>Please note:</b> This must be used with caution since the information may be required to generate documents for several confi...
java
protected static void removeFromContext(CmsObject cms, CmsPublishedResource pubRes) { cms.getRequestContext().removeAttribute(getAttributeKey(pubRes.getRootPath())); }
[ "protected", "static", "void", "removeFromContext", "(", "CmsObject", "cms", ",", "CmsPublishedResource", "pubRes", ")", "{", "cms", ".", "getRequestContext", "(", ")", ".", "removeAttribute", "(", "getAttributeKey", "(", "pubRes", ".", "getRootPath", "(", ")", ...
Removes the dependency object for a published resource from the OpenCms runtime context.<p> <b>Please note:</b> This must be used with caution since the information may be required to generate documents for several configured indexes. It must be ensured that this is called only when all indexes have been updated.<p> ...
[ "Removes", "the", "dependency", "object", "for", "a", "published", "resource", "from", "the", "OpenCms", "runtime", "context", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/CmsDocumentDependency.java#L380-L383
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/BufferedDecoder.java
BufferedDecoder.writeBuffer
@Override protected void writeBuffer(byte[] buffer, int start, int length) throws IOException { """ Writes <code>length</code> bytes from the specified byte array starting at offset <code>start</code> to this byte array output stream. @param buffer the data. @param start the start offset in the data. @p...
java
@Override protected void writeBuffer(byte[] buffer, int start, int length) throws IOException { if (out instanceof ByteArrayOutputStream) { if (((ByteArrayOutputStream)out).size() + length > bufferSize) { swapBuffers(); } } out.write(buffer, start, le...
[ "@", "Override", "protected", "void", "writeBuffer", "(", "byte", "[", "]", "buffer", ",", "int", "start", ",", "int", "length", ")", "throws", "IOException", "{", "if", "(", "out", "instanceof", "ByteArrayOutputStream", ")", "{", "if", "(", "(", "(", "B...
Writes <code>length</code> bytes from the specified byte array starting at offset <code>start</code> to this byte array output stream. @param buffer the data. @param start the start offset in the data. @param length the number of bytes to write. @exception IOException if an I/O error occurs.
[ "Writes", "<code", ">", "length<", "/", "code", ">", "bytes", "from", "the", "specified", "byte", "array", "starting", "at", "offset", "<code", ">", "start<", "/", "code", ">", "to", "this", "byte", "array", "output", "stream", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/BufferedDecoder.java#L199-L210
HubSpot/jinjava
src/main/java/com/hubspot/jinjava/el/JinjavaInterpreterResolver.java
JinjavaInterpreterResolver.getValue
@Override public Object getValue(ELContext context, Object base, Object property) { """ {@inheritDoc} If the base object is null, the property will be looked up in the context. """ return getValue(context, base, property, true); }
java
@Override public Object getValue(ELContext context, Object base, Object property) { return getValue(context, base, property, true); }
[ "@", "Override", "public", "Object", "getValue", "(", "ELContext", "context", ",", "Object", "base", ",", "Object", "property", ")", "{", "return", "getValue", "(", "context", ",", "base", ",", "property", ",", "true", ")", ";", "}" ]
{@inheritDoc} If the base object is null, the property will be looked up in the context.
[ "{", "@inheritDoc", "}" ]
train
https://github.com/HubSpot/jinjava/blob/ce570935630f49c666170d2330b0b9ba4eddb955/src/main/java/com/hubspot/jinjava/el/JinjavaInterpreterResolver.java#L107-L110
deephacks/confit
api-runtime/src/main/java/org/deephacks/confit/query/ConfigQueryBuilder.java
ConfigQueryBuilder.greaterThan
public static <A extends Comparable<A>> Restriction greaterThan(String property, A value) { """ Query which asserts that a property is greater than (but not equal to) a value. @param property field to query @param value value to query for @return restriction to be added to {@link ConfigQuery}. """ ...
java
public static <A extends Comparable<A>> Restriction greaterThan(String property, A value) { return new GreaterThan<>(property, value); }
[ "public", "static", "<", "A", "extends", "Comparable", "<", "A", ">", ">", "Restriction", "greaterThan", "(", "String", "property", ",", "A", "value", ")", "{", "return", "new", "GreaterThan", "<>", "(", "property", ",", "value", ")", ";", "}" ]
Query which asserts that a property is greater than (but not equal to) a value. @param property field to query @param value value to query for @return restriction to be added to {@link ConfigQuery}.
[ "Query", "which", "asserts", "that", "a", "property", "is", "greater", "than", "(", "but", "not", "equal", "to", ")", "a", "value", "." ]
train
https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-runtime/src/main/java/org/deephacks/confit/query/ConfigQueryBuilder.java#L58-L60
apache/incubator-shardingsphere
sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/prepare/SQLExecutePrepareTemplate.java
SQLExecutePrepareTemplate.getExecuteUnitGroups
public Collection<ShardingExecuteGroup<StatementExecuteUnit>> getExecuteUnitGroups(final Collection<RouteUnit> routeUnits, final SQLExecutePrepareCallback callback) throws SQLException { """ Get execute unit groups. @param routeUnits route units @param callback SQL execute prepare callback @return statement e...
java
public Collection<ShardingExecuteGroup<StatementExecuteUnit>> getExecuteUnitGroups(final Collection<RouteUnit> routeUnits, final SQLExecutePrepareCallback callback) throws SQLException { return getSynchronizedExecuteUnitGroups(routeUnits, callback); }
[ "public", "Collection", "<", "ShardingExecuteGroup", "<", "StatementExecuteUnit", ">", ">", "getExecuteUnitGroups", "(", "final", "Collection", "<", "RouteUnit", ">", "routeUnits", ",", "final", "SQLExecutePrepareCallback", "callback", ")", "throws", "SQLException", "{"...
Get execute unit groups. @param routeUnits route units @param callback SQL execute prepare callback @return statement execute unit groups @throws SQLException SQL exception
[ "Get", "execute", "unit", "groups", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/prepare/SQLExecutePrepareTemplate.java#L58-L60
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/xmlutil/XmlUtilities.java
XmlUtilities.decodeDateTime
public static int decodeDateTime(DateTimeField field, String strValue) { """ Decode date time value and set the field value. @param field @return """ Date date = null; try { if (strValue != null) { if (field instanceof TimeField) date = timeFormat.parse(strValue); ...
java
public static int decodeDateTime(DateTimeField field, String strValue) { Date date = null; try { if (strValue != null) { if (field instanceof TimeField) date = timeFormat.parse(strValue); else if (field instanceof DateField) date = dateFormat.parse(strVal...
[ "public", "static", "int", "decodeDateTime", "(", "DateTimeField", "field", ",", "String", "strValue", ")", "{", "Date", "date", "=", "null", ";", "try", "{", "if", "(", "strValue", "!=", "null", ")", "{", "if", "(", "field", "instanceof", "TimeField", "...
Decode date time value and set the field value. @param field @return
[ "Decode", "date", "time", "value", "and", "set", "the", "field", "value", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/xmlutil/XmlUtilities.java#L291-L309
molgenis/molgenis
molgenis-data/src/main/java/org/molgenis/data/util/EntityUtils.java
EntityUtils.getTypedValue
public static Object getTypedValue(String valueStr, Attribute attr, EntityManager entityManager) { """ Convert a string value to a typed value based on the attribute data type. @param valueStr string value @param attr attribute @param entityManager entity manager used to convert referenced entity values @ret...
java
public static Object getTypedValue(String valueStr, Attribute attr, EntityManager entityManager) { if (valueStr == null) return null; switch (attr.getDataType()) { case BOOL: return Boolean.valueOf(valueStr); case CATEGORICAL: case FILE: case XREF: EntityType xrefEntity =...
[ "public", "static", "Object", "getTypedValue", "(", "String", "valueStr", ",", "Attribute", "attr", ",", "EntityManager", "entityManager", ")", "{", "if", "(", "valueStr", "==", "null", ")", "return", "null", ";", "switch", "(", "attr", ".", "getDataType", "...
Convert a string value to a typed value based on the attribute data type. @param valueStr string value @param attr attribute @param entityManager entity manager used to convert referenced entity values @return typed value
[ "Convert", "a", "string", "value", "to", "a", "typed", "value", "based", "on", "the", "attribute", "data", "type", "." ]
train
https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data/src/main/java/org/molgenis/data/util/EntityUtils.java#L55-L111
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/base64/Base64.java
Base64.encodeBytes
@Nonnull public static String encodeBytes (@Nonnull final byte [] source, final int options) throws IOException { """ Encodes a byte array into Base64 notation. <p> Example options: <pre> GZIP: gzip-compresses object before encoding it. DO_BREAK_LINES: break lines at 76 characters Note: Technically, this...
java
@Nonnull public static String encodeBytes (@Nonnull final byte [] source, final int options) throws IOException { return encodeBytes (source, 0, source.length, options); }
[ "@", "Nonnull", "public", "static", "String", "encodeBytes", "(", "@", "Nonnull", "final", "byte", "[", "]", "source", ",", "final", "int", "options", ")", "throws", "IOException", "{", "return", "encodeBytes", "(", "source", ",", "0", ",", "source", ".", ...
Encodes a byte array into Base64 notation. <p> Example options: <pre> GZIP: gzip-compresses object before encoding it. DO_BREAK_LINES: break lines at 76 characters Note: Technically, this makes your encoding non-compliant. </pre> <p> Example: <code>encodeBytes( myData, Base64.GZIP )</code> or <p> Example: <code>encode...
[ "Encodes", "a", "byte", "array", "into", "Base64", "notation", ".", "<p", ">", "Example", "options", ":" ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L1699-L1703
OpenLiberty/open-liberty
dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/remap/AddVersionFieldClassAdapter.java
AddVersionFieldClassAdapter.visitField
@Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { """ Field visitor that observes existing fields before chaining to the delegate {@ClassVisitor}. <p> {@inheritDoc} """ fieldAlreadyExists |= name.equals(versionFieldName); ret...
java
@Override public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { fieldAlreadyExists |= name.equals(versionFieldName); return super.visitField(access, name, desc, signature, value); }
[ "@", "Override", "public", "FieldVisitor", "visitField", "(", "int", "access", ",", "String", "name", ",", "String", "desc", ",", "String", "signature", ",", "Object", "value", ")", "{", "fieldAlreadyExists", "|=", "name", ".", "equals", "(", "versionFieldName...
Field visitor that observes existing fields before chaining to the delegate {@ClassVisitor}. <p> {@inheritDoc}
[ "Field", "visitor", "that", "observes", "existing", "fields", "before", "chaining", "to", "the", "delegate", "{" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/remap/AddVersionFieldClassAdapter.java#L61-L66
alkacon/opencms-core
src/org/opencms/xml/containerpage/CmsDynamicFunctionParser.java
CmsDynamicFunctionParser.parseFunctionBean
public CmsDynamicFunctionBean parseFunctionBean(CmsObject cms, CmsResource res) throws CmsException { """ Parses a dynamic function bean given a resource.<p> @param cms the current CMS context @param res the resource from which to read the dynamic function @return the dynamic function bean created from the ...
java
public CmsDynamicFunctionBean parseFunctionBean(CmsObject cms, CmsResource res) throws CmsException { CmsFile file = cms.readFile(res); CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(cms, file); return parseFunctionBean(cms, xmlContent); }
[ "public", "CmsDynamicFunctionBean", "parseFunctionBean", "(", "CmsObject", "cms", ",", "CmsResource", "res", ")", "throws", "CmsException", "{", "CmsFile", "file", "=", "cms", ".", "readFile", "(", "res", ")", ";", "CmsXmlContent", "xmlContent", "=", "CmsXmlConten...
Parses a dynamic function bean given a resource.<p> @param cms the current CMS context @param res the resource from which to read the dynamic function @return the dynamic function bean created from the resource @throws CmsException if something goes wrong
[ "Parses", "a", "dynamic", "function", "bean", "given", "a", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsDynamicFunctionParser.java#L72-L77
pippo-java/pippo
pippo-core/src/main/java/ro/pippo/core/PippoSettings.java
PippoSettings.overrideSetting
public void overrideSetting(String name, int value) { """ Override the setting at runtime with the specified value. This change does not persist. @param name @param value """ overrides.put(name, Integer.toString(value)); }
java
public void overrideSetting(String name, int value) { overrides.put(name, Integer.toString(value)); }
[ "public", "void", "overrideSetting", "(", "String", "name", ",", "int", "value", ")", "{", "overrides", ".", "put", "(", "name", ",", "Integer", ".", "toString", "(", "value", ")", ")", ";", "}" ]
Override the setting at runtime with the specified value. This change does not persist. @param name @param value
[ "Override", "the", "setting", "at", "runtime", "with", "the", "specified", "value", ".", "This", "change", "does", "not", "persist", "." ]
train
https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L1045-L1047
minio/minio-java
api/src/main/java/io/minio/PostPolicy.java
PostPolicy.formData
public Map<String,String> formData(String accessKey, String secretKey, String region) throws NoSuchAlgorithmException, InvalidKeyException, InvalidArgumentException { """ Returns form data of this post policy setting the provided region. """ if (Strings.isNullOrEmpty(region)) { throw new Inval...
java
public Map<String,String> formData(String accessKey, String secretKey, String region) throws NoSuchAlgorithmException, InvalidKeyException, InvalidArgumentException { if (Strings.isNullOrEmpty(region)) { throw new InvalidArgumentException("empty region"); } return makeFormData(accessKey, secre...
[ "public", "Map", "<", "String", ",", "String", ">", "formData", "(", "String", "accessKey", ",", "String", "secretKey", ",", "String", "region", ")", "throws", "NoSuchAlgorithmException", ",", "InvalidKeyException", ",", "InvalidArgumentException", "{", "if", "(",...
Returns form data of this post policy setting the provided region.
[ "Returns", "form", "data", "of", "this", "post", "policy", "setting", "the", "provided", "region", "." ]
train
https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/PostPolicy.java#L177-L185
hawkular/hawkular-agent
hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/CoreJBossASClient.java
CoreJBossASClient.addExtension
public void addExtension(String name) throws Exception { """ Adds a new module extension to the core system. @param name the name of the new module extension @throws Exception any error """ // /extension=<name>/:add(module=<name>) final ModelNode request = createRequest(ADD, Address.root()....
java
public void addExtension(String name) throws Exception { // /extension=<name>/:add(module=<name>) final ModelNode request = createRequest(ADD, Address.root().add(EXTENSION, name)); request.get(MODULE).set(name); final ModelNode response = execute(request); if (!isSuccess(response...
[ "public", "void", "addExtension", "(", "String", "name", ")", "throws", "Exception", "{", "// /extension=<name>/:add(module=<name>)", "final", "ModelNode", "request", "=", "createRequest", "(", "ADD", ",", "Address", ".", "root", "(", ")", ".", "add", "(", "EXTE...
Adds a new module extension to the core system. @param name the name of the new module extension @throws Exception any error
[ "Adds", "a", "new", "module", "extension", "to", "the", "core", "system", "." ]
train
https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/CoreJBossASClient.java#L291-L300
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java
MethodBuilder.getInstance
public static MethodBuilder getInstance(Context context, ClassDoc classDoc, MethodWriter writer) { """ Construct a new MethodBuilder. @param context the build context. @param classDoc the class whoses members are being documented. @param writer the doclet specific writer. @return an insta...
java
public static MethodBuilder getInstance(Context context, ClassDoc classDoc, MethodWriter writer) { return new MethodBuilder(context, classDoc, writer); }
[ "public", "static", "MethodBuilder", "getInstance", "(", "Context", "context", ",", "ClassDoc", "classDoc", ",", "MethodWriter", "writer", ")", "{", "return", "new", "MethodBuilder", "(", "context", ",", "classDoc", ",", "writer", ")", ";", "}" ]
Construct a new MethodBuilder. @param context the build context. @param classDoc the class whoses members are being documented. @param writer the doclet specific writer. @return an instance of a MethodBuilder.
[ "Construct", "a", "new", "MethodBuilder", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java#L109-L112
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/Counters.java
Counters.toSortedByKeysString
public static <T extends Comparable<T>> String toSortedByKeysString(Counter<T> counter, String itemFormat, String joiner, String wrapperFormat) { """ Returns a string representation of a Counter, where (key, value) pairs are sorted by key, and formatted as specified. @param counter The Counter. @param itemFo...
java
public static <T extends Comparable<T>> String toSortedByKeysString(Counter<T> counter, String itemFormat, String joiner, String wrapperFormat) { List<String> strings = new ArrayList<String>(); for (T key : CollectionUtils.sorted(counter.keySet())) { strings.add(String.format(itemFormat, key, counter.g...
[ "public", "static", "<", "T", "extends", "Comparable", "<", "T", ">", ">", "String", "toSortedByKeysString", "(", "Counter", "<", "T", ">", "counter", ",", "String", "itemFormat", ",", "String", "joiner", ",", "String", "wrapperFormat", ")", "{", "List", "...
Returns a string representation of a Counter, where (key, value) pairs are sorted by key, and formatted as specified. @param counter The Counter. @param itemFormat The format string for key/count pairs, where the key is first and the value is second. To display the value first, use argument indices, e.g. "%2$f %1$s". ...
[ "Returns", "a", "string", "representation", "of", "a", "Counter", "where", "(", "key", "value", ")", "pairs", "are", "sorted", "by", "key", "and", "formatted", "as", "specified", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1813-L1819
eclipse/xtext-extras
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/conformance/TypeConformanceComputer.java
TypeConformanceComputer.isRecursiveRequest
@Deprecated protected final boolean isRecursiveRequest(List<LightweightTypeReference> types, Set<String> allNames, List<LightweightTypeReference> initiallyRequested) { """ Logic was moved to inner class CommonSuperTypeFinder in the context of bug 495314. This method is scheduled for deletion in Xtext 2.15 @...
java
@Deprecated protected final boolean isRecursiveRequest(List<LightweightTypeReference> types, Set<String> allNames, List<LightweightTypeReference> initiallyRequested) { CommonSuperTypeFinder typeFinder = newCommonSuperTypeFinder(types.get(0).getOwner()); typeFinder.requestsInProgress = Lists.newArrayList(); typeF...
[ "@", "Deprecated", "protected", "final", "boolean", "isRecursiveRequest", "(", "List", "<", "LightweightTypeReference", ">", "types", ",", "Set", "<", "String", ">", "allNames", ",", "List", "<", "LightweightTypeReference", ">", "initiallyRequested", ")", "{", "Co...
Logic was moved to inner class CommonSuperTypeFinder in the context of bug 495314. This method is scheduled for deletion in Xtext 2.15 @deprecated see {@link CommonSuperTypeFinder#isRecursiveRequest(List, Set)}
[ "Logic", "was", "moved", "to", "inner", "class", "CommonSuperTypeFinder", "in", "the", "context", "of", "bug", "495314", "." ]
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/conformance/TypeConformanceComputer.java#L829-L835
samskivert/samskivert
src/main/java/com/samskivert/velocity/FormTool.java
FormTool.fixedText
public String fixedText (String name, String extra, Object value) { """ Creates a text input field with the specified name and the specified extra arguments and the specified value. """ return fixedInput("text", name, value, extra); }
java
public String fixedText (String name, String extra, Object value) { return fixedInput("text", name, value, extra); }
[ "public", "String", "fixedText", "(", "String", "name", ",", "String", "extra", ",", "Object", "value", ")", "{", "return", "fixedInput", "(", "\"text\"", ",", "name", ",", "value", ",", "extra", ")", ";", "}" ]
Creates a text input field with the specified name and the specified extra arguments and the specified value.
[ "Creates", "a", "text", "input", "field", "with", "the", "specified", "name", "and", "the", "specified", "extra", "arguments", "and", "the", "specified", "value", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L90-L93
alibaba/jstorm
jstorm-core/src/main/java/com/alibaba/jstorm/utils/JStormUtils.java
JStormUtils.launchProcess
@Deprecated public static ByteArrayOutputStream launchProcess( String command, final Map environment, final String workDir, ExecuteResultHandler resultHandler) throws IOException { """ If it is backend, please set resultHandler, such as DefaultExecuteResultHandler If it is frontend, By...
java
@Deprecated public static ByteArrayOutputStream launchProcess( String command, final Map environment, final String workDir, ExecuteResultHandler resultHandler) throws IOException { String[] cmdlist = command.split(" "); CommandLine cmd = new CommandLine(cmdlist[0]); ...
[ "@", "Deprecated", "public", "static", "ByteArrayOutputStream", "launchProcess", "(", "String", "command", ",", "final", "Map", "environment", ",", "final", "String", "workDir", ",", "ExecuteResultHandler", "resultHandler", ")", "throws", "IOException", "{", "String",...
If it is backend, please set resultHandler, such as DefaultExecuteResultHandler If it is frontend, ByteArrayOutputStream.toString will return the calling result <p> This function will ignore whether the command is successfully executed or not @param command command to be executed @param environment env vars @p...
[ "If", "it", "is", "backend", "please", "set", "resultHandler", "such", "as", "DefaultExecuteResultHandler", "If", "it", "is", "frontend", "ByteArrayOutputStream", ".", "toString", "will", "return", "the", "calling", "result", "<p", ">", "This", "function", "will",...
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/JStormUtils.java#L636-L673
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java
ReviewsImpl.getReview
public Review getReview(String teamName, String reviewId) { """ Returns review details for the review Id passed. @param teamName Your Team Name. @param reviewId Id of the review. @throws IllegalArgumentException thrown if parameters fail the validation @throws APIErrorException thrown if the request is rejec...
java
public Review getReview(String teamName, String reviewId) { return getReviewWithServiceResponseAsync(teamName, reviewId).toBlocking().single().body(); }
[ "public", "Review", "getReview", "(", "String", "teamName", ",", "String", "reviewId", ")", "{", "return", "getReviewWithServiceResponseAsync", "(", "teamName", ",", "reviewId", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", ".", "body", "(", ")"...
Returns review details for the review Id passed. @param teamName Your Team Name. @param reviewId Id of the review. @throws IllegalArgumentException thrown if parameters fail the validation @throws APIErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exception...
[ "Returns", "review", "details", "for", "the", "review", "Id", "passed", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L141-L143
aol/cyclops
cyclops/src/main/java/cyclops/companion/Functions.java
Functions.limitDouble
public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> limitDouble(long maxSize) { """ /* Fluent limit operation using primitive types e.g. <pre> {@code import static cyclops.ReactiveSeq.limitDoubles; ReactiveSeq.ofDoubles(1d,2d,3d) .to(limitDoubles(1)); //[1] } </pre> ...
java
public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> limitDouble(long maxSize){ return a->a.doubles(i->i,s->s.limit(maxSize)); }
[ "public", "static", "Function", "<", "?", "super", "ReactiveSeq", "<", "Double", ">", ",", "?", "extends", "ReactiveSeq", "<", "Double", ">", ">", "limitDouble", "(", "long", "maxSize", ")", "{", "return", "a", "->", "a", ".", "doubles", "(", "i", "->"...
/* Fluent limit operation using primitive types e.g. <pre> {@code import static cyclops.ReactiveSeq.limitDoubles; ReactiveSeq.ofDoubles(1d,2d,3d) .to(limitDoubles(1)); //[1] } </pre>
[ "/", "*", "Fluent", "limit", "operation", "using", "primitive", "types", "e", ".", "g", ".", "<pre", ">", "{", "@code", "import", "static", "cyclops", ".", "ReactiveSeq", ".", "limitDoubles", ";" ]
train
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Functions.java#L461-L464
allure-framework/allure1
allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java
ReportGenerate.validateResultsDirectories
protected void validateResultsDirectories() { """ Throws an exception if at least one results directory is missing. """ for (String result : results) { if (Files.notExists(Paths.get(result))) { throw new AllureCommandException(String.format("Report directory <%s> not found."...
java
protected void validateResultsDirectories() { for (String result : results) { if (Files.notExists(Paths.get(result))) { throw new AllureCommandException(String.format("Report directory <%s> not found.", result)); } } }
[ "protected", "void", "validateResultsDirectories", "(", ")", "{", "for", "(", "String", "result", ":", "results", ")", "{", "if", "(", "Files", ".", "notExists", "(", "Paths", ".", "get", "(", "result", ")", ")", ")", "{", "throw", "new", "AllureCommandE...
Throws an exception if at least one results directory is missing.
[ "Throws", "an", "exception", "if", "at", "least", "one", "results", "directory", "is", "missing", "." ]
train
https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-commandline/src/main/java/ru/yandex/qatools/allure/command/ReportGenerate.java#L56-L62
JoeKerouac/utils
src/main/java/com/joe/utils/reflect/BeanUtils.java
BeanUtils.getMethod
private static Method getMethod(String methodName, Class<?> clazz, Class<?>... args) { """ 获取指定方法 @param methodName 方法名 @param clazz Class @param args 方法的参数类型 @return 方法名对应的方法,如果获取不到返回null """ Method method; try { method = clazz.getMethod(methodName, args); ...
java
private static Method getMethod(String methodName, Class<?> clazz, Class<?>... args) { Method method; try { method = clazz.getMethod(methodName, args); } catch (NoSuchMethodException e1) { method = null; } return method; }
[ "private", "static", "Method", "getMethod", "(", "String", "methodName", ",", "Class", "<", "?", ">", "clazz", ",", "Class", "<", "?", ">", "...", "args", ")", "{", "Method", "method", ";", "try", "{", "method", "=", "clazz", ".", "getMethod", "(", "...
获取指定方法 @param methodName 方法名 @param clazz Class @param args 方法的参数类型 @return 方法名对应的方法,如果获取不到返回null
[ "获取指定方法" ]
train
https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/BeanUtils.java#L400-L408
hawkular/hawkular-apm
server/api/src/main/java/org/hawkular/apm/server/api/utils/SourceInfoUtil.java
SourceInfoUtil.getSourceInfo
public static SourceInfo getSourceInfo(String tenantId, Span serverSpan, SpanCache spanCache) { """ This method attempts to derive the Source Information for the supplied server span. If the information is not available, then a null will be returned, which can be used to trigger a retry attempt if appropriate. ...
java
public static SourceInfo getSourceInfo(String tenantId, Span serverSpan, SpanCache spanCache) { String clientSpanId = SpanUniqueIdGenerator.getClientId(serverSpan.getId()); if (spanCache != null && clientSpanId != null) { Span clientSpan = spanCache.get(tenantId, clientSpanId); ...
[ "public", "static", "SourceInfo", "getSourceInfo", "(", "String", "tenantId", ",", "Span", "serverSpan", ",", "SpanCache", "spanCache", ")", "{", "String", "clientSpanId", "=", "SpanUniqueIdGenerator", ".", "getClientId", "(", "serverSpan", ".", "getId", "(", ")",...
This method attempts to derive the Source Information for the supplied server span. If the information is not available, then a null will be returned, which can be used to trigger a retry attempt if appropriate. @param tenantId The tenant id @param serverSpan The server span @param spanCache The cache @return The sour...
[ "This", "method", "attempts", "to", "derive", "the", "Source", "Information", "for", "the", "supplied", "server", "span", ".", "If", "the", "information", "is", "not", "available", "then", "a", "null", "will", "be", "returned", "which", "can", "be", "used", ...
train
https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/server/api/src/main/java/org/hawkular/apm/server/api/utils/SourceInfoUtil.java#L198-L238
rubenlagus/TelegramBots
telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/BaseAbilityBot.java
BaseAbilityBot.getUser
protected User getUser(int id) { """ Gets the user with the specified ID. @param id the id of the required user @return the user """ User user = users().get(id); if (user == null) { throw new IllegalStateException(format("Could not find user corresponding to id [%d]", id)); } return ...
java
protected User getUser(int id) { User user = users().get(id); if (user == null) { throw new IllegalStateException(format("Could not find user corresponding to id [%d]", id)); } return user; }
[ "protected", "User", "getUser", "(", "int", "id", ")", "{", "User", "user", "=", "users", "(", ")", ".", "get", "(", "id", ")", ";", "if", "(", "user", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "format", "(", "\"Could not ...
Gets the user with the specified ID. @param id the id of the required user @return the user
[ "Gets", "the", "user", "with", "the", "specified", "ID", "." ]
train
https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/BaseAbilityBot.java#L263-L270
EdwardRaff/JSAT
JSAT/src/jsat/DataSet.java
DataSet.applyTransformMutate
public void applyTransformMutate(final DataTransform dt, boolean mutate, boolean parallel) { """ Applies the given transformation to all points in this data set in parallel. If the transform supports mutating the original data points, this will be applied if {@code mutableTransform} is set to {@code true} @pa...
java
public void applyTransformMutate(final DataTransform dt, boolean mutate, boolean parallel) { if (mutate && dt instanceof InPlaceTransform) { final InPlaceTransform ipt = (InPlaceTransform) dt; ParallelUtils.range(size(), parallel) .forEach(i->ipt.mut...
[ "public", "void", "applyTransformMutate", "(", "final", "DataTransform", "dt", ",", "boolean", "mutate", ",", "boolean", "parallel", ")", "{", "if", "(", "mutate", "&&", "dt", "instanceof", "InPlaceTransform", ")", "{", "final", "InPlaceTransform", "ipt", "=", ...
Applies the given transformation to all points in this data set in parallel. If the transform supports mutating the original data points, this will be applied if {@code mutableTransform} is set to {@code true} @param dt the transformation to apply @param mutate {@code true} to mutableTransform the original data points...
[ "Applies", "the", "given", "transformation", "to", "all", "points", "in", "this", "data", "set", "in", "parallel", ".", "If", "the", "transform", "supports", "mutating", "the", "original", "data", "points", "this", "will", "be", "applied", "if", "{", "@code"...
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/DataSet.java#L219-L236
lucee/Lucee
core/src/main/java/lucee/runtime/cache/CacheUtil.java
CacheUtil.getPassword
public static Password getPassword(PageContext pc, String password, boolean server) throws lucee.runtime.exp.SecurityException { """ returns true if the webAdminPassword matches the passed password if one is passed, or a password defined in Application . cfc as this.webAdminPassword if null or empty-string is pas...
java
public static Password getPassword(PageContext pc, String password, boolean server) throws lucee.runtime.exp.SecurityException { // TODO: move this to a utility class in a more // generic package? // no password passed if (StringUtil.isEmpty(password, true)) { ApplicationContext appContext =...
[ "public", "static", "Password", "getPassword", "(", "PageContext", "pc", ",", "String", "password", ",", "boolean", "server", ")", "throws", "lucee", ".", "runtime", ".", "exp", ".", "SecurityException", "{", "// TODO: move this to a utility class in a more", "// gene...
returns true if the webAdminPassword matches the passed password if one is passed, or a password defined in Application . cfc as this.webAdminPassword if null or empty-string is passed for password @param pc @param password @return @throws lucee.runtime.exp.SecurityException
[ "returns", "true", "if", "the", "webAdminPassword", "matches", "the", "passed", "password", "if", "one", "is", "passed", "or", "a", "password", "defined", "in", "Application", ".", "cfc", "as", "this", ".", "webAdminPassword", "if", "null", "or", "empty", "-...
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/cache/CacheUtil.java#L382-L397
navnorth/LRJavaLib
src/com/navnorth/learningregistry/LRImporter.java
LRImporter.getObtainJSONData
private LRResult getObtainJSONData(String requestID, Boolean byResourceID, Boolean byDocID, Boolean idsOnly, String resumptionToken) throws LRException { """ Get a result from an obtain request If the resumption token is not null, it will override the other parameters for ths request @param requestID the "requ...
java
private LRResult getObtainJSONData(String requestID, Boolean byResourceID, Boolean byDocID, Boolean idsOnly, String resumptionToken) throws LRException { String path = getObtainRequestPath(requestID, byResourceID, byDocID, idsOnly, resumptionToken); JSONObject json = getJSONFromPath...
[ "private", "LRResult", "getObtainJSONData", "(", "String", "requestID", ",", "Boolean", "byResourceID", ",", "Boolean", "byDocID", ",", "Boolean", "idsOnly", ",", "String", "resumptionToken", ")", "throws", "LRException", "{", "String", "path", "=", "getObtainReques...
Get a result from an obtain request If the resumption token is not null, it will override the other parameters for ths request @param requestID the "request_id" value to use for this request @param byResourceID the "by_resource_id" value to use for this request @param byDocID the "by_doc_id" value to use for this requ...
[ "Get", "a", "result", "from", "an", "obtain", "request", "If", "the", "resumption", "token", "is", "not", "null", "it", "will", "override", "the", "other", "parameters", "for", "ths", "request" ]
train
https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRImporter.java#L247-L254
datasalt/pangool
core/src/main/java/com/datasalt/pangool/tuplemr/mapred/lib/output/PangoolMultipleOutputs.java
PangoolMultipleOutputs.checkNamedOutputName
private static void checkNamedOutputName(JobContext job, String namedOutput, boolean alreadyDefined) { """ Checks if a named output name is valid. @param namedOutput named output Name @throws IllegalArgumentException if the output name is not valid. """ validateOutputName(namedOutput); List<String> d...
java
private static void checkNamedOutputName(JobContext job, String namedOutput, boolean alreadyDefined) { validateOutputName(namedOutput); List<String> definedChannels = getNamedOutputsList(job); if(alreadyDefined && definedChannels.contains(namedOutput)) { throw new IllegalArgumentException("Named output '" + na...
[ "private", "static", "void", "checkNamedOutputName", "(", "JobContext", "job", ",", "String", "namedOutput", ",", "boolean", "alreadyDefined", ")", "{", "validateOutputName", "(", "namedOutput", ")", ";", "List", "<", "String", ">", "definedChannels", "=", "getNam...
Checks if a named output name is valid. @param namedOutput named output Name @throws IllegalArgumentException if the output name is not valid.
[ "Checks", "if", "a", "named", "output", "name", "is", "valid", "." ]
train
https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/mapred/lib/output/PangoolMultipleOutputs.java#L134-L142
apache/incubator-atlas
repository/src/main/java/org/apache/atlas/discovery/DataSetLineageService.java
DataSetLineageService.getSchema
@Override @GraphTransaction public String getSchema(String datasetName) throws AtlasException { """ Return the schema for the given tableName. @param datasetName tableName @return Schema as JSON """ datasetName = ParamChecker.notEmpty(datasetName, "table name"); LOG.info("Fetching s...
java
@Override @GraphTransaction public String getSchema(String datasetName) throws AtlasException { datasetName = ParamChecker.notEmpty(datasetName, "table name"); LOG.info("Fetching schema for tableName={}", datasetName); TypeUtils.Pair<String, String> typeIdPair = validateDatasetNameExists...
[ "@", "Override", "@", "GraphTransaction", "public", "String", "getSchema", "(", "String", "datasetName", ")", "throws", "AtlasException", "{", "datasetName", "=", "ParamChecker", ".", "notEmpty", "(", "datasetName", ",", "\"table name\"", ")", ";", "LOG", ".", "...
Return the schema for the given tableName. @param datasetName tableName @return Schema as JSON
[ "Return", "the", "schema", "for", "the", "given", "tableName", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/discovery/DataSetLineageService.java#L173-L181
phax/ph-commons
ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java
MicroWriter.getNodeAsString
@Nullable public static String getNodeAsString (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings) { """ Convert the passed micro node to an XML string using the provided settings. @param aNode The node to be converted to a string. May not be <code>null</code> . @param aSettings ...
java
@Nullable public static String getNodeAsString (@Nonnull final IMicroNode aNode, @Nonnull final IXMLWriterSettings aSettings) { ValueEnforcer.notNull (aNode, "Node"); ValueEnforcer.notNull (aSettings, "Settings"); try (final NonBlockingStringWriter aWriter = new NonBlockingStringWriter (50 * CGlobal.BY...
[ "@", "Nullable", "public", "static", "String", "getNodeAsString", "(", "@", "Nonnull", "final", "IMicroNode", "aNode", ",", "@", "Nonnull", "final", "IXMLWriterSettings", "aSettings", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aNode", ",", "\"Node\"", ")",...
Convert the passed micro node to an XML string using the provided settings. @param aNode The node to be converted to a string. May not be <code>null</code> . @param aSettings The XML writer settings to use. May not be <code>null</code>. @return The string representation of the passed node.
[ "Convert", "the", "passed", "micro", "node", "to", "an", "XML", "string", "using", "the", "provided", "settings", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java#L262-L280
alkacon/opencms-core
src/org/opencms/workplace/CmsWorkplaceManager.java
CmsWorkplaceManager.translateGroupName
public String translateGroupName(String groupName, boolean keepOu) { """ Translates a group name using the configured {@link I_CmsGroupNameTranslation}.<p> @param groupName the group name @param keepOu if true, the OU will be appended to the translated name @return the translated group name """ ...
java
public String translateGroupName(String groupName, boolean keepOu) { I_CmsGroupNameTranslation translation = getGroupNameTranslation(); return translation.translateGroupName(groupName, keepOu); }
[ "public", "String", "translateGroupName", "(", "String", "groupName", ",", "boolean", "keepOu", ")", "{", "I_CmsGroupNameTranslation", "translation", "=", "getGroupNameTranslation", "(", ")", ";", "return", "translation", ".", "translateGroupName", "(", "groupName", "...
Translates a group name using the configured {@link I_CmsGroupNameTranslation}.<p> @param groupName the group name @param keepOu if true, the OU will be appended to the translated name @return the translated group name
[ "Translates", "a", "group", "name", "using", "the", "configured", "{", "@link", "I_CmsGroupNameTranslation", "}", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceManager.java#L2254-L2258
jenkinsci/ssh-slaves-plugin
src/main/java/hudson/plugins/sshslaves/SSHLauncher.java
SSHLauncher.copySlaveJarUsingSCP
private void copySlaveJarUsingSCP(TaskListener listener, String workingDirectory) throws IOException, InterruptedException { """ Method copies the agent jar to the remote system using scp. @param listener The listener. @param workingDirectory The directory into which the agent jar will be copied. @t...
java
private void copySlaveJarUsingSCP(TaskListener listener, String workingDirectory) throws IOException, InterruptedException { SCPClient scp = new SCPClient(connection); try { // check if the working directory exists if (connection.exec("test -d " + workingDirectory ,listener.getLo...
[ "private", "void", "copySlaveJarUsingSCP", "(", "TaskListener", "listener", ",", "String", "workingDirectory", ")", "throws", "IOException", ",", "InterruptedException", "{", "SCPClient", "scp", "=", "new", "SCPClient", "(", "connection", ")", ";", "try", "{", "//...
Method copies the agent jar to the remote system using scp. @param listener The listener. @param workingDirectory The directory into which the agent jar will be copied. @throws IOException If something goes wrong. @throws InterruptedException If something goes wrong.
[ "Method", "copies", "the", "agent", "jar", "to", "the", "remote", "system", "using", "scp", "." ]
train
https://github.com/jenkinsci/ssh-slaves-plugin/blob/95f528730fc1e01b25983459927b7516ead3ee00/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L775-L797
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/DTDBasedZippedXMLMagicNumber.java
DTDBasedZippedXMLMagicNumber.isContentType
@Override protected boolean isContentType(String schemaId, String schemaVersion, String systemId, String publicId) { """ Replies if the specified stream contains data that corresponds to this magic number. @param schemaId is the ID of the XSL schema associated to this magic number. @param schemaVersion is th...
java
@Override protected boolean isContentType(String schemaId, String schemaVersion, String systemId, String publicId) { return (this.publicId != null && this.publicId.equalsIgnoreCase(publicId)) || (this.systemId != null && this.systemId.equalsIgnoreCase(systemId)); }
[ "@", "Override", "protected", "boolean", "isContentType", "(", "String", "schemaId", ",", "String", "schemaVersion", ",", "String", "systemId", ",", "String", "publicId", ")", "{", "return", "(", "this", ".", "publicId", "!=", "null", "&&", "this", ".", "pub...
Replies if the specified stream contains data that corresponds to this magic number. @param schemaId is the ID of the XSL schema associated to this magic number. @param schemaVersion is the ID of the XSL schema associated to this magic number. @param systemId is the DTD system ID associated to this magic number. @para...
[ "Replies", "if", "the", "specified", "stream", "contains", "data", "that", "corresponds", "to", "this", "magic", "number", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/filetype/DTDBasedZippedXMLMagicNumber.java#L78-L82
transloadit/java-sdk
src/main/java/com/transloadit/sdk/Transloadit.java
Transloadit.updateTemplate
public Response updateTemplate(String id, Map<String, Object> options) throws RequestException, LocalOperationException { """ Updates the template with the specified id. @param id id of the template to update @param options a Map of options to update/add. @return {@link Response} @throws Reques...
java
public Response updateTemplate(String id, Map<String, Object> options) throws RequestException, LocalOperationException { Request request = new Request(this); return new Response(request.put("/templates/" + id, options)); }
[ "public", "Response", "updateTemplate", "(", "String", "id", ",", "Map", "<", "String", ",", "Object", ">", "options", ")", "throws", "RequestException", ",", "LocalOperationException", "{", "Request", "request", "=", "new", "Request", "(", "this", ")", ";", ...
Updates the template with the specified id. @param id id of the template to update @param options a Map of options to update/add. @return {@link Response} @throws RequestException if request to transloadit server fails. @throws LocalOperationException if something goes wrong while running non-http operations.
[ "Updates", "the", "template", "with", "the", "specified", "id", "." ]
train
https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L210-L214
facebookarchive/hadoop-20
src/contrib/benchmark/src/java/org/apache/hadoop/mapred/DatanodeBenThread.java
DatanodeBenThread.getRunningDatanode
private String getRunningDatanode(Configuration conf) throws IOException { """ Write a small file to figure out which datanode we are running """ FileSystem fs = FileSystem.newInstance(conf); fs.mkdirs(new Path("/tmp")); Path fileName = new Path("/tmp", rtc.task_name + System.currentT...
java
private String getRunningDatanode(Configuration conf) throws IOException { FileSystem fs = FileSystem.newInstance(conf); fs.mkdirs(new Path("/tmp")); Path fileName = new Path("/tmp", rtc.task_name + System.currentTimeMillis() + rb.nextInt()); if (fs.exists(fileName)) { ...
[ "private", "String", "getRunningDatanode", "(", "Configuration", "conf", ")", "throws", "IOException", "{", "FileSystem", "fs", "=", "FileSystem", ".", "newInstance", "(", "conf", ")", ";", "fs", ".", "mkdirs", "(", "new", "Path", "(", "\"/tmp\"", ")", ")", ...
Write a small file to figure out which datanode we are running
[ "Write", "a", "small", "file", "to", "figure", "out", "which", "datanode", "we", "are", "running" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/DatanodeBenThread.java#L455-L480
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/xmlutil/XmlUtilities.java
XmlUtilities.decodeFieldData
public static void decodeFieldData(BaseField field, String string) { """ Change this base64 string to raw data and set the value in this field. WARNING - This requires 64bit encoding found in javax.mail! @param field The field containing the binary data to decode. @param The string to decode using base64. "...
java
public static void decodeFieldData(BaseField field, String string) { if ((string == null) || (string.length() == 0)) return; byte[] ba = Base64.decode(string.toCharArray()); InputStream is = new ByteArrayInputStream(ba); DataInputStream daIn = new DataInputStream(is); ...
[ "public", "static", "void", "decodeFieldData", "(", "BaseField", "field", ",", "String", "string", ")", "{", "if", "(", "(", "string", "==", "null", ")", "||", "(", "string", ".", "length", "(", ")", "==", "0", ")", ")", "return", ";", "byte", "[", ...
Change this base64 string to raw data and set the value in this field. WARNING - This requires 64bit encoding found in javax.mail! @param field The field containing the binary data to decode. @param The string to decode using base64.
[ "Change", "this", "base64", "string", "to", "raw", "data", "and", "set", "the", "value", "in", "this", "field", ".", "WARNING", "-", "This", "requires", "64bit", "encoding", "found", "in", "javax", ".", "mail!" ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/xmlutil/XmlUtilities.java#L400-L408
apptik/jus
jus-java/src/main/java/io/apptik/comm/jus/NetworkDispatcher.java
NetworkDispatcher.hasResponseBody
public static boolean hasResponseBody(String requestMethod, int responseCode) { """ Checks if a response message contains a body. @param requestMethod request method @param responseCode response status code @return whether the response has a body @see <a href="https://tools.ietf.org/html/rfc7230#section-3.3...
java
public static boolean hasResponseBody(String requestMethod, int responseCode) { return requestMethod != Request.Method.HEAD && !(100 <= responseCode && responseCode < HttpURLConnection.HTTP_OK) && responseCode != HttpURLConnection.HTTP_NO_CONTENT && responseCode !...
[ "public", "static", "boolean", "hasResponseBody", "(", "String", "requestMethod", ",", "int", "responseCode", ")", "{", "return", "requestMethod", "!=", "Request", ".", "Method", ".", "HEAD", "&&", "!", "(", "100", "<=", "responseCode", "&&", "responseCode", "...
Checks if a response message contains a body. @param requestMethod request method @param responseCode response status code @return whether the response has a body @see <a href="https://tools.ietf.org/html/rfc7230#section-3.3">RFC 7230 section 3.3</a>
[ "Checks", "if", "a", "response", "message", "contains", "a", "body", "." ]
train
https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/NetworkDispatcher.java#L83-L89
Impetus/Kundera
examples/polyglot/kvapps/src/main/java/com/impetus/kvapps/runner/AppRunner.java
AppRunner.onDestroyDBResources
private static void onDestroyDBResources(EntityManagerFactory emf,EntityManager em) { """ After successful processing close entity manager and it's factory instance. @param emf entity manager factory instance. @param em entity manager instance """ if(emf != null) { emf.close(); ...
java
private static void onDestroyDBResources(EntityManagerFactory emf,EntityManager em) { if(emf != null) { emf.close(); } if(em != null) { em.close(); } }
[ "private", "static", "void", "onDestroyDBResources", "(", "EntityManagerFactory", "emf", ",", "EntityManager", "em", ")", "{", "if", "(", "emf", "!=", "null", ")", "{", "emf", ".", "close", "(", ")", ";", "}", "if", "(", "em", "!=", "null", ")", "{", ...
After successful processing close entity manager and it's factory instance. @param emf entity manager factory instance. @param em entity manager instance
[ "After", "successful", "processing", "close", "entity", "manager", "and", "it", "s", "factory", "instance", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/examples/polyglot/kvapps/src/main/java/com/impetus/kvapps/runner/AppRunner.java#L119-L129
javamelody/javamelody
javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MSwingUtilities.java
MSwingUtilities.showMessage
public static void showMessage(Component component, String message) { """ Affiche une boîte de dialogue d'information. @param component Component @param message String """ JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(component), message, UIManager.getString("OptionPane.messageDialog...
java
public static void showMessage(Component component, String message) { JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(component), message, UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.INFORMATION_MESSAGE); }
[ "public", "static", "void", "showMessage", "(", "Component", "component", ",", "String", "message", ")", "{", "JOptionPane", ".", "showMessageDialog", "(", "SwingUtilities", ".", "getWindowAncestor", "(", "component", ")", ",", "message", ",", "UIManager", ".", ...
Affiche une boîte de dialogue d'information. @param component Component @param message String
[ "Affiche", "une", "boîte", "de", "dialogue", "d", "information", "." ]
train
https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/util/MSwingUtilities.java#L79-L83
intive-FDV/DynamicJasper
src/main/java/ar/com/fdvs/dj/util/ExpressionUtils.java
ExpressionUtils.createCustomExpressionInvocationText
public static String createCustomExpressionInvocationText(CustomExpression customExpression, String customExpName, boolean usePreviousFieldValues) { """ If you register a CustomExpression with the name "customExpName", then this will create the text needed to invoke it in a JRDesignExpression @param customExpN...
java
public static String createCustomExpressionInvocationText(CustomExpression customExpression, String customExpName, boolean usePreviousFieldValues) { String stringExpression; if (customExpression instanceof DJSimpleExpression) { DJSimpleExpression varexp = (DJSimpleExpression) customExpressio...
[ "public", "static", "String", "createCustomExpressionInvocationText", "(", "CustomExpression", "customExpression", ",", "String", "customExpName", ",", "boolean", "usePreviousFieldValues", ")", "{", "String", "stringExpression", ";", "if", "(", "customExpression", "instance...
If you register a CustomExpression with the name "customExpName", then this will create the text needed to invoke it in a JRDesignExpression @param customExpName @param usePreviousFieldValues @return
[ "If", "you", "register", "a", "CustomExpression", "with", "the", "name", "customExpName", "then", "this", "will", "create", "the", "text", "needed", "to", "invoke", "it", "in", "a", "JRDesignExpression" ]
train
https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/util/ExpressionUtils.java#L293-L327
apache/reef
lang/java/reef-common/src/main/java/org/apache/reef/util/SingletonAsserter.java
SingletonAsserter.assertSingleton
public static synchronized boolean assertSingleton(final String scopeId, final Class clazz) { """ Check if given class is singleton within a particular environment or scope. @param scopeId Environment id, e.g. Driver name or REEF job id. @param clazz Class that must have no more than 1 instance in that environme...
java
public static synchronized boolean assertSingleton(final String scopeId, final Class clazz) { ALL_CLASSES.add(clazz); return SINGLETONS_SCOPED.add(new Tuple<>(scopeId, clazz)) && !SINGLETONS_GLOBAL.contains(clazz); }
[ "public", "static", "synchronized", "boolean", "assertSingleton", "(", "final", "String", "scopeId", ",", "final", "Class", "clazz", ")", "{", "ALL_CLASSES", ".", "add", "(", "clazz", ")", ";", "return", "SINGLETONS_SCOPED", ".", "add", "(", "new", "Tuple", ...
Check if given class is singleton within a particular environment or scope. @param scopeId Environment id, e.g. Driver name or REEF job id. @param clazz Class that must have no more than 1 instance in that environment. @return true if the instance is unique within that particular environment, false otherwise.
[ "Check", "if", "given", "class", "is", "singleton", "within", "a", "particular", "environment", "or", "scope", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/util/SingletonAsserter.java#L58-L61
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.feature.cmdline/src/com/ibm/ws/kernel/feature/internal/generator/ManifestFileProcessor.java
ManifestFileProcessor.getCoreAssetDir
public File getCoreAssetDir() { """ Retrieves the Liberty core assets directory. @return The Liberty core assets directory """ File assetDir = null; File installDir = Utils.getInstallDir(); if (installDir != null) { assetDir = new File(installDir, ASSET_DIR); } ...
java
public File getCoreAssetDir() { File assetDir = null; File installDir = Utils.getInstallDir(); if (installDir != null) { assetDir = new File(installDir, ASSET_DIR); } if (assetDir == null) { throw new RuntimeException("Asset Directory not found"); ...
[ "public", "File", "getCoreAssetDir", "(", ")", "{", "File", "assetDir", "=", "null", ";", "File", "installDir", "=", "Utils", ".", "getInstallDir", "(", ")", ";", "if", "(", "installDir", "!=", "null", ")", "{", "assetDir", "=", "new", "File", "(", "in...
Retrieves the Liberty core assets directory. @return The Liberty core assets directory
[ "Retrieves", "the", "Liberty", "core", "assets", "directory", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.cmdline/src/com/ibm/ws/kernel/feature/internal/generator/ManifestFileProcessor.java#L479-L489
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplPlain_CustomFieldSerializer.java
OWLLiteralImplPlain_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLLiteralImplPlain instance) throws SerializationException { """ Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user....
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLLiteralImplPlain instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLLiteralImplPlain", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.client.rp...
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{" ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplPlain_CustomFieldSerializer.java#L66-L69
h2oai/h2o-2
src/main/java/water/fvec/Chunk.java
Chunk.set0
public final double set0(int idx, double d) { """ Set a double element in a chunk given a 0-based chunk local index. """ setWrite(); if( _chk2.set_impl(idx,d) ) return d; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,d); return d; }
java
public final double set0(int idx, double d) { setWrite(); if( _chk2.set_impl(idx,d) ) return d; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,d); return d; }
[ "public", "final", "double", "set0", "(", "int", "idx", ",", "double", "d", ")", "{", "setWrite", "(", ")", ";", "if", "(", "_chk2", ".", "set_impl", "(", "idx", ",", "d", ")", ")", "return", "d", ";", "(", "_chk2", "=", "inflate_impl", "(", "new...
Set a double element in a chunk given a 0-based chunk local index.
[ "Set", "a", "double", "element", "in", "a", "chunk", "given", "a", "0", "-", "based", "chunk", "local", "index", "." ]
train
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/Chunk.java#L137-L142
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.writePropertyObjects
public void writePropertyObjects(CmsRequestContext context, CmsResource resource, List<CmsProperty> properties) throws CmsException, CmsSecurityException { """ Writes a list of properties for a specified resource.<p> Code calling this method has to ensure that the no properties <code>a, b</code> are contai...
java
public void writePropertyObjects(CmsRequestContext context, CmsResource resource, List<CmsProperty> properties) throws CmsException, CmsSecurityException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { checkOfflineProject(dbc); checkPermissions(dbc, reso...
[ "public", "void", "writePropertyObjects", "(", "CmsRequestContext", "context", ",", "CmsResource", "resource", ",", "List", "<", "CmsProperty", ">", "properties", ")", "throws", "CmsException", ",", "CmsSecurityException", "{", "CmsDbContext", "dbc", "=", "m_dbContext...
Writes a list of properties for a specified resource.<p> Code calling this method has to ensure that the no properties <code>a, b</code> are contained in the specified list so that <code>a.equals(b)</code>, otherwise an exception is thrown.<p> @param context the current request context @param resource the resource to...
[ "Writes", "a", "list", "of", "properties", "for", "a", "specified", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6837-L6851
wisdom-framework/wisdom-jcr
wisdom-modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/handler/RestQueryHandlerImpl.java
RestQueryHandlerImpl.planQuery
@Override public RestQueryPlanResult planQuery(Request request, String repositoryName, String workspaceName, String language, String statement, ...
java
@Override public RestQueryPlanResult planQuery(Request request, String repositoryName, String workspaceName, String language, String statement, ...
[ "@", "Override", "public", "RestQueryPlanResult", "planQuery", "(", "Request", "request", ",", "String", "repositoryName", ",", "String", "workspaceName", ",", "String", "language", ",", "String", "statement", ",", "long", "offset", ",", "long", "limit", ")", "t...
Executes a the given query string (based on the language information) against a JCR repository, returning a rest model based result. @param request a non-null {@link Request} @param repositoryName a non-null, URL encoded {@link String} representing the name of a repository @param workspaceName a non-null, URL ...
[ "Executes", "a", "the", "given", "query", "string", "(", "based", "on", "the", "language", "information", ")", "against", "a", "JCR", "repository", "returning", "a", "rest", "model", "based", "result", "." ]
train
https://github.com/wisdom-framework/wisdom-jcr/blob/2711383dde2239a19b90c226b3fd2aecab5715e4/wisdom-modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/handler/RestQueryHandlerImpl.java#L124-L144
Netflix/Hystrix
hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java
HystrixCommandExecutionHook.onError
@Deprecated public <T> Exception onError(HystrixCommand<T> commandInstance, FailureType failureType, Exception e) { """ DEPRECATED: Change usages of this to {@link #onError}. Invoked after failed completion of {@link HystrixCommand} execution. @param commandInstance The executing HystrixCommand instance...
java
@Deprecated public <T> Exception onError(HystrixCommand<T> commandInstance, FailureType failureType, Exception e) { // pass-thru by default return e; }
[ "@", "Deprecated", "public", "<", "T", ">", "Exception", "onError", "(", "HystrixCommand", "<", "T", ">", "commandInstance", ",", "FailureType", "failureType", ",", "Exception", "e", ")", "{", "// pass-thru by default", "return", "e", ";", "}" ]
DEPRECATED: Change usages of this to {@link #onError}. Invoked after failed completion of {@link HystrixCommand} execution. @param commandInstance The executing HystrixCommand instance. @param failureType {@link FailureType} representing the type of failure that occurred. <p> See {@link HystrixRuntimeException} for m...
[ "DEPRECATED", ":", "Change", "usages", "of", "this", "to", "{", "@link", "#onError", "}", "." ]
train
https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java#L492-L496
rhuss/jolokia
agent/core/src/main/java/org/jolokia/request/JmxWriteRequest.java
JmxWriteRequest.newCreator
static RequestCreator<JmxWriteRequest> newCreator() { """ Creator for {@link JmxWriteRequest}s @return the creator implementation """ return new RequestCreator<JmxWriteRequest>() { /** {@inheritDoc} */ public JmxWriteRequest create(Stack<String> pStack, ProcessingParameters p...
java
static RequestCreator<JmxWriteRequest> newCreator() { return new RequestCreator<JmxWriteRequest>() { /** {@inheritDoc} */ public JmxWriteRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException { return new JmxWriteRequest( ...
[ "static", "RequestCreator", "<", "JmxWriteRequest", ">", "newCreator", "(", ")", "{", "return", "new", "RequestCreator", "<", "JmxWriteRequest", ">", "(", ")", "{", "/** {@inheritDoc} */", "public", "JmxWriteRequest", "create", "(", "Stack", "<", "String", ">", ...
Creator for {@link JmxWriteRequest}s @return the creator implementation
[ "Creator", "for", "{", "@link", "JmxWriteRequest", "}", "s" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxWriteRequest.java#L123-L141
mgm-tp/jfunk
jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java
ConstraintFactory.getObject
private Constraint getObject(final MathRandom random, final Element element, final Constructor<? extends Constraint> constructor) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { """ Generates a new constraint instance using the given constructor, the...
java
private Constraint getObject(final MathRandom random, final Element element, final Constructor<? extends Constraint> constructor) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { LOG.debug("Creating constraint: " + element.getAttributes()); Constrain...
[ "private", "Constraint", "getObject", "(", "final", "MathRandom", "random", ",", "final", "Element", "element", ",", "final", "Constructor", "<", "?", "extends", "Constraint", ">", "constructor", ")", "throws", "IllegalArgumentException", ",", "InstantiationException"...
Generates a new constraint instance using the given constructor, the element and the generateor callback as parameters.
[ "Generates", "a", "new", "constraint", "instance", "using", "the", "given", "constructor", "the", "element", "and", "the", "generateor", "callback", "as", "parameters", "." ]
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-data-generator/src/main/java/com/mgmtp/jfunk/data/generator/constraint/ConstraintFactory.java#L151-L157
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java
TimedDirContext.traceJndiReturn
private void traceJndiReturn(String methodname, long duration, Object... objs) { """ Trace a message with "JNDI_CALL' that includes the returned objects from that JNDI call. @param methodname The name of the method that is requesting the trace. @param duration The duration of the call in milliseconds. @param ...
java
private void traceJndiReturn(String methodname, long duration, Object... objs) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, JNDI_CALL + methodname + " [" + duration + " ms]", objs); } }
[ "private", "void", "traceJndiReturn", "(", "String", "methodname", ",", "long", "duration", ",", "Object", "...", "objs", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "T...
Trace a message with "JNDI_CALL' that includes the returned objects from that JNDI call. @param methodname The name of the method that is requesting the trace. @param duration The duration of the call in milliseconds. @param objs The objects to trace.
[ "Trace", "a", "message", "with", "JNDI_CALL", "that", "includes", "the", "returned", "objects", "from", "that", "JNDI", "call", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java#L529-L533
Netflix/Hystrix
hystrix-core/src/main/java/com/netflix/hystrix/collapser/RequestCollapserFactory.java
RequestCollapserFactory.getRequestVariableForCommand
@SuppressWarnings("unchecked") private HystrixRequestVariableHolder<RequestCollapser<?, ?, ?>> getRequestVariableForCommand(final HystrixCollapserBridge<BatchReturnType, ResponseType, RequestArgumentType> commandCollapser) { """ Lookup (or create and store) the RequestVariable for a given HystrixCollapserKey. ...
java
@SuppressWarnings("unchecked") private HystrixRequestVariableHolder<RequestCollapser<?, ?, ?>> getRequestVariableForCommand(final HystrixCollapserBridge<BatchReturnType, ResponseType, RequestArgumentType> commandCollapser) { HystrixRequestVariableHolder<RequestCollapser<?, ?, ?>> requestVariable = requestSc...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "HystrixRequestVariableHolder", "<", "RequestCollapser", "<", "?", ",", "?", ",", "?", ">", ">", "getRequestVariableForCommand", "(", "final", "HystrixCollapserBridge", "<", "BatchReturnType", ",", "Respon...
Lookup (or create and store) the RequestVariable for a given HystrixCollapserKey. @param commandCollapser collapser to retrieve {@link HystrixRequestVariableHolder} for @return HystrixRequestVariableHolder
[ "Lookup", "(", "or", "create", "and", "store", ")", "the", "RequestVariable", "for", "a", "given", "HystrixCollapserKey", "." ]
train
https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/collapser/RequestCollapserFactory.java#L140-L163
looly/hutool
hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java
MapUtil.get
public static <T> T get(Map<?, ?> map, Object key, Class<T> type) { """ 获取Map指定key的值,并转换为指定类型 @param <T> 目标值类型 @param map Map @param key 键 @param type 值类型 @return 值 @since 4.0.6 """ return null == map ? null : Convert.convert(type, map.get(key)); }
java
public static <T> T get(Map<?, ?> map, Object key, Class<T> type) { return null == map ? null : Convert.convert(type, map.get(key)); }
[ "public", "static", "<", "T", ">", "T", "get", "(", "Map", "<", "?", ",", "?", ">", "map", ",", "Object", "key", ",", "Class", "<", "T", ">", "type", ")", "{", "return", "null", "==", "map", "?", "null", ":", "Convert", ".", "convert", "(", "...
获取Map指定key的值,并转换为指定类型 @param <T> 目标值类型 @param map Map @param key 键 @param type 值类型 @return 值 @since 4.0.6
[ "获取Map指定key的值,并转换为指定类型" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L866-L868