repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
google/closure-templates
java/src/com/google/template/soy/internal/i18n/BidiFormatter.java
BidiFormatter.spanWrappingText
public BidiWrappingText spanWrappingText(@Nullable Dir dir, String str, boolean isHtml) { """ Operates like {@link #spanWrap(Dir, String, boolean)} but only returns the text that would be prepended and appended to {@code str}. @param dir {@code str}'s directionality. If null, i.e. unknown, it is estimated. @p...
java
public BidiWrappingText spanWrappingText(@Nullable Dir dir, String str, boolean isHtml) { if (dir == null) { dir = estimateDirection(str, isHtml); } StringBuilder beforeText = new StringBuilder(); StringBuilder afterText = new StringBuilder(); boolean dirCondition = (dir != Dir.NEUTRAL && dir...
[ "public", "BidiWrappingText", "spanWrappingText", "(", "@", "Nullable", "Dir", "dir", ",", "String", "str", ",", "boolean", "isHtml", ")", "{", "if", "(", "dir", "==", "null", ")", "{", "dir", "=", "estimateDirection", "(", "str", ",", "isHtml", ")", ";"...
Operates like {@link #spanWrap(Dir, String, boolean)} but only returns the text that would be prepended and appended to {@code str}. @param dir {@code str}'s directionality. If null, i.e. unknown, it is estimated. @param str The input string @param isHtml Whether {@code str} is HTML / HTML-escaped
[ "Operates", "like", "{", "@link", "#spanWrap", "(", "Dir", "String", "boolean", ")", "}", "but", "only", "returns", "the", "text", "that", "would", "be", "prepended", "and", "appended", "to", "{", "@code", "str", "}", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/BidiFormatter.java#L140-L154
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isAssignableOrConvertibleFrom
public static boolean isAssignableOrConvertibleFrom(Class<?> clazz, Class<?> type) { """ Returns true if the specified clazz parameter is either the same as, or is a superclass or superinterface of, the specified type parameter. Converts primitive types to compatible class automatically. @param clazz @param t...
java
public static boolean isAssignableOrConvertibleFrom(Class<?> clazz, Class<?> type) { if (type == null || clazz == null) { return false; } if (type.isPrimitive()) { // convert primitive type to compatible class Class<?> primitiveClass = GrailsClassUtils.PRIMITI...
[ "public", "static", "boolean", "isAssignableOrConvertibleFrom", "(", "Class", "<", "?", ">", "clazz", ",", "Class", "<", "?", ">", "type", ")", "{", "if", "(", "type", "==", "null", "||", "clazz", "==", "null", ")", "{", "return", "false", ";", "}", ...
Returns true if the specified clazz parameter is either the same as, or is a superclass or superinterface of, the specified type parameter. Converts primitive types to compatible class automatically. @param clazz @param type @return true if the class is a taglib @see java.lang.Class#isAssignableFrom(Class)
[ "Returns", "true", "if", "the", "specified", "clazz", "parameter", "is", "either", "the", "same", "as", "or", "is", "a", "superclass", "or", "superinterface", "of", "the", "specified", "type", "parameter", ".", "Converts", "primitive", "types", "to", "compatib...
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L789-L803
haraldk/TwelveMonkeys
common/common-image/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java
BufferedImageFactory.setSourceSubsampling
public void setSourceSubsampling(int pXSub, int pYSub) { """ Sets the source subsampling for the new image. @param pXSub horizontal subsampling factor @param pYSub vertical subsampling factor """ // Re-fetch everything, if subsampling changed if (xSub != pXSub || ySub != pYSub) { ...
java
public void setSourceSubsampling(int pXSub, int pYSub) { // Re-fetch everything, if subsampling changed if (xSub != pXSub || ySub != pYSub) { dispose(); } if (pXSub > 1) { xSub = pXSub; } if (pYSub > 1) { ySub = pYSub; } }
[ "public", "void", "setSourceSubsampling", "(", "int", "pXSub", ",", "int", "pYSub", ")", "{", "// Re-fetch everything, if subsampling changed", "if", "(", "xSub", "!=", "pXSub", "||", "ySub", "!=", "pYSub", ")", "{", "dispose", "(", ")", ";", "}", "if", "(",...
Sets the source subsampling for the new image. @param pXSub horizontal subsampling factor @param pYSub vertical subsampling factor
[ "Sets", "the", "source", "subsampling", "for", "the", "new", "image", "." ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java#L176-L188
wcm-io/wcm-io-handler
media/src/main/java/io/wcm/handler/media/format/MediaFormat.java
MediaFormat.getMinDimension
public Dimension getMinDimension() { """ Get minimum dimensions for media format. If only with or height is defined the missing dimensions is calculated from the ratio. If no ratio defined either only width or height dimension is returned. If neither width or height are defined null is returned. @return Min. di...
java
public Dimension getMinDimension() { long effWithMin = getEffectiveMinWidth(); long effHeightMin = getEffectiveMinHeight(); double effRatio = getRatio(); if (effWithMin == 0 && effHeightMin > 0 && effRatio > 0) { effWithMin = Math.round(effHeightMin * effRatio); } if (effWithMin > 0 && ef...
[ "public", "Dimension", "getMinDimension", "(", ")", "{", "long", "effWithMin", "=", "getEffectiveMinWidth", "(", ")", ";", "long", "effHeightMin", "=", "getEffectiveMinHeight", "(", ")", ";", "double", "effRatio", "=", "getRatio", "(", ")", ";", "if", "(", "...
Get minimum dimensions for media format. If only with or height is defined the missing dimensions is calculated from the ratio. If no ratio defined either only width or height dimension is returned. If neither width or height are defined null is returned. @return Min. dimensions or null
[ "Get", "minimum", "dimensions", "for", "media", "format", ".", "If", "only", "with", "or", "height", "is", "defined", "the", "missing", "dimensions", "is", "calculated", "from", "the", "ratio", ".", "If", "no", "ratio", "defined", "either", "only", "width", ...
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/MediaFormat.java#L432-L450
pravega/pravega
segmentstore/contracts/src/main/java/io/pravega/segmentstore/contracts/tables/TableEntry.java
TableEntry.unversioned
public static TableEntry unversioned(@NonNull ArrayView key, @NonNull ArrayView value) { """ Creates a new instance of the TableEntry class with no desired version. @param key The Key. @param value The Value. @return the TableEntry that was created """ return new TableEntry(TableKey.unversione...
java
public static TableEntry unversioned(@NonNull ArrayView key, @NonNull ArrayView value) { return new TableEntry(TableKey.unversioned(key), value); }
[ "public", "static", "TableEntry", "unversioned", "(", "@", "NonNull", "ArrayView", "key", ",", "@", "NonNull", "ArrayView", "value", ")", "{", "return", "new", "TableEntry", "(", "TableKey", ".", "unversioned", "(", "key", ")", ",", "value", ")", ";", "}" ...
Creates a new instance of the TableEntry class with no desired version. @param key The Key. @param value The Value. @return the TableEntry that was created
[ "Creates", "a", "new", "instance", "of", "the", "TableEntry", "class", "with", "no", "desired", "version", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/contracts/src/main/java/io/pravega/segmentstore/contracts/tables/TableEntry.java#L42-L44
google/auto
common/src/main/java/com/google/auto/common/MoreElements.java
MoreElements.getLocalAndInheritedMethods
public static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods( TypeElement type, Types typeUtils, Elements elementUtils) { """ Returns the set of all non-private methods from {@code type}, including methods that it inherits from its ancestors. Inherited methods that are overridden are not includ...
java
public static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods( TypeElement type, Types typeUtils, Elements elementUtils) { return getLocalAndInheritedMethods(type, new ExplicitOverrides(typeUtils)); }
[ "public", "static", "ImmutableSet", "<", "ExecutableElement", ">", "getLocalAndInheritedMethods", "(", "TypeElement", "type", ",", "Types", "typeUtils", ",", "Elements", "elementUtils", ")", "{", "return", "getLocalAndInheritedMethods", "(", "type", ",", "new", "Expli...
Returns the set of all non-private methods from {@code type}, including methods that it inherits from its ancestors. Inherited methods that are overridden are not included in the result. So if {@code type} defines {@code public String toString()}, the returned set will contain that method, but not the {@code toString()...
[ "Returns", "the", "set", "of", "all", "non", "-", "private", "methods", "from", "{", "@code", "type", "}", "including", "methods", "that", "it", "inherits", "from", "its", "ancestors", ".", "Inherited", "methods", "that", "are", "overridden", "are", "not", ...
train
https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/common/src/main/java/com/google/auto/common/MoreElements.java#L329-L332
OpenLiberty/open-liberty
dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/document/SymbolTable.java
SymbolTable.addSymbol
public String addSymbol(String symbol) { """ Adds the specified symbol to the symbol table and returns a reference to the unique symbol. If the symbol already exists, the previous symbol reference is returned instead, in order guarantee that symbol references remain unique. @param symbol The new symbol. ...
java
public String addSymbol(String symbol) { // search for identical symbol int bucket = hash(symbol) % fTableSize; int length = symbol.length(); OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) { if (length == entry.characters.length) { ...
[ "public", "String", "addSymbol", "(", "String", "symbol", ")", "{", "// search for identical symbol", "int", "bucket", "=", "hash", "(", "symbol", ")", "%", "fTableSize", ";", "int", "length", "=", "symbol", ".", "length", "(", ")", ";", "OUTER", ":", "for...
Adds the specified symbol to the symbol table and returns a reference to the unique symbol. If the symbol already exists, the previous symbol reference is returned instead, in order guarantee that symbol references remain unique. @param symbol The new symbol.
[ "Adds", "the", "specified", "symbol", "to", "the", "symbol", "table", "and", "returns", "a", "reference", "to", "the", "unique", "symbol", ".", "If", "the", "symbol", "already", "exists", "the", "previous", "symbol", "reference", "is", "returned", "instead", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/document/SymbolTable.java#L86-L107
apache/groovy
subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
GPathResult.getBody
public Closure getBody() { """ Creates a Closure representing the body of this GPathResult. @return the body of this GPathResult, converted to a <code>Closure</code> """ return new Closure(this.parent,this) { public void doCall(Object[] args) { final GroovyObject delegate...
java
public Closure getBody() { return new Closure(this.parent,this) { public void doCall(Object[] args) { final GroovyObject delegate = (GroovyObject)getDelegate(); final GPathResult thisObject = (GPathResult)getThisObject(); Node node = (Node)thisObject....
[ "public", "Closure", "getBody", "(", ")", "{", "return", "new", "Closure", "(", "this", ".", "parent", ",", "this", ")", "{", "public", "void", "doCall", "(", "Object", "[", "]", "args", ")", "{", "final", "GroovyObject", "delegate", "=", "(", "GroovyO...
Creates a Closure representing the body of this GPathResult. @return the body of this GPathResult, converted to a <code>Closure</code>
[ "Creates", "a", "Closure", "representing", "the", "body", "of", "this", "GPathResult", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L623-L642
groovyfx-project/groovyfx
src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java
FXBindableASTTransformation.createGetterStatement
protected Statement createGetterStatement(PropertyNode fxProperty) { """ Creates the body of a getter method for the original property that is actually backed by a JavaFX *Property instance: <p> Object $property = this.someProperty() return $property.getValue() @param fxProperty The new JavaFX property. @r...
java
protected Statement createGetterStatement(PropertyNode fxProperty) { String fxPropertyGetter = getFXPropertyGetterName(fxProperty); VariableExpression thisExpression = VariableExpression.THIS_EXPRESSION; ArgumentListExpression emptyArguments = ArgumentListExpression.EMPTY_ARGUMENTS; // ...
[ "protected", "Statement", "createGetterStatement", "(", "PropertyNode", "fxProperty", ")", "{", "String", "fxPropertyGetter", "=", "getFXPropertyGetterName", "(", "fxProperty", ")", ";", "VariableExpression", "thisExpression", "=", "VariableExpression", ".", "THIS_EXPRESSIO...
Creates the body of a getter method for the original property that is actually backed by a JavaFX *Property instance: <p> Object $property = this.someProperty() return $property.getValue() @param fxProperty The new JavaFX property. @return A Statement that is the body of the new getter.
[ "Creates", "the", "body", "of", "a", "getter", "method", "for", "the", "original", "property", "that", "is", "actually", "backed", "by", "a", "JavaFX", "*", "Property", "instance", ":", "<p", ">", "Object", "$property", "=", "this", ".", "someProperty", "(...
train
https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L621-L635
alipay/sofa-rpc
core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInternalContext.java
RpcInternalContext.setAttachment
public RpcInternalContext setAttachment(String key, Object value) { """ set attachment. @param key the key @param value the value @return context attachment """ if (key == null) { return this; } if (!ATTACHMENT_ENABLE) { // 未开启附件传递功能,只能传递隐藏key("." 开头的Key) ...
java
public RpcInternalContext setAttachment(String key, Object value) { if (key == null) { return this; } if (!ATTACHMENT_ENABLE) { // 未开启附件传递功能,只能传递隐藏key("." 开头的Key) if (!isHiddenParamKey(key)) { return this; } } else { ...
[ "public", "RpcInternalContext", "setAttachment", "(", "String", "key", ",", "Object", "value", ")", "{", "if", "(", "key", "==", "null", ")", "{", "return", "this", ";", "}", "if", "(", "!", "ATTACHMENT_ENABLE", ")", "{", "// 未开启附件传递功能,只能传递隐藏key(\".\" 开头的Key)"...
set attachment. @param key the key @param value the value @return context attachment
[ "set", "attachment", "." ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInternalContext.java#L342-L363
apereo/cas
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java
LdapUtils.executeModifyOperation
public static boolean executeModifyOperation(final String currentDn, final ConnectionFactory connectionFactory, final Map<String, Set<String>> attributes) { """ Execute modify operation boolean. @param currentDn the current dn @param connectionFactory th...
java
public static boolean executeModifyOperation(final String currentDn, final ConnectionFactory connectionFactory, final Map<String, Set<String>> attributes) { try (val modifyConnection = createConnection(connectionFactory)) { val operation = new ModifyO...
[ "public", "static", "boolean", "executeModifyOperation", "(", "final", "String", "currentDn", ",", "final", "ConnectionFactory", "connectionFactory", ",", "final", "Map", "<", "String", ",", "Set", "<", "String", ">", ">", "attributes", ")", "{", "try", "(", "...
Execute modify operation boolean. @param currentDn the current dn @param connectionFactory the connection factory @param attributes the attributes @return true/false
[ "Execute", "modify", "operation", "boolean", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L355-L375
camunda/camunda-bpmn-model
src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractEventBuilder.java
AbstractEventBuilder.camundaOutputParameter
public B camundaOutputParameter(String name, String value) { """ Creates a new camunda output parameter extension element with the given name and value. @param name the name of the output parameter @param value the value of the output parameter @return the builder object """ CamundaInputOutput camund...
java
public B camundaOutputParameter(String name, String value) { CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement(CamundaInputOutput.class); CamundaOutputParameter camundaOutputParameter = createChild(camundaInputOutput, CamundaOutputParameter.class); camundaOutputParameter.setCamundaNam...
[ "public", "B", "camundaOutputParameter", "(", "String", "name", ",", "String", "value", ")", "{", "CamundaInputOutput", "camundaInputOutput", "=", "getCreateSingleExtensionElement", "(", "CamundaInputOutput", ".", "class", ")", ";", "CamundaOutputParameter", "camundaOutpu...
Creates a new camunda output parameter extension element with the given name and value. @param name the name of the output parameter @param value the value of the output parameter @return the builder object
[ "Creates", "a", "new", "camunda", "output", "parameter", "extension", "element", "with", "the", "given", "name", "and", "value", "." ]
train
https://github.com/camunda/camunda-bpmn-model/blob/debcadf041d10fa62b799de0307b832cea84e5d4/src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractEventBuilder.java#L60-L68
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java
BoxApiBookmark.getCopyRequest
public BoxRequestsBookmark.CopyBookmark getCopyRequest(String id, String parentId) { """ Gets a request that copies a bookmark @param id id of the bookmark to copy @param parentId id of the parent folder to copy the bookmark into @return request to copy a bookmark """ BoxRequestsBookmark.Copy...
java
public BoxRequestsBookmark.CopyBookmark getCopyRequest(String id, String parentId) { BoxRequestsBookmark.CopyBookmark request = new BoxRequestsBookmark.CopyBookmark(id, parentId, getBookmarkCopyUrl(id), mSession); return request; }
[ "public", "BoxRequestsBookmark", ".", "CopyBookmark", "getCopyRequest", "(", "String", "id", ",", "String", "parentId", ")", "{", "BoxRequestsBookmark", ".", "CopyBookmark", "request", "=", "new", "BoxRequestsBookmark", ".", "CopyBookmark", "(", "id", ",", "parentId...
Gets a request that copies a bookmark @param id id of the bookmark to copy @param parentId id of the parent folder to copy the bookmark into @return request to copy a bookmark
[ "Gets", "a", "request", "that", "copies", "a", "bookmark" ]
train
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L108-L111
mbenson/therian
core/src/main/java/therian/util/Positions.java
Positions.readOnly
public static <T> Position.Readable<T> readOnly(final Typed<T> typed, final Supplier<T> supplier) { """ Get a read-only position of type {@code typed.type}, obtaining its value from {@code supplier}. @param typed not {@code null} @param supplier not {@code null} @return Position.Readable """ retur...
java
public static <T> Position.Readable<T> readOnly(final Typed<T> typed, final Supplier<T> supplier) { return readOnly(Validate.notNull(typed, "type").getType(), supplier); }
[ "public", "static", "<", "T", ">", "Position", ".", "Readable", "<", "T", ">", "readOnly", "(", "final", "Typed", "<", "T", ">", "typed", ",", "final", "Supplier", "<", "T", ">", "supplier", ")", "{", "return", "readOnly", "(", "Validate", ".", "notN...
Get a read-only position of type {@code typed.type}, obtaining its value from {@code supplier}. @param typed not {@code null} @param supplier not {@code null} @return Position.Readable
[ "Get", "a", "read", "-", "only", "position", "of", "type", "{", "@code", "typed", ".", "type", "}", "obtaining", "its", "value", "from", "{", "@code", "supplier", "}", "." ]
train
https://github.com/mbenson/therian/blob/0653505f73e2a6f5b0abc394ea6d83af03408254/core/src/main/java/therian/util/Positions.java#L223-L225
thinkaurelius/titan
titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner/placement/PartitionIDRange.java
PartitionIDRange.getGlobalRange
public static List<PartitionIDRange> getGlobalRange(final int partitionBits) { """ /* =========== Helper methods to generate PartitionIDRanges ============ """ Preconditions.checkArgument(partitionBits>=0 && partitionBits<(Integer.SIZE-1),"Invalid partition bits: %s",partitionBits); final int ...
java
public static List<PartitionIDRange> getGlobalRange(final int partitionBits) { Preconditions.checkArgument(partitionBits>=0 && partitionBits<(Integer.SIZE-1),"Invalid partition bits: %s",partitionBits); final int partitionIdBound = (1 << (partitionBits)); return ImmutableList.of(new PartitionIDR...
[ "public", "static", "List", "<", "PartitionIDRange", ">", "getGlobalRange", "(", "final", "int", "partitionBits", ")", "{", "Preconditions", ".", "checkArgument", "(", "partitionBits", ">=", "0", "&&", "partitionBits", "<", "(", "Integer", ".", "SIZE", "-", "1...
/* =========== Helper methods to generate PartitionIDRanges ============
[ "/", "*", "===========", "Helper", "methods", "to", "generate", "PartitionIDRanges", "============" ]
train
https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner/placement/PartitionIDRange.java#L120-L124
apache/incubator-gobblin
gobblin-service/src/main/java/org/apache/gobblin/service/modules/scheduler/GobblinServiceJobScheduler.java
GobblinServiceJobScheduler.scheduleSpecsFromCatalog
private void scheduleSpecsFromCatalog() { """ Load all {@link FlowSpec}s from {@link FlowCatalog} as one of the initialization step, and make schedulers be aware of that. """ Iterator<URI> specUris = null; long startTime = System.currentTimeMillis(); try { specUris = this.flowCatalog.get()....
java
private void scheduleSpecsFromCatalog() { Iterator<URI> specUris = null; long startTime = System.currentTimeMillis(); try { specUris = this.flowCatalog.get().getSpecURIs(); } catch (SpecSerDeException ssde) { throw new RuntimeException("Failed to get the iterator of all Spec URIS", ssde); ...
[ "private", "void", "scheduleSpecsFromCatalog", "(", ")", "{", "Iterator", "<", "URI", ">", "specUris", "=", "null", ";", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "try", "{", "specUris", "=", "this", ".", "flowCatalog", "...
Load all {@link FlowSpec}s from {@link FlowCatalog} as one of the initialization step, and make schedulers be aware of that.
[ "Load", "all", "{", "@link", "FlowSpec", "}", "s", "from", "{", "@link", "FlowCatalog", "}", "as", "one", "of", "the", "initialization", "step", "and", "make", "schedulers", "be", "aware", "of", "that", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/scheduler/GobblinServiceJobScheduler.java#L139-L171
oasp/oasp4j
modules/cxf-client/src/main/java/io/oasp/module/cxf/common/impl/client/SyncServiceClientFactoryCxf.java
SyncServiceClientFactoryCxf.applyInterceptors
protected void applyInterceptors(ServiceContext<?> context, InterceptorProvider client, String serviceName) { """ Applies CXF interceptors to the given {@code serviceClient}. @param context the {@link ServiceContext}. @param client the {@link InterceptorProvider}. @param serviceName the {@link #createServiceN...
java
protected void applyInterceptors(ServiceContext<?> context, InterceptorProvider client, String serviceName) { client.getOutInterceptors().add(new PerformanceStartInterceptor()); client.getInInterceptors().add(new PerformanceStopInterceptor()); client.getInFaultInterceptors().add(new TechnicalExceptionInter...
[ "protected", "void", "applyInterceptors", "(", "ServiceContext", "<", "?", ">", "context", ",", "InterceptorProvider", "client", ",", "String", "serviceName", ")", "{", "client", ".", "getOutInterceptors", "(", ")", ".", "add", "(", "new", "PerformanceStartInterce...
Applies CXF interceptors to the given {@code serviceClient}. @param context the {@link ServiceContext}. @param client the {@link InterceptorProvider}. @param serviceName the {@link #createServiceName(ServiceContext) service name}.
[ "Applies", "CXF", "interceptors", "to", "the", "given", "{", "@code", "serviceClient", "}", "." ]
train
https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/cxf-client/src/main/java/io/oasp/module/cxf/common/impl/client/SyncServiceClientFactoryCxf.java#L120-L125
UrielCh/ovh-java-sdk
ovh-java-sdk-overTheBox/src/main/java/net/minidev/ovh/api/ApiOvhOverTheBox.java
ApiOvhOverTheBox.serviceName_device_restoreBackup_POST
public ArrayList<OvhDeviceAction> serviceName_device_restoreBackup_POST(String serviceName, String backupId) throws IOException { """ Create a group of actions to restore a given backup REST: POST /overTheBox/{serviceName}/device/restoreBackup @param backupId [required] The id of the backup to restore @param ...
java
public ArrayList<OvhDeviceAction> serviceName_device_restoreBackup_POST(String serviceName, String backupId) throws IOException { String qPath = "/overTheBox/{serviceName}/device/restoreBackup"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "ba...
[ "public", "ArrayList", "<", "OvhDeviceAction", ">", "serviceName_device_restoreBackup_POST", "(", "String", "serviceName", ",", "String", "backupId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/overTheBox/{serviceName}/device/restoreBackup\"", ";", "Strin...
Create a group of actions to restore a given backup REST: POST /overTheBox/{serviceName}/device/restoreBackup @param backupId [required] The id of the backup to restore @param serviceName [required] The internal name of your overTheBox offer API beta
[ "Create", "a", "group", "of", "actions", "to", "restore", "a", "given", "backup" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-overTheBox/src/main/java/net/minidev/ovh/api/ApiOvhOverTheBox.java#L173-L180
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/math/Duration.java
Duration.getComponents
public Components getComponents() { """ Return the duration components. @return the individual time components of this duration """ if (this.components == null) { // This is idempotent, so no need to synchronize ... // Calculate how many seconds, and don't lose any informati...
java
public Components getComponents() { if (this.components == null) { // This is idempotent, so no need to synchronize ... // Calculate how many seconds, and don't lose any information ... BigDecimal bigSeconds = new BigDecimal(this.durationInNanos).divide(new BigDecimal(100000...
[ "public", "Components", "getComponents", "(", ")", "{", "if", "(", "this", ".", "components", "==", "null", ")", "{", "// This is idempotent, so no need to synchronize ...", "// Calculate how many seconds, and don't lose any information ...", "BigDecimal", "bigSeconds", "=", ...
Return the duration components. @return the individual time components of this duration
[ "Return", "the", "duration", "components", "." ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/math/Duration.java#L203-L220
huahin/huahin-core
src/main/java/org/huahinframework/core/util/ObjectUtil.java
ObjectUtil.typeCompareTo
public static int typeCompareTo(Writable one, Writable other) { """ Compare the type Writable. @param one the original object @param other the object to be compared. @return if 0, are equal. """ PrimitiveObject noOne = hadoop2Primitive(one); PrimitiveObject noOther = hadoop2Primitive(other);...
java
public static int typeCompareTo(Writable one, Writable other) { PrimitiveObject noOne = hadoop2Primitive(one); PrimitiveObject noOther = hadoop2Primitive(other); if (noOne.getType() != noOther.getType()) { return -1; } return 0; }
[ "public", "static", "int", "typeCompareTo", "(", "Writable", "one", ",", "Writable", "other", ")", "{", "PrimitiveObject", "noOne", "=", "hadoop2Primitive", "(", "one", ")", ";", "PrimitiveObject", "noOther", "=", "hadoop2Primitive", "(", "other", ")", ";", "i...
Compare the type Writable. @param one the original object @param other the object to be compared. @return if 0, are equal.
[ "Compare", "the", "type", "Writable", "." ]
train
https://github.com/huahin/huahin-core/blob/a87921b5a12be92a822f753c075ab2431036e6f5/src/main/java/org/huahinframework/core/util/ObjectUtil.java#L339-L347
ThreeTen/threetenbp
src/main/java/org/threeten/bp/zone/ZoneOffsetTransitionRule.java
ZoneOffsetTransitionRule.readExternal
static ZoneOffsetTransitionRule readExternal(DataInput in) throws IOException { """ Reads the state from the stream. @param in the input stream, not null @return the created object, not null @throws IOException if an error occurs """ int data = in.readInt(); Month month = Month.of(data >>...
java
static ZoneOffsetTransitionRule readExternal(DataInput in) throws IOException { int data = in.readInt(); Month month = Month.of(data >>> 28); int dom = ((data & (63 << 22)) >>> 22) - 32; int dowByte = (data & (7 << 19)) >>> 19; DayOfWeek dow = dowByte == 0 ? null : DayOfWeek.of(d...
[ "static", "ZoneOffsetTransitionRule", "readExternal", "(", "DataInput", "in", ")", "throws", "IOException", "{", "int", "data", "=", "in", ".", "readInt", "(", ")", ";", "Month", "month", "=", "Month", ".", "of", "(", "data", ">>>", "28", ")", ";", "int"...
Reads the state from the stream. @param in the input stream, not null @return the created object, not null @throws IOException if an error occurs
[ "Reads", "the", "state", "from", "the", "stream", "." ]
train
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/ZoneOffsetTransitionRule.java#L262-L284
republicofgavin/PauseResumeAudioRecorder
library/src/main/java/com/github/republicofgavin/pauseresumeaudiorecorder/PauseResumeAudioRecorder.java
PauseResumeAudioRecorder.startRecording
public void startRecording() { """ Starts the recording if the recorder is in a prepared state. At this time, the complete file path should not have .temp file(as that is where the writing is taking place) and the specified .wav file should not exist as well(as that is where the .temp file will be converted to). ...
java
public void startRecording(){ if (currentAudioState.get() == PREPARED_STATE) { currentAudioRecordingThread = new AudioRecorderThread(audioFile.replace(".wav",".temp"), MediaRecorder.AudioSource.MIC, sampleRateInHertz,channelConfig,audioEncoding,maxFileSizeInBytes); currentAudioState.set(...
[ "public", "void", "startRecording", "(", ")", "{", "if", "(", "currentAudioState", ".", "get", "(", ")", "==", "PREPARED_STATE", ")", "{", "currentAudioRecordingThread", "=", "new", "AudioRecorderThread", "(", "audioFile", ".", "replace", "(", "\".wav\"", ",", ...
Starts the recording if the recorder is in a prepared state. At this time, the complete file path should not have .temp file(as that is where the writing is taking place) and the specified .wav file should not exist as well(as that is where the .temp file will be converted to). Does nothing if it is recorder is not in ...
[ "Starts", "the", "recording", "if", "the", "recorder", "is", "in", "a", "prepared", "state", ".", "At", "this", "time", "the", "complete", "file", "path", "should", "not", "have", ".", "temp", "file", "(", "as", "that", "is", "where", "the", "writing", ...
train
https://github.com/republicofgavin/PauseResumeAudioRecorder/blob/938128a6266fb5bd7b60f844b5d7e56e1899d4e2/library/src/main/java/com/github/republicofgavin/pauseresumeaudiorecorder/PauseResumeAudioRecorder.java#L223-L237
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java
FormLayout.setHonorsVisibility
public void setHonorsVisibility(Component component, Boolean b) { """ Specifies whether the given component shall be taken into account for sizing and positioning. This setting overrides the container-wide default. See {@link #setHonorsVisibility(boolean)} for details. @param component the component that shal...
java
public void setHonorsVisibility(Component component, Boolean b) { CellConstraints constraints = getConstraints0(component); if (Objects.equals(b, constraints.honorsVisibility)) { return; } constraints.honorsVisibility = b; invalidateAndRepaint(component.getParent()); ...
[ "public", "void", "setHonorsVisibility", "(", "Component", "component", ",", "Boolean", "b", ")", "{", "CellConstraints", "constraints", "=", "getConstraints0", "(", "component", ")", ";", "if", "(", "Objects", ".", "equals", "(", "b", ",", "constraints", ".",...
Specifies whether the given component shall be taken into account for sizing and positioning. This setting overrides the container-wide default. See {@link #setHonorsVisibility(boolean)} for details. @param component the component that shall get an individual setting @param b {@code Boolean.TRUE} to override the conta...
[ "Specifies", "whether", "the", "given", "component", "shall", "be", "taken", "into", "account", "for", "sizing", "and", "positioning", ".", "This", "setting", "overrides", "the", "container", "-", "wide", "default", ".", "See", "{", "@link", "#setHonorsVisibilit...
train
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java#L985-L992
pressgang-ccms/PressGangCCMSContentSpecProcessor
src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java
ContentSpecParser.getTitle
protected String getTitle(final String input, final char startDelim) { """ Gets the title of a chapter/section/appendix/topic by returning everything before the start delimiter. @param input The input to be parsed to get the title. @param startDelim The delimiter that specifies that start of options (ie '...
java
protected String getTitle(final String input, final char startDelim) { if (isStringNullOrEmpty(input)) { return null; } else { return ProcessorUtilities.cleanXMLCharacterReferences(StringUtilities.split(input, startDelim)[0].trim()); } }
[ "protected", "String", "getTitle", "(", "final", "String", "input", ",", "final", "char", "startDelim", ")", "{", "if", "(", "isStringNullOrEmpty", "(", "input", ")", ")", "{", "return", "null", ";", "}", "else", "{", "return", "ProcessorUtilities", ".", "...
Gets the title of a chapter/section/appendix/topic by returning everything before the start delimiter. @param input The input to be parsed to get the title. @param startDelim The delimiter that specifies that start of options (ie '[') @return The title as a String or null if the title is blank.
[ "Gets", "the", "title", "of", "a", "chapter", "/", "section", "/", "appendix", "/", "topic", "by", "returning", "everything", "before", "the", "start", "delimiter", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L1784-L1790
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/EigenPowerMethod_DDRM.java
EigenPowerMethod_DDRM.computeShiftInvert
public boolean computeShiftInvert(DMatrixRMaj A , double alpha ) { """ Computes the most dominant eigen vector of A using an inverted shifted matrix. The inverted shifted matrix is defined as <b>B = (A - &alpha;I)<sup>-1</sup></b> and can converge faster if &alpha; is chosen wisely. @param A An invertible squ...
java
public boolean computeShiftInvert(DMatrixRMaj A , double alpha ) { initPower(A); LinearSolverDense solver = LinearSolverFactory_DDRM.linear(A.numCols); SpecializedOps_DDRM.addIdentity(A,B,-alpha); solver.setA(B); boolean converged = false; for( int i = 0; i < maxItera...
[ "public", "boolean", "computeShiftInvert", "(", "DMatrixRMaj", "A", ",", "double", "alpha", ")", "{", "initPower", "(", "A", ")", ";", "LinearSolverDense", "solver", "=", "LinearSolverFactory_DDRM", ".", "linear", "(", "A", ".", "numCols", ")", ";", "Specializ...
Computes the most dominant eigen vector of A using an inverted shifted matrix. The inverted shifted matrix is defined as <b>B = (A - &alpha;I)<sup>-1</sup></b> and can converge faster if &alpha; is chosen wisely. @param A An invertible square matrix matrix. @param alpha Shifting factor. @return If it converged or not.
[ "Computes", "the", "most", "dominant", "eigen", "vector", "of", "A", "using", "an", "inverted", "shifted", "matrix", ".", "The", "inverted", "shifted", "matrix", "is", "defined", "as", "<b", ">", "B", "=", "(", "A", "-", "&alpha", ";", "I", ")", "<sup"...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/EigenPowerMethod_DDRM.java#L195-L214
exoplatform/jcr
exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lnkproducer/LinkGenerator.java
LinkGenerator.writeZeroString
private void writeZeroString(String outString, OutputStream outStream) throws IOException { """ Writes zero-string into stream. @param outString string @param outStream stream @throws IOException {@link IOException} """ simpleWriteString(outString, outStream); outStream.write(0); outStre...
java
private void writeZeroString(String outString, OutputStream outStream) throws IOException { simpleWriteString(outString, outStream); outStream.write(0); outStream.write(0); }
[ "private", "void", "writeZeroString", "(", "String", "outString", ",", "OutputStream", "outStream", ")", "throws", "IOException", "{", "simpleWriteString", "(", "outString", ",", "outStream", ")", ";", "outStream", ".", "write", "(", "0", ")", ";", "outStream", ...
Writes zero-string into stream. @param outString string @param outStream stream @throws IOException {@link IOException}
[ "Writes", "zero", "-", "string", "into", "stream", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lnkproducer/LinkGenerator.java#L350-L355
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java
OrientationHistogramSift.computeAngle
double computeAngle( int index1 ) { """ Compute the angle. The angle for each neighbor bin is found using the weighted sum of the derivative. Then the peak index is found by 2nd order polygon interpolation. These two bits of information are combined and used to return the final angle output. @param index1 ...
java
double computeAngle( int index1 ) { int index0 = CircularIndex.addOffset(index1,-1, histogramMag.length); int index2 = CircularIndex.addOffset(index1, 1, histogramMag.length); // compute the peak location using a second order polygon double v0 = histogramMag[index0]; double v1 = histogramMag[index1]; doub...
[ "double", "computeAngle", "(", "int", "index1", ")", "{", "int", "index0", "=", "CircularIndex", ".", "addOffset", "(", "index1", ",", "-", "1", ",", "histogramMag", ".", "length", ")", ";", "int", "index2", "=", "CircularIndex", ".", "addOffset", "(", "...
Compute the angle. The angle for each neighbor bin is found using the weighted sum of the derivative. Then the peak index is found by 2nd order polygon interpolation. These two bits of information are combined and used to return the final angle output. @param index1 Histogram index of the peak @return angle of the ...
[ "Compute", "the", "angle", ".", "The", "angle", "for", "each", "neighbor", "bin", "is", "found", "using", "the", "weighted", "sum", "of", "the", "derivative", ".", "Then", "the", "peak", "index", "is", "found", "by", "2nd", "order", "polygon", "interpolati...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/OrientationHistogramSift.java#L259-L273
xsonorg/xson
src/main/java/org/xson/core/asm/ClassWriter.java
ClassWriter.getCommonSuperClass
@SuppressWarnings( { """ Returns the common super type of the two given types. The default implementation of this method <i>loads<i> the two given classes and uses the java.lang.Class methods to find the common super class. It can be overridden to compute this common super type in other ways, in particular wit...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) protected String getCommonSuperClass(final String type1, final String type2) { Class c, d; try { c = Class.forName(type1.replace('/', '.')); d = Class.forName(type2.replace('/', '.')); } catch (Exception e) { th...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "protected", "String", "getCommonSuperClass", "(", "final", "String", "type1", ",", "final", "String", "type2", ")", "{", "Class", "c", ",", "d", ";", "try", "{", "c", "=", ...
Returns the common super type of the two given types. The default implementation of this method <i>loads<i> the two given classes and uses the java.lang.Class methods to find the common super class. It can be overridden to compute this common super type in other ways, in particular without actually loading any class, o...
[ "Returns", "the", "common", "super", "type", "of", "the", "two", "given", "types", ".", "The", "default", "implementation", "of", "this", "method", "<i", ">", "loads<i", ">", "the", "two", "given", "classes", "and", "uses", "the", "java", ".", "lang", "....
train
https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/ClassWriter.java#L1264-L1288
Wikidata/Wikidata-Toolkit
wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/ApiConnection.java
ApiConnection.getQueryString
String getQueryString(Map<String, String> params) { """ Returns the query string of a URL from a parameter list. @param params Map with parameters @return query string """ StringBuilder builder = new StringBuilder(); try { boolean first = true; for (Map.Entry<String,String> entry : params.entryS...
java
String getQueryString(Map<String, String> params) { StringBuilder builder = new StringBuilder(); try { boolean first = true; for (Map.Entry<String,String> entry : params.entrySet()) { if (first) { first = false; } else { builder.append("&"); } builder.append(URLEncoder.encode(entry.g...
[ "String", "getQueryString", "(", "Map", "<", "String", ",", "String", ">", "params", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "try", "{", "boolean", "first", "=", "true", ";", "for", "(", "Map", ".", "Entry", "<...
Returns the query string of a URL from a parameter list. @param params Map with parameters @return query string
[ "Returns", "the", "query", "string", "of", "a", "URL", "from", "a", "parameter", "list", "." ]
train
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/ApiConnection.java#L696-L716
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java
DataSourceTask.getLogString
private String getLogString(String message, String taskName) { """ Utility function that composes a string for logging purposes. The string includes the given message and the index of the task in its task group together with the number of tasks in the task group. @param message The main message for the log. @...
java
private String getLogString(String message, String taskName) { return BatchTask.constructLogString(message, taskName, this); }
[ "private", "String", "getLogString", "(", "String", "message", ",", "String", "taskName", ")", "{", "return", "BatchTask", ".", "constructLogString", "(", "message", ",", "taskName", ",", "this", ")", ";", "}" ]
Utility function that composes a string for logging purposes. The string includes the given message and the index of the task in its task group together with the number of tasks in the task group. @param message The main message for the log. @param taskName The name of the task. @return The string ready for logging.
[ "Utility", "function", "that", "composes", "a", "string", "for", "logging", "purposes", ".", "The", "string", "includes", "the", "given", "message", "and", "the", "index", "of", "the", "task", "in", "its", "task", "group", "together", "with", "the", "number"...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java#L339-L341
apache/groovy
src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
ResourceGroovyMethods.withDataInputStream
public static <T> T withDataInputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.DataInputStream") Closure<T> closure) throws IOException { """ Create a new DataInputStream for this file and passes it into the closure. This method ensures the stream is closed after the closure return...
java
public static <T> T withDataInputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.DataInputStream") Closure<T> closure) throws IOException { return IOGroovyMethods.withStream(newDataInputStream(file), closure); }
[ "public", "static", "<", "T", ">", "T", "withDataInputStream", "(", "File", "file", ",", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"java.io.DataInputStream\"", ")", "Closure", "<", "T", ">", "closure", ")", ...
Create a new DataInputStream for this file and passes it into the closure. This method ensures the stream is closed after the closure returns. @param file a File @param closure a closure @return the value returned by the closure @throws IOException if an IOException occurs. @see IOGroovyMethods#withStream(java.io.I...
[ "Create", "a", "new", "DataInputStream", "for", "this", "file", "and", "passes", "it", "into", "the", "closure", ".", "This", "method", "ensures", "the", "stream", "is", "closed", "after", "the", "closure", "returns", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1887-L1889
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/olap/OLAPService.java
OLAPService.addBatch
public BatchResult addBatch(ApplicationDefinition appDef, String shardName, OlapBatch batch) { """ Add a batch of updates for the given application to the given shard. Objects can new, updated, or deleted. @param appDef {@link ApplicationDefinition} of application to update. @param shardName Shard to add b...
java
public BatchResult addBatch(ApplicationDefinition appDef, String shardName, OlapBatch batch) { return addBatch(appDef, shardName, batch, null); }
[ "public", "BatchResult", "addBatch", "(", "ApplicationDefinition", "appDef", ",", "String", "shardName", ",", "OlapBatch", "batch", ")", "{", "return", "addBatch", "(", "appDef", ",", "shardName", ",", "batch", ",", "null", ")", ";", "}" ]
Add a batch of updates for the given application to the given shard. Objects can new, updated, or deleted. @param appDef {@link ApplicationDefinition} of application to update. @param shardName Shard to add batch to. @param batch {@link OlapBatch} containing object updates. @return {@link BatchResult} ...
[ "Add", "a", "batch", "of", "updates", "for", "the", "given", "application", "to", "the", "given", "shard", ".", "Objects", "can", "new", "updated", "or", "deleted", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/olap/OLAPService.java#L198-L200
arquillian/arquillian-core
container/impl-base/src/main/java/org/jboss/arquillian/container/impl/client/container/DeploymentExceptionHandler.java
DeploymentExceptionHandler.containsType
private boolean containsType(Throwable exception, Class<? extends Exception> expectedType) { """ /* public void verifyExpectedExceptionDuringUnDeploy(@Observes EventContext<UnDeployDeployment> context) throws Exception { DeploymentDescription deployment = context.getEvent().getDeployment(); try { context.pro...
java
private boolean containsType(Throwable exception, Class<? extends Exception> expectedType) { Throwable transformedException = transform(exception); if (transformedException == null) { return false; } if (expectedType.isAssignableFrom(transformedException.getClass())) { ...
[ "private", "boolean", "containsType", "(", "Throwable", "exception", ",", "Class", "<", "?", "extends", "Exception", ">", "expectedType", ")", "{", "Throwable", "transformedException", "=", "transform", "(", "exception", ")", ";", "if", "(", "transformedException"...
/* public void verifyExpectedExceptionDuringUnDeploy(@Observes EventContext<UnDeployDeployment> context) throws Exception { DeploymentDescription deployment = context.getEvent().getDeployment(); try { context.proceed(); } catch (Exception e) { if(deployment.getExpectedException() == null) { throw e; } } }
[ "/", "*", "public", "void", "verifyExpectedExceptionDuringUnDeploy", "(" ]
train
https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/container/impl-base/src/main/java/org/jboss/arquillian/container/impl/client/container/DeploymentExceptionHandler.java#L91-L102
dita-ot/dita-ot
src/main/java/org/dita/dost/module/KeyrefModule.java
KeyrefModule.processFile
private void processFile(final ResolveTask r) { """ Process key references in a topic. Topic is stored with a new name if it's been processed before. """ final List<XMLFilter> filters = new ArrayList<>(); final ConkeyrefFilter conkeyrefFilter = new ConkeyrefFilter(); conkeyrefFilter.s...
java
private void processFile(final ResolveTask r) { final List<XMLFilter> filters = new ArrayList<>(); final ConkeyrefFilter conkeyrefFilter = new ConkeyrefFilter(); conkeyrefFilter.setLogger(logger); conkeyrefFilter.setJob(job); conkeyrefFilter.setKeyDefinitions(r.scope); c...
[ "private", "void", "processFile", "(", "final", "ResolveTask", "r", ")", "{", "final", "List", "<", "XMLFilter", ">", "filters", "=", "new", "ArrayList", "<>", "(", ")", ";", "final", "ConkeyrefFilter", "conkeyrefFilter", "=", "new", "ConkeyrefFilter", "(", ...
Process key references in a topic. Topic is stored with a new name if it's been processed before.
[ "Process", "key", "references", "in", "a", "topic", ".", "Topic", "is", "stored", "with", "a", "new", "name", "if", "it", "s", "been", "processed", "before", "." ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/KeyrefModule.java#L340-L377
jblas-project/jblas
src/main/java/org/jblas/util/LibraryLoader.java
LibraryLoader.loadLibraryFromStream
private void loadLibraryFromStream(String libname, InputStream is) { """ Load a system library from a stream. Copies the library to a temp file and loads from there. @param libname name of the library (just used in constructing the library name) @param is InputStream pointing to the library """ ...
java
private void loadLibraryFromStream(String libname, InputStream is) { try { File tempfile = createTempFile(libname); OutputStream os = new FileOutputStream(tempfile); logger.debug("tempfile.getPath() = " + tempfile.getPath()); long savedTime = System.currentTimeMillis(); // ...
[ "private", "void", "loadLibraryFromStream", "(", "String", "libname", ",", "InputStream", "is", ")", "{", "try", "{", "File", "tempfile", "=", "createTempFile", "(", "libname", ")", ";", "OutputStream", "os", "=", "new", "FileOutputStream", "(", "tempfile", ")...
Load a system library from a stream. Copies the library to a temp file and loads from there. @param libname name of the library (just used in constructing the library name) @param is InputStream pointing to the library
[ "Load", "a", "system", "library", "from", "a", "stream", ".", "Copies", "the", "library", "to", "a", "temp", "file", "and", "loads", "from", "there", "." ]
train
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/LibraryLoader.java#L249-L282
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsInner.java
NetworkInterfaceTapConfigurationsInner.createOrUpdateAsync
public Observable<NetworkInterfaceTapConfigurationInner> createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { """ Creates or updates a Tap configuration in the specified NetworkInterface. @para...
java
public Observable<NetworkInterfaceTapConfigurationInner> createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceNa...
[ "public", "Observable", "<", "NetworkInterfaceTapConfigurationInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "networkInterfaceName", ",", "String", "tapConfigurationName", ",", "NetworkInterfaceTapConfigurationInner", "tapConfigurationParamet...
Creates or updates a Tap configuration in the specified NetworkInterface. @param resourceGroupName The name of the resource group. @param networkInterfaceName The name of the network interface. @param tapConfigurationName The name of the tap configuration. @param tapConfigurationParameters Parameters supplied to the c...
[ "Creates", "or", "updates", "a", "Tap", "configuration", "in", "the", "specified", "NetworkInterface", "." ]
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/NetworkInterfaceTapConfigurationsInner.java#L391-L398
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java
XPathParser.initXPath
public void initXPath( Compiler compiler, String expression, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { """ Given an string, init an XPath object for selections, in order that a parse doesn't have to be done each time the expression is evaluated. @...
java
public void initXPath( Compiler compiler, String expression, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { m_ops = compiler; m_namespaceContext = namespaceContext; m_functionTable = compiler.getFunctionTable(); Lexer lexer = new Lexer(compil...
[ "public", "void", "initXPath", "(", "Compiler", "compiler", ",", "String", "expression", ",", "PrefixResolver", "namespaceContext", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "m_ops", "=", "compiler", ";", "m_namespaceC...
Given an string, init an XPath object for selections, in order that a parse doesn't have to be done each time the expression is evaluated. @param compiler The compiler object. @param expression A string conforming to the XPath grammar. @param namespaceContext An object that is able to resolve prefixes in the XPath to ...
[ "Given", "an", "string", "init", "an", "XPath", "object", "for", "selections", "in", "order", "that", "a", "parse", "doesn", "t", "have", "to", "be", "done", "each", "time", "the", "expression", "is", "evaluated", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java#L101-L164
windup/windup
graph/api/src/main/java/org/jboss/windup/graph/service/OrganizationService.java
OrganizationService.attachLink
public OrganizationModel attachLink(OrganizationModel organizationModel, LinkModel linkModel) { """ This method just attaches the {@link LinkModel} to the {@link OrganizationModel}. It will only do so if this link is not already present. """ // check for duplicates for (LinkModel existing : or...
java
public OrganizationModel attachLink(OrganizationModel organizationModel, LinkModel linkModel) { // check for duplicates for (LinkModel existing : organizationModel.getLinks()) { if (existing.equals(linkModel)) { return organizationModel; } ...
[ "public", "OrganizationModel", "attachLink", "(", "OrganizationModel", "organizationModel", ",", "LinkModel", "linkModel", ")", "{", "// check for duplicates", "for", "(", "LinkModel", "existing", ":", "organizationModel", ".", "getLinks", "(", ")", ")", "{", "if", ...
This method just attaches the {@link LinkModel} to the {@link OrganizationModel}. It will only do so if this link is not already present.
[ "This", "method", "just", "attaches", "the", "{" ]
train
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/OrganizationService.java#L63-L75
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
StringGroovyMethods.eachMatch
public static String eachMatch(String self, String regex, @ClosureParams(value=FromString.class, options= { """ Process each regex group matched substring of the given string. If the closure parameter takes one argument, an array with all match groups is passed to it. If the closure takes as many arguments as th...
java
public static String eachMatch(String self, String regex, @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) Closure closure) { return eachMatch(self, Pattern.compile(regex), closure); }
[ "public", "static", "String", "eachMatch", "(", "String", "self", ",", "String", "regex", ",", "@", "ClosureParams", "(", "value", "=", "FromString", ".", "class", ",", "options", "=", "{", "\"List<String>\"", ",", "\"String[]\"", "}", ")", "Closure", "closu...
Process each regex group matched substring of the given string. If the closure parameter takes one argument, an array with all match groups is passed to it. If the closure takes as many arguments as there are match groups, then each parameter will be one match group. @param self the source string @param regex a R...
[ "Process", "each", "regex", "group", "matched", "substring", "of", "the", "given", "string", ".", "If", "the", "closure", "parameter", "takes", "one", "argument", "an", "array", "with", "all", "match", "groups", "is", "passed", "to", "it", ".", "If", "the"...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L745-L747
HanSolo/SteelSeries-Swing
src/main/java/eu/hansolo/steelseries/extras/Poi.java
Poi.create_POI_Image
private BufferedImage create_POI_Image(final int WIDTH) { """ Creates the image of the poi @param WIDTH @return buffered image of the poi """ if (WIDTH <= 0) { return null; } final java.awt.image.BufferedImage IMAGE = UTIL.createImage(WIDTH, WIDTH, java.awt.Transparency.T...
java
private BufferedImage create_POI_Image(final int WIDTH) { if (WIDTH <= 0) { return null; } final java.awt.image.BufferedImage IMAGE = UTIL.createImage(WIDTH, WIDTH, java.awt.Transparency.TRANSLUCENT); final java.awt.Graphics2D G2 = IMAGE.createGraphics(); G2.setRende...
[ "private", "BufferedImage", "create_POI_Image", "(", "final", "int", "WIDTH", ")", "{", "if", "(", "WIDTH", "<=", "0", ")", "{", "return", "null", ";", "}", "final", "java", ".", "awt", ".", "image", ".", "BufferedImage", "IMAGE", "=", "UTIL", ".", "cr...
Creates the image of the poi @param WIDTH @return buffered image of the poi
[ "Creates", "the", "image", "of", "the", "poi" ]
train
https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L456-L488
ThreeTen/threetenbp
src/main/java/org/threeten/bp/format/DateTimeFormatter.java
DateTimeFormatter.withResolverStyle
public DateTimeFormatter withResolverStyle(ResolverStyle resolverStyle) { """ Returns a copy of this formatter with a new resolver style. <p> This returns a formatter with similar state to this formatter but with the resolver style set. By default, a formatter has the {@link ResolverStyle#SMART SMART} resolver...
java
public DateTimeFormatter withResolverStyle(ResolverStyle resolverStyle) { Jdk8Methods.requireNonNull(resolverStyle, "resolverStyle"); if (Jdk8Methods.equals(this.resolverStyle, resolverStyle)) { return this; } return new DateTimeFormatter(printerParser, locale, decimalStyle, ...
[ "public", "DateTimeFormatter", "withResolverStyle", "(", "ResolverStyle", "resolverStyle", ")", "{", "Jdk8Methods", ".", "requireNonNull", "(", "resolverStyle", ",", "\"resolverStyle\"", ")", ";", "if", "(", "Jdk8Methods", ".", "equals", "(", "this", ".", "resolverS...
Returns a copy of this formatter with a new resolver style. <p> This returns a formatter with similar state to this formatter but with the resolver style set. By default, a formatter has the {@link ResolverStyle#SMART SMART} resolver style. <p> Changing the resolver style only has an effect during parsing. Parsing a te...
[ "Returns", "a", "copy", "of", "this", "formatter", "with", "a", "new", "resolver", "style", ".", "<p", ">", "This", "returns", "a", "formatter", "with", "similar", "state", "to", "this", "formatter", "but", "with", "the", "resolver", "style", "set", ".", ...
train
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatter.java#L1223-L1229
haraldk/TwelveMonkeys
common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java
SystemUtil.isClassAvailable
public static boolean isClassAvailable(String pClassName, Class pFromClass) { """ Tests if a named class is available from another class. If a class is considered available, a call to {@code Class.forName(pClassName, true, pFromClass.getClassLoader())} will not result in an exception. @param pClassName the c...
java
public static boolean isClassAvailable(String pClassName, Class pFromClass) { ClassLoader loader = pFromClass != null ? pFromClass.getClassLoader() : null; return isClassAvailable(pClassName, loader); }
[ "public", "static", "boolean", "isClassAvailable", "(", "String", "pClassName", ",", "Class", "pFromClass", ")", "{", "ClassLoader", "loader", "=", "pFromClass", "!=", "null", "?", "pFromClass", ".", "getClassLoader", "(", ")", ":", "null", ";", "return", "isC...
Tests if a named class is available from another class. If a class is considered available, a call to {@code Class.forName(pClassName, true, pFromClass.getClassLoader())} will not result in an exception. @param pClassName the class name to test @param pFromClass the class to test from @return {@code true} if available
[ "Tests", "if", "a", "named", "class", "is", "available", "from", "another", "class", ".", "If", "a", "class", "is", "considered", "available", "a", "call", "to", "{", "@code", "Class", ".", "forName", "(", "pClassName", "true", "pFromClass", ".", "getClass...
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java#L590-L593
meltmedia/cadmium
servlets/src/main/java/com/meltmedia/cadmium/servlets/shiro/PersistablePropertiesRealm.java
PersistablePropertiesRealm.loadProperties
public void loadProperties(File contentDir) { """ loads a properties file named {@link REALM_FILE_NAME} in the directory passed in. """ String resourceFile = null; if(contentDir.exists() && contentDir.isDirectory()) { File propFile = new File(contentDir, REALM_FILE_NAME); if(propFile.exists...
java
public void loadProperties(File contentDir) { String resourceFile = null; if(contentDir.exists() && contentDir.isDirectory()) { File propFile = new File(contentDir, REALM_FILE_NAME); if(propFile.exists() && propFile.canRead()) { resourceFile = propFile.getAbsoluteFile().getAbsolutePath(); ...
[ "public", "void", "loadProperties", "(", "File", "contentDir", ")", "{", "String", "resourceFile", "=", "null", ";", "if", "(", "contentDir", ".", "exists", "(", ")", "&&", "contentDir", ".", "isDirectory", "(", ")", ")", "{", "File", "propFile", "=", "n...
loads a properties file named {@link REALM_FILE_NAME} in the directory passed in.
[ "loads", "a", "properties", "file", "named", "{" ]
train
https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/shiro/PersistablePropertiesRealm.java#L88-L103
Jasig/uPortal
uPortal-portlets/src/main/java/org/apereo/portal/portlets/portletadmin/PortletAdministrationHelper.java
PortletAdministrationHelper.addPrincipalPermissionsToForm
private void addPrincipalPermissionsToForm(IPortletDefinition def, PortletDefinitionForm form) { """ /* Add to the form SUBSCRIBE, BROWSE, and CONFIGURE activity permissions, along with their principals, assigned to the portlet. """ final String portletTargetId = PermissionHelper.permissionTargetIdFo...
java
private void addPrincipalPermissionsToForm(IPortletDefinition def, PortletDefinitionForm form) { final String portletTargetId = PermissionHelper.permissionTargetIdForPortletDefinition(def); final Set<JsonEntityBean> principalBeans = new HashSet<>(); Map<String, IPermissionManager> permManagers ...
[ "private", "void", "addPrincipalPermissionsToForm", "(", "IPortletDefinition", "def", ",", "PortletDefinitionForm", "form", ")", "{", "final", "String", "portletTargetId", "=", "PermissionHelper", ".", "permissionTargetIdForPortletDefinition", "(", "def", ")", ";", "final...
/* Add to the form SUBSCRIBE, BROWSE, and CONFIGURE activity permissions, along with their principals, assigned to the portlet.
[ "/", "*", "Add", "to", "the", "form", "SUBSCRIBE", "BROWSE", "and", "CONFIGURE", "activity", "permissions", "along", "with", "their", "principals", "assigned", "to", "the", "portlet", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/portletadmin/PortletAdministrationHelper.java#L222-L261
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/transformer/AbstractObservableTransformerSource.java
AbstractObservableTransformerSource.onSourceErrorOccurred
protected void onSourceErrorOccurred(TransformerSourceErrorEvent event) { """ (Re)-fires a preconstructed event. @param event The event to fire """ for (TransformerSourceEventListener listener : transformerSourceEventListeners) fireErrorEvent(listener, event); } /** * Fires ...
java
protected void onSourceErrorOccurred(TransformerSourceErrorEvent event) { for (TransformerSourceEventListener listener : transformerSourceEventListeners) fireErrorEvent(listener, event); } /** * Fires the given event on the given listener. * @param listener The listener to fire t...
[ "protected", "void", "onSourceErrorOccurred", "(", "TransformerSourceErrorEvent", "event", ")", "{", "for", "(", "TransformerSourceEventListener", "listener", ":", "transformerSourceEventListeners", ")", "fireErrorEvent", "(", "listener", ",", "event", ")", ";", "}", "/...
(Re)-fires a preconstructed event. @param event The event to fire
[ "(", "Re", ")", "-", "fires", "a", "preconstructed", "event", "." ]
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/transformer/AbstractObservableTransformerSource.java#L79-L102
sahan/RoboZombie
robozombie/src/main/java/com/lonepulse/robozombie/AbstractGenericFactory.java
AbstractGenericFactory.newInstance
@Override public OUTPUT newInstance(INPUT input, INPUT... inputs) throws FAILURE { """ <p><b>Unsupported</b>. Override to provide an implementation.</p> <p>See {@link GenericFactory#newInstance(Object, Object...)}</p> @since 1.3.0 """ StringBuilder builder = new StringBuilder() .append(getClass()...
java
@Override public OUTPUT newInstance(INPUT input, INPUT... inputs) throws FAILURE { StringBuilder builder = new StringBuilder() .append(getClass().getName()) .append(".newInstance(Input, Input...) is unsupported."); throw new UnsupportedOperationException(builder.toString()); }
[ "@", "Override", "public", "OUTPUT", "newInstance", "(", "INPUT", "input", ",", "INPUT", "...", "inputs", ")", "throws", "FAILURE", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ".", "append", "(", "getClass", "(", ")", ".", "getN...
<p><b>Unsupported</b>. Override to provide an implementation.</p> <p>See {@link GenericFactory#newInstance(Object, Object...)}</p> @since 1.3.0
[ "<p", ">", "<b", ">", "Unsupported<", "/", "b", ">", ".", "Override", "to", "provide", "an", "implementation", ".", "<", "/", "p", ">" ]
train
https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/com/lonepulse/robozombie/AbstractGenericFactory.java#L83-L91
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/TimeZone.java
TimeZone.getDisplayName
public final String getDisplayName(boolean daylight, int style) { """ Returns a name in the specified {@code style} of this {@code TimeZone} suitable for presentation to the user in the default locale. If the specified {@code daylight} is {@code true}, a Daylight Saving Time name is returned (even if this {@cod...
java
public final String getDisplayName(boolean daylight, int style) { return getDisplayName(daylight, style, Locale.getDefault(Locale.Category.DISPLAY)); }
[ "public", "final", "String", "getDisplayName", "(", "boolean", "daylight", ",", "int", "style", ")", "{", "return", "getDisplayName", "(", "daylight", ",", "style", ",", "Locale", ".", "getDefault", "(", "Locale", ".", "Category", ".", "DISPLAY", ")", ")", ...
Returns a name in the specified {@code style} of this {@code TimeZone} suitable for presentation to the user in the default locale. If the specified {@code daylight} is {@code true}, a Daylight Saving Time name is returned (even if this {@code TimeZone} doesn't observe Daylight Saving Time). Otherwise, a Standard Time ...
[ "Returns", "a", "name", "in", "the", "specified", "{", "@code", "style", "}", "of", "this", "{", "@code", "TimeZone", "}", "suitable", "for", "presentation", "to", "the", "user", "in", "the", "default", "locale", ".", "If", "the", "specified", "{", "@cod...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/TimeZone.java#L369-L372
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractDatabase.java
AbstractDatabase.setDocumentExpiration
public void setDocumentExpiration(@NonNull String id, Date expiration) throws CouchbaseLiteException { """ Sets an expiration date on a document. After this time, the document will be purged from the database. @param id The ID of the Document @param expiration Nullable expiration timestamp as a Date, ...
java
public void setDocumentExpiration(@NonNull String id, Date expiration) throws CouchbaseLiteException { if (id == null) { throw new IllegalArgumentException("document id cannot be null."); } synchronized (lock) { try { if (expiration == null) { getC4Databa...
[ "public", "void", "setDocumentExpiration", "(", "@", "NonNull", "String", "id", ",", "Date", "expiration", ")", "throws", "CouchbaseLiteException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"document id cannot...
Sets an expiration date on a document. After this time, the document will be purged from the database. @param id The ID of the Document @param expiration Nullable expiration timestamp as a Date, set timestamp to null to remove expiration date time from doc. @throws CouchbaseLiteException Throws an exception if...
[ "Sets", "an", "expiration", "date", "on", "a", "document", ".", "After", "this", "time", "the", "document", "will", "be", "purged", "from", "the", "database", "." ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L503-L520
ecclesia/kipeto
kipeto-tools/src/main/java/de/ecclesia/kipeto/tools/blueprint/BlueprintFactory.java
BlueprintFactory.fromDir
public Blueprint fromDir(String programId, String description, File rootDir, File icon) { """ Erstellt einen Blueprint aus dem übergebenen RootDir. Blobs und Directorys werden sofort im übergebenen Repository gespeichert. Der Blueprint selbst wird <b>nicht</b> von gepeichert.<br/> <br/> Alle Dateien werden GZIP...
java
public Blueprint fromDir(String programId, String description, File rootDir, File icon) { return new Blueprint(programId, description, processDir(rootDir), processBlob(icon)); }
[ "public", "Blueprint", "fromDir", "(", "String", "programId", ",", "String", "description", ",", "File", "rootDir", ",", "File", "icon", ")", "{", "return", "new", "Blueprint", "(", "programId", ",", "description", ",", "processDir", "(", "rootDir", ")", ","...
Erstellt einen Blueprint aus dem übergebenen RootDir. Blobs und Directorys werden sofort im übergebenen Repository gespeichert. Der Blueprint selbst wird <b>nicht</b> von gepeichert.<br/> <br/> Alle Dateien werden GZIP komprimiert @param programId Name @param description Beschreibung @param rootDir Einstiegsverzeichni...
[ "Erstellt", "einen", "Blueprint", "aus", "dem", "übergebenen", "RootDir", ".", "Blobs", "und", "Directorys", "werden", "sofort", "im", "übergebenen", "Repository", "gespeichert", ".", "Der", "Blueprint", "selbst", "wird", "<b", ">", "nicht<", "/", "b", ">", "v...
train
https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto-tools/src/main/java/de/ecclesia/kipeto/tools/blueprint/BlueprintFactory.java#L91-L93
OpenLiberty/open-liberty
dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallKernelMap.java
InstallKernelMap.generateJsonFromIndividualESAs
private File generateJsonFromIndividualESAs(Path jsonDirectory, Map<String, String> shortNameMap) throws IOException, RepositoryException, InstallException { """ generate a JSON from provided individual ESA files @param generatedJson path @param shortNameMap contains features parsed from individual esa files ...
java
private File generateJsonFromIndividualESAs(Path jsonDirectory, Map<String, String> shortNameMap) throws IOException, RepositoryException, InstallException { String dir = jsonDirectory.toString(); List<File> esas = (List<File>) data.get(INDIVIDUAL_ESAS); File singleJson = new File(dir + "/Single...
[ "private", "File", "generateJsonFromIndividualESAs", "(", "Path", "jsonDirectory", ",", "Map", "<", "String", ",", "String", ">", "shortNameMap", ")", "throws", "IOException", ",", "RepositoryException", ",", "InstallException", "{", "String", "dir", "=", "jsonDirec...
generate a JSON from provided individual ESA files @param generatedJson path @param shortNameMap contains features parsed from individual esa files @return singleJson file @throws IOException @throws RepositoryException @throws InstallException
[ "generate", "a", "JSON", "from", "provided", "individual", "ESA", "files" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallKernelMap.java#L845-L881
aws/aws-sdk-java
aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/TableInput.java
TableInput.withParameters
public TableInput withParameters(java.util.Map<String, String> parameters) { """ <p> These key-value pairs define properties associated with the table. </p> @param parameters These key-value pairs define properties associated with the table. @return Returns a reference to this object so that method calls ca...
java
public TableInput withParameters(java.util.Map<String, String> parameters) { setParameters(parameters); return this; }
[ "public", "TableInput", "withParameters", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "parameters", ")", "{", "setParameters", "(", "parameters", ")", ";", "return", "this", ";", "}" ]
<p> These key-value pairs define properties associated with the table. </p> @param parameters These key-value pairs define properties associated with the table. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "These", "key", "-", "value", "pairs", "define", "properties", "associated", "with", "the", "table", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/TableInput.java#L672-L675
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/CertificateOperations.java
CertificateOperations.deleteCertificate
public void deleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { """ Deletes the certificate from the Batch account. <p>The delete operation requests that the certificate be deleted. The request puts the certi...
java
public void deleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { CertificateDeleteOptions options = new CertificateDeleteOptions(); BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(),...
[ "public", "void", "deleteCertificate", "(", "String", "thumbprintAlgorithm", ",", "String", "thumbprint", ",", "Iterable", "<", "BatchClientBehavior", ">", "additionalBehaviors", ")", "throws", "BatchErrorException", ",", "IOException", "{", "CertificateDeleteOptions", "o...
Deletes the certificate from the Batch account. <p>The delete operation requests that the certificate be deleted. The request puts the certificate in the {@link com.microsoft.azure.batch.protocol.models.CertificateState#DELETING Deleting} state. The Batch service will perform the actual certificate deletion without any...
[ "Deletes", "the", "certificate", "from", "the", "Batch", "account", ".", "<p", ">", "The", "delete", "operation", "requests", "that", "the", "certificate", "be", "deleted", ".", "The", "request", "puts", "the", "certificate", "in", "the", "{", "@link", "com"...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/CertificateOperations.java#L227-L233
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.addProjectMember
public GitlabProjectMember addProjectMember(Integer projectId, Integer userId, GitlabAccessLevel accessLevel) throws IOException { """ Add a project member. @param projectId the project id @param userId the user id @param accessLevel the GitlabAccessLevel @return the GitlabProjectMember @throws IOExc...
java
public GitlabProjectMember addProjectMember(Integer projectId, Integer userId, GitlabAccessLevel accessLevel) throws IOException { Query query = new Query() .appendIf("id", projectId) .appendIf("user_id", userId) .appendIf("access_level", accessLevel); Str...
[ "public", "GitlabProjectMember", "addProjectMember", "(", "Integer", "projectId", ",", "Integer", "userId", ",", "GitlabAccessLevel", "accessLevel", ")", "throws", "IOException", "{", "Query", "query", "=", "new", "Query", "(", ")", ".", "appendIf", "(", "\"id\"",...
Add a project member. @param projectId the project id @param userId the user id @param accessLevel the GitlabAccessLevel @return the GitlabProjectMember @throws IOException on gitlab api call error
[ "Add", "a", "project", "member", "." ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3041-L3048
tzaeschke/zoodb
src/org/zoodb/internal/server/index/AbstractPagedIndex.java
AbstractPagedIndex.writeToPreallocated
final int writeToPreallocated(StorageChannelOutput out, Map<AbstractIndexPage, Integer> map) { """ Special write method that uses only pre-allocated pages. @param map @return the root page Id. """ return getRoot().writeToPreallocated(out, map); }
java
final int writeToPreallocated(StorageChannelOutput out, Map<AbstractIndexPage, Integer> map) { return getRoot().writeToPreallocated(out, map); }
[ "final", "int", "writeToPreallocated", "(", "StorageChannelOutput", "out", ",", "Map", "<", "AbstractIndexPage", ",", "Integer", ">", "map", ")", "{", "return", "getRoot", "(", ")", ".", "writeToPreallocated", "(", "out", ",", "map", ")", ";", "}" ]
Special write method that uses only pre-allocated pages. @param map @return the root page Id.
[ "Special", "write", "method", "that", "uses", "only", "pre", "-", "allocated", "pages", "." ]
train
https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/AbstractPagedIndex.java#L154-L156
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/TSNE.java
TSNE.updateSolution
protected void updateSolution(double[][] sol, double[] meta, int it) { """ Update the current solution on iteration. @param sol Solution matrix @param meta Metadata array (gradient, momentum, learning rate) @param it Iteration number, to choose momentum factor. """ final double mom = (it < momentumSwi...
java
protected void updateSolution(double[][] sol, double[] meta, int it) { final double mom = (it < momentumSwitch && initialMomentum < finalMomentum) ? initialMomentum : finalMomentum; final int dim3 = dim * 3; for(int i = 0, off = 0; i < sol.length; i++, off += dim3) { final double[] sol_i = sol[i]; ...
[ "protected", "void", "updateSolution", "(", "double", "[", "]", "[", "]", "sol", ",", "double", "[", "]", "meta", ",", "int", "it", ")", "{", "final", "double", "mom", "=", "(", "it", "<", "momentumSwitch", "&&", "initialMomentum", "<", "finalMomentum", ...
Update the current solution on iteration. @param sol Solution matrix @param meta Metadata array (gradient, momentum, learning rate) @param it Iteration number, to choose momentum factor.
[ "Update", "the", "current", "solution", "on", "iteration", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/TSNE.java#L345-L360
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueService.java
QueueService.createLocalQueueStats
public LocalQueueStats createLocalQueueStats(String name, int partitionId) { """ Returns the local queue statistics for the given name and partition ID. If this node is the owner for the partition, returned stats contain {@link LocalQueueStats#getOwnedItemCount()}, otherwise it contains {@link LocalQueueStats#g...
java
public LocalQueueStats createLocalQueueStats(String name, int partitionId) { LocalQueueStatsImpl stats = getLocalQueueStatsImpl(name); stats.setOwnedItemCount(0); stats.setBackupItemCount(0); QueueContainer container = containerMap.get(name); if (container == null) { ...
[ "public", "LocalQueueStats", "createLocalQueueStats", "(", "String", "name", ",", "int", "partitionId", ")", "{", "LocalQueueStatsImpl", "stats", "=", "getLocalQueueStatsImpl", "(", "name", ")", ";", "stats", ".", "setOwnedItemCount", "(", "0", ")", ";", "stats", ...
Returns the local queue statistics for the given name and partition ID. If this node is the owner for the partition, returned stats contain {@link LocalQueueStats#getOwnedItemCount()}, otherwise it contains {@link LocalQueueStats#getBackupItemCount()}. @param name the name of the queue for which the statistics ...
[ "Returns", "the", "local", "queue", "statistics", "for", "the", "given", "name", "and", "partition", "ID", ".", "If", "this", "node", "is", "the", "owner", "for", "the", "partition", "returned", "stats", "contain", "{", "@link", "LocalQueueStats#getOwnedItemCoun...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueService.java#L310-L330
Alluxio/alluxio
core/common/src/main/java/alluxio/util/CommonUtils.java
CommonUtils.getWorkerDataDirectory
public static String getWorkerDataDirectory(String storageDir, AlluxioConfiguration conf) { """ @param storageDir the root of a storage directory in tiered storage @param conf Alluxio's current configuration @return the worker data folder path after each storage directory, the final path will be like "/mnt/ra...
java
public static String getWorkerDataDirectory(String storageDir, AlluxioConfiguration conf) { return PathUtils.concatPath( storageDir.trim(), conf.get(PropertyKey.WORKER_DATA_FOLDER)); }
[ "public", "static", "String", "getWorkerDataDirectory", "(", "String", "storageDir", ",", "AlluxioConfiguration", "conf", ")", "{", "return", "PathUtils", ".", "concatPath", "(", "storageDir", ".", "trim", "(", ")", ",", "conf", ".", "get", "(", "PropertyKey", ...
@param storageDir the root of a storage directory in tiered storage @param conf Alluxio's current configuration @return the worker data folder path after each storage directory, the final path will be like "/mnt/ramdisk/alluxioworker" for storage dir "/mnt/ramdisk" by appending {@link PropertyKey#WORKER_DATA_FOLDER).
[ "@param", "storageDir", "the", "root", "of", "a", "storage", "directory", "in", "tiered", "storage", "@param", "conf", "Alluxio", "s", "current", "configuration" ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L99-L102
RestComm/media-core
network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java
IPAddressCompare.compareByteValues
private static boolean compareByteValues(byte[] network,byte[] subnet,byte[] ipAddress) { """ Checks whether ipAddress is in network with specified subnet by comparing byte logical end values """ for(int i=0;i<network.length;i++) if((network[i] & subnet[i]) != (ipAddress[i] & subnet[i])) ...
java
private static boolean compareByteValues(byte[] network,byte[] subnet,byte[] ipAddress) { for(int i=0;i<network.length;i++) if((network[i] & subnet[i]) != (ipAddress[i] & subnet[i])) return false; return true; }
[ "private", "static", "boolean", "compareByteValues", "(", "byte", "[", "]", "network", ",", "byte", "[", "]", "subnet", ",", "byte", "[", "]", "ipAddress", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "network", ".", "length", ";", "i...
Checks whether ipAddress is in network with specified subnet by comparing byte logical end values
[ "Checks", "whether", "ipAddress", "is", "in", "network", "with", "specified", "subnet", "by", "comparing", "byte", "logical", "end", "values" ]
train
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java#L58-L65
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/Bar.java
Bar.setColorGradient
public void setColorGradient(ColorRgba color1, ColorRgba color2) { """ Set a gradient color from point 1 with color 1 to point2 with color 2. @param color1 The first color. @param color2 The last color. """ setColorGradient(x, y, color1, x + maxWidth, y + maxHeight, color2); }
java
public void setColorGradient(ColorRgba color1, ColorRgba color2) { setColorGradient(x, y, color1, x + maxWidth, y + maxHeight, color2); }
[ "public", "void", "setColorGradient", "(", "ColorRgba", "color1", ",", "ColorRgba", "color2", ")", "{", "setColorGradient", "(", "x", ",", "y", ",", "color1", ",", "x", "+", "maxWidth", ",", "y", "+", "maxHeight", ",", "color2", ")", ";", "}" ]
Set a gradient color from point 1 with color 1 to point2 with color 2. @param color1 The first color. @param color2 The last color.
[ "Set", "a", "gradient", "color", "from", "point", "1", "with", "color", "1", "to", "point2", "with", "color", "2", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Bar.java#L194-L197
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java
TagAttributesImpl.get
public TagAttribute get(String ns, String localName) { """ Find a TagAttribute that matches the passed namespace and local name. @param ns namespace of the desired attribute @param localName local name of the attribute @return a TagAttribute found, otherwise null """ if (ns != null && localName ...
java
public TagAttribute get(String ns, String localName) { if (ns != null && localName != null) { int idx = Arrays.binarySearch(_namespaces, ns); if (idx >= 0) { for (TagAttribute attribute : _nsattrs.get(idx)) { if ...
[ "public", "TagAttribute", "get", "(", "String", "ns", ",", "String", "localName", ")", "{", "if", "(", "ns", "!=", "null", "&&", "localName", "!=", "null", ")", "{", "int", "idx", "=", "Arrays", ".", "binarySearch", "(", "_namespaces", ",", "ns", ")", ...
Find a TagAttribute that matches the passed namespace and local name. @param ns namespace of the desired attribute @param localName local name of the attribute @return a TagAttribute found, otherwise null
[ "Find", "a", "TagAttribute", "that", "matches", "the", "passed", "namespace", "and", "local", "name", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java#L123-L141
jbundle/jbundle
base/message/core/src/main/java/org/jbundle/base/message/core/tree/TreeMessageFilterList.java
TreeMessageFilterList.setNewFilterTree
public void setNewFilterTree(BaseMessageFilter messageFilter, Object[][] propKeys) { """ Update this filter with this new information. @param messageFilter The message filter I am updating. @param propKeys New tree key filter information (ie, bookmark=345). """ if (propKeys != null) if (!...
java
public void setNewFilterTree(BaseMessageFilter messageFilter, Object[][] propKeys) { if (propKeys != null) if (!propKeys.equals(messageFilter.getNameValueTree())) { // This moves the filter to the new leaf this.getRegistry().removeMessageFilter(messageFilter); s...
[ "public", "void", "setNewFilterTree", "(", "BaseMessageFilter", "messageFilter", ",", "Object", "[", "]", "[", "]", "propKeys", ")", "{", "if", "(", "propKeys", "!=", "null", ")", "if", "(", "!", "propKeys", ".", "equals", "(", "messageFilter", ".", "getNa...
Update this filter with this new information. @param messageFilter The message filter I am updating. @param propKeys New tree key filter information (ie, bookmark=345).
[ "Update", "this", "filter", "with", "this", "new", "information", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/core/src/main/java/org/jbundle/base/message/core/tree/TreeMessageFilterList.java#L90-L99
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.showSummary
protected void showSummary(MavenProject mp, Dependency[] dependencies) { """ Generates a warning message listing a summary of dependencies and their associated CPE and CVE entries. @param mp the Maven project for which the summary is shown @param dependencies a list of dependency objects """ if (s...
java
protected void showSummary(MavenProject mp, Dependency[] dependencies) { if (showSummary) { DependencyCheckScanAgent.showSummary(mp.getName(), dependencies); } }
[ "protected", "void", "showSummary", "(", "MavenProject", "mp", ",", "Dependency", "[", "]", "dependencies", ")", "{", "if", "(", "showSummary", ")", "{", "DependencyCheckScanAgent", ".", "showSummary", "(", "mp", ".", "getName", "(", ")", ",", "dependencies", ...
Generates a warning message listing a summary of dependencies and their associated CPE and CVE entries. @param mp the Maven project for which the summary is shown @param dependencies a list of dependency objects
[ "Generates", "a", "warning", "message", "listing", "a", "summary", "of", "dependencies", "and", "their", "associated", "CPE", "and", "CVE", "entries", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L1865-L1869
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java
BlockMetadataManager.resizeTempBlockMeta
public void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize) throws InvalidWorkerStateException { """ Modifies the size of a temp block. @param tempBlockMeta the temp block to modify @param newSize new size in bytes @throws InvalidWorkerStateException when newSize is smaller than current s...
java
public void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize) throws InvalidWorkerStateException { StorageDir dir = tempBlockMeta.getParentDir(); dir.resizeTempBlockMeta(tempBlockMeta, newSize); }
[ "public", "void", "resizeTempBlockMeta", "(", "TempBlockMeta", "tempBlockMeta", ",", "long", "newSize", ")", "throws", "InvalidWorkerStateException", "{", "StorageDir", "dir", "=", "tempBlockMeta", ".", "getParentDir", "(", ")", ";", "dir", ".", "resizeTempBlockMeta",...
Modifies the size of a temp block. @param tempBlockMeta the temp block to modify @param newSize new size in bytes @throws InvalidWorkerStateException when newSize is smaller than current size
[ "Modifies", "the", "size", "of", "a", "temp", "block", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L459-L463
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java
WebMonitorUtils.validateAndNormalizeUri
public static Path validateAndNormalizeUri(URI archiveDirUri) { """ Checks and normalizes the given URI. This method first checks the validity of the URI (scheme and path are not null) and then normalizes the URI to a path. @param archiveDirUri The URI to check and normalize. @return A normalized URI as a Pat...
java
public static Path validateAndNormalizeUri(URI archiveDirUri) { final String scheme = archiveDirUri.getScheme(); final String path = archiveDirUri.getPath(); // some validity checks if (scheme == null) { throw new IllegalArgumentException("The scheme (hdfs://, file://, etc) is null. " + "Please specify ...
[ "public", "static", "Path", "validateAndNormalizeUri", "(", "URI", "archiveDirUri", ")", "{", "final", "String", "scheme", "=", "archiveDirUri", ".", "getScheme", "(", ")", ";", "final", "String", "path", "=", "archiveDirUri", ".", "getPath", "(", ")", ";", ...
Checks and normalizes the given URI. This method first checks the validity of the URI (scheme and path are not null) and then normalizes the URI to a path. @param archiveDirUri The URI to check and normalize. @return A normalized URI as a Path. @throws IllegalArgumentException Thrown, if the URI misses scheme or path...
[ "Checks", "and", "normalizes", "the", "given", "URI", ".", "This", "method", "first", "checks", "the", "validity", "of", "the", "URI", "(", "scheme", "and", "path", "are", "not", "null", ")", "and", "then", "normalizes", "the", "URI", "to", "a", "path", ...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java#L263-L278
brianwhu/xillium
base/src/main/java/org/xillium/base/util/Mathematical.java
Mathematical.floor
public static int floor(int n, int m) { """ Rounds n down to the nearest multiple of m @param n an integer @param m an integer @return the value after rounding {@code n} down to the nearest multiple of {@code m} """ return n >= 0 ? (n / m) * m : ((n - m + 1) / m) * m; }
java
public static int floor(int n, int m) { return n >= 0 ? (n / m) * m : ((n - m + 1) / m) * m; }
[ "public", "static", "int", "floor", "(", "int", "n", ",", "int", "m", ")", "{", "return", "n", ">=", "0", "?", "(", "n", "/", "m", ")", "*", "m", ":", "(", "(", "n", "-", "m", "+", "1", ")", "/", "m", ")", "*", "m", ";", "}" ]
Rounds n down to the nearest multiple of m @param n an integer @param m an integer @return the value after rounding {@code n} down to the nearest multiple of {@code m}
[ "Rounds", "n", "down", "to", "the", "nearest", "multiple", "of", "m" ]
train
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/util/Mathematical.java#L15-L17
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/cluster/RedisClusterClient.java
RedisClusterClient.connectToNodeAsync
<K, V> ConnectionFuture<StatefulRedisConnection<K, V>> connectToNodeAsync(RedisCodec<K, V> codec, String nodeId, RedisChannelWriter clusterWriter, Mono<SocketAddress> socketAddressSupplier) { """ Create a connection to a redis socket address. @param codec Use this codec to encode/decode keys and val...
java
<K, V> ConnectionFuture<StatefulRedisConnection<K, V>> connectToNodeAsync(RedisCodec<K, V> codec, String nodeId, RedisChannelWriter clusterWriter, Mono<SocketAddress> socketAddressSupplier) { assertNotNull(codec); assertNotEmpty(initialUris); LettuceAssert.notNull(socketAddressSuppl...
[ "<", "K", ",", "V", ">", "ConnectionFuture", "<", "StatefulRedisConnection", "<", "K", ",", "V", ">", ">", "connectToNodeAsync", "(", "RedisCodec", "<", "K", ",", "V", ">", "codec", ",", "String", "nodeId", ",", "RedisChannelWriter", "clusterWriter", ",", ...
Create a connection to a redis socket address. @param codec Use this codec to encode/decode keys and values, must not be {@literal null} @param nodeId the nodeId @param clusterWriter global cluster writer @param socketAddressSupplier supplier for the socket address @param <K> Key type @param <V> Value type @return A n...
[ "Create", "a", "connection", "to", "a", "redis", "socket", "address", "." ]
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/RedisClusterClient.java#L482-L507
Azure/azure-sdk-for-java
labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java
LabsInner.createOrUpdateAsync
public Observable<LabInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, LabInner lab) { """ Create or replace an existing Lab. @param resourceGroupName The name of the resource group. @param labAccountName The name of the lab Account. @param labName The name of the lab...
java
public Observable<LabInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, LabInner lab) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab).map(new Func1<ServiceResponse<LabInner>, LabInner>() { @Override ...
[ "public", "Observable", "<", "LabInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "labAccountName", ",", "String", "labName", ",", "LabInner", "lab", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupN...
Create or replace an existing Lab. @param resourceGroupName The name of the resource group. @param labAccountName The name of the lab Account. @param labName The name of the lab. @param lab Represents a lab. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the LabInne...
[ "Create", "or", "replace", "an", "existing", "Lab", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java#L594-L601
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/grid/DataRecordBuffer.java
DataRecordBuffer.bookmarkToIndex
public int bookmarkToIndex(Object bookmark, int iHandleType) { """ This method was created by a SmartGuide. @return int index in table; or -1 if not found. @param bookmark java.lang.Object The bookmark to find in this table. @param iHandleType int The type of handle to look for (typically OBJECT_ID). """ ...
java
public int bookmarkToIndex(Object bookmark, int iHandleType) { DataRecord thisBookmark = null; if (bookmark == null) return -1; for (int iTargetPosition = m_iCurrentRecordStart; iTargetPosition < m_iCurrentRecordEnd; iTargetPosition++) { thisBookmark = (DataRe...
[ "public", "int", "bookmarkToIndex", "(", "Object", "bookmark", ",", "int", "iHandleType", ")", "{", "DataRecord", "thisBookmark", "=", "null", ";", "if", "(", "bookmark", "==", "null", ")", "return", "-", "1", ";", "for", "(", "int", "iTargetPosition", "="...
This method was created by a SmartGuide. @return int index in table; or -1 if not found. @param bookmark java.lang.Object The bookmark to find in this table. @param iHandleType int The type of handle to look for (typically OBJECT_ID).
[ "This", "method", "was", "created", "by", "a", "SmartGuide", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/grid/DataRecordBuffer.java#L26-L40
tvesalainen/util
ham/src/main/java/org/vesalainen/ham/hffax/Fax.java
Fax.isAbout
public static boolean isAbout(double expected, double value, double tolerance) { """ Returns true if value differs only tolerance percent. @param expected @param value @param tolerance @return """ double delta = expected*tolerance/100.0; return value > expected-delta && value < expected+del...
java
public static boolean isAbout(double expected, double value, double tolerance) { double delta = expected*tolerance/100.0; return value > expected-delta && value < expected+delta; }
[ "public", "static", "boolean", "isAbout", "(", "double", "expected", ",", "double", "value", ",", "double", "tolerance", ")", "{", "double", "delta", "=", "expected", "*", "tolerance", "/", "100.0", ";", "return", "value", ">", "expected", "-", "delta", "&...
Returns true if value differs only tolerance percent. @param expected @param value @param tolerance @return
[ "Returns", "true", "if", "value", "differs", "only", "tolerance", "percent", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/ham/src/main/java/org/vesalainen/ham/hffax/Fax.java#L52-L56
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/RelationalJMapper.java
RelationalJMapper.oneToManyWithoutControl
public <D> D oneToManyWithoutControl(D destination,final T source) { """ This Method returns the destination given in input enriched with data contained in source given in input<br> with this setting: <table summary =""> <tr> <td><code>NullPointerControl</code></td><td><code>NOT_ANY</code></td> </tr><tr> <td...
java
public <D> D oneToManyWithoutControl(D destination,final T source) { try{ return this.<D,T>getJMapper(relationalOneToManyMapper,destination.getClass()).getDestinationWithoutControl(destination,source); } catch (Exception e) { return this.logAndReturnNull(e); } }
[ "public", "<", "D", ">", "D", "oneToManyWithoutControl", "(", "D", "destination", ",", "final", "T", "source", ")", "{", "try", "{", "return", "this", ".", "<", "D", ",", "T", ">", "getJMapper", "(", "relationalOneToManyMapper", ",", "destination", ".", ...
This Method returns the destination given in input enriched with data contained in source given in input<br> with this setting: <table summary =""> <tr> <td><code>NullPointerControl</code></td><td><code>NOT_ANY</code></td> </tr><tr> <td><code>MappingType</code> of Destination</td><td><code>ALL_FIELDS</code></td> </tr><...
[ "This", "Method", "returns", "the", "destination", "given", "in", "input", "enriched", "with", "data", "contained", "in", "source", "given", "in", "input<br", ">", "with", "this", "setting", ":", "<table", "summary", "=", ">", "<tr", ">", "<td", ">", "<cod...
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/RelationalJMapper.java#L603-L606
Azure/azure-sdk-for-java
privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsInner.java
RecordSetsInner.getAsync
public Observable<RecordSetInner> getAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { """ Gets a record set. @param resourceGroupName The name of the resource group. @param privateZoneName The name of the Private DNS zone (without a terminating dot)...
java
public Observable<RecordSetInner> getAsync(String resourceGroupName, String privateZoneName, RecordType recordType, String relativeRecordSetName) { return getWithServiceResponseAsync(resourceGroupName, privateZoneName, recordType, relativeRecordSetName).map(new Func1<ServiceResponse<RecordSetInner>, RecordSetIn...
[ "public", "Observable", "<", "RecordSetInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "privateZoneName", ",", "RecordType", "recordType", ",", "String", "relativeRecordSetName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resour...
Gets a record set. @param resourceGroupName The name of the resource group. @param privateZoneName The name of the Private DNS zone (without a terminating dot). @param recordType The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT' @param relativeRe...
[ "Gets", "a", "record", "set", "." ]
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/RecordSetsInner.java#L772-L779
jirutka/spring-rest-exception-handler
src/main/java/cz/jirutka/spring/exhandler/RestHandlerExceptionResolverBuilder.java
RestHandlerExceptionResolverBuilder.addErrorMessageHandler
public RestHandlerExceptionResolverBuilder addErrorMessageHandler( Class<? extends Exception> exceptionClass, HttpStatus status) { """ Registers {@link ErrorMessageRestExceptionHandler} for the specified exception type. This handler will be also used for all the exception subtypes, when no more specif...
java
public RestHandlerExceptionResolverBuilder addErrorMessageHandler( Class<? extends Exception> exceptionClass, HttpStatus status) { return addHandler(new ErrorMessageRestExceptionHandler<>(exceptionClass, status)); }
[ "public", "RestHandlerExceptionResolverBuilder", "addErrorMessageHandler", "(", "Class", "<", "?", "extends", "Exception", ">", "exceptionClass", ",", "HttpStatus", "status", ")", "{", "return", "addHandler", "(", "new", "ErrorMessageRestExceptionHandler", "<>", "(", "e...
Registers {@link ErrorMessageRestExceptionHandler} for the specified exception type. This handler will be also used for all the exception subtypes, when no more specific mapping is found. @param exceptionClass The exception type to handle. @param status The HTTP status to map the specified exception to.
[ "Registers", "{", "@link", "ErrorMessageRestExceptionHandler", "}", "for", "the", "specified", "exception", "type", ".", "This", "handler", "will", "be", "also", "used", "for", "all", "the", "exception", "subtypes", "when", "no", "more", "specific", "mapping", "...
train
https://github.com/jirutka/spring-rest-exception-handler/blob/f171956e59fe866f1a853c7d38444f136acc7a3b/src/main/java/cz/jirutka/spring/exhandler/RestHandlerExceptionResolverBuilder.java#L212-L216
aalmiray/Json-lib
src/main/java/net/sf/json/JsonConfig.java
JsonConfig.registerJsonBeanProcessor
public void registerJsonBeanProcessor( Class target, JsonBeanProcessor jsonBeanProcessor ) { """ Registers a JsonBeanProcessor.<br> [Java -&gt; JSON] @param target the class to use as key @param jsonBeanProcessor the processor to register """ if( target != null && jsonBeanProcessor != null ) { ...
java
public void registerJsonBeanProcessor( Class target, JsonBeanProcessor jsonBeanProcessor ) { if( target != null && jsonBeanProcessor != null ) { beanProcessorMap.put( target, jsonBeanProcessor ); } }
[ "public", "void", "registerJsonBeanProcessor", "(", "Class", "target", ",", "JsonBeanProcessor", "jsonBeanProcessor", ")", "{", "if", "(", "target", "!=", "null", "&&", "jsonBeanProcessor", "!=", "null", ")", "{", "beanProcessorMap", ".", "put", "(", "target", "...
Registers a JsonBeanProcessor.<br> [Java -&gt; JSON] @param target the class to use as key @param jsonBeanProcessor the processor to register
[ "Registers", "a", "JsonBeanProcessor", ".", "<br", ">", "[", "Java", "-", "&gt", ";", "JSON", "]" ]
train
https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L786-L790
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/util/CompressionUtil.java
CompressionUtil.extractFileGzip
public static File extractFileGzip(String _compressedFile, String _outputFileName) { """ Extracts a GZIP compressed file to the given outputfile. @param _compressedFile @param _outputFileName @return file-object with outputfile or null on any error. """ return decompress(CompressionMethod.GZIP, _c...
java
public static File extractFileGzip(String _compressedFile, String _outputFileName) { return decompress(CompressionMethod.GZIP, _compressedFile, _outputFileName); }
[ "public", "static", "File", "extractFileGzip", "(", "String", "_compressedFile", ",", "String", "_outputFileName", ")", "{", "return", "decompress", "(", "CompressionMethod", ".", "GZIP", ",", "_compressedFile", ",", "_outputFileName", ")", ";", "}" ]
Extracts a GZIP compressed file to the given outputfile. @param _compressedFile @param _outputFileName @return file-object with outputfile or null on any error.
[ "Extracts", "a", "GZIP", "compressed", "file", "to", "the", "given", "outputfile", "." ]
train
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/CompressionUtil.java#L42-L44
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java
ReUtil.extractMulti
public static String extractMulti(Pattern pattern, CharSequence content, String template) { """ 从content中匹配出多个值并根据template生成新的字符串<br> 例如:<br> content 2013年5月 pattern (.*?)年(.*?)月 template: $1-$2 return 2013-5 @param pattern 匹配正则 @param content 被匹配的内容 @param template 生成内容模板,变量 $1 表示group1的内容,以此类推 @return 新字...
java
public static String extractMulti(Pattern pattern, CharSequence content, String template) { if (null == content || null == pattern || null == template) { return null; } //提取模板中的编号 final TreeSet<Integer> varNums = new TreeSet<>(new Comparator<Integer>() { @Override public int compare(Integer o1...
[ "public", "static", "String", "extractMulti", "(", "Pattern", "pattern", ",", "CharSequence", "content", ",", "String", "template", ")", "{", "if", "(", "null", "==", "content", "||", "null", "==", "pattern", "||", "null", "==", "template", ")", "{", "retu...
从content中匹配出多个值并根据template生成新的字符串<br> 例如:<br> content 2013年5月 pattern (.*?)年(.*?)月 template: $1-$2 return 2013-5 @param pattern 匹配正则 @param content 被匹配的内容 @param template 生成内容模板,变量 $1 表示group1的内容,以此类推 @return 新字符串
[ "从content中匹配出多个值并根据template生成新的字符串<br", ">", "例如:<br", ">", "content", "2013年5月", "pattern", "(", ".", "*", "?", ")", "年", "(", ".", "*", "?", ")", "月", "template:", "$1", "-", "$2", "return", "2013", "-", "5" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L171-L196
OpenLiberty/open-liberty
dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/AbstractMBeanIntrospector.java
AbstractMBeanIntrospector.introspectMBeanAttributes
@FFDCIgnore(Throwable.class) void introspectMBeanAttributes(MBeanServer mbeanServer, ObjectName mbean, PrintWriter writer) { """ Introspect an MBean's attributes. Introspection will capture the MBean's description, its canonical object name, and its attributes. When attributes are a complex {@link OpenType},...
java
@FFDCIgnore(Throwable.class) void introspectMBeanAttributes(MBeanServer mbeanServer, ObjectName mbean, PrintWriter writer) { try { // Dump the description and the canonical form of the object name writer.println(); writer.print(mbeanServer.getMBeanInfo(mbean).getDescripti...
[ "@", "FFDCIgnore", "(", "Throwable", ".", "class", ")", "void", "introspectMBeanAttributes", "(", "MBeanServer", "mbeanServer", ",", "ObjectName", "mbean", ",", "PrintWriter", "writer", ")", "{", "try", "{", "// Dump the description and the canonical form of the object na...
Introspect an MBean's attributes. Introspection will capture the MBean's description, its canonical object name, and its attributes. When attributes are a complex {@link OpenType}, an attempt will be made to format the complex type. Primitives and types that do not have metadata will be formatted with {@linkplain Strin...
[ "Introspect", "an", "MBean", "s", "attributes", ".", "Introspection", "will", "capture", "the", "MBean", "s", "description", "its", "canonical", "object", "name", "and", "its", "attributes", ".", "When", "attributes", "are", "a", "complex", "{", "@link", "Open...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/AbstractMBeanIntrospector.java#L89-L118
OpenTSDB/opentsdb
src/tools/UidManager.java
UidManager.purgeTree
private static int purgeTree(final TSDB tsdb, final int tree_id, final boolean delete_definition) throws Exception { """ Attempts to delete the branches, leaves, collisions and not-matched entries for a given tree. Optionally removes the tree definition itself @param tsdb The TSDB to use for access @para...
java
private static int purgeTree(final TSDB tsdb, final int tree_id, final boolean delete_definition) throws Exception { final TreeSync sync = new TreeSync(tsdb, 0, 1, 0); return sync.purgeTree(tree_id, delete_definition); }
[ "private", "static", "int", "purgeTree", "(", "final", "TSDB", "tsdb", ",", "final", "int", "tree_id", ",", "final", "boolean", "delete_definition", ")", "throws", "Exception", "{", "final", "TreeSync", "sync", "=", "new", "TreeSync", "(", "tsdb", ",", "0", ...
Attempts to delete the branches, leaves, collisions and not-matched entries for a given tree. Optionally removes the tree definition itself @param tsdb The TSDB to use for access @param tree_id ID of the tree to delete @param delete_definition Whether or not to delete the tree definition as well @return 0 if completed ...
[ "Attempts", "to", "delete", "the", "branches", "leaves", "collisions", "and", "not", "-", "matched", "entries", "for", "a", "given", "tree", ".", "Optionally", "removes", "the", "tree", "definition", "itself" ]
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/UidManager.java#L1149-L1153
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/TableForm.java
TableForm.addTextArea
public TextArea addTextArea(String tag, String label, int width, int height, String value) { """ Add a Text Area. @param tag The form name of the element @param label The label for the...
java
public TextArea addTextArea(String tag, String label, int width, int height, String value) { TextArea ta = new TextArea(tag,value); ta.setSize(width,height); addFi...
[ "public", "TextArea", "addTextArea", "(", "String", "tag", ",", "String", "label", ",", "int", "width", ",", "int", "height", ",", "String", "value", ")", "{", "TextArea", "ta", "=", "new", "TextArea", "(", "tag", ",", "value", ")", ";", "ta", ".", "...
Add a Text Area. @param tag The form name of the element @param label The label for the element in the table.
[ "Add", "a", "Text", "Area", "." ]
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L84-L94
Azure/azure-sdk-for-java
eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java
TopicsInner.beginCreateOrUpdateAsync
public Observable<TopicInner> beginCreateOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { """ Create a topic. Asynchronously creates a new topic with the specified parameters. @param resourceGroupName The name of the resource group within the user's subscription. @param topicN...
java
public Observable<TopicInner> beginCreateOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo).map(new Func1<ServiceResponse<TopicInner>, TopicInner>() { @Override publ...
[ "public", "Observable", "<", "TopicInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "topicName", ",", "TopicInner", "topicInfo", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "t...
Create a topic. Asynchronously creates a new topic with the specified parameters. @param resourceGroupName The name of the resource group within the user's subscription. @param topicName Name of the topic @param topicInfo Topic information @throws IllegalArgumentException thrown if parameters fail the validation @retu...
[ "Create", "a", "topic", ".", "Asynchronously", "creates", "a", "new", "topic", "with", "the", "specified", "parameters", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L331-L338
tvesalainen/util
util/src/main/java/org/vesalainen/math/Circles.java
Circles.distanceFromCenter
public static double distanceFromCenter(Point center, double x, double y) { """ Returns point (x, y) distance from circles center. @param center @param x @param y @return """ return Math.hypot(x-center.getX(), y-center.getY()); }
java
public static double distanceFromCenter(Point center, double x, double y) { return Math.hypot(x-center.getX(), y-center.getY()); }
[ "public", "static", "double", "distanceFromCenter", "(", "Point", "center", ",", "double", "x", ",", "double", "y", ")", "{", "return", "Math", ".", "hypot", "(", "x", "-", "center", ".", "getX", "(", ")", ",", "y", "-", "center", ".", "getY", "(", ...
Returns point (x, y) distance from circles center. @param center @param x @param y @return
[ "Returns", "point", "(", "x", "y", ")", "distance", "from", "circles", "center", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Circles.java#L71-L74
google/flogger
api/src/main/java/com/google/common/flogger/parser/ParseException.java
ParseException.atPosition
public static ParseException atPosition(String errorMessage, String logMessage, int position) { """ Creates a new parse exception for situations in which the position of the error is known. @param errorMessage the user error message. @param logMessage the original log message. @param position the index of the...
java
public static ParseException atPosition(String errorMessage, String logMessage, int position) { return new ParseException(msg(errorMessage, logMessage, position, position + 1), logMessage); }
[ "public", "static", "ParseException", "atPosition", "(", "String", "errorMessage", ",", "String", "logMessage", ",", "int", "position", ")", "{", "return", "new", "ParseException", "(", "msg", "(", "errorMessage", ",", "logMessage", ",", "position", ",", "positi...
Creates a new parse exception for situations in which the position of the error is known. @param errorMessage the user error message. @param logMessage the original log message. @param position the index of the invalid character in the log message. @return the parser exception.
[ "Creates", "a", "new", "parse", "exception", "for", "situations", "in", "which", "the", "position", "of", "the", "error", "is", "known", "." ]
train
https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/ParseException.java#L56-L58
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java
EqualsBuilder.reflectionEquals
@GwtIncompatible("incompatible method") public static boolean reflectionEquals(final Object lhs, final Object rhs, final boolean testTransients, final Class<?> reflectUpToClass, final String... excludeFields) { """ <p>This method uses reflection to determine if the two <code>Object</code>s are equ...
java
@GwtIncompatible("incompatible method") public static boolean reflectionEquals(final Object lhs, final Object rhs, final boolean testTransients, final Class<?> reflectUpToClass, final String... excludeFields) { return reflectionEquals(lhs, rhs, testTransients, reflectUpToClass, false, excludeFie...
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "boolean", "reflectionEquals", "(", "final", "Object", "lhs", ",", "final", "Object", "rhs", ",", "final", "boolean", "testTransients", ",", "final", "Class", "<", "?", ">", "reflec...
<p>This method uses reflection to determine if the two <code>Object</code>s are equal.</p> <p>It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will throw a security exception if run under a security manager, if the permissions are not set up correctly. It is also...
[ "<p", ">", "This", "method", "uses", "reflection", "to", "determine", "if", "the", "two", "<code", ">", "Object<", "/", "code", ">", "s", "are", "equal", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java#L394-L398
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/bayesian/ConditionalProbabilityTable.java
ConditionalProbabilityTable.query
public double query(int targetClass, int targetValue, int[] cord) { """ Queries the CPT for the probability of the target class occurring with the specified value given the class values of the other attributes @param targetClass the index in the original data set of the class that we want to probability of @pa...
java
public double query(int targetClass, int targetValue, int[] cord) { double sumVal = 0; double targetVal = 0; int realTargetIndex = catIndexToRealIndex[targetClass]; CategoricalData queryData = valid.get(targetClass); //Now do all other target class posibilt...
[ "public", "double", "query", "(", "int", "targetClass", ",", "int", "targetValue", ",", "int", "[", "]", "cord", ")", "{", "double", "sumVal", "=", "0", ";", "double", "targetVal", "=", "0", ";", "int", "realTargetIndex", "=", "catIndexToRealIndex", "[", ...
Queries the CPT for the probability of the target class occurring with the specified value given the class values of the other attributes @param targetClass the index in the original data set of the class that we want to probability of @param targetValue the value of the <tt>targetClass</tt> that we want to probabilit...
[ "Queries", "the", "CPT", "for", "the", "probability", "of", "the", "target", "class", "occurring", "with", "the", "specified", "value", "given", "the", "class", "values", "of", "the", "other", "attributes" ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/bayesian/ConditionalProbabilityTable.java#L225-L248
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java
BigtableVeneerSettingsFactory.buildMutateRowSettings
private static void buildMutateRowSettings(Builder builder, BigtableOptions options) { """ To build BigtableDataSettings#mutateRowSettings with default Retry settings. """ RetrySettings retrySettings = buildIdempotentRetrySettings(builder.mutateRowSettings().getRetrySettings(), options); build...
java
private static void buildMutateRowSettings(Builder builder, BigtableOptions options) { RetrySettings retrySettings = buildIdempotentRetrySettings(builder.mutateRowSettings().getRetrySettings(), options); builder.mutateRowSettings() .setRetrySettings(retrySettings) .setRetryableCodes(bui...
[ "private", "static", "void", "buildMutateRowSettings", "(", "Builder", "builder", ",", "BigtableOptions", "options", ")", "{", "RetrySettings", "retrySettings", "=", "buildIdempotentRetrySettings", "(", "builder", ".", "mutateRowSettings", "(", ")", ".", "getRetrySettin...
To build BigtableDataSettings#mutateRowSettings with default Retry settings.
[ "To", "build", "BigtableDataSettings#mutateRowSettings", "with", "default", "Retry", "settings", "." ]
train
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java#L214-L221
jhalterman/failsafe
src/main/java/net/jodah/failsafe/FailsafeExecutor.java
FailsafeExecutor.getStageAsync
public <T extends R> CompletableFuture<T> getStageAsync(CheckedSupplier<? extends CompletionStage<T>> supplier) { """ Executes the {@code supplier} asynchronously until the resulting future is successfully completed or the configured policies are exceeded. <p> If a configured circuit breaker is open, the result...
java
public <T extends R> CompletableFuture<T> getStageAsync(CheckedSupplier<? extends CompletionStage<T>> supplier) { return callAsync(execution -> Functions.promiseOfStage(supplier, execution), false); }
[ "public", "<", "T", "extends", "R", ">", "CompletableFuture", "<", "T", ">", "getStageAsync", "(", "CheckedSupplier", "<", "?", "extends", "CompletionStage", "<", "T", ">", ">", "supplier", ")", "{", "return", "callAsync", "(", "execution", "->", "Functions"...
Executes the {@code supplier} asynchronously until the resulting future is successfully completed or the configured policies are exceeded. <p> If a configured circuit breaker is open, the resulting future is completed exceptionally with {@link CircuitBreakerOpenException}. @throws NullPointerException if the {@code su...
[ "Executes", "the", "{", "@code", "supplier", "}", "asynchronously", "until", "the", "resulting", "future", "is", "successfully", "completed", "or", "the", "configured", "policies", "are", "exceeded", ".", "<p", ">", "If", "a", "configured", "circuit", "breaker",...
train
https://github.com/jhalterman/failsafe/blob/65fcd3a82f7b232d2ff59bc525a59d693dd8e223/src/main/java/net/jodah/failsafe/FailsafeExecutor.java#L174-L176
XiaoMi/chronos
chronos-server/src/main/java/com/xiaomi/infra/chronos/zookeeper/HostPort.java
HostPort.parseHostPort
public static HostPort parseHostPort(String string) { """ Parse a host_port string to construct the HostPost object. @param string the host_port string @return the HostPort object """ String[] strings = string.split("_"); return new HostPort(strings[0], Integer.parseInt(strings[1])); }
java
public static HostPort parseHostPort(String string) { String[] strings = string.split("_"); return new HostPort(strings[0], Integer.parseInt(strings[1])); }
[ "public", "static", "HostPort", "parseHostPort", "(", "String", "string", ")", "{", "String", "[", "]", "strings", "=", "string", ".", "split", "(", "\"_\"", ")", ";", "return", "new", "HostPort", "(", "strings", "[", "0", "]", ",", "Integer", ".", "pa...
Parse a host_port string to construct the HostPost object. @param string the host_port string @return the HostPort object
[ "Parse", "a", "host_port", "string", "to", "construct", "the", "HostPost", "object", "." ]
train
https://github.com/XiaoMi/chronos/blob/92e4a30c98947e87aba47ea88c944a56505a4ec0/chronos-server/src/main/java/com/xiaomi/infra/chronos/zookeeper/HostPort.java#L39-L42
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/common/FrameworkProjectMgr.java
FrameworkProjectMgr.getFrameworkProject
public FrameworkProject getFrameworkProject(final String name) { """ @return an existing Project object and returns it @param name The name of the project """ FrameworkProject frameworkProject = loadChild(name); if (null != frameworkProject) { return frameworkProject; } ...
java
public FrameworkProject getFrameworkProject(final String name) { FrameworkProject frameworkProject = loadChild(name); if (null != frameworkProject) { return frameworkProject; } throw new NoSuchResourceException("Project does not exist: " + name, this); }
[ "public", "FrameworkProject", "getFrameworkProject", "(", "final", "String", "name", ")", "{", "FrameworkProject", "frameworkProject", "=", "loadChild", "(", "name", ")", ";", "if", "(", "null", "!=", "frameworkProject", ")", "{", "return", "frameworkProject", ";"...
@return an existing Project object and returns it @param name The name of the project
[ "@return", "an", "existing", "Project", "object", "and", "returns", "it" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/FrameworkProjectMgr.java#L197-L203
phax/ph-masterdata
ph-masterdata/src/main/java/com/helger/masterdata/vat/VATManager.java
VATManager.isZeroVATAllowed
public boolean isZeroVATAllowed (@Nonnull final Locale aCountry, final boolean bUndefinedValue) { """ Check if zero VAT is allowed for the passed country @param aCountry The country to be checked. @param bUndefinedValue The value to be returned, if no VAT data is available for the passed country @return <c...
java
public boolean isZeroVATAllowed (@Nonnull final Locale aCountry, final boolean bUndefinedValue) { ValueEnforcer.notNull (aCountry, "Country"); // first get locale specific VAT types final VATCountryData aVATCountryData = getVATCountryData (aCountry); return aVATCountryData != null ? aVATCountryData.i...
[ "public", "boolean", "isZeroVATAllowed", "(", "@", "Nonnull", "final", "Locale", "aCountry", ",", "final", "boolean", "bUndefinedValue", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aCountry", ",", "\"Country\"", ")", ";", "// first get locale specific VAT types",...
Check if zero VAT is allowed for the passed country @param aCountry The country to be checked. @param bUndefinedValue The value to be returned, if no VAT data is available for the passed country @return <code>true</code> or <code>false</code>
[ "Check", "if", "zero", "VAT", "is", "allowed", "for", "the", "passed", "country" ]
train
https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/vat/VATManager.java#L258-L265
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/QueryRecord.java
QueryRecord.getField
public BaseField getField(String strTableName, int iFieldSeq) // Lookup this field { """ Get this field in the record. This is a little different for a query record, because I have to look through multiple records. @param iFieldSeq The position in the query to retrive. @param strTableName The record name. @r...
java
public BaseField getField(String strTableName, int iFieldSeq) // Lookup this field { Record record = this.getRecord(strTableName); if (record != null) return record.getField(iFieldSeq); return null; // Not found }
[ "public", "BaseField", "getField", "(", "String", "strTableName", ",", "int", "iFieldSeq", ")", "// Lookup this field", "{", "Record", "record", "=", "this", ".", "getRecord", "(", "strTableName", ")", ";", "if", "(", "record", "!=", "null", ")", "return", "...
Get this field in the record. This is a little different for a query record, because I have to look through multiple records. @param iFieldSeq The position in the query to retrive. @param strTableName The record name. @return The field at this location.
[ "Get", "this", "field", "in", "the", "record", ".", "This", "is", "a", "little", "different", "for", "a", "query", "record", "because", "I", "have", "to", "look", "through", "multiple", "records", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/QueryRecord.java#L327-L333
Azure/azure-sdk-for-java
logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java
WorkflowTriggersInner.getSchemaJson
public JsonSchemaInner getSchemaJson(String resourceGroupName, String workflowName, String triggerName) { """ Get the trigger schema as JSON. @param resourceGroupName The resource group name. @param workflowName The workflow name. @param triggerName The workflow trigger name. @throws IllegalArgumentException...
java
public JsonSchemaInner getSchemaJson(String resourceGroupName, String workflowName, String triggerName) { return getSchemaJsonWithServiceResponseAsync(resourceGroupName, workflowName, triggerName).toBlocking().single().body(); }
[ "public", "JsonSchemaInner", "getSchemaJson", "(", "String", "resourceGroupName", ",", "String", "workflowName", ",", "String", "triggerName", ")", "{", "return", "getSchemaJsonWithServiceResponseAsync", "(", "resourceGroupName", ",", "workflowName", ",", "triggerName", "...
Get the trigger schema as JSON. @param resourceGroupName The resource group name. @param workflowName The workflow name. @param triggerName The workflow trigger name. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws Run...
[ "Get", "the", "trigger", "schema", "as", "JSON", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java#L638-L640
hibernate/hibernate-ogm
infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/LocalCacheManager.java
LocalCacheManager.enableClusteringHashGroups
private static Configuration enableClusteringHashGroups(String cacheName, Configuration configuration) { """ Enable the clustering.hash.groups configuration if it's not already enabled. <p> Infinispan requires this option enabled because we are using fine grained maps. The function will log a warning if the pro...
java
private static Configuration enableClusteringHashGroups(String cacheName, Configuration configuration) { if ( configuration.clustering().hash().groups().enabled() ) { return configuration; } LOG.clusteringHashGroupsMustBeEnabled( cacheName ); ConfigurationBuilder builder = new ConfigurationBuilder().read( co...
[ "private", "static", "Configuration", "enableClusteringHashGroups", "(", "String", "cacheName", ",", "Configuration", "configuration", ")", "{", "if", "(", "configuration", ".", "clustering", "(", ")", ".", "hash", "(", ")", ".", "groups", "(", ")", ".", "enab...
Enable the clustering.hash.groups configuration if it's not already enabled. <p> Infinispan requires this option enabled because we are using fine grained maps. The function will log a warning if the property is disabled. @return the updated configuration
[ "Enable", "the", "clustering", ".", "hash", ".", "groups", "configuration", "if", "it", "s", "not", "already", "enabled", ".", "<p", ">", "Infinispan", "requires", "this", "option", "enabled", "because", "we", "are", "using", "fine", "grained", "maps", ".", ...
train
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/LocalCacheManager.java#L155-L163
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/Validate.java
Validate.inclusiveBetween
@SuppressWarnings("boxing") public static void inclusiveBetween(final double start, final double end, final double value) { """ Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception. <pre>Validate.inclusiveBetween(0.1, 2.1, 1.1);</pre> ...
java
@SuppressWarnings("boxing") public static void inclusiveBetween(final double start, final double end, final double value) { // TODO when breaking BC, consider returning value if (value < start || value > end) { throw new IllegalArgumentException(StringUtils.simpleFormat(DEFAULT_INCLUSIVE...
[ "@", "SuppressWarnings", "(", "\"boxing\"", ")", "public", "static", "void", "inclusiveBetween", "(", "final", "double", "start", ",", "final", "double", "end", ",", "final", "double", "value", ")", "{", "// TODO when breaking BC, consider returning value", "if", "(...
Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception. <pre>Validate.inclusiveBetween(0.1, 2.1, 1.1);</pre> @param start the inclusive start value @param end the inclusive end value @param value the value to validate @throws IllegalArgumentExcep...
[ "Validate", "that", "the", "specified", "primitive", "value", "falls", "between", "the", "two", "inclusive", "values", "specified", ";", "otherwise", "throws", "an", "exception", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L1078-L1084
leancloud/java-sdk-all
core/src/main/java/cn/leancloud/AVQuery.java
AVQuery.whereMatchesKeyInQuery
public AVQuery<T> whereMatchesKeyInQuery(String key, String keyInQuery, AVQuery<?> query) { """ Add a constraint to the query that requires a particular key's value matches a value for a key in the results of another AVQuery @param key The key whose value is being checked @param keyInQuery The key in the obje...
java
public AVQuery<T> whereMatchesKeyInQuery(String key, String keyInQuery, AVQuery<?> query) { Map<String, Object> inner = new HashMap<String, Object>(); inner.put("className", query.getClassName()); inner.put("where", query.conditions.compileWhereOperationMap()); if (query.conditions.getSkip() > 0) inner....
[ "public", "AVQuery", "<", "T", ">", "whereMatchesKeyInQuery", "(", "String", "key", ",", "String", "keyInQuery", ",", "AVQuery", "<", "?", ">", "query", ")", "{", "Map", "<", "String", ",", "Object", ">", "inner", "=", "new", "HashMap", "<", "String", ...
Add a constraint to the query that requires a particular key's value matches a value for a key in the results of another AVQuery @param key The key whose value is being checked @param keyInQuery The key in the objects from the sub query to look in @param query The sub query to run @return Returns the query so you can ...
[ "Add", "a", "constraint", "to", "the", "query", "that", "requires", "a", "particular", "key", "s", "value", "matches", "a", "value", "for", "a", "key", "in", "the", "results", "of", "another", "AVQuery" ]
train
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/core/src/main/java/cn/leancloud/AVQuery.java#L737-L749
virgo47/javasimon
core/src/main/java/org/javasimon/utils/SimonUtils.java
SimonUtils.doWithStopwatch
public static void doWithStopwatch(String name, Runnable runnable) { """ Calls a block of code with stopwatch around, can not return any result or throw an exception (use {@link #doWithStopwatch(String, java.util.concurrent.Callable)} instead). @param name name of the Stopwatch @param runnable wrapped block o...
java
public static void doWithStopwatch(String name, Runnable runnable) { try (Split split = SimonManager.getStopwatch(name).start()) { runnable.run(); } }
[ "public", "static", "void", "doWithStopwatch", "(", "String", "name", ",", "Runnable", "runnable", ")", "{", "try", "(", "Split", "split", "=", "SimonManager", ".", "getStopwatch", "(", "name", ")", ".", "start", "(", ")", ")", "{", "runnable", ".", "run...
Calls a block of code with stopwatch around, can not return any result or throw an exception (use {@link #doWithStopwatch(String, java.util.concurrent.Callable)} instead). @param name name of the Stopwatch @param runnable wrapped block of code @since 3.0
[ "Calls", "a", "block", "of", "code", "with", "stopwatch", "around", "can", "not", "return", "any", "result", "or", "throw", "an", "exception", "(", "use", "{", "@link", "#doWithStopwatch", "(", "String", "java", ".", "util", ".", "concurrent", ".", "Callab...
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/utils/SimonUtils.java#L358-L362
jcuda/jcuda
JCudaJava/src/main/java/jcuda/runtime/JCuda.java
JCuda.cudaMemcpyFromArray
public static int cudaMemcpyFromArray(Pointer dst, cudaArray src, long wOffset, long hOffset, long count, int cudaMemcpyKind_kind) { """ Copies data between host and device. <pre> cudaError_t cudaMemcpyFromArray ( void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyK...
java
public static int cudaMemcpyFromArray(Pointer dst, cudaArray src, long wOffset, long hOffset, long count, int cudaMemcpyKind_kind) { return checkResult(cudaMemcpyFromArrayNative(dst, src, wOffset, hOffset, count, cudaMemcpyKind_kind)); }
[ "public", "static", "int", "cudaMemcpyFromArray", "(", "Pointer", "dst", ",", "cudaArray", "src", ",", "long", "wOffset", ",", "long", "hOffset", ",", "long", "count", ",", "int", "cudaMemcpyKind_kind", ")", "{", "return", "checkResult", "(", "cudaMemcpyFromArra...
Copies data between host and device. <pre> cudaError_t cudaMemcpyFromArray ( void* dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, cudaMemcpyKind kind ) </pre> <div> <p>Copies data between host and device. Copies <tt>count</tt> bytes from the CUDA array <tt>src</tt> starting at the upper left...
[ "Copies", "data", "between", "host", "and", "device", "." ]
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L4820-L4823
belaban/JGroups
src/org/jgroups/fork/ForkChannel.java
ForkChannel.disconnect
@Override public ForkChannel disconnect() { """ Removes the fork-channel from the fork-stack's hashmap and resets its state. Does <em>not</em> affect the main-channel """ if(state != State.CONNECTED) return this; prot_stack.down(new Event(Event.DISCONNECT, local_addr)); // will...
java
@Override public ForkChannel disconnect() { if(state != State.CONNECTED) return this; prot_stack.down(new Event(Event.DISCONNECT, local_addr)); // will be discarded by ForkProtocol prot_stack.stopStack(cluster_name); ((ForkProtocolStack)prot_stack).remove(fork_channel_id)...
[ "@", "Override", "public", "ForkChannel", "disconnect", "(", ")", "{", "if", "(", "state", "!=", "State", ".", "CONNECTED", ")", "return", "this", ";", "prot_stack", ".", "down", "(", "new", "Event", "(", "Event", ".", "DISCONNECT", ",", "local_addr", ")...
Removes the fork-channel from the fork-stack's hashmap and resets its state. Does <em>not</em> affect the main-channel
[ "Removes", "the", "fork", "-", "channel", "from", "the", "fork", "-", "stack", "s", "hashmap", "and", "resets", "its", "state", ".", "Does", "<em", ">", "not<", "/", "em", ">", "affect", "the", "main", "-", "channel" ]
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/fork/ForkChannel.java#L180-L191
orhanobut/mockwebserverplus
mockwebserverplus/src/main/java/com/orhanobut/mockwebserverplus/Fixture.java
Fixture.parseFrom
public static Fixture parseFrom(String fileName, Parser parser) { """ Parse the given filename and returns the Fixture object. @param fileName filename should not contain extension or relative path. ie: login @param parser parser is required for parsing operation, it should not be null """ if (fileNa...
java
public static Fixture parseFrom(String fileName, Parser parser) { if (fileName == null) { throw new NullPointerException("File name should not be null"); } String path = "fixtures/" + fileName + ".yaml"; InputStream inputStream = openPathAsStream(path); Fixture result = parser.parse(inputStrea...
[ "public", "static", "Fixture", "parseFrom", "(", "String", "fileName", ",", "Parser", "parser", ")", "{", "if", "(", "fileName", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"File name should not be null\"", ")", ";", "}", "String", "...
Parse the given filename and returns the Fixture object. @param fileName filename should not contain extension or relative path. ie: login @param parser parser is required for parsing operation, it should not be null
[ "Parse", "the", "given", "filename", "and", "returns", "the", "Fixture", "object", "." ]
train
https://github.com/orhanobut/mockwebserverplus/blob/bb2c5cb4eece98745688ec562486b6bfc5d1b6c7/mockwebserverplus/src/main/java/com/orhanobut/mockwebserverplus/Fixture.java#L38-L55
Jasig/uPortal
uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java
GroupService.ifindLockableGroup
private ILockableEntityGroup ifindLockableGroup(String key, String lockOwner) throws GroupsException { """ Returns a pre-existing <code>ILockableEntityGroup</code> or null if the group is not found. @param key String - the group key. @param lockOwner String - typically the user. @return org.apereo...
java
private ILockableEntityGroup ifindLockableGroup(String key, String lockOwner) throws GroupsException { return compositeGroupService.findGroupWithLock(key, lockOwner); }
[ "private", "ILockableEntityGroup", "ifindLockableGroup", "(", "String", "key", ",", "String", "lockOwner", ")", "throws", "GroupsException", "{", "return", "compositeGroupService", ".", "findGroupWithLock", "(", "key", ",", "lockOwner", ")", ";", "}" ]
Returns a pre-existing <code>ILockableEntityGroup</code> or null if the group is not found. @param key String - the group key. @param lockOwner String - typically the user. @return org.apereo.portal.groups.ILockableEntityGroup
[ "Returns", "a", "pre", "-", "existing", "<code", ">", "ILockableEntityGroup<", "/", "code", ">", "or", "null", "if", "the", "group", "is", "not", "found", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/services/GroupService.java#L239-L242
apereo/cas
core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java
AbstractCasView.getErrorCodeFrom
protected String getErrorCodeFrom(final Map<String, Object> model) { """ Gets error code from. @param model the model @return the error code from """ return model.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_ERROR_CODE).toString(); }
java
protected String getErrorCodeFrom(final Map<String, Object> model) { return model.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_ERROR_CODE).toString(); }
[ "protected", "String", "getErrorCodeFrom", "(", "final", "Map", "<", "String", ",", "Object", ">", "model", ")", "{", "return", "model", ".", "get", "(", "CasViewConstants", ".", "MODEL_ATTRIBUTE_NAME_ERROR_CODE", ")", ".", "toString", "(", ")", ";", "}" ]
Gets error code from. @param model the model @return the error code from
[ "Gets", "error", "code", "from", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java#L86-L88
interedition/collatex
collatex-core/src/main/java/eu/interedition/collatex/suffixarray/Skew.java
Skew.radixPass
private static void radixPass(int[] src, int[] dst, int[] v, int vi, final int n, final int K, int start, int[] cnt) { """ Stably sort indexes from src[0..n-1] to dst[0..n-1] with values in 0..K from v. A constant offset of <code>vi</code> is added to indexes from src. """ ...
java
private static void radixPass(int[] src, int[] dst, int[] v, int vi, final int n, final int K, int start, int[] cnt) { // check counter array's size. assert cnt.length >= K + 1; Arrays.fill(cnt, 0, K + 1, 0); // count occurrences for (int i = 0;...
[ "private", "static", "void", "radixPass", "(", "int", "[", "]", "src", ",", "int", "[", "]", "dst", ",", "int", "[", "]", "v", ",", "int", "vi", ",", "final", "int", "n", ",", "final", "int", "K", ",", "int", "start", ",", "int", "[", "]", "c...
Stably sort indexes from src[0..n-1] to dst[0..n-1] with values in 0..K from v. A constant offset of <code>vi</code> is added to indexes from src.
[ "Stably", "sort", "indexes", "from", "src", "[", "0", "..", "n", "-", "1", "]", "to", "dst", "[", "0", "..", "n", "-", "1", "]", "with", "values", "in", "0", "..", "K", "from", "v", ".", "A", "constant", "offset", "of", "<code", ">", "vi<", "...
train
https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/suffixarray/Skew.java#L41-L61