repository_name
stringlengths
7
54
func_path_in_repository
stringlengths
18
218
func_name
stringlengths
5
140
whole_func_string
stringlengths
79
3.99k
language
stringclasses
1 value
func_code_string
stringlengths
79
3.99k
func_code_tokens
listlengths
20
624
func_documentation_string
stringlengths
61
1.96k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
107
339
amaembo/streamex
src/main/java/one/util/streamex/StreamEx.java
StreamEx.partitioningTo
public <C extends Collection<T>> Map<Boolean, C> partitioningTo(Predicate<? super T> predicate, Supplier<C> collectionFactory) { return collect(Collectors.partitioningBy(predicate, Collectors.toCollection(collectionFactory))); }
java
public <C extends Collection<T>> Map<Boolean, C> partitioningTo(Predicate<? super T> predicate, Supplier<C> collectionFactory) { return collect(Collectors.partitioningBy(predicate, Collectors.toCollection(collectionFactory))); }
[ "public", "<", "C", "extends", "Collection", "<", "T", ">", ">", "Map", "<", "Boolean", ",", "C", ">", "partitioningTo", "(", "Predicate", "<", "?", "super", "T", ">", "predicate", ",", "Supplier", "<", "C", ">", "collectionFactory", ")", "{", "return"...
Returns a {@code Map<Boolean, C>} which contains two partitions of the input elements according to a {@code Predicate}. <p> This is a <a href="package-summary.html#StreamOps">terminal</a> operation. <p> There are no guarantees on the type, mutability, serializability, or thread-safety of the {@code Map} returned. @p...
[ "Returns", "a", "{", "@code", "Map<Boolean", "C", ">", "}", "which", "contains", "two", "partitions", "of", "the", "input", "elements", "according", "to", "a", "{", "@code", "Predicate", "}", "." ]
train
https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L730-L733
samskivert/samskivert
src/main/java/com/samskivert/swing/util/SwingUtil.java
SwingUtil.createImageCursor
public static Cursor createImageCursor (Image img, Point hotspot) { Toolkit tk = Toolkit.getDefaultToolkit(); // for now, just report the cursor restrictions, then blindly create int w = img.getWidth(null); int h = img.getHeight(null); Dimension d = tk.getBestCursorSize(w, h...
java
public static Cursor createImageCursor (Image img, Point hotspot) { Toolkit tk = Toolkit.getDefaultToolkit(); // for now, just report the cursor restrictions, then blindly create int w = img.getWidth(null); int h = img.getHeight(null); Dimension d = tk.getBestCursorSize(w, h...
[ "public", "static", "Cursor", "createImageCursor", "(", "Image", "img", ",", "Point", "hotspot", ")", "{", "Toolkit", "tk", "=", "Toolkit", ".", "getDefaultToolkit", "(", ")", ";", "// for now, just report the cursor restrictions, then blindly create", "int", "w", "="...
Create a custom cursor out of the specified image, with the specified hotspot.
[ "Create", "a", "custom", "cursor", "out", "of", "the", "specified", "image", "with", "the", "specified", "hotspot", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L508-L549
alkacon/opencms-core
src/org/opencms/jsp/search/controller/CmsSearchControllerFacetField.java
CmsSearchControllerFacetField.appendFacetOption
protected void appendFacetOption(StringBuffer query, final String name, final String value) { query.append(" facet.").append(name).append("=").append(value); }
java
protected void appendFacetOption(StringBuffer query, final String name, final String value) { query.append(" facet.").append(name).append("=").append(value); }
[ "protected", "void", "appendFacetOption", "(", "StringBuffer", "query", ",", "final", "String", "name", ",", "final", "String", "value", ")", "{", "query", ".", "append", "(", "\" facet.\"", ")", ".", "append", "(", "name", ")", ".", "append", "(", "\"=\""...
Appends the query part for the facet to the query string. @param query The current query string. @param name The name of the facet parameter, e.g. "limit", "order", .... @param value The value to set for the parameter specified by name.
[ "Appends", "the", "query", "part", "for", "the", "facet", "to", "the", "query", "string", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/controller/CmsSearchControllerFacetField.java#L204-L207
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WColumnLayout.java
WColumnLayout.setRightColumn
public void setRightColumn(final String heading, final WComponent content) { setRightColumn(new WHeading(WHeading.MINOR, heading), content); }
java
public void setRightColumn(final String heading, final WComponent content) { setRightColumn(new WHeading(WHeading.MINOR, heading), content); }
[ "public", "void", "setRightColumn", "(", "final", "String", "heading", ",", "final", "WComponent", "content", ")", "{", "setRightColumn", "(", "new", "WHeading", "(", "WHeading", ".", "MINOR", ",", "heading", ")", ",", "content", ")", ";", "}" ]
Sets the right column content. @param heading the column heading text. @param content the content.
[ "Sets", "the", "right", "column", "content", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WColumnLayout.java#L111-L113
apache/groovy
src/main/groovy/groovy/lang/MetaClassImpl.java
MetaClassImpl.setAttribute
public void setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass) { checkInitalised(); boolean isStatic = theClass != Class.class && object instanceof Class; if (isStatic && object != theClass) { MetaClass mc = regist...
java
public void setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass) { checkInitalised(); boolean isStatic = theClass != Class.class && object instanceof Class; if (isStatic && object != theClass) { MetaClass mc = regist...
[ "public", "void", "setAttribute", "(", "Class", "sender", ",", "Object", "object", ",", "String", "attribute", ",", "Object", "newValue", ",", "boolean", "useSuper", ",", "boolean", "fromInsideClass", ")", "{", "checkInitalised", "(", ")", ";", "boolean", "isS...
<p>Sets an attribute on the given receiver for the specified arguments. The sender is the class that is setting the attribute from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided. <p>The isCallToSuper and fromInsideClass help the Groovy runtime perform ...
[ "<p", ">", "Sets", "an", "attribute", "on", "the", "given", "receiver", "for", "the", "specified", "arguments", ".", "The", "sender", "is", "the", "class", "that", "is", "setting", "the", "attribute", "from", "the", "object", ".", "The", "MetaClass", "will...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaClassImpl.java#L2953-L2977
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/obl/StateSet.java
StateSet.checkCircularity
private void checkCircularity(State state, Obligation obligation, int basicBlockId) throws ObligationAcquiredOrReleasedInLoopException { if (state.getPath().hasComponent(basicBlockId)) { throw new ObligationAcquiredOrReleasedInLoopException(obligation); } }
java
private void checkCircularity(State state, Obligation obligation, int basicBlockId) throws ObligationAcquiredOrReleasedInLoopException { if (state.getPath().hasComponent(basicBlockId)) { throw new ObligationAcquiredOrReleasedInLoopException(obligation); } }
[ "private", "void", "checkCircularity", "(", "State", "state", ",", "Obligation", "obligation", ",", "int", "basicBlockId", ")", "throws", "ObligationAcquiredOrReleasedInLoopException", "{", "if", "(", "state", ".", "getPath", "(", ")", ".", "hasComponent", "(", "b...
Bail out of the analysis is an obligation is acquired or released in a loop. @param state a State to which an obligation is being added or removed @param obligation the Obligation being added or removed @param basicBlockId the id of the BasicBlock adding or removing the obligation
[ "Bail", "out", "of", "the", "analysis", "is", "an", "obligation", "is", "acquired", "or", "released", "in", "a", "loop", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/obl/StateSet.java#L242-L247
alkacon/opencms-core
src/org/opencms/json/JSONML.java
JSONML.stringify
private static void stringify(JSONArray ja, StringBuffer b) throws JSONException { int i; JSONObject jo; String k; Iterator<String> keys; int len; Object o; Object v; // Emit <tagName> b.append('<'); b.append(ja.get(0)); o = ja.o...
java
private static void stringify(JSONArray ja, StringBuffer b) throws JSONException { int i; JSONObject jo; String k; Iterator<String> keys; int len; Object o; Object v; // Emit <tagName> b.append('<'); b.append(ja.get(0)); o = ja.o...
[ "private", "static", "void", "stringify", "(", "JSONArray", "ja", ",", "StringBuffer", "b", ")", "throws", "JSONException", "{", "int", "i", ";", "JSONObject", "jo", ";", "String", "k", ";", "Iterator", "<", "String", ">", "keys", ";", "int", "len", ";",...
Reverse the JSONML transformation, making an XML text from a JSONArray.<p> @param ja a JSONArray @param b a string buffer in which to build the text @throws JSONException if something goes wrong
[ "Reverse", "the", "JSONML", "transformation", "making", "an", "XML", "text", "from", "a", "JSONArray", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/json/JSONML.java#L288-L341
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java
RunbookDraftsInner.get
public RunbookDraftInner get(String resourceGroupName, String automationAccountName, String runbookName) { return getWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName).toBlocking().single().body(); }
java
public RunbookDraftInner get(String resourceGroupName, String automationAccountName, String runbookName) { return getWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName).toBlocking().single().body(); }
[ "public", "RunbookDraftInner", "get", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "runbookName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "automationAccountName", ",", "runbookName", "...
Retrieve the runbook draft identified by runbook name. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param runbookName The runbook name. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorResponseException...
[ "Retrieve", "the", "runbook", "draft", "identified", "by", "runbook", "name", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java#L373-L375
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.scanClassPath
public static Set<String> scanClassPath(final String classPath, final Set<String> excludeJarSet, final Set<String> excludePrefixes, final Set<String> includePrefixes) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.process...
java
public static Set<String> scanClassPath(final String classPath, final Set<String> excludeJarSet, final Set<String> excludePrefixes, final Set<String> includePrefixes) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.process...
[ "public", "static", "Set", "<", "String", ">", "scanClassPath", "(", "final", "String", "classPath", ",", "final", "Set", "<", "String", ">", "excludeJarSet", ",", "final", "Set", "<", "String", ">", "excludePrefixes", ",", "final", "Set", "<", "String", "...
Scan the classpath string provided, and collect a set of package paths found in jars and classes on the path. On the resulting path set, first exclude those that match any exclude prefixes, and then include those that match a set of include prefixes. @param classPath the classpath string @param excludeJarSet a set of ...
[ "Scan", "the", "classpath", "string", "provided", "and", "collect", "a", "set", "of", "package", "paths", "found", "in", "jars", "and", "classes", "on", "the", "path", ".", "On", "the", "resulting", "path", "set", "first", "exclude", "those", "that", "matc...
train
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L199-L205
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/cql3/CqlRecordReader.java
CqlRecordReader.next
public boolean next(Long key, Row value) throws IOException { if (nextKeyValue()) { ((WrappedRow)value).setRow(getCurrentValue()); return true; } return false; }
java
public boolean next(Long key, Row value) throws IOException { if (nextKeyValue()) { ((WrappedRow)value).setRow(getCurrentValue()); return true; } return false; }
[ "public", "boolean", "next", "(", "Long", "key", ",", "Row", "value", ")", "throws", "IOException", "{", "if", "(", "nextKeyValue", "(", ")", ")", "{", "(", "(", "WrappedRow", ")", "value", ")", ".", "setRow", "(", "getCurrentValue", "(", ")", ")", "...
and ColumnFamilyRecordReader don't support them, it should be fine for now.
[ "and", "ColumnFamilyRecordReader", "don", "t", "support", "them", "it", "should", "be", "fine", "for", "now", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/cql3/CqlRecordReader.java#L210-L218
pippo-java/pippo
pippo-controller-parent/pippo-controller/src/main/java/ro/pippo/controller/ControllerRegistry.java
ControllerRegistry.registerControllerMethods
private void registerControllerMethods(Map<Method, Class<? extends Annotation>> controllerMethods, Controller controller) { List<Route> controllerRoutes = createControllerRoutes(controllerMethods); for (Route controllerRoute : controllerRoutes) { if (controller != null) { ((C...
java
private void registerControllerMethods(Map<Method, Class<? extends Annotation>> controllerMethods, Controller controller) { List<Route> controllerRoutes = createControllerRoutes(controllerMethods); for (Route controllerRoute : controllerRoutes) { if (controller != null) { ((C...
[ "private", "void", "registerControllerMethods", "(", "Map", "<", "Method", ",", "Class", "<", "?", "extends", "Annotation", ">", ">", "controllerMethods", ",", "Controller", "controller", ")", "{", "List", "<", "Route", ">", "controllerRoutes", "=", "createContr...
Register the controller methods as routes. @param controllerMethods @param controller
[ "Register", "the", "controller", "methods", "as", "routes", "." ]
train
https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-controller-parent/pippo-controller/src/main/java/ro/pippo/controller/ControllerRegistry.java#L162-L172
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java
JobsImpl.deleteAsync
public Observable<Void> deleteAsync(String jobId, JobDeleteOptions jobDeleteOptions) { return deleteWithServiceResponseAsync(jobId, jobDeleteOptions).map(new Func1<ServiceResponseWithHeaders<Void, JobDeleteHeaders>, Void>() { @Override public Void call(ServiceResponseWithHeaders<Void, Jo...
java
public Observable<Void> deleteAsync(String jobId, JobDeleteOptions jobDeleteOptions) { return deleteWithServiceResponseAsync(jobId, jobDeleteOptions).map(new Func1<ServiceResponseWithHeaders<Void, JobDeleteHeaders>, Void>() { @Override public Void call(ServiceResponseWithHeaders<Void, Jo...
[ "public", "Observable", "<", "Void", ">", "deleteAsync", "(", "String", "jobId", ",", "JobDeleteOptions", "jobDeleteOptions", ")", "{", "return", "deleteWithServiceResponseAsync", "(", "jobId", ",", "jobDeleteOptions", ")", ".", "map", "(", "new", "Func1", "<", ...
Deletes a job. Deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes, the Batch services deletes those tasks' working directories and all their contents...
[ "Deletes", "a", "job", ".", "Deleting", "a", "job", "also", "deletes", "all", "tasks", "that", "are", "part", "of", "that", "job", "and", "all", "job", "statistics", ".", "This", "also", "overrides", "the", "retention", "period", "for", "task", "data", "...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L488-L495
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunctionFactory.java
DifferentialFunctionFactory.matchConditionCount
public SDVariable matchConditionCount(SDVariable in, Condition condition, boolean keepDims, int... dimensions) { return new MatchCondition(sameDiff(), in, condition, keepDims, dimensions).outputVariable(); }
java
public SDVariable matchConditionCount(SDVariable in, Condition condition, boolean keepDims, int... dimensions) { return new MatchCondition(sameDiff(), in, condition, keepDims, dimensions).outputVariable(); }
[ "public", "SDVariable", "matchConditionCount", "(", "SDVariable", "in", ",", "Condition", "condition", ",", "boolean", "keepDims", ",", "int", "...", "dimensions", ")", "{", "return", "new", "MatchCondition", "(", "sameDiff", "(", ")", ",", "in", ",", "conditi...
Returns a count of the number of elements that satisfy the condition @param in Input @param condition Condition @return Number of elements that the condition is satisfied for
[ "Returns", "a", "count", "of", "the", "number", "of", "elements", "that", "satisfy", "the", "condition" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunctionFactory.java#L712-L714
apache/groovy
src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
StaticTypeCheckingVisitor.checkForTargetType
private ClassNode checkForTargetType(final Expression expr, final ClassNode type) { BinaryExpression enclosingBinaryExpression = typeCheckingContext.getEnclosingBinaryExpression(); if (enclosingBinaryExpression instanceof DeclarationExpression && isEmptyCollection(expr) && isAssignment(e...
java
private ClassNode checkForTargetType(final Expression expr, final ClassNode type) { BinaryExpression enclosingBinaryExpression = typeCheckingContext.getEnclosingBinaryExpression(); if (enclosingBinaryExpression instanceof DeclarationExpression && isEmptyCollection(expr) && isAssignment(e...
[ "private", "ClassNode", "checkForTargetType", "(", "final", "Expression", "expr", ",", "final", "ClassNode", "type", ")", "{", "BinaryExpression", "enclosingBinaryExpression", "=", "typeCheckingContext", ".", "getEnclosingBinaryExpression", "(", ")", ";", "if", "(", "...
/ it seems attractive to want to do this for more cases but perhaps not all cases
[ "/", "it", "seems", "attractive", "to", "want", "to", "do", "this", "for", "more", "cases", "but", "perhaps", "not", "all", "cases" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L4227-L4245
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java
ZoneOperationId.of
public static ZoneOperationId of(String project, String zone, String operation) { return new ZoneOperationId(project, zone, operation); }
java
public static ZoneOperationId of(String project, String zone, String operation) { return new ZoneOperationId(project, zone, operation); }
[ "public", "static", "ZoneOperationId", "of", "(", "String", "project", ",", "String", "zone", ",", "String", "operation", ")", "{", "return", "new", "ZoneOperationId", "(", "project", ",", "zone", ",", "operation", ")", ";", "}" ]
Returns a zone operation identity given project, zone and operation names.
[ "Returns", "a", "zone", "operation", "identity", "given", "project", "zone", "and", "operation", "names", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java#L101-L103
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/decomposition/hessenberg/TridiagonalDecompositionHouseholder_DDRM.java
TridiagonalDecompositionHouseholder_DDRM.similarTransform
private void similarTransform( int k) { double t[] = QT.data; // find the largest value in this column // this is used to normalize the column and mitigate overflow/underflow double max = 0; int rowU = (k-1)*N; for( int i = k; i < N; i++ ) { double val = Ma...
java
private void similarTransform( int k) { double t[] = QT.data; // find the largest value in this column // this is used to normalize the column and mitigate overflow/underflow double max = 0; int rowU = (k-1)*N; for( int i = k; i < N; i++ ) { double val = Ma...
[ "private", "void", "similarTransform", "(", "int", "k", ")", "{", "double", "t", "[", "]", "=", "QT", ".", "data", ";", "// find the largest value in this column", "// this is used to normalize the column and mitigate overflow/underflow", "double", "max", "=", "0", ";",...
Computes and performs the similar a transform for submatrix k.
[ "Computes", "and", "performs", "the", "similar", "a", "transform", "for", "submatrix", "k", "." ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/hessenberg/TridiagonalDecompositionHouseholder_DDRM.java#L171-L208
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.bindInterface
private <T> void bindInterface(NameSpaceBinder<T> binder, HomeRecord hr, HomeWrapperSet homeSet, int numInterfaces, boolean singleGlobalInterface, ...
java
private <T> void bindInterface(NameSpaceBinder<T> binder, HomeRecord hr, HomeWrapperSet homeSet, int numInterfaces, boolean singleGlobalInterface, ...
[ "private", "<", "T", ">", "void", "bindInterface", "(", "NameSpaceBinder", "<", "T", ">", "binder", ",", "HomeRecord", "hr", ",", "HomeWrapperSet", "homeSet", ",", "int", "numInterfaces", ",", "boolean", "singleGlobalInterface", ",", "String", "interfaceName", "...
Bind a single interface to all binding locations. @param binder the namespace binder @param hr the bean home record @param homeSet the remote and local home wrappers, or <tt>null</tt> if deferred initialization bindings should be used @pram numInterfaces the number of remote or local interfaces @param singleGlobalInte...
[ "Bind", "a", "single", "interface", "to", "all", "binding", "locations", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L975-L1011
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java
Calc.scaleAdd
public static Atom scaleAdd(double s, Atom x, Atom b){ double xc = s*x.getX() + b.getX(); double yc = s*x.getY() + b.getY(); double zc = s*x.getZ() + b.getZ(); //Atom a = new AtomImpl(); b.setX(xc); b.setY(yc); b.setZ(zc); return b; }
java
public static Atom scaleAdd(double s, Atom x, Atom b){ double xc = s*x.getX() + b.getX(); double yc = s*x.getY() + b.getY(); double zc = s*x.getZ() + b.getZ(); //Atom a = new AtomImpl(); b.setX(xc); b.setY(yc); b.setZ(zc); return b; }
[ "public", "static", "Atom", "scaleAdd", "(", "double", "s", ",", "Atom", "x", ",", "Atom", "b", ")", "{", "double", "xc", "=", "s", "*", "x", ".", "getX", "(", ")", "+", "b", ".", "getX", "(", ")", ";", "double", "yc", "=", "s", "*", "x", "...
Perform linear transformation s*X+B, and store the result in b @param s Amount to scale x @param x Input coordinate @param b Vector to translate (will be modified) @return b, after modification
[ "Perform", "linear", "transformation", "s", "*", "X", "+", "B", "and", "store", "the", "result", "in", "b" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L878-L890
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java
CommercePriceEntryPersistenceImpl.findByCPInstanceUuid
@Override public List<CommercePriceEntry> findByCPInstanceUuid( String CPInstanceUuid, int start, int end) { return findByCPInstanceUuid(CPInstanceUuid, start, end, null); }
java
@Override public List<CommercePriceEntry> findByCPInstanceUuid( String CPInstanceUuid, int start, int end) { return findByCPInstanceUuid(CPInstanceUuid, start, end, null); }
[ "@", "Override", "public", "List", "<", "CommercePriceEntry", ">", "findByCPInstanceUuid", "(", "String", "CPInstanceUuid", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCPInstanceUuid", "(", "CPInstanceUuid", ",", "start", ",", "end", ",", ...
Returns a range of all the commerce price entries where CPInstanceUuid = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result ...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "price", "entries", "where", "CPInstanceUuid", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java#L3085-L3089
52inc/android-52Kit
library/src/main/java/com/ftinc/kit/util/IntentUtils.java
IntentUtils.isIntentAvailable
public static boolean isIntentAvailable(Context context, Intent intent) { PackageManager packageManager = context.getPackageManager(); List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); return list.size() > 0; }
java
public static boolean isIntentAvailable(Context context, Intent intent) { PackageManager packageManager = context.getPackageManager(); List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); return list.size() > 0; }
[ "public", "static", "boolean", "isIntentAvailable", "(", "Context", "context", ",", "Intent", "intent", ")", "{", "PackageManager", "packageManager", "=", "context", ".", "getPackageManager", "(", ")", ";", "List", "<", "ResolveInfo", ">", "list", "=", "packageM...
Check that in the system exists application which can handle this intent @param context Application context @param intent Checked intent @return true if intent consumer exists, false otherwise
[ "Check", "that", "in", "the", "system", "exists", "application", "which", "can", "handle", "this", "intent" ]
train
https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/IntentUtils.java#L493-L497
groundupworks/wings
wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookEndpoint.java
FacebookEndpoint.requestAlbums
boolean requestAlbums(String id, Callback callback) { boolean isSuccessful = false; Session session = Session.getActiveSession(); if (session != null && session.isOpened()) { // Construct fields to request. Bundle params = new Bundle(); params.putString(ALBUM...
java
boolean requestAlbums(String id, Callback callback) { boolean isSuccessful = false; Session session = Session.getActiveSession(); if (session != null && session.isOpened()) { // Construct fields to request. Bundle params = new Bundle(); params.putString(ALBUM...
[ "boolean", "requestAlbums", "(", "String", "id", ",", "Callback", "callback", ")", "{", "boolean", "isSuccessful", "=", "false", ";", "Session", "session", "=", "Session", ".", "getActiveSession", "(", ")", ";", "if", "(", "session", "!=", "null", "&&", "s...
Asynchronously requests the albums associated with the linked account. Requires an opened active {@link Session}. @param id may be {@link #ME} or a Page id. @param callback a {@link Callback} when the request completes. @return true if the request is made; false if no opened {@link Session} is active.
[ "Asynchronously", "requests", "the", "albums", "associated", "with", "the", "linked", "account", ".", "Requires", "an", "opened", "active", "{", "@link", "Session", "}", "." ]
train
https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookEndpoint.java#L700-L717
exoplatform/jcr
exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java
UserProfileHandlerImpl.writeProfile
private void writeProfile(UserProfile userProfile, Node profileNode) throws RepositoryException { for (Entry<String, String> attribute : userProfile.getUserInfoMap().entrySet()) { profileNode.setProperty(ATTRIBUTE_PREFIX + attribute.getKey(), attribute.getValue()); } }
java
private void writeProfile(UserProfile userProfile, Node profileNode) throws RepositoryException { for (Entry<String, String> attribute : userProfile.getUserInfoMap().entrySet()) { profileNode.setProperty(ATTRIBUTE_PREFIX + attribute.getKey(), attribute.getValue()); } }
[ "private", "void", "writeProfile", "(", "UserProfile", "userProfile", ",", "Node", "profileNode", ")", "throws", "RepositoryException", "{", "for", "(", "Entry", "<", "String", ",", "String", ">", "attribute", ":", "userProfile", ".", "getUserInfoMap", "(", ")",...
Write profile to storage. @param profileNode the node which stores profile attributes as properties with prefix {@link #ATTRIBUTE_PREFIX} @param userProfile the profile to store @throws RepositoryException if unexpected exception is occurred during writing
[ "Write", "profile", "to", "storage", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java#L365-L371
samskivert/samskivert
src/main/java/com/samskivert/util/StringUtil.java
StringUtil.parseLongArray
public static long[] parseLongArray (String source) { StringTokenizer tok = new StringTokenizer(source, ","); long[] vals = new long[tok.countTokens()]; for (int i = 0; tok.hasMoreTokens(); i++) { try { // trim the whitespace from the token vals[i]...
java
public static long[] parseLongArray (String source) { StringTokenizer tok = new StringTokenizer(source, ","); long[] vals = new long[tok.countTokens()]; for (int i = 0; tok.hasMoreTokens(); i++) { try { // trim the whitespace from the token vals[i]...
[ "public", "static", "long", "[", "]", "parseLongArray", "(", "String", "source", ")", "{", "StringTokenizer", "tok", "=", "new", "StringTokenizer", "(", "source", ",", "\",\"", ")", ";", "long", "[", "]", "vals", "=", "new", "long", "[", "tok", ".", "c...
Parses an array of longs from it's string representation. The array should be represented as a bare list of numbers separated by commas, for example: <pre>25, 17125141422, 21, 99</pre> Any inability to parse the long array will result in the function returning null.
[ "Parses", "an", "array", "of", "longs", "from", "it", "s", "string", "representation", ".", "The", "array", "should", "be", "represented", "as", "a", "bare", "list", "of", "numbers", "separated", "by", "commas", "for", "example", ":" ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L821-L834
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/stores/PEMKeyStore.java
PEMKeyStore.engineGetKey
@Override public Key engineGetKey(String s, char[] chars) throws NoSuchAlgorithmException, UnrecoverableKeyException { CredentialWrapper credential = getKeyEntry(s); Key key = null; if (credential != null) { try { String password = null; if (chars != null) { password = new String(chars); ...
java
@Override public Key engineGetKey(String s, char[] chars) throws NoSuchAlgorithmException, UnrecoverableKeyException { CredentialWrapper credential = getKeyEntry(s); Key key = null; if (credential != null) { try { String password = null; if (chars != null) { password = new String(chars); ...
[ "@", "Override", "public", "Key", "engineGetKey", "(", "String", "s", ",", "char", "[", "]", "chars", ")", "throws", "NoSuchAlgorithmException", ",", "UnrecoverableKeyException", "{", "CredentialWrapper", "credential", "=", "getKeyEntry", "(", "s", ")", ";", "Ke...
Get the key referenced by the specified alias. @param s The key's alias. @param chars The key's password. @return The key reference by the alias or null. @throws NoSuchAlgorithmException If the key is encoded with an invalid algorithm. @throws UnrecoverableKeyException If the key can not be retrieved.
[ "Get", "the", "key", "referenced", "by", "the", "specified", "alias", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/stores/PEMKeyStore.java#L139-L159
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java
Long.getLong
public static Long getLong(String nm, Long val) { String v = null; try { v = System.getProperty(nm); } catch (IllegalArgumentException | NullPointerException e) { } if (v != null) { try { return Long.decode(v); } catch (NumberFo...
java
public static Long getLong(String nm, Long val) { String v = null; try { v = System.getProperty(nm); } catch (IllegalArgumentException | NullPointerException e) { } if (v != null) { try { return Long.decode(v); } catch (NumberFo...
[ "public", "static", "Long", "getLong", "(", "String", "nm", ",", "Long", "val", ")", "{", "String", "v", "=", "null", ";", "try", "{", "v", "=", "System", ".", "getProperty", "(", "nm", ")", ";", "}", "catch", "(", "IllegalArgumentException", "|", "N...
Returns the {@code long} value of the system property with the specified name. The first argument is treated as the name of a system property. System properties are accessible through the {@link java.lang.System#getProperty(java.lang.String)} method. The string value of this property is then interpreted as a {@code l...
[ "Returns", "the", "{", "@code", "long", "}", "value", "of", "the", "system", "property", "with", "the", "specified", "name", ".", "The", "first", "argument", "is", "treated", "as", "the", "name", "of", "a", "system", "property", ".", "System", "properties"...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java#L1053-L1066
integration-technology/amazon-mws-orders
src/main/java/com/amazonservices/mws/client/MwsUtl.java
MwsUtl.calculateStringToSignV2
static String calculateStringToSignV2(URI serviceUri, Map<String, String> parameters) { StringBuilder data = new StringBuilder(); data.append("POST"); data.append("\n"); data.append(serviceUri.getHost().toLowerCase()); if (!usesStandardPort(serviceUri)) { data.append(...
java
static String calculateStringToSignV2(URI serviceUri, Map<String, String> parameters) { StringBuilder data = new StringBuilder(); data.append("POST"); data.append("\n"); data.append(serviceUri.getHost().toLowerCase()); if (!usesStandardPort(serviceUri)) { data.append(...
[ "static", "String", "calculateStringToSignV2", "(", "URI", "serviceUri", ",", "Map", "<", "String", ",", "String", ">", "parameters", ")", "{", "StringBuilder", "data", "=", "new", "StringBuilder", "(", ")", ";", "data", ".", "append", "(", "\"POST\"", ")", ...
Calculate String to Sign for SignatureVersion 2 @param serviceUri @param parameters request parameters @return String to Sign
[ "Calculate", "String", "to", "Sign", "for", "SignatureVersion", "2" ]
train
https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/client/MwsUtl.java#L163-L191
OpenBEL/openbel-framework
org.openbel.framework.common/src/main/java/org/openbel/framework/common/record/Record.java
Record.readBuffer
public final T readBuffer(byte[] buffer) { if (buffer == null) { throw new InvalidArgument("buffer", buffer); } else if (buffer.length != recordSize) { final String fmt = "invalid buffer (%d bytes, expected %d)"; final String msg = format(fmt, buffer.length, recordSiz...
java
public final T readBuffer(byte[] buffer) { if (buffer == null) { throw new InvalidArgument("buffer", buffer); } else if (buffer.length != recordSize) { final String fmt = "invalid buffer (%d bytes, expected %d)"; final String msg = format(fmt, buffer.length, recordSiz...
[ "public", "final", "T", "readBuffer", "(", "byte", "[", "]", "buffer", ")", "{", "if", "(", "buffer", "==", "null", ")", "{", "throw", "new", "InvalidArgument", "(", "\"buffer\"", ",", "buffer", ")", ";", "}", "else", "if", "(", "buffer", ".", "lengt...
Reads {@code <T>} from a byte buffer. @param buffer {@code byte[]}; of size {@link #getRecordSize()} @return {@code <T>} @throws InvalidArgument Thrown if {@code buffer} is null or invalid
[ "Reads", "{", "@code", "<T", ">", "}", "from", "a", "byte", "buffer", "." ]
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/record/Record.java#L244-L253
kiegroup/drools
drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java
DroolsStreamUtils.streamIn
public static Object streamIn(InputStream in, ClassLoader classLoader) throws IOException, ClassNotFoundException { return streamIn(in, classLoader, false); }
java
public static Object streamIn(InputStream in, ClassLoader classLoader) throws IOException, ClassNotFoundException { return streamIn(in, classLoader, false); }
[ "public", "static", "Object", "streamIn", "(", "InputStream", "in", ",", "ClassLoader", "classLoader", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "return", "streamIn", "(", "in", ",", "classLoader", ",", "false", ")", ";", "}" ]
This method reads the contents from the given input stream and returns the object. It is expected that the contents in the given stream was not compressed, and it was written by the corresponding streamOut methods of this class. @param in @param classLoader @return @throws IOException @throws ClassNotFoundException
[ "This", "method", "reads", "the", "contents", "from", "the", "given", "input", "stream", "and", "returns", "the", "object", ".", "It", "is", "expected", "that", "the", "contents", "in", "the", "given", "stream", "was", "not", "compressed", "and", "it", "wa...
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java#L187-L190
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java
Expressions.asComparable
public static <T extends Comparable<?>> ComparableExpression<T> asComparable(Expression<T> expr) { Expression<T> underlyingMixin = ExpressionUtils.extract(expr); if (underlyingMixin instanceof PathImpl) { return new ComparablePath<T>((PathImpl<T>) underlyingMixin); } else if (underly...
java
public static <T extends Comparable<?>> ComparableExpression<T> asComparable(Expression<T> expr) { Expression<T> underlyingMixin = ExpressionUtils.extract(expr); if (underlyingMixin instanceof PathImpl) { return new ComparablePath<T>((PathImpl<T>) underlyingMixin); } else if (underly...
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", ">", ">", "ComparableExpression", "<", "T", ">", "asComparable", "(", "Expression", "<", "T", ">", "expr", ")", "{", "Expression", "<", "T", ">", "underlyingMixin", "=", "ExpressionUtils", "....
Create a new ComparableExpression @param expr Expression of type Comparable @return new ComparableExpression
[ "Create", "a", "new", "ComparableExpression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L1899-L1920
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/renderer/image/ImgHTMLRenderer.java
ImgHTMLRenderer.renderImage
@Override public void renderImage(String imgSource, Map<String, Object> attributes, final Writer writer) throws IOException { StringBuilder sb = new StringBuilder(tagStart); sb.append("src=\"").append(imgSource).append("\" "); for (Entry<String, Object> mapEntry : attributes.entrySet()) { sb.append(mapEntry.g...
java
@Override public void renderImage(String imgSource, Map<String, Object> attributes, final Writer writer) throws IOException { StringBuilder sb = new StringBuilder(tagStart); sb.append("src=\"").append(imgSource).append("\" "); for (Entry<String, Object> mapEntry : attributes.entrySet()) { sb.append(mapEntry.g...
[ "@", "Override", "public", "void", "renderImage", "(", "String", "imgSource", ",", "Map", "<", "String", ",", "Object", ">", "attributes", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", ...
Render the actual tag @param imgSource Source of the image @param attributes Attributes for the tag. @param writer Writer to render the HTML into. Will NOT be closed or flushed. @throws IOException if an exception occurs
[ "Render", "the", "actual", "tag" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/renderer/image/ImgHTMLRenderer.java#L72-L83
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java
PanelGridRenderer.generateContainerStart
protected void generateContainerStart(ResponseWriter writer, PanelGrid panelGrid, boolean idHasBeenRendered) throws IOException { writer.startElement("div", panelGrid); if (!idHasBeenRendered) { String clientId = panelGrid.getClientId(); writer.writeAttribute("id", clientId, "id"); } writeAttribute(writer...
java
protected void generateContainerStart(ResponseWriter writer, PanelGrid panelGrid, boolean idHasBeenRendered) throws IOException { writer.startElement("div", panelGrid); if (!idHasBeenRendered) { String clientId = panelGrid.getClientId(); writer.writeAttribute("id", clientId, "id"); } writeAttribute(writer...
[ "protected", "void", "generateContainerStart", "(", "ResponseWriter", "writer", ",", "PanelGrid", "panelGrid", ",", "boolean", "idHasBeenRendered", ")", "throws", "IOException", "{", "writer", ".", "startElement", "(", "\"div\"", ",", "panelGrid", ")", ";", "if", ...
Generates the start of the entire Bootstrap container. @param writer the current response writer. @throws IOException if something's wrong with the response writer.
[ "Generates", "the", "start", "of", "the", "entire", "Bootstrap", "container", "." ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L304-L324
eclipse/xtext-extras
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java
FeatureScopes.createConstructorDelegateScope
protected IScope createConstructorDelegateScope(EObject featureCall, LightweightTypeReference type, IScope parent, IFeatureScopeSession session) { return new ConstructorDelegateScope(parent, type, session, asAbstractFeatureCall(featureCall)); }
java
protected IScope createConstructorDelegateScope(EObject featureCall, LightweightTypeReference type, IScope parent, IFeatureScopeSession session) { return new ConstructorDelegateScope(parent, type, session, asAbstractFeatureCall(featureCall)); }
[ "protected", "IScope", "createConstructorDelegateScope", "(", "EObject", "featureCall", ",", "LightweightTypeReference", "type", ",", "IScope", "parent", ",", "IFeatureScopeSession", "session", ")", "{", "return", "new", "ConstructorDelegateScope", "(", "parent", ",", "...
A constructor delegate scope provides the descriptions for {@code this()} and {@code super()} calls in a constructor body.
[ "A", "constructor", "delegate", "scope", "provides", "the", "descriptions", "for", "{" ]
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java#L636-L638
rometools/rome
rome-propono/src/main/java/com/rometools/propono/utils/Utilities.java
Utilities.replaceNonAlphanumeric
public static String replaceNonAlphanumeric(final String str, final char subst) { final StringBuffer ret = new StringBuffer(str.length()); final char[] testChars = str.toCharArray(); for (final char testChar : testChars) { if (Character.isLetterOrDigit(testChar)) { re...
java
public static String replaceNonAlphanumeric(final String str, final char subst) { final StringBuffer ret = new StringBuffer(str.length()); final char[] testChars = str.toCharArray(); for (final char testChar : testChars) { if (Character.isLetterOrDigit(testChar)) { re...
[ "public", "static", "String", "replaceNonAlphanumeric", "(", "final", "String", "str", ",", "final", "char", "subst", ")", "{", "final", "StringBuffer", "ret", "=", "new", "StringBuffer", "(", "str", ".", "length", "(", ")", ")", ";", "final", "char", "[",...
Replaces occurences of non-alphanumeric characters with a supplied char.
[ "Replaces", "occurences", "of", "non", "-", "alphanumeric", "characters", "with", "a", "supplied", "char", "." ]
train
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/utils/Utilities.java#L124-L135
alkacon/opencms-core
src/org/opencms/ui/apps/sitemanager/CmsCreateSiteThread.java
CmsCreateSiteThread.setTemplate
private void setTemplate(CmsResource siteRootResource) { try { m_cms.lockResource(siteRootResource); // add template property if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_template)) { CmsProperty prop = new CmsProperty(CmsPropertyDefinition.PROPERTY_TEMPLA...
java
private void setTemplate(CmsResource siteRootResource) { try { m_cms.lockResource(siteRootResource); // add template property if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_template)) { CmsProperty prop = new CmsProperty(CmsPropertyDefinition.PROPERTY_TEMPLA...
[ "private", "void", "setTemplate", "(", "CmsResource", "siteRootResource", ")", "{", "try", "{", "m_cms", ".", "lockResource", "(", "siteRootResource", ")", ";", "// add template property", "if", "(", "CmsStringUtil", ".", "isNotEmptyOrWhitespaceOnly", "(", "m_templat...
Sets the selected template as property to site root folder.<p> @param siteRootResource Resource representing root folder
[ "Sets", "the", "selected", "template", "as", "property", "to", "site", "root", "folder", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsCreateSiteThread.java#L612-L625
marklogic/java-client-api
marklogic-client-api/src/main/java/com/marklogic/client/datamovement/HostAvailabilityListener.java
HostAvailabilityListener.processFailure
public void processFailure(QueryBatchException queryBatch) { boolean isHostUnavailableException = processException(queryBatch.getBatcher(), queryBatch, queryBatch.getClient().getHost()); if ( isHostUnavailableException == true ) { try { logger.warn("Retrying failed batch: {}, results so far: {}, f...
java
public void processFailure(QueryBatchException queryBatch) { boolean isHostUnavailableException = processException(queryBatch.getBatcher(), queryBatch, queryBatch.getClient().getHost()); if ( isHostUnavailableException == true ) { try { logger.warn("Retrying failed batch: {}, results so far: {}, f...
[ "public", "void", "processFailure", "(", "QueryBatchException", "queryBatch", ")", "{", "boolean", "isHostUnavailableException", "=", "processException", "(", "queryBatch", ".", "getBatcher", "(", ")", ",", "queryBatch", ",", "queryBatch", ".", "getClient", "(", ")"...
This implements the QueryFailureListener interface @param queryBatch the exception with information about the failed query attempt
[ "This", "implements", "the", "QueryFailureListener", "interface" ]
train
https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/HostAvailabilityListener.java#L213-L226
rometools/rome
rome/src/main/java/com/rometools/rome/io/impl/Atom10Parser.java
Atom10Parser.formURI
private static String formURI(String base, String append) { base = stripTrailingSlash(base); append = stripStartingSlash(append); if (append.startsWith("..")) { final String[] parts = append.split("/"); for (final String part : parts) { if ("..".equals(par...
java
private static String formURI(String base, String append) { base = stripTrailingSlash(base); append = stripStartingSlash(append); if (append.startsWith("..")) { final String[] parts = append.split("/"); for (final String part : parts) { if ("..".equals(par...
[ "private", "static", "String", "formURI", "(", "String", "base", ",", "String", "append", ")", "{", "base", "=", "stripTrailingSlash", "(", "base", ")", ";", "append", "=", "stripStartingSlash", "(", "append", ")", ";", "if", "(", "append", ".", "startsWit...
Form URI by combining base with append portion and giving special consideration to append portions that begin with ".." @param base Base of URI, may end with trailing slash @param append String to append, may begin with slash or ".."
[ "Form", "URI", "by", "combining", "base", "with", "append", "portion", "and", "giving", "special", "consideration", "to", "append", "portions", "that", "begin", "with", ".." ]
train
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/Atom10Parser.java#L646-L664
DDTH/ddth-zookeeper
src/main/java/com/github/ddth/zookeeper/ZooKeeperClient.java
ZooKeeperClient.createNode
public boolean createNode(String path, String value) throws ZooKeeperException { return _create(path, value != null ? value.getBytes(UTF8) : null, CreateMode.PERSISTENT); }
java
public boolean createNode(String path, String value) throws ZooKeeperException { return _create(path, value != null ? value.getBytes(UTF8) : null, CreateMode.PERSISTENT); }
[ "public", "boolean", "createNode", "(", "String", "path", ",", "String", "value", ")", "throws", "ZooKeeperException", "{", "return", "_create", "(", "path", ",", "value", "!=", "null", "?", "value", ".", "getBytes", "(", "UTF8", ")", ":", "null", ",", "...
Creates a node, with initial values. <p> Note: nodes are created recursively (parent nodes are created if needed). </p> @param path @param value @return @throws ZooKeeperException
[ "Creates", "a", "node", "with", "initial", "values", "." ]
train
https://github.com/DDTH/ddth-zookeeper/blob/0994eea8b25fa3d885f3da4579768b7d08c1c32b/src/main/java/com/github/ddth/zookeeper/ZooKeeperClient.java#L469-L471
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/Form.java
Form.setAnswer
public void setAnswer(String variable, int value) { FormField field = getField(variable); if (field == null) { throw new IllegalArgumentException("Field not found for the specified variable name."); } validateThatFieldIsText(field); setAnswer(field, value); }
java
public void setAnswer(String variable, int value) { FormField field = getField(variable); if (field == null) { throw new IllegalArgumentException("Field not found for the specified variable name."); } validateThatFieldIsText(field); setAnswer(field, value); }
[ "public", "void", "setAnswer", "(", "String", "variable", ",", "int", "value", ")", "{", "FormField", "field", "=", "getField", "(", "variable", ")", ";", "if", "(", "field", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Field...
Sets a new int value to a given form's field. The field whose variable matches the requested variable will be completed with the specified value. If no field could be found for the specified variable then an exception will be raised. @param variable the variable name that was completed. @param value the int value that...
[ "Sets", "a", "new", "int", "value", "to", "a", "given", "form", "s", "field", ".", "The", "field", "whose", "variable", "matches", "the", "requested", "variable", "will", "be", "completed", "with", "the", "specified", "value", ".", "If", "no", "field", "...
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/Form.java#L139-L146
bernardladenthin/streambuffer
src/main/java/net/ladenthin/streambuffer/StreamBuffer.java
StreamBuffer.correctOffsetAndLengthToWrite
public static boolean correctOffsetAndLengthToWrite(byte[] b, int off, int len) { if (b == null) { throw new NullPointerException(); } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { throw new IndexOutOfBound...
java
public static boolean correctOffsetAndLengthToWrite(byte[] b, int off, int len) { if (b == null) { throw new NullPointerException(); } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { throw new IndexOutOfBound...
[ "public", "static", "boolean", "correctOffsetAndLengthToWrite", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "{", "if", "(", "b", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "else", "if"...
Security check mostly copied from {@link OutputStream#write(byte[], int, int)}. Ensures the parameter are valid. @param b the byte array to write to the array @param off the offset to write to the array @param len the len of the bytes to write to the array @return <code>true</code> if there are bytes to write, otherwis...
[ "Security", "check", "mostly", "copied", "from", "{" ]
train
https://github.com/bernardladenthin/streambuffer/blob/46d586c95fc3316c7a92b76a556c932b9346015d/src/main/java/net/ladenthin/streambuffer/StreamBuffer.java#L191-L201
sporniket/core
sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java
XmlStringTools.getOpeningTag
public static String getOpeningTag(String tag, Map<String, String> attributes) { StringBuffer _result = new StringBuffer(); Map<String, String> _attributes = (null != attributes) ? attributes : EMPTY_MAP; return doAppendOpeningTag(_result, tag, _attributes).toString(); }
java
public static String getOpeningTag(String tag, Map<String, String> attributes) { StringBuffer _result = new StringBuffer(); Map<String, String> _attributes = (null != attributes) ? attributes : EMPTY_MAP; return doAppendOpeningTag(_result, tag, _attributes).toString(); }
[ "public", "static", "String", "getOpeningTag", "(", "String", "tag", ",", "Map", "<", "String", ",", "String", ">", "attributes", ")", "{", "StringBuffer", "_result", "=", "new", "StringBuffer", "(", ")", ";", "Map", "<", "String", ",", "String", ">", "_...
Create a string containing a closing tag. @param tag the closing tag to generate. @param attributes the map of attributes @return the opening tag.
[ "Create", "a", "string", "containing", "a", "closing", "tag", "." ]
train
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L593-L598
oasp/oasp4j
modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java
RestServiceExceptionFacade.handleSecurityError
protected Response handleSecurityError(Throwable exception, Throwable catched) { NlsRuntimeException error; if ((exception == catched) && (exception instanceof NlsRuntimeException)) { error = (NlsRuntimeException) exception; } else { error = new SecurityErrorUserException(catched); } LO...
java
protected Response handleSecurityError(Throwable exception, Throwable catched) { NlsRuntimeException error; if ((exception == catched) && (exception instanceof NlsRuntimeException)) { error = (NlsRuntimeException) exception; } else { error = new SecurityErrorUserException(catched); } LO...
[ "protected", "Response", "handleSecurityError", "(", "Throwable", "exception", ",", "Throwable", "catched", ")", "{", "NlsRuntimeException", "error", ";", "if", "(", "(", "exception", "==", "catched", ")", "&&", "(", "exception", "instanceof", "NlsRuntimeException",...
Exception handling for security exception. @param exception the exception to handle @param catched the original exception that was cached. Either same as {@code error} or a (child-) {@link Throwable#getCause() cause} of it. @return the response build from exception
[ "Exception", "handling", "for", "security", "exception", "." ]
train
https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java#L298-L316
terrestris/shogun-core
src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java
PhysicalNamingStrategyShogunCore.toPhysicalTableName
@Override public Identifier toPhysicalTableName(Identifier tableIdentifier, JdbcEnvironment context) { return convertToLimitedLowerCase(context, tableIdentifier, tablePrefix); }
java
@Override public Identifier toPhysicalTableName(Identifier tableIdentifier, JdbcEnvironment context) { return convertToLimitedLowerCase(context, tableIdentifier, tablePrefix); }
[ "@", "Override", "public", "Identifier", "toPhysicalTableName", "(", "Identifier", "tableIdentifier", ",", "JdbcEnvironment", "context", ")", "{", "return", "convertToLimitedLowerCase", "(", "context", ",", "tableIdentifier", ",", "tablePrefix", ")", ";", "}" ]
Converts table names to lower case and limits the length if necessary.
[ "Converts", "table", "names", "to", "lower", "case", "and", "limits", "the", "length", "if", "necessary", "." ]
train
https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java#L48-L51
gallandarakhneorg/afc
core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java
Transform2D.setScale
@SuppressWarnings("checkstyle:magicnumber") public void setScale(double scaleX, double scaleY) { final double[] tmpScale = new double[3]; final double[] tmpRot = new double[9]; getScaleRotate2x2(tmpScale, tmpRot); this.m00 = tmpRot[0] * scaleX; this.m01 = tmpRot[1] * scaleY; this.m10 = tmpRot[3] * scaleX; ...
java
@SuppressWarnings("checkstyle:magicnumber") public void setScale(double scaleX, double scaleY) { final double[] tmpScale = new double[3]; final double[] tmpRot = new double[9]; getScaleRotate2x2(tmpScale, tmpRot); this.m00 = tmpRot[0] * scaleX; this.m01 = tmpRot[1] * scaleY; this.m10 = tmpRot[3] * scaleX; ...
[ "@", "SuppressWarnings", "(", "\"checkstyle:magicnumber\"", ")", "public", "void", "setScale", "(", "double", "scaleX", ",", "double", "scaleY", ")", "{", "final", "double", "[", "]", "tmpScale", "=", "new", "double", "[", "3", "]", ";", "final", "double", ...
Change the scale of this matrix. Performs an SVD normalization of this matrix for determining and preserving the rotation. @param scaleX the scaling factor along x axis. @param scaleY the scaling factor along y axis. @see #makeScaleMatrix(double, double)
[ "Change", "the", "scale", "of", "this", "matrix", ".", "Performs", "an", "SVD", "normalization", "of", "this", "matrix", "for", "determining", "and", "preserving", "the", "rotation", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L475-L484
apereo/cas
support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/support/claims/WrappingSecurityTokenServiceClaimsHandler.java
WrappingSecurityTokenServiceClaimsHandler.createProcessedClaim
protected ProcessedClaim createProcessedClaim(final Claim requestClaim, final ClaimsParameters parameters) { val claim = new ProcessedClaim(); claim.setClaimType(createProcessedClaimType(requestClaim, parameters)); claim.setIssuer(this.issuer); claim.setOriginalIssuer(this.issuer); ...
java
protected ProcessedClaim createProcessedClaim(final Claim requestClaim, final ClaimsParameters parameters) { val claim = new ProcessedClaim(); claim.setClaimType(createProcessedClaimType(requestClaim, parameters)); claim.setIssuer(this.issuer); claim.setOriginalIssuer(this.issuer); ...
[ "protected", "ProcessedClaim", "createProcessedClaim", "(", "final", "Claim", "requestClaim", ",", "final", "ClaimsParameters", "parameters", ")", "{", "val", "claim", "=", "new", "ProcessedClaim", "(", ")", ";", "claim", ".", "setClaimType", "(", "createProcessedCl...
Create processed claim processed claim. @param requestClaim the request claim @param parameters the parameters @return the processed claim
[ "Create", "processed", "claim", "processed", "claim", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/support/claims/WrappingSecurityTokenServiceClaimsHandler.java#L69-L76
VoltDB/voltdb
src/frontend/org/voltdb/client/ConnectionUtil.java
ConnectionUtil.getAuthenticatedConnection
public static Object[] getAuthenticatedConnection(String host, String username, byte[] hashedPassword, int port, final Subject subject, ClientAuthScheme scheme, ...
java
public static Object[] getAuthenticatedConnection(String host, String username, byte[] hashedPassword, int port, final Subject subject, ClientAuthScheme scheme, ...
[ "public", "static", "Object", "[", "]", "getAuthenticatedConnection", "(", "String", "host", ",", "String", "username", ",", "byte", "[", "]", "hashedPassword", ",", "int", "port", ",", "final", "Subject", "subject", ",", "ClientAuthScheme", "scheme", ",", "lo...
Create a connection to a Volt server and authenticate the connection. @param host @param username @param hashedPassword @param port @param subject @throws IOException @returns An array of objects. The first is an authenticated socket channel, the second. is an array of 4 longs - Integer hostId, Long connectionId, Long ...
[ "Create", "a", "connection", "to", "a", "Volt", "server", "and", "authenticate", "the", "connection", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/ConnectionUtil.java#L253-L259
alkacon/opencms-core
src/org/opencms/widgets/CmsHtmlWidgetOption.java
CmsHtmlWidgetOption.parseEmbeddedGalleryOptions
public static CmsPair<String, Map<String, String>> parseEmbeddedGalleryOptions(String configuration) { final Map<String, String> galleryOptions = Maps.newHashMap(); String resultConfig = CmsStringUtil.substitute( PATTERN_EMBEDDED_GALLERY_CONFIG, configuration, new I_...
java
public static CmsPair<String, Map<String, String>> parseEmbeddedGalleryOptions(String configuration) { final Map<String, String> galleryOptions = Maps.newHashMap(); String resultConfig = CmsStringUtil.substitute( PATTERN_EMBEDDED_GALLERY_CONFIG, configuration, new I_...
[ "public", "static", "CmsPair", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "parseEmbeddedGalleryOptions", "(", "String", "configuration", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "galleryOptions", "=", "Maps", ".", ...
Parses and removes embedded gallery configuration strings. @param configuration the configuration string to parse @return a map containing both the string resulting from removing the embedded configurations, and the embedded configurations as a a map
[ "Parses", "and", "removes", "embedded", "gallery", "configuration", "strings", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsHtmlWidgetOption.java#L497-L514
OpenLiberty/open-liberty
dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java
TwitterEndpointServices.obtainAccessToken
@Sensitive public Map<String, Object> obtainAccessToken(SocialLoginConfig config, String requestToken, String verifierOrPinValue) { String endpointUrl = config.getTokenEndpoint(); try { SocialUtil.validateEndpointWithQuery(endpointUrl); } catch (SocialLoginException e) { ...
java
@Sensitive public Map<String, Object> obtainAccessToken(SocialLoginConfig config, String requestToken, String verifierOrPinValue) { String endpointUrl = config.getTokenEndpoint(); try { SocialUtil.validateEndpointWithQuery(endpointUrl); } catch (SocialLoginException e) { ...
[ "@", "Sensitive", "public", "Map", "<", "String", ",", "Object", ">", "obtainAccessToken", "(", "SocialLoginConfig", "config", ",", "String", "requestToken", ",", "String", "verifierOrPinValue", ")", "{", "String", "endpointUrl", "=", "config", ".", "getTokenEndpo...
Invokes the {@value TwitterConstants#TWITTER_ENDPOINT_ACCESS_TOKEN} endpoint in order to obtain an access token. The request is authorized for the consumer key set by the class and the previously obtained request token. The appropriate consumer key must be set before invoking this method in order to obtain an access to...
[ "Invokes", "the", "{", "@value", "TwitterConstants#TWITTER_ENDPOINT_ACCESS_TOKEN", "}", "endpoint", "in", "order", "to", "obtain", "an", "access", "token", ".", "The", "request", "is", "authorized", "for", "the", "consumer", "key", "set", "by", "the", "class", "...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java#L945-L962
icode/ameba
src/main/java/ameba/db/ebean/internal/ModelInterceptor.java
ModelInterceptor.applyUriQuery
@SuppressWarnings("unchecked") public static FutureRowCount applyUriQuery(MultivaluedMap<String, String> queryParams, SpiQuery query, InjectionManager manager, boolean needPageList) { Set<String> inv = query.valida...
java
@SuppressWarnings("unchecked") public static FutureRowCount applyUriQuery(MultivaluedMap<String, String> queryParams, SpiQuery query, InjectionManager manager, boolean needPageList) { Set<String> inv = query.valida...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "FutureRowCount", "applyUriQuery", "(", "MultivaluedMap", "<", "String", ",", "String", ">", "queryParams", ",", "SpiQuery", "query", ",", "InjectionManager", "manager", ",", "boolean", "needPag...
apply uri query parameter on query @param queryParams uri query params @param query Query @param needPageList need page list @param manager a {@link InjectionManager} object. @return page list count or null @see #applyFetchProperties @see #applyFilter @see #applyOrderBy @see #applyPageList
[ "apply", "uri", "query", "parameter", "on", "query" ]
train
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/internal/ModelInterceptor.java#L349-L367
keyboardsurfer/Crouton
library/src/main/java/de/keyboardsurfer/android/widget/crouton/Crouton.java
Crouton.makeText
public static Crouton makeText(Activity activity, int textResourceId, Style style, ViewGroup viewGroup) { return makeText(activity, activity.getString(textResourceId), style, viewGroup); }
java
public static Crouton makeText(Activity activity, int textResourceId, Style style, ViewGroup viewGroup) { return makeText(activity, activity.getString(textResourceId), style, viewGroup); }
[ "public", "static", "Crouton", "makeText", "(", "Activity", "activity", ",", "int", "textResourceId", ",", "Style", "style", ",", "ViewGroup", "viewGroup", ")", "{", "return", "makeText", "(", "activity", ",", "activity", ".", "getString", "(", "textResourceId",...
Creates a {@link Crouton} with provided text-resource and style for a given activity. @param activity The {@link Activity} that represents the context in which the Crouton should exist. @param textResourceId The resource id of the text you want to display. @param style The style that this {@link Crouton} should be cre...
[ "Creates", "a", "{", "@link", "Crouton", "}", "with", "provided", "text", "-", "resource", "and", "style", "for", "a", "given", "activity", "." ]
train
https://github.com/keyboardsurfer/Crouton/blob/7806b15e4d52793e1f5aeaa4a55b1e220289e619/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Crouton.java#L270-L272
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserUploadManager.java
UserUploadManager.addUploadedFile
public void addUploadedFile (@Nonnull @Nonempty final String sFieldName, @Nonnull final TemporaryUserDataObject aUDO) { ValueEnforcer.notEmpty (sFieldName, "FieldName"); ValueEnforcer.notNull (aUDO, "UDO"); m_aRWLock.writeLocked ( () -> { // Remove an eventually existing old UDO with the same filen...
java
public void addUploadedFile (@Nonnull @Nonempty final String sFieldName, @Nonnull final TemporaryUserDataObject aUDO) { ValueEnforcer.notEmpty (sFieldName, "FieldName"); ValueEnforcer.notNull (aUDO, "UDO"); m_aRWLock.writeLocked ( () -> { // Remove an eventually existing old UDO with the same filen...
[ "public", "void", "addUploadedFile", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sFieldName", ",", "@", "Nonnull", "final", "TemporaryUserDataObject", "aUDO", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sFieldName", ",", "\"FieldName\"", ")", ...
Add an uploaded file. Existing UDOs with the same field name are overwritten and the underlying file is deleted. By default an uploaded file is not confirmed and will be deleted when the session expires. By confirming the uploaded image it is safe for later reuse. @param sFieldName The ID of the uploaded file. May nei...
[ "Add", "an", "uploaded", "file", ".", "Existing", "UDOs", "with", "the", "same", "field", "name", "are", "overwritten", "and", "the", "underlying", "file", "is", "deleted", ".", "By", "default", "an", "uploaded", "file", "is", "not", "confirmed", "and", "w...
train
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserUploadManager.java#L103-L118
phax/ph-pdf-layout
src/main/java/com/helger/pdflayout4/spec/FontSpec.java
FontSpec.getCloneWithDifferentFontSize
@Nonnull public FontSpec getCloneWithDifferentFontSize (final float fNewFontSize) { ValueEnforcer.isGT0 (fNewFontSize, "FontSize"); if (EqualsHelper.equals (fNewFontSize, m_fFontSize)) return this; return new FontSpec (m_aPreloadFont, fNewFontSize, m_aColor); }
java
@Nonnull public FontSpec getCloneWithDifferentFontSize (final float fNewFontSize) { ValueEnforcer.isGT0 (fNewFontSize, "FontSize"); if (EqualsHelper.equals (fNewFontSize, m_fFontSize)) return this; return new FontSpec (m_aPreloadFont, fNewFontSize, m_aColor); }
[ "@", "Nonnull", "public", "FontSpec", "getCloneWithDifferentFontSize", "(", "final", "float", "fNewFontSize", ")", "{", "ValueEnforcer", ".", "isGT0", "(", "fNewFontSize", ",", "\"FontSize\"", ")", ";", "if", "(", "EqualsHelper", ".", "equals", "(", "fNewFontSize"...
Return a clone of this object but with a different font size. @param fNewFontSize The new font size to use. Must be &gt; 0. @return this if the font sizes are equal - a new object otherwise.
[ "Return", "a", "clone", "of", "this", "object", "but", "with", "a", "different", "font", "size", "." ]
train
https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/spec/FontSpec.java#L129-L136
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java
RingPartitioner.walkRingSystem
private static IRingSet walkRingSystem(IRingSet rs, IRing ring, IRingSet newRs) { IRing tempRing; IRingSet tempRings = rs.getConnectedRings(ring); // logger.debug("walkRingSystem -> tempRings.size(): " + tempRings.size()); rs.removeAtomContainer(ring); for (IAtomContainer ...
java
private static IRingSet walkRingSystem(IRingSet rs, IRing ring, IRingSet newRs) { IRing tempRing; IRingSet tempRings = rs.getConnectedRings(ring); // logger.debug("walkRingSystem -> tempRings.size(): " + tempRings.size()); rs.removeAtomContainer(ring); for (IAtomContainer ...
[ "private", "static", "IRingSet", "walkRingSystem", "(", "IRingSet", "rs", ",", "IRing", "ring", ",", "IRingSet", "newRs", ")", "{", "IRing", "tempRing", ";", "IRingSet", "tempRings", "=", "rs", ".", "getConnectedRings", "(", "ring", ")", ";", "// logger...
Perform a walk in the given RingSet, starting at a given Ring and recursively searching for other Rings connected to this ring. By doing this it finds all rings in the RingSet connected to the start ring, putting them in newRs, and removing them from rs. @param rs The RingSet to be searched @param ring The rin...
[ "Perform", "a", "walk", "in", "the", "given", "RingSet", "starting", "at", "a", "given", "Ring", "and", "recursively", "searching", "for", "other", "Rings", "connected", "to", "this", "ring", ".", "By", "doing", "this", "it", "finds", "all", "rings", "in",...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java#L120-L133
ologolo/streamline-api
src/org/daisy/streamline/api/config/UserConfigurationsCollection.java
UserConfigurationsCollection.addConfiguration
public synchronized Optional<String> addConfiguration(String niceName, String description, Map<String, Object> config) { try { if (catalog==null) { throw new FileNotFoundException(); } return sync(()-> { ConfigurationDetails p = new ConfigurationDetails.Builder(inventory.nextIdentifier()) .nice...
java
public synchronized Optional<String> addConfiguration(String niceName, String description, Map<String, Object> config) { try { if (catalog==null) { throw new FileNotFoundException(); } return sync(()-> { ConfigurationDetails p = new ConfigurationDetails.Builder(inventory.nextIdentifier()) .nice...
[ "public", "synchronized", "Optional", "<", "String", ">", "addConfiguration", "(", "String", "niceName", ",", "String", "description", ",", "Map", "<", "String", ",", "Object", ">", "config", ")", "{", "try", "{", "if", "(", "catalog", "==", "null", ")", ...
Adds a configuration to this catalog. @param niceName the display name @param description the configuration description @param config the configuration details @return the identifier for the new configuration, or an empty optional if the configuration could not be added
[ "Adds", "a", "configuration", "to", "this", "catalog", "." ]
train
https://github.com/ologolo/streamline-api/blob/4934b6da1de06e364ae90d6ea9b0929500da9cdb/src/org/daisy/streamline/api/config/UserConfigurationsCollection.java#L102-L124
d-sauer/JCalcAPI
src/main/java/org/jdice/calc/Num.java
Num.toBigDecimal
public BigDecimal toBigDecimal(Integer scale, Rounding rounding, boolean stripTrailingZeros) { out = this.in; if (scale != null && rounding != null) out = out.setScale(scale, rounding.getBigDecimalRound()); else if (scale != null && rounding == null) out = out.setScale(scale...
java
public BigDecimal toBigDecimal(Integer scale, Rounding rounding, boolean stripTrailingZeros) { out = this.in; if (scale != null && rounding != null) out = out.setScale(scale, rounding.getBigDecimalRound()); else if (scale != null && rounding == null) out = out.setScale(scale...
[ "public", "BigDecimal", "toBigDecimal", "(", "Integer", "scale", ",", "Rounding", "rounding", ",", "boolean", "stripTrailingZeros", ")", "{", "out", "=", "this", ".", "in", ";", "if", "(", "scale", "!=", "null", "&&", "rounding", "!=", "null", ")", "out", ...
Return BigDecimal with given parameters. @param scale @param rounding @param stripTrailingZeros @return BigDecimal
[ "Return", "BigDecimal", "with", "given", "parameters", "." ]
train
https://github.com/d-sauer/JCalcAPI/blob/36ae1f9adfe611a6f1bd8ef87cf1dc0ec88ac035/src/main/java/org/jdice/calc/Num.java#L418-L430
jboss/jboss-jstl-api_spec
src/main/java/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java
TimeZoneSupport.getTimeZone
static TimeZone getTimeZone(PageContext pc, Tag fromTag) { TimeZone tz = null; Tag t = findAncestorWithClass(fromTag, TimeZoneSupport.class); if (t != null) { // use time zone from parent <timeZone> tag TimeZoneSupport parent = (TimeZoneSupport) t; tz = paren...
java
static TimeZone getTimeZone(PageContext pc, Tag fromTag) { TimeZone tz = null; Tag t = findAncestorWithClass(fromTag, TimeZoneSupport.class); if (t != null) { // use time zone from parent <timeZone> tag TimeZoneSupport parent = (TimeZoneSupport) t; tz = paren...
[ "static", "TimeZone", "getTimeZone", "(", "PageContext", "pc", ",", "Tag", "fromTag", ")", "{", "TimeZone", "tz", "=", "null", ";", "Tag", "t", "=", "findAncestorWithClass", "(", "fromTag", ",", "TimeZoneSupport", ".", "class", ")", ";", "if", "(", "t", ...
/* Determines and returns the time zone to be used by the given action. <p> If the given action is nested inside a &lt;timeZone&gt; action, the time zone is taken from the enclosing &lt;timeZone&gt; action. <p> Otherwise, the time zone configuration setting <tt>javax.servlet.jsp.jstl.core.Config.FMT_TIME_ZONE</tt> is...
[ "/", "*", "Determines", "and", "returns", "the", "time", "zone", "to", "be", "used", "by", "the", "given", "action", "." ]
train
https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java#L136-L157
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/frame/transaction/AbstractDataFrameTransaction.java
AbstractDataFrameTransaction.attemptResend
boolean attemptResend(ZWaveChannelContext ctx, boolean dueToCAN) { if (startFrame.getSendCount() < MAX_SEND_COUNT) { logger.debug("Transaction {} has failed - will reset and resend initial request", getId()); reset(); // if a CAN was received, then we decrement the send count...
java
boolean attemptResend(ZWaveChannelContext ctx, boolean dueToCAN) { if (startFrame.getSendCount() < MAX_SEND_COUNT) { logger.debug("Transaction {} has failed - will reset and resend initial request", getId()); reset(); // if a CAN was received, then we decrement the send count...
[ "boolean", "attemptResend", "(", "ZWaveChannelContext", "ctx", ",", "boolean", "dueToCAN", ")", "{", "if", "(", "startFrame", ".", "getSendCount", "(", ")", "<", "MAX_SEND_COUNT", ")", "{", "logger", ".", "debug", "(", "\"Transaction {} has failed - will reset and r...
Attempts to re-send the data frame that initiated this transaction. @param ctx the ChannelHandlerContext @param dueToCAN indicates whether the re-send attempt was due to a CAN frame that was received @return boolean indicating whether re-send was attempted
[ "Attempts", "to", "re", "-", "send", "the", "data", "frame", "that", "initiated", "this", "transaction", "." ]
train
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/frame/transaction/AbstractDataFrameTransaction.java#L71-L86
dita-ot/dita-ot
src/main/plugins/org.dita.eclipsehelp/src/main/java/org/dita/dost/writer/EclipseIndexWriter.java
EclipseIndexWriter.outputIndexTerm
private void outputIndexTerm(final IndexTerm term, final XMLStreamWriter serializer, final boolean indexsee) throws XMLStreamException { final List<IndexTerm> subTerms = term.getSubTerms(); final int subTermNum = subTerms.size(); outputIndexTermStartElement(term, serializer, indexsee); i...
java
private void outputIndexTerm(final IndexTerm term, final XMLStreamWriter serializer, final boolean indexsee) throws XMLStreamException { final List<IndexTerm> subTerms = term.getSubTerms(); final int subTermNum = subTerms.size(); outputIndexTermStartElement(term, serializer, indexsee); i...
[ "private", "void", "outputIndexTerm", "(", "final", "IndexTerm", "term", ",", "final", "XMLStreamWriter", "serializer", ",", "final", "boolean", "indexsee", ")", "throws", "XMLStreamException", "{", "final", "List", "<", "IndexTerm", ">", "subTerms", "=", "term", ...
Output the given indexterm into the XML writer. @param term term to serialize @param serializer XML output to write to @param indexsee is term a see term
[ "Output", "the", "given", "indexterm", "into", "the", "XML", "writer", "." ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/plugins/org.dita.eclipsehelp/src/main/java/org/dita/dost/writer/EclipseIndexWriter.java#L122-L132
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java
UnconditionalValueDerefAnalysis.checkNonNullPutField
private void checkNonNullPutField(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact) throws DataflowAnalysisException { INullnessAnnotationDatabase database = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase(); FieldInstruction fieldIns = (F...
java
private void checkNonNullPutField(Location location, ValueNumberFrame vnaFrame, UnconditionalValueDerefSet fact) throws DataflowAnalysisException { INullnessAnnotationDatabase database = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase(); FieldInstruction fieldIns = (F...
[ "private", "void", "checkNonNullPutField", "(", "Location", "location", ",", "ValueNumberFrame", "vnaFrame", ",", "UnconditionalValueDerefSet", "fact", ")", "throws", "DataflowAnalysisException", "{", "INullnessAnnotationDatabase", "database", "=", "AnalysisContext", ".", "...
If this is a putfield or putstatic instruction, check to see if the field is @NonNull, and treat it as dereferences. @param location the Location of the instruction @param vnaFrame the ValueNumberFrame at the Location of the instruction @param fact the dataflow value to modify @throws DataflowAnalysisException
[ "If", "this", "is", "a", "putfield", "or", "putstatic", "instruction", "check", "to", "see", "if", "the", "field", "is", "@NonNull", "and", "treat", "it", "as", "dereferences", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/deref/UnconditionalValueDerefAnalysis.java#L474-L497
paymill/paymill-java
src/main/java/com/paymill/services/PaymentService.java
PaymentService.createWithTokenAndClient
public Payment createWithTokenAndClient( String token, String clientId ) { ValidationUtils.validatesToken( token ); ValidationUtils.validatesId( clientId ); ParameterMap<String, String> params = new ParameterMap<String, String>(); params.add( "token", token ); params.add( "client", clientId ); ...
java
public Payment createWithTokenAndClient( String token, String clientId ) { ValidationUtils.validatesToken( token ); ValidationUtils.validatesId( clientId ); ParameterMap<String, String> params = new ParameterMap<String, String>(); params.add( "token", token ); params.add( "client", clientId ); ...
[ "public", "Payment", "createWithTokenAndClient", "(", "String", "token", ",", "String", "clientId", ")", "{", "ValidationUtils", ".", "validatesToken", "(", "token", ")", ";", "ValidationUtils", ".", "validatesId", "(", "clientId", ")", ";", "ParameterMap", "<", ...
Creates a credit card or direct debit {@link Payment} from a given token. With the provided {@link Client}, the {@link Payment} will be created and subsequently be added to the given {@link Client}. @param token Token generated by PAYMILL Bridge, which represents a credit card or direct debit. @param clientId The Id of...
[ "Creates", "a", "credit", "card", "or", "direct", "debit", "{" ]
train
https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/PaymentService.java#L134-L143
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/document/json/JsonObject.java
JsonObject.putNullAndEncrypt
public JsonObject putNullAndEncrypt(String name, String providerName) { addValueEncryptionInfo(name, providerName, true); content.put(name, null); return this; }
java
public JsonObject putNullAndEncrypt(String name, String providerName) { addValueEncryptionInfo(name, providerName, true); content.put(name, null); return this; }
[ "public", "JsonObject", "putNullAndEncrypt", "(", "String", "name", ",", "String", "providerName", ")", "{", "addValueEncryptionInfo", "(", "name", ",", "providerName", ",", "true", ")", ";", "content", ".", "put", "(", "name", ",", "null", ")", ";", "return...
Store a null value as encrypted identified by the field's name. This method is equivalent to calling {@link #put(String, Object)} with either {@link JsonValue#NULL JsonValue.NULL} or a null value explicitly cast to Object. Note: Use of the Field Level Encryption functionality provided in the com.couchbase.client.encr...
[ "Store", "a", "null", "value", "as", "encrypted", "identified", "by", "the", "field", "s", "name", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L1010-L1014
carewebframework/carewebframework-core
org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/service/InfoPanelService.java
InfoPanelService.findInfoPanel
public static IInfoPanel findInfoPanel(PluginContainer container, boolean activeOnly) { return findInfoPanel(ElementUI.getAssociatedElement(container), activeOnly); }
java
public static IInfoPanel findInfoPanel(PluginContainer container, boolean activeOnly) { return findInfoPanel(ElementUI.getAssociatedElement(container), activeOnly); }
[ "public", "static", "IInfoPanel", "findInfoPanel", "(", "PluginContainer", "container", ",", "boolean", "activeOnly", ")", "{", "return", "findInfoPanel", "(", "ElementUI", ".", "getAssociatedElement", "(", "container", ")", ",", "activeOnly", ")", ";", "}" ]
Finds the "nearest" info panel. @param container The container from which to begin the search. @param activeOnly If true, only active info panels are considered. @return The nearest active info panel, or null if none found.
[ "Finds", "the", "nearest", "info", "panel", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/service/InfoPanelService.java#L55-L57
OpenHFT/Chronicle-Map
src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java
ReplicatedChronicleMap.readExternalEntry
@Override public void readExternalEntry(@NotNull Bytes source, byte remoteNodeIdentifier) { byte hunk = source.readByte(); if (hunk == BOOTSTRAP_TIME_HUNK) { setRemoteNodeCouldBootstrapFrom(remoteNodeIdentifier, source.readLong()); } else { assert hunk == ENTRY_HUNK; ...
java
@Override public void readExternalEntry(@NotNull Bytes source, byte remoteNodeIdentifier) { byte hunk = source.readByte(); if (hunk == BOOTSTRAP_TIME_HUNK) { setRemoteNodeCouldBootstrapFrom(remoteNodeIdentifier, source.readLong()); } else { assert hunk == ENTRY_HUNK; ...
[ "@", "Override", "public", "void", "readExternalEntry", "(", "@", "NotNull", "Bytes", "source", ",", "byte", "remoteNodeIdentifier", ")", "{", "byte", "hunk", "=", "source", ".", "readByte", "(", ")", ";", "if", "(", "hunk", "==", "BOOTSTRAP_TIME_HUNK", ")",...
This method does not set a segment lock, A segment lock should be obtained before calling this method, especially when being used in a multi threaded context.
[ "This", "method", "does", "not", "set", "a", "segment", "lock", "A", "segment", "lock", "should", "be", "obtained", "before", "calling", "this", "method", "especially", "when", "being", "used", "in", "a", "multi", "threaded", "context", "." ]
train
https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java#L551-L562
thorstenwagner/TraJ
src/main/java/de/biomedical_imaging/traJ/features/BoundednessFeature.java
BoundednessFeature.calculateBoundedness
public static double calculateBoundedness(double D, int N, double timelag, double confRadius){ double r = confRadius; double cov_area = a(N)*D*timelag; double res = cov_area/(4*r*r); return res; }
java
public static double calculateBoundedness(double D, int N, double timelag, double confRadius){ double r = confRadius; double cov_area = a(N)*D*timelag; double res = cov_area/(4*r*r); return res; }
[ "public", "static", "double", "calculateBoundedness", "(", "double", "D", ",", "int", "N", ",", "double", "timelag", ",", "double", "confRadius", ")", "{", "double", "r", "=", "confRadius", ";", "double", "cov_area", "=", "a", "(", "N", ")", "*", "D", ...
Calculates the Boundedness value to given confinement radius, diffusion coefficient, timlag and number of steps. @param D diffusion coefficient @param N Number of steps @param timelag Timelag @param confRadius Confinement radius @return Boundedness value
[ "Calculates", "the", "Boundedness", "value", "to", "given", "confinement", "radius", "diffusion", "coefficient", "timlag", "and", "number", "of", "steps", "." ]
train
https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/features/BoundednessFeature.java#L36-L41
alkacon/opencms-core
src-modules/org/opencms/workplace/commons/CmsSecure.java
CmsSecure.actionChangeSecureExport
public void actionChangeSecureExport() throws JspException { // save initialized instance of this class in request attribute for included sub-elements getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this); String filename = getParamResource(); try { // lock res...
java
public void actionChangeSecureExport() throws JspException { // save initialized instance of this class in request attribute for included sub-elements getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this); String filename = getParamResource(); try { // lock res...
[ "public", "void", "actionChangeSecureExport", "(", ")", "throws", "JspException", "{", "// save initialized instance of this class in request attribute for included sub-elements", "getJsp", "(", ")", ".", "getRequest", "(", ")", ".", "setAttribute", "(", "SESSION_WORKPLACE_CLAS...
Performs the Security and Export Change.<p> @throws JspException if including a JSP sub element is not successful
[ "Performs", "the", "Security", "and", "Export", "Change", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsSecure.java#L112-L142
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ComponentUtil.java
ComponentUtil.registerTypeMapping
private static Class registerTypeMapping(WSServer server, Class clazz) { java.lang.reflect.Method[] methods = clazz.getMethods(); java.lang.reflect.Method method; Class[] params; for (int i = 0; i < methods.length; i++) { method = methods[i]; if (method.getDeclaringClass() == clazz) { _registerTypeMappi...
java
private static Class registerTypeMapping(WSServer server, Class clazz) { java.lang.reflect.Method[] methods = clazz.getMethods(); java.lang.reflect.Method method; Class[] params; for (int i = 0; i < methods.length; i++) { method = methods[i]; if (method.getDeclaringClass() == clazz) { _registerTypeMappi...
[ "private", "static", "Class", "registerTypeMapping", "(", "WSServer", "server", ",", "Class", "clazz", ")", "{", "java", ".", "lang", ".", "reflect", ".", "Method", "[", "]", "methods", "=", "clazz", ".", "getMethods", "(", ")", ";", "java", ".", "lang",...
search in methods of a class for complex types @param server @param clazz @return
[ "search", "in", "methods", "of", "a", "class", "for", "complex", "types" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java#L291-L306
lucee/Lucee
core/src/main/java/lucee/runtime/net/http/HttpServletRequestDummy.java
HttpServletRequestDummy.addHeader
public void addHeader(String name, String value) { headers = ReqRspUtil.add(headers, name, value); }
java
public void addHeader(String name, String value) { headers = ReqRspUtil.add(headers, name, value); }
[ "public", "void", "addHeader", "(", "String", "name", ",", "String", "value", ")", "{", "headers", "=", "ReqRspUtil", ".", "add", "(", "headers", ",", "name", ",", "value", ")", ";", "}" ]
add a new header value @param name name of the new value @param value header value
[ "add", "a", "new", "header", "value" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/http/HttpServletRequestDummy.java#L247-L249
resilience4j/resilience4j
resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/CircuitBreakerExports.java
CircuitBreakerExports.ofCircuitBreaker
public static CircuitBreakerExports ofCircuitBreaker(String prefix, CircuitBreaker circuitBreaker) { requireNonNull(prefix); requireNonNull(circuitBreaker); return new CircuitBreakerExports(prefix, Array.of(circuitBreaker)); }
java
public static CircuitBreakerExports ofCircuitBreaker(String prefix, CircuitBreaker circuitBreaker) { requireNonNull(prefix); requireNonNull(circuitBreaker); return new CircuitBreakerExports(prefix, Array.of(circuitBreaker)); }
[ "public", "static", "CircuitBreakerExports", "ofCircuitBreaker", "(", "String", "prefix", ",", "CircuitBreaker", "circuitBreaker", ")", "{", "requireNonNull", "(", "prefix", ")", ";", "requireNonNull", "(", "circuitBreaker", ")", ";", "return", "new", "CircuitBreakerE...
Creates a new instance of {@link CircuitBreakerExports} with default metrics names prefix and a circuit breaker as a source. @param prefix the prefix of metrics names @param circuitBreaker the circuit breaker
[ "Creates", "a", "new", "instance", "of", "{", "@link", "CircuitBreakerExports", "}", "with", "default", "metrics", "names", "prefix", "and", "a", "circuit", "breaker", "as", "a", "source", "." ]
train
https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/CircuitBreakerExports.java#L140-L144
kiegroup/drools
drools-core/src/main/java/org/drools/core/phreak/SegmentUtilities.java
SegmentUtilities.isRootNode
public static boolean isRootNode(LeftTupleNode node, TerminalNode removingTN) { return node.getType() == NodeTypeEnums.LeftInputAdapterNode || isNonTerminalTipNode( node.getLeftTupleSource(), removingTN ); }
java
public static boolean isRootNode(LeftTupleNode node, TerminalNode removingTN) { return node.getType() == NodeTypeEnums.LeftInputAdapterNode || isNonTerminalTipNode( node.getLeftTupleSource(), removingTN ); }
[ "public", "static", "boolean", "isRootNode", "(", "LeftTupleNode", "node", ",", "TerminalNode", "removingTN", ")", "{", "return", "node", ".", "getType", "(", ")", "==", "NodeTypeEnums", ".", "LeftInputAdapterNode", "||", "isNonTerminalTipNode", "(", "node", ".", ...
Returns whether the node is the root of a segment. Lians are always the root of a segment. node cannot be null. The result should discount any removingRule. That means it gives you the result as if the rule had already been removed from the network.
[ "Returns", "whether", "the", "node", "is", "the", "root", "of", "a", "segment", ".", "Lians", "are", "always", "the", "root", "of", "a", "segment", "." ]
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/phreak/SegmentUtilities.java#L471-L473
alipay/sofa-rpc
extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/transport/http/Http2ServerChannelInitializer.java
Http2ServerChannelInitializer.configureClearText
private void configureClearText(final SocketChannel ch) { final ChannelPipeline p = ch.pipeline(); final HttpServerCodec sourceCodec = new HttpServerCodec(); final HttpServerUpgradeHandler upgradeHandler = new HttpServerUpgradeHandler(sourceCodec, new UpgradeCodecFactory() { ...
java
private void configureClearText(final SocketChannel ch) { final ChannelPipeline p = ch.pipeline(); final HttpServerCodec sourceCodec = new HttpServerCodec(); final HttpServerUpgradeHandler upgradeHandler = new HttpServerUpgradeHandler(sourceCodec, new UpgradeCodecFactory() { ...
[ "private", "void", "configureClearText", "(", "final", "SocketChannel", "ch", ")", "{", "final", "ChannelPipeline", "p", "=", "ch", ".", "pipeline", "(", ")", ";", "final", "HttpServerCodec", "sourceCodec", "=", "new", "HttpServerCodec", "(", ")", ";", "final"...
Configure the pipeline for a cleartext upgrade from HTTP to HTTP/2.0
[ "Configure", "the", "pipeline", "for", "a", "cleartext", "upgrade", "from", "HTTP", "to", "HTTP", "/", "2", ".", "0" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-http/src/main/java/com/alipay/sofa/rpc/transport/http/Http2ServerChannelInitializer.java#L116-L156
lessthanoptimal/ejml
main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java
CommonOps_DSCC.multTransAB
public static void multTransAB(DMatrixSparseCSC A , DMatrixRMaj B , DMatrixRMaj C ) { if( A.numRows != B.numCols ) throw new MatrixDimensionException("Inconsistent matrix shapes. "+stringShapes(A,B)); C.reshape(A.numCols,B.numRows); ImplSparseSparseMult_DSCC.multTransAB(A,B,C); ...
java
public static void multTransAB(DMatrixSparseCSC A , DMatrixRMaj B , DMatrixRMaj C ) { if( A.numRows != B.numCols ) throw new MatrixDimensionException("Inconsistent matrix shapes. "+stringShapes(A,B)); C.reshape(A.numCols,B.numRows); ImplSparseSparseMult_DSCC.multTransAB(A,B,C); ...
[ "public", "static", "void", "multTransAB", "(", "DMatrixSparseCSC", "A", ",", "DMatrixRMaj", "B", ",", "DMatrixRMaj", "C", ")", "{", "if", "(", "A", ".", "numRows", "!=", "B", ".", "numCols", ")", "throw", "new", "MatrixDimensionException", "(", "\"Inconsist...
Performs matrix multiplication. C = A<sup>T</sup>*B<sup>T</sup> @param A Matrix @param B Dense Matrix @param C Dense Matrix
[ "Performs", "matrix", "multiplication", ".", "C", "=", "A<sup", ">", "T<", "/", "sup", ">", "*", "B<sup", ">", "T<", "/", "sup", ">" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L276-L283
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.getFlowSeries
public List<Flow> getFlowSeries(String cluster, String user, String appId, String version, boolean populateTasks, long startTime, long endTime, int limit) throws IOException { // TODO: use RunMatchFilter to limit scan on the server side byte[] rowPrefix = Bytes.toBytes( cluster + Constants.S...
java
public List<Flow> getFlowSeries(String cluster, String user, String appId, String version, boolean populateTasks, long startTime, long endTime, int limit) throws IOException { // TODO: use RunMatchFilter to limit scan on the server side byte[] rowPrefix = Bytes.toBytes( cluster + Constants.S...
[ "public", "List", "<", "Flow", ">", "getFlowSeries", "(", "String", "cluster", ",", "String", "user", ",", "String", "appId", ",", "String", "version", ",", "boolean", "populateTasks", ",", "long", "startTime", ",", "long", "endTime", ",", "int", "limit", ...
Returns the most recent {@link Flow} runs within that time range, up to {@code limit} instances. If the {@code version} parameter is non-null, the returned results will be restricted to those matching this app version. @param cluster the cluster where the jobs were run @param user the user running the jobs @param appI...
[ "Returns", "the", "most", "recent", "{", "@link", "Flow", "}", "runs", "within", "that", "time", "range", "up", "to", "{", "@code", "limit", "}", "instances", ".", "If", "the", "{", "@code", "version", "}", "parameter", "is", "non", "-", "null", "the",...
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L289-L316
Arello-Mobile/Moxy
moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java
MvpViewState.restoreState
protected void restoreState(View view, Set<ViewCommand<View>> currentState) { if (mViewCommands.isEmpty()) { return; } mViewCommands.reapply(view, currentState); }
java
protected void restoreState(View view, Set<ViewCommand<View>> currentState) { if (mViewCommands.isEmpty()) { return; } mViewCommands.reapply(view, currentState); }
[ "protected", "void", "restoreState", "(", "View", "view", ",", "Set", "<", "ViewCommand", "<", "View", ">", ">", "currentState", ")", "{", "if", "(", "mViewCommands", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "mViewCommands", ".", "reapply"...
Apply saved state to attached view @param view mvp view to restore state @param currentState commands that was applied already
[ "Apply", "saved", "state", "to", "attached", "view" ]
train
https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java#L36-L42
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java
ServiceManagementRecord.findServiceManagementRecord
public static ServiceManagementRecord findServiceManagementRecord(EntityManager em, Service service) { requireArgument(em != null, "Entity manager can not be null."); requireArgument(service != null, "Service cannot be null."); TypedQuery<ServiceManagementRecord> query = em.createNamedQuery("Se...
java
public static ServiceManagementRecord findServiceManagementRecord(EntityManager em, Service service) { requireArgument(em != null, "Entity manager can not be null."); requireArgument(service != null, "Service cannot be null."); TypedQuery<ServiceManagementRecord> query = em.createNamedQuery("Se...
[ "public", "static", "ServiceManagementRecord", "findServiceManagementRecord", "(", "EntityManager", "em", ",", "Service", "service", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager can not be null.\"", ")", ";", "requireArgument", "(", "serv...
Returns a record for the specified service. @param em The entity manager to use. Cannot be null. @param service The service for which to obtain the record. Cannot be null. @return The management record for the specified service or null if no record exists.
[ "Returns", "a", "record", "for", "the", "specified", "service", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java#L117-L129
konmik/satellite
valuemap/src/main/java/valuemap/ValueMap.java
ValueMap.get
public <T> T get(String key, T defaultValue) { if (map.containsKey(key)) { Object value = map.get(key); return (T)(value instanceof byte[] ? unmarshall((byte[])value) : value); } return defaultValue; }
java
public <T> T get(String key, T defaultValue) { if (map.containsKey(key)) { Object value = map.get(key); return (T)(value instanceof byte[] ? unmarshall((byte[])value) : value); } return defaultValue; }
[ "public", "<", "T", ">", "T", "get", "(", "String", "key", ",", "T", "defaultValue", ")", "{", "if", "(", "map", ".", "containsKey", "(", "key", ")", ")", "{", "Object", "value", "=", "map", ".", "get", "(", "key", ")", ";", "return", "(", "T",...
Returns the value of the mapping with the specified key, or the given default value.
[ "Returns", "the", "value", "of", "the", "mapping", "with", "the", "specified", "key", "or", "the", "given", "default", "value", "." ]
train
https://github.com/konmik/satellite/blob/7b0d3194bf84b3db4c233a131890a23e2d5825b9/valuemap/src/main/java/valuemap/ValueMap.java#L91-L97
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeFormatter.java
DateTimeFormatter.parseResolved0
private TemporalAccessor parseResolved0(final CharSequence text, final ParsePosition position) { ParsePosition pos = (position != null ? position : new ParsePosition(0)); DateTimeParseContext context = parseUnresolved0(text, pos); if (context == null || pos.getErrorIndex() >= 0 || (position == n...
java
private TemporalAccessor parseResolved0(final CharSequence text, final ParsePosition position) { ParsePosition pos = (position != null ? position : new ParsePosition(0)); DateTimeParseContext context = parseUnresolved0(text, pos); if (context == null || pos.getErrorIndex() >= 0 || (position == n...
[ "private", "TemporalAccessor", "parseResolved0", "(", "final", "CharSequence", "text", ",", "final", "ParsePosition", "position", ")", "{", "ParsePosition", "pos", "=", "(", "position", "!=", "null", "?", "position", ":", "new", "ParsePosition", "(", "0", ")", ...
Parses and resolves the specified text. <p> This parses to a {@code TemporalAccessor} ensuring that the text is fully parsed. @param text the text to parse, not null @param position the position to parse from, updated with length parsed and the index of any error, null if parsing whole string @return the resolved re...
[ "Parses", "and", "resolves", "the", "specified", "text", ".", "<p", ">", "This", "parses", "to", "a", "{", "@code", "TemporalAccessor", "}", "ensuring", "that", "the", "text", "is", "fully", "parsed", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeFormatter.java#L1937-L1956
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ejs/ras/hpel/Messages.java
Messages.getFormattedMessageFromLocalizedMessage
public static String getFormattedMessageFromLocalizedMessage(String traceString, Object[] newParms, boolean b) { String retVal = ""; try { retVal = MessageFormat.format(traceString, newParms); if (null == retVal && b) { retVal = traceString; // System.out.println("Using default key"); } } catch (...
java
public static String getFormattedMessageFromLocalizedMessage(String traceString, Object[] newParms, boolean b) { String retVal = ""; try { retVal = MessageFormat.format(traceString, newParms); if (null == retVal && b) { retVal = traceString; // System.out.println("Using default key"); } } catch (...
[ "public", "static", "String", "getFormattedMessageFromLocalizedMessage", "(", "String", "traceString", ",", "Object", "[", "]", "newParms", ",", "boolean", "b", ")", "{", "String", "retVal", "=", "\"\"", ";", "try", "{", "retVal", "=", "MessageFormat", ".", "f...
Retrieve a string from the bundle and format it using the parameters @param traceString localized string to be formatted @param newParms parameters to populate positional parameters in localized message @param b whether to return the initial string if formatting fails @return formatted and localized message
[ "Retrieve", "a", "string", "from", "the", "bundle", "and", "format", "it", "using", "the", "parameters" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ejs/ras/hpel/Messages.java#L96-L114
JOML-CI/JOML
src/org/joml/Quaterniond.java
Quaterniond.rotateTo
public Quaterniond rotateTo(double fromDirX, double fromDirY, double fromDirZ, double toDirX, double toDirY, double toDirZ) { return rotateTo(fromDirX, fromDirY, fromDirZ, toDirX, toDirY, toDirZ, this); }
java
public Quaterniond rotateTo(double fromDirX, double fromDirY, double fromDirZ, double toDirX, double toDirY, double toDirZ) { return rotateTo(fromDirX, fromDirY, fromDirZ, toDirX, toDirY, toDirZ, this); }
[ "public", "Quaterniond", "rotateTo", "(", "double", "fromDirX", ",", "double", "fromDirY", ",", "double", "fromDirZ", ",", "double", "toDirX", ",", "double", "toDirY", ",", "double", "toDirZ", ")", "{", "return", "rotateTo", "(", "fromDirX", ",", "fromDirY", ...
Apply a rotation to <code>this</code> that rotates the <code>fromDir</code> vector to point along <code>toDir</code>. <p> Since there can be multiple possible rotations, this method chooses the one with the shortest arc. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representin...
[ "Apply", "a", "rotation", "to", "<code", ">", "this<", "/", "code", ">", "that", "rotates", "the", "<code", ">", "fromDir<", "/", "code", ">", "vector", "to", "point", "along", "<code", ">", "toDir<", "/", "code", ">", ".", "<p", ">", "Since", "there...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L2098-L2100
JodaOrg/joda-time
src/main/java/org/joda/time/MutablePeriod.java
MutablePeriod.setPeriod
public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtil...
java
public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtil...
[ "public", "void", "setPeriod", "(", "ReadableInstant", "start", ",", "ReadableInstant", "end", ")", "{", "if", "(", "start", "==", "end", ")", "{", "setPeriod", "(", "0L", ")", ";", "}", "else", "{", "long", "startMillis", "=", "DateTimeUtils", ".", "get...
Sets all the fields in one go from two instants representing an interval. <p> The chronology of the start instant is used, unless that is null when the chronology of the end instant is used instead. @param start the start instant, null means now @param end the end instant, null means now @throws ArithmeticException ...
[ "Sets", "all", "the", "fields", "in", "one", "go", "from", "two", "instants", "representing", "an", "interval", ".", "<p", ">", "The", "chronology", "of", "the", "start", "instant", "is", "used", "unless", "that", "is", "null", "when", "the", "chronology",...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutablePeriod.java#L515-L524
wcm-io/wcm-io-sling
commons/src/main/java/io/wcm/sling/commons/resource/ResourceType.java
ResourceType.makeRelative
public static @NotNull String makeRelative(@NotNull String resourceType, @NotNull ResourceResolver resourceResolver) { String[] searchPaths = resourceResolver.getSearchPath(); for (String prefix : searchPaths) { if (StringUtils.startsWith(resourceType, prefix)) { return resourceType.substring(pref...
java
public static @NotNull String makeRelative(@NotNull String resourceType, @NotNull ResourceResolver resourceResolver) { String[] searchPaths = resourceResolver.getSearchPath(); for (String prefix : searchPaths) { if (StringUtils.startsWith(resourceType, prefix)) { return resourceType.substring(pref...
[ "public", "static", "@", "NotNull", "String", "makeRelative", "(", "@", "NotNull", "String", "resourceType", ",", "@", "NotNull", "ResourceResolver", "resourceResolver", ")", "{", "String", "[", "]", "searchPaths", "=", "resourceResolver", ".", "getSearchPath", "(...
Makes the given resource type relative by stripping off any search path prefix. In case the given resource type does not start with any of these prefixes it is returned unmodified. @param resourceType The resource type to make relative. @param resourceResolver Resource resolver @return Relative resource type
[ "Makes", "the", "given", "resource", "type", "relative", "by", "stripping", "off", "any", "search", "path", "prefix", ".", "In", "case", "the", "given", "resource", "type", "does", "not", "start", "with", "any", "of", "these", "prefixes", "it", "is", "retu...
train
https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/resource/ResourceType.java#L99-L107
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileVersionRetention.java
BoxFileVersionRetention.getRetentions
public static Iterable<BoxFileVersionRetention.Info> getRetentions( final BoxAPIConnection api, QueryFilter filter, String ... fields) { filter.addFields(fields); return new BoxResourceIterable<BoxFileVersionRetention.Info>(api, ALL_RETENTIONS_URL_TEMPLATE.buildWithQuery(api....
java
public static Iterable<BoxFileVersionRetention.Info> getRetentions( final BoxAPIConnection api, QueryFilter filter, String ... fields) { filter.addFields(fields); return new BoxResourceIterable<BoxFileVersionRetention.Info>(api, ALL_RETENTIONS_URL_TEMPLATE.buildWithQuery(api....
[ "public", "static", "Iterable", "<", "BoxFileVersionRetention", ".", "Info", ">", "getRetentions", "(", "final", "BoxAPIConnection", "api", ",", "QueryFilter", "filter", ",", "String", "...", "fields", ")", "{", "filter", ".", "addFields", "(", "fields", ")", ...
Retrieves all file version retentions matching given filters as an Iterable. @param api the API connection to be used by the resource. @param filter filters for the query stored in QueryFilter object. @param fields the fields to retrieve. @return an iterable contains information about all file version retentions matchi...
[ "Retrieves", "all", "file", "version", "retentions", "matching", "given", "filters", "as", "an", "Iterable", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersionRetention.java#L83-L96
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.compare
public static int compare(String s1, String s2, boolean ignoreCase) { if (s1 == null && s2 == null) { return 0; } else if (s1 == null) { return -1; } else if (s2 == null) { return 1; } return ignoreCase ? s1.compareToIgnoreCase(s2) : s1.compareTo(s2); }
java
public static int compare(String s1, String s2, boolean ignoreCase) { if (s1 == null && s2 == null) { return 0; } else if (s1 == null) { return -1; } else if (s2 == null) { return 1; } return ignoreCase ? s1.compareToIgnoreCase(s2) : s1.compareTo(s2); }
[ "public", "static", "int", "compare", "(", "String", "s1", ",", "String", "s2", ",", "boolean", "ignoreCase", ")", "{", "if", "(", "s1", "==", "null", "&&", "s2", "==", "null", ")", "{", "return", "0", ";", "}", "else", "if", "(", "s1", "==", "nu...
Null safe comparison of strings @param s1 string 1 @param s2 string 2 @param ignoreCase True perform case insensitive comparison, False perform case sensitive comparison @return as long as neither are null
[ "Null", "safe", "comparison", "of", "strings" ]
train
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L132-L141
cdk/cdk
doc/javadoc/source/XMIDoclet.java
XMIDoclet.generateUMLClass
private void generateUMLClass(ClassDoc[] classes, String pkgname) throws IOException { for (int i=0; i<classes.length; i++) { ClassDoc c = classes[i]; out.println(" <UML:Class stereotype=\"\" " + "package=\"" + pkgname + "\" " + ...
java
private void generateUMLClass(ClassDoc[] classes, String pkgname) throws IOException { for (int i=0; i<classes.length; i++) { ClassDoc c = classes[i]; out.println(" <UML:Class stereotype=\"\" " + "package=\"" + pkgname + "\" " + ...
[ "private", "void", "generateUMLClass", "(", "ClassDoc", "[", "]", "classes", ",", "String", "pkgname", ")", "throws", "IOException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classes", ".", "length", ";", "i", "++", ")", "{", "ClassDoc", ...
Method that serializes ClassDoc objects into &lt;UML:Class> elements. @param pkgs an array of ClassDoc objects
[ "Method", "that", "serializes", "ClassDoc", "objects", "into", "&lt", ";", "UML", ":", "Class", ">", "elements", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/doc/javadoc/source/XMIDoclet.java#L92-L115
strator-dev/greenpepper-open
extensions-external/php/src/main/java/com/greenpepper/phpsud/container/PHPClassPath.java
PHPClassPath.getClassDescriptor
public PHPClassDescriptor getClassDescriptor(String className, PHPContainer container) throws PHPException { return PHPClassDescriptor.getClassDescriptor(className, container, classCache); }
java
public PHPClassDescriptor getClassDescriptor(String className, PHPContainer container) throws PHPException { return PHPClassDescriptor.getClassDescriptor(className, container, classCache); }
[ "public", "PHPClassDescriptor", "getClassDescriptor", "(", "String", "className", ",", "PHPContainer", "container", ")", "throws", "PHPException", "{", "return", "PHPClassDescriptor", ".", "getClassDescriptor", "(", "className", ",", "container", ",", "classCache", ")",...
<p>getClassDescriptor.</p> @param className a {@link java.lang.String} object. @param container a {@link com.greenpepper.phpsud.container.PHPContainer} object. @return a {@link com.greenpepper.phpsud.container.PHPClassDescriptor} object. @throws com.greenpepper.phpsud.exceptions.PHPException if any.
[ "<p", ">", "getClassDescriptor", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper-open/blob/71fd244b4989e9cd2d07ae62dd954a1f2a269a92/extensions-external/php/src/main/java/com/greenpepper/phpsud/container/PHPClassPath.java#L54-L56
inferred/FreeBuilder
src/main/java/org/inferred/freebuilder/processor/model/ModelUtils.java
ModelUtils.upperBound
public static TypeMirror upperBound(Elements elements, TypeMirror type) { if (type.getKind() == TypeKind.WILDCARD) { WildcardType wildcard = (WildcardType) type; type = wildcard.getExtendsBound(); if (type == null) { type = elements.getTypeElement(Object.class.getName()).asType(); } ...
java
public static TypeMirror upperBound(Elements elements, TypeMirror type) { if (type.getKind() == TypeKind.WILDCARD) { WildcardType wildcard = (WildcardType) type; type = wildcard.getExtendsBound(); if (type == null) { type = elements.getTypeElement(Object.class.getName()).asType(); } ...
[ "public", "static", "TypeMirror", "upperBound", "(", "Elements", "elements", ",", "TypeMirror", "type", ")", "{", "if", "(", "type", ".", "getKind", "(", ")", "==", "TypeKind", ".", "WILDCARD", ")", "{", "WildcardType", "wildcard", "=", "(", "WildcardType", ...
Returns the upper bound of {@code type}.<ul> <li>T -> T <li>? -> Object <li>? extends T -> T <li>? super T -> Object </ul>
[ "Returns", "the", "upper", "bound", "of", "{" ]
train
https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/model/ModelUtils.java#L321-L330
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
ClassWriter.writeEnclosingMethodAttribute
protected int writeEnclosingMethodAttribute(Name attributeName, ClassSymbol c) { if (c.owner.kind != MTH && // neither a local class c.name != names.empty) // nor anonymous return 0; int alenIdx = writeAttr(attributeName); ClassSymbol enclClass = c.owner.enclClass(); ...
java
protected int writeEnclosingMethodAttribute(Name attributeName, ClassSymbol c) { if (c.owner.kind != MTH && // neither a local class c.name != names.empty) // nor anonymous return 0; int alenIdx = writeAttr(attributeName); ClassSymbol enclClass = c.owner.enclClass(); ...
[ "protected", "int", "writeEnclosingMethodAttribute", "(", "Name", "attributeName", ",", "ClassSymbol", "c", ")", "{", "if", "(", "c", ".", "owner", ".", "kind", "!=", "MTH", "&&", "// neither a local class", "c", ".", "name", "!=", "names", ".", "empty", ")"...
Write the EnclosingMethod attribute with a specified name. Returns the number of attributes written (0 or 1).
[ "Write", "the", "EnclosingMethod", "attribute", "with", "a", "specified", "name", ".", "Returns", "the", "number", "of", "attributes", "written", "(", "0", "or", "1", ")", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java#L546-L562
GoogleCloudPlatform/appengine-plugins-core
src/main/java/com/google/cloud/tools/managedcloudsdk/install/SdkInstaller.java
SdkInstaller.newInstaller
public static SdkInstaller newInstaller( Path managedSdkDirectory, Version version, OsInfo osInfo, String userAgentString, boolean usageReporting) { DownloaderFactory downloaderFactory = new DownloaderFactory(userAgentString); ExtractorFactory extractorFactory = new ExtractorFactor...
java
public static SdkInstaller newInstaller( Path managedSdkDirectory, Version version, OsInfo osInfo, String userAgentString, boolean usageReporting) { DownloaderFactory downloaderFactory = new DownloaderFactory(userAgentString); ExtractorFactory extractorFactory = new ExtractorFactor...
[ "public", "static", "SdkInstaller", "newInstaller", "(", "Path", "managedSdkDirectory", ",", "Version", "version", ",", "OsInfo", "osInfo", ",", "String", "userAgentString", ",", "boolean", "usageReporting", ")", "{", "DownloaderFactory", "downloaderFactory", "=", "ne...
Configure and create a new Installer instance. @param managedSdkDirectory home directory of google cloud java managed cloud SDKs @param version version of the Cloud SDK we want to install @param osInfo target operating system for installation @param userAgentString user agent string for https requests @param usageRepo...
[ "Configure", "and", "create", "a", "new", "Installer", "instance", "." ]
train
https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/d22e9fa1103522409ab6fdfbf68c4a5a0bc5b97d/src/main/java/com/google/cloud/tools/managedcloudsdk/install/SdkInstaller.java#L145-L162
GCRC/nunaliit
nunaliit2-couch-client/src/main/java/ca/carleton/gcrc/couch/fsentry/FSEntrySupport.java
FSEntrySupport.findDescendant
static public FSEntry findDescendant(FSEntry root, String path) throws Exception { if( null == root ) { throw new Exception("root parameter should not be null"); } List<String> pathFrags = interpretPath(path); // Iterate through path fragments, navigating through // the offered children FSEntry see...
java
static public FSEntry findDescendant(FSEntry root, String path) throws Exception { if( null == root ) { throw new Exception("root parameter should not be null"); } List<String> pathFrags = interpretPath(path); // Iterate through path fragments, navigating through // the offered children FSEntry see...
[ "static", "public", "FSEntry", "findDescendant", "(", "FSEntry", "root", ",", "String", "path", ")", "throws", "Exception", "{", "if", "(", "null", "==", "root", ")", "{", "throw", "new", "Exception", "(", "\"root parameter should not be null\"", ")", ";", "}"...
Traverses a directory structure designated by root and looks for a descendant with the provided path. If found, the supporting instance of FSEntry for the path is returned. If not found, null is returned. @param root Root of directory structure where the descendant is searched @param path Path of the seeked descendant ...
[ "Traverses", "a", "directory", "structure", "designated", "by", "root", "and", "looks", "for", "a", "descendant", "with", "the", "provided", "path", ".", "If", "found", "the", "supporting", "instance", "of", "FSEntry", "for", "the", "path", "is", "returned", ...
train
https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-couch-client/src/main/java/ca/carleton/gcrc/couch/fsentry/FSEntrySupport.java#L35-L65
eclipse/xtext-extras
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java
FeatureScopes.isValidFeatureCallArgument
protected boolean isValidFeatureCallArgument(XExpression expression, JvmIdentifiableElement linkedReceiver, IFeatureScopeSession session) { if (linkedReceiver instanceof JvmType) { IEObjectDescription knownSuperType = session.getLocalElement(SUPER); if (knownSuperType != null && linkedReceiver == knownSuperType...
java
protected boolean isValidFeatureCallArgument(XExpression expression, JvmIdentifiableElement linkedReceiver, IFeatureScopeSession session) { if (linkedReceiver instanceof JvmType) { IEObjectDescription knownSuperType = session.getLocalElement(SUPER); if (knownSuperType != null && linkedReceiver == knownSuperType...
[ "protected", "boolean", "isValidFeatureCallArgument", "(", "XExpression", "expression", ",", "JvmIdentifiableElement", "linkedReceiver", ",", "IFeatureScopeSession", "session", ")", "{", "if", "(", "linkedReceiver", "instanceof", "JvmType", ")", "{", "IEObjectDescription", ...
Returns <code>true</code> if the linked receiver may be passed as an argument. Basically everything could be passed as an argument except the linked receiver is null, a proxy or a reference to <code>super</code>.
[ "Returns", "<code", ">", "true<", "/", "code", ">", "if", "the", "linked", "receiver", "may", "be", "passed", "as", "an", "argument", ".", "Basically", "everything", "could", "be", "passed", "as", "an", "argument", "except", "the", "linked", "receiver", "i...
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/FeatureScopes.java#L291-L299
facebookarchive/hadoop-20
src/core/org/apache/hadoop/record/meta/StructTypeID.java
StructTypeID.genericReadTypeInfo
private FieldTypeInfo genericReadTypeInfo(RecordInput rin, String tag) throws IOException { String fieldName = rin.readString(tag); TypeID id = genericReadTypeID(rin, tag); return new FieldTypeInfo(fieldName, id); }
java
private FieldTypeInfo genericReadTypeInfo(RecordInput rin, String tag) throws IOException { String fieldName = rin.readString(tag); TypeID id = genericReadTypeID(rin, tag); return new FieldTypeInfo(fieldName, id); }
[ "private", "FieldTypeInfo", "genericReadTypeInfo", "(", "RecordInput", "rin", ",", "String", "tag", ")", "throws", "IOException", "{", "String", "fieldName", "=", "rin", ".", "readString", "(", "tag", ")", ";", "TypeID", "id", "=", "genericReadTypeID", "(", "r...
generic reader: reads the next TypeInfo object from stream and returns it
[ "generic", "reader", ":", "reads", "the", "next", "TypeInfo", "object", "from", "stream", "and", "returns", "it" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/record/meta/StructTypeID.java#L99-L103
google/closure-compiler
src/com/google/javascript/rhino/jstype/JSTypeRegistry.java
JSTypeRegistry.createTemplatizedType
public TemplatizedType createTemplatizedType(ObjectType baseType, JSType... templatizedTypes) { return createTemplatizedType(baseType, ImmutableList.copyOf(templatizedTypes)); }
java
public TemplatizedType createTemplatizedType(ObjectType baseType, JSType... templatizedTypes) { return createTemplatizedType(baseType, ImmutableList.copyOf(templatizedTypes)); }
[ "public", "TemplatizedType", "createTemplatizedType", "(", "ObjectType", "baseType", ",", "JSType", "...", "templatizedTypes", ")", "{", "return", "createTemplatizedType", "(", "baseType", ",", "ImmutableList", ".", "copyOf", "(", "templatizedTypes", ")", ")", ";", ...
Creates a templatized instance of the specified type. Only ObjectTypes can currently be templatized; extend the logic in this function when more types can be templatized. @param baseType the type to be templatized. @param templatizedTypes a list of the template JSTypes. Will be matched by list order to the template ke...
[ "Creates", "a", "templatized", "instance", "of", "the", "specified", "type", ".", "Only", "ObjectTypes", "can", "currently", "be", "templatized", ";", "extend", "the", "logic", "in", "this", "function", "when", "more", "types", "can", "be", "templatized", "." ...
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L1929-L1931
jenkinsci/jenkins
core/src/main/java/hudson/Launcher.java
Launcher.printCommandLine
protected final void printCommandLine(@Nonnull String[] cmd, @CheckForNull FilePath workDir) { StringBuilder buf = new StringBuilder(); if (workDir != null) { buf.append('['); if(showFullPath) buf.append(workDir.getRemote()); else buf.a...
java
protected final void printCommandLine(@Nonnull String[] cmd, @CheckForNull FilePath workDir) { StringBuilder buf = new StringBuilder(); if (workDir != null) { buf.append('['); if(showFullPath) buf.append(workDir.getRemote()); else buf.a...
[ "protected", "final", "void", "printCommandLine", "(", "@", "Nonnull", "String", "[", "]", "cmd", ",", "@", "CheckForNull", "FilePath", "workDir", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "workDir", "!=", "nu...
Prints out the command line to the listener so that users know what we are doing.
[ "Prints", "out", "the", "command", "line", "to", "the", "listener", "so", "that", "users", "know", "what", "we", "are", "doing", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Launcher.java#L742-L765
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/message/analytics/GenericAnalyticsRequest.java
GenericAnalyticsRequest.jsonQuery
public static GenericAnalyticsRequest jsonQuery(String jsonQuery, String bucket, String username, String password) { return jsonQuery(jsonQuery, bucket, username, password, NO_PRIORITY); }
java
public static GenericAnalyticsRequest jsonQuery(String jsonQuery, String bucket, String username, String password) { return jsonQuery(jsonQuery, bucket, username, password, NO_PRIORITY); }
[ "public", "static", "GenericAnalyticsRequest", "jsonQuery", "(", "String", "jsonQuery", ",", "String", "bucket", ",", "String", "username", ",", "String", "password", ")", "{", "return", "jsonQuery", "(", "jsonQuery", ",", "bucket", ",", "username", ",", "passwo...
Create a {@link GenericAnalyticsRequest} and mark it as containing a full Analytics query in Json form (including additional query parameters). The simplest form of such a query is a single statement encapsulated in a json query object: <pre>{"statement":"SELECT * FROM default"}</pre>. @param jsonQuery the Analytics ...
[ "Create", "a", "{", "@link", "GenericAnalyticsRequest", "}", "and", "mark", "it", "as", "containing", "a", "full", "Analytics", "query", "in", "Json", "form", "(", "including", "additional", "query", "parameters", ")", "." ]
train
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/analytics/GenericAnalyticsRequest.java#L132-L134
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/types/CharacterType.java
CharacterType.getRightTrimSise
public static int getRightTrimSise(String s, char trim) { int endindex = s.length(); for (--endindex; endindex >= 0 && s.charAt(endindex) == trim; endindex--) {} endindex++; return endindex; }
java
public static int getRightTrimSise(String s, char trim) { int endindex = s.length(); for (--endindex; endindex >= 0 && s.charAt(endindex) == trim; endindex--) {} endindex++; return endindex; }
[ "public", "static", "int", "getRightTrimSise", "(", "String", "s", ",", "char", "trim", ")", "{", "int", "endindex", "=", "s", ".", "length", "(", ")", ";", "for", "(", "--", "endindex", ";", "endindex", ">=", "0", "&&", "s", ".", "charAt", "(", "e...
/* public static Object concat(Object a, Object b) { if (a == null || b == null) { return null; } return a.toString() + b.toString(); }
[ "/", "*", "public", "static", "Object", "concat", "(", "Object", "a", "Object", "b", ")", "{" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/CharacterType.java#L965-L975
actorapp/actor-platform
actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java
MarkdownParser.findSpanEnd
private int findSpanEnd(TextCursor cursor, int spanStart, int limit, char span) { for (int i = spanStart + 1; i < limit; i++) { char c = cursor.text.charAt(i); if (c == span) { // Check prev and next symbols if (isGoodAnchor(cursor.text, i + 1) && isNotSym...
java
private int findSpanEnd(TextCursor cursor, int spanStart, int limit, char span) { for (int i = spanStart + 1; i < limit; i++) { char c = cursor.text.charAt(i); if (c == span) { // Check prev and next symbols if (isGoodAnchor(cursor.text, i + 1) && isNotSym...
[ "private", "int", "findSpanEnd", "(", "TextCursor", "cursor", ",", "int", "spanStart", ",", "int", "limit", ",", "char", "span", ")", "{", "for", "(", "int", "i", "=", "spanStart", "+", "1", ";", "i", "<", "limit", ";", "i", "++", ")", "{", "char",...
Searching for valid formatting span end @param cursor text cursor @param spanStart expected span start @param limit maximum index in cursor @param span span control character @return span end, -1 if not found
[ "Searching", "for", "valid", "formatting", "span", "end" ]
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java#L293-L304
anotheria/configureme
src/main/java/org/configureme/mbean/util/MBeanRegisterUtil.java
MBeanRegisterUtil.buildObjectName
private static String buildObjectName(final Object object, final String... parameters) { final StringBuilder objectName = new StringBuilder(); objectName.append(object.getClass().getPackage().getName()); objectName.append(":type="); objectName.append(object.getClass().getName()); if (parameters.length > 0) { ...
java
private static String buildObjectName(final Object object, final String... parameters) { final StringBuilder objectName = new StringBuilder(); objectName.append(object.getClass().getPackage().getName()); objectName.append(":type="); objectName.append(object.getClass().getName()); if (parameters.length > 0) { ...
[ "private", "static", "String", "buildObjectName", "(", "final", "Object", "object", ",", "final", "String", "...", "parameters", ")", "{", "final", "StringBuilder", "objectName", "=", "new", "StringBuilder", "(", ")", ";", "objectName", ".", "append", "(", "ob...
Return object name with which will be register in {@link MBeanServer}. @param object provided object @param parameters additional parameters @return object name
[ "Return", "object", "name", "with", "which", "will", "be", "register", "in", "{", "@link", "MBeanServer", "}", "." ]
train
https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/mbean/util/MBeanRegisterUtil.java#L59-L80
HubSpot/Singularity
SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java
SingularityClient.browseTaskSandBox
public Optional<SingularitySandbox> browseTaskSandBox(String taskId, String path) { final Function<String, String> requestUrl = (host) -> String.format(SANDBOX_BROWSE_FORMAT, getApiBase(host), taskId); return getSingleWithParams(requestUrl, "browse sandbox for task", taskId, Optional.of(ImmutableMap.of("path",...
java
public Optional<SingularitySandbox> browseTaskSandBox(String taskId, String path) { final Function<String, String> requestUrl = (host) -> String.format(SANDBOX_BROWSE_FORMAT, getApiBase(host), taskId); return getSingleWithParams(requestUrl, "browse sandbox for task", taskId, Optional.of(ImmutableMap.of("path",...
[ "public", "Optional", "<", "SingularitySandbox", ">", "browseTaskSandBox", "(", "String", "taskId", ",", "String", "path", ")", "{", "final", "Function", "<", "String", ",", "String", ">", "requestUrl", "=", "(", "host", ")", "-", ">", "String", ".", "form...
Retrieve information about a specific task's sandbox @param taskId The task ID to browse @param path The path to browse from. if not specified it will browse from the sandbox root. @return A {@link SingularitySandbox} object that captures the information for the path to a specific task's Mesos sandbox
[ "Retrieve", "information", "about", "a", "specific", "task", "s", "sandbox" ]
train
https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java#L1284-L1289
micronaut-projects/micronaut-core
cli/src/main/groovy/io/micronaut/cli/console/logging/MicronautConsole.java
MicronautConsole.reinitialize
public void reinitialize(InputStream systemIn, PrintStream systemOut, PrintStream systemErr) throws IOException { if (reader != null) { reader.shutdown(); } initialize(systemIn, systemOut, systemErr); }
java
public void reinitialize(InputStream systemIn, PrintStream systemOut, PrintStream systemErr) throws IOException { if (reader != null) { reader.shutdown(); } initialize(systemIn, systemOut, systemErr); }
[ "public", "void", "reinitialize", "(", "InputStream", "systemIn", ",", "PrintStream", "systemOut", ",", "PrintStream", "systemErr", ")", "throws", "IOException", "{", "if", "(", "reader", "!=", "null", ")", "{", "reader", ".", "shutdown", "(", ")", ";", "}",...
Use in testing when System.out, System.err or System.in change. @param systemIn The system in @param systemOut The system out @param systemErr The system err @throws IOException if there is an error
[ "Use", "in", "testing", "when", "System", ".", "out", "System", ".", "err", "or", "System", ".", "in", "change", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/console/logging/MicronautConsole.java#L196-L201
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/ServerCommandListener.java
ServerCommandListener.asyncResponse
private synchronized void asyncResponse(String command, SocketChannel sc) { if (closed) { Utils.tryToClose(sc); } else { Thread thread = new Thread(new ResponseThread(command, sc), "kernel-" + command + "-command-response"); // We allow a maximum of one outstanding s...
java
private synchronized void asyncResponse(String command, SocketChannel sc) { if (closed) { Utils.tryToClose(sc); } else { Thread thread = new Thread(new ResponseThread(command, sc), "kernel-" + command + "-command-response"); // We allow a maximum of one outstanding s...
[ "private", "synchronized", "void", "asyncResponse", "(", "String", "command", ",", "SocketChannel", "sc", ")", "{", "if", "(", "closed", ")", "{", "Utils", ".", "tryToClose", "(", "sc", ")", ";", "}", "else", "{", "Thread", "thread", "=", "new", "Thread"...
Creates a single thread to wait for the command to complete then respond.
[ "Creates", "a", "single", "thread", "to", "wait", "for", "the", "command", "to", "complete", "then", "respond", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/ServerCommandListener.java#L474-L488
ixa-ehu/kaflib
src/main/java/ixa/kaflib/KAFDocument.java
KAFDocument.newProperty
public Feature newProperty(String id, String lemma, List<Span<Term>> references) { idManager.updateCounter(AnnotationType.PROPERTY, id); Feature newProperty = new Feature(id, lemma, references); annotationContainer.add(newProperty, Layer.PROPERTIES, AnnotationType.PROPERTY); return newProperty; }
java
public Feature newProperty(String id, String lemma, List<Span<Term>> references) { idManager.updateCounter(AnnotationType.PROPERTY, id); Feature newProperty = new Feature(id, lemma, references); annotationContainer.add(newProperty, Layer.PROPERTIES, AnnotationType.PROPERTY); return newProperty; }
[ "public", "Feature", "newProperty", "(", "String", "id", ",", "String", "lemma", ",", "List", "<", "Span", "<", "Term", ">", ">", "references", ")", "{", "idManager", ".", "updateCounter", "(", "AnnotationType", ".", "PROPERTY", ",", "id", ")", ";", "Fea...
Creates a new property. It receives it's ID as an argument. The property is added to the document. @param id the ID of the property. @param lemma the lemma of the property. @param references different mentions (list of targets) to the same property. @return a new coreference.
[ "Creates", "a", "new", "property", ".", "It", "receives", "it", "s", "ID", "as", "an", "argument", ".", "The", "property", "is", "added", "to", "the", "document", "." ]
train
https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L902-L907
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/html/swf/HCSWFObject.java
HCSWFObject.addObjectAttr
@Nonnull public final HCSWFObject addObjectAttr (@Nonnull final String sName, final String sValue) { if (!JSMarshaller.isJSIdentifier (sName)) throw new IllegalArgumentException ("The name '" + sName + "' is not a legal JS identifier!"); if (m_aObjectAttrs == null) m_aObjectAttrs = new CommonsL...
java
@Nonnull public final HCSWFObject addObjectAttr (@Nonnull final String sName, final String sValue) { if (!JSMarshaller.isJSIdentifier (sName)) throw new IllegalArgumentException ("The name '" + sName + "' is not a legal JS identifier!"); if (m_aObjectAttrs == null) m_aObjectAttrs = new CommonsL...
[ "@", "Nonnull", "public", "final", "HCSWFObject", "addObjectAttr", "(", "@", "Nonnull", "final", "String", "sName", ",", "final", "String", "sValue", ")", "{", "if", "(", "!", "JSMarshaller", ".", "isJSIdentifier", "(", "sName", ")", ")", "throw", "new", "...
Add an attribute to the created <code>object</code> tag @param sName Attribute name @param sValue Attribute value @return this
[ "Add", "an", "attribute", "to", "the", "created", "<code", ">", "object<", "/", "code", ">", "tag" ]
train
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/html/swf/HCSWFObject.java#L241-L251