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
geomajas/geomajas-project-client-gwt
plugin/editing/editing-javascript-api-gwt/src/main/java/org/geomajas/plugin/editing/jsapi/gwt/client/gfx/JsSnapService.java
JsSnapService.addNearestVertexSnappingRule
public void addNearestVertexSnappingRule(String snapLayer, double distance) { SnapSourceProvider snapSourceProvider = new VectorLayerSourceProvider(editor.getMapWidget().getMapModel() .getVectorLayer(snapLayer)); delegate.addSnappingRule(new SnappingRule(new NearestVertexSnapAlgorithm(), snapSourceProvider, distance)); }
java
public void addNearestVertexSnappingRule(String snapLayer, double distance) { SnapSourceProvider snapSourceProvider = new VectorLayerSourceProvider(editor.getMapWidget().getMapModel() .getVectorLayer(snapLayer)); delegate.addSnappingRule(new SnappingRule(new NearestVertexSnapAlgorithm(), snapSourceProvider, distance)); }
[ "public", "void", "addNearestVertexSnappingRule", "(", "String", "snapLayer", ",", "double", "distance", ")", "{", "SnapSourceProvider", "snapSourceProvider", "=", "new", "VectorLayerSourceProvider", "(", "editor", ".", "getMapWidget", "(", ")", ".", "getMapModel", "(...
Add a new snapping rules to the list. Each new rule provides information on how snapping should occur. The added rule will use algorithm {@link NearestVertexSnapAlgorithm}. @param snapLayer The layer id that will provide the target geometries where to snap. @param distance The maximum distance to bridge during snapping. unit=meters.
[ "Add", "a", "new", "snapping", "rules", "to", "the", "list", ".", "Each", "new", "rule", "provides", "information", "on", "how", "snapping", "should", "occur", ".", "The", "added", "rule", "will", "use", "algorithm", "{", "@link", "NearestVertexSnapAlgorithm",...
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/editing/editing-javascript-api-gwt/src/main/java/org/geomajas/plugin/editing/jsapi/gwt/client/gfx/JsSnapService.java#L66-L70
Jasig/uPortal
uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/QualityOfServiceBlockingQueue.java
QualityOfServiceBlockingQueue.waitForAdd
private boolean waitForAdd(long waitStart, long maxWait) throws InterruptedException { while (this.size == 0) { if (!waitOnCondition(this.notEmpty, maxWait, waitStart)) { return false; } } return true; }
java
private boolean waitForAdd(long waitStart, long maxWait) throws InterruptedException { while (this.size == 0) { if (!waitOnCondition(this.notEmpty, maxWait, waitStart)) { return false; } } return true; }
[ "private", "boolean", "waitForAdd", "(", "long", "waitStart", ",", "long", "maxWait", ")", "throws", "InterruptedException", "{", "while", "(", "this", ".", "size", "==", "0", ")", "{", "if", "(", "!", "waitOnCondition", "(", "this", ".", "notEmpty", ",", ...
This MUST be called while {@link #writeLock} is locked by the current thread
[ "This", "MUST", "be", "called", "while", "{" ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/QualityOfServiceBlockingQueue.java#L688-L696
hibernate/hibernate-ogm
neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java
EmbeddedNeo4jEntityQueries.removeEntity
public void removeEntity(GraphDatabaseService executionEngine, Object[] columnValues) { Map<String, Object> params = params( columnValues ); executionEngine.execute( getRemoveEntityQuery(), params ); }
java
public void removeEntity(GraphDatabaseService executionEngine, Object[] columnValues) { Map<String, Object> params = params( columnValues ); executionEngine.execute( getRemoveEntityQuery(), params ); }
[ "public", "void", "removeEntity", "(", "GraphDatabaseService", "executionEngine", ",", "Object", "[", "]", "columnValues", ")", "{", "Map", "<", "String", ",", "Object", ">", "params", "=", "params", "(", "columnValues", ")", ";", "executionEngine", ".", "exec...
Remove the nodes representing the entity and the embedded elements attached to it. @param executionEngine the {@link GraphDatabaseService} used to run the query @param columnValues the values of the key identifying the entity to remove
[ "Remove", "the", "nodes", "representing", "the", "entity", "and", "the", "embedded", "elements", "attached", "to", "it", "." ]
train
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L154-L157
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectAllValuesFromImpl_CustomFieldSerializer.java
OWLObjectAllValuesFromImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLObjectAllValuesFromImpl instance) throws SerializationException { serialize(streamWriter, instance); }
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLObjectAllValuesFromImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLObjectAllValuesFromImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.client.rpc.SerializationException if the serialization operation is not successful
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{", "@link", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "rpc", ".", "SerializationStreamWriter", "}", "." ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectAllValuesFromImpl_CustomFieldSerializer.java#L73-L76
bazaarvoice/emodb
mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseRecordReader.java
BaseRecordReader.setNextKeyValue
public boolean setNextKeyValue(Text key, Row value) throws IOException { if (!_rows.hasNext()) { Closeables.close(this, true); return false; } try { Map<String, Object> content = _rows.next(); key.set(Coordinate.fromJson(content).toString()); value.set(content); _rowsRead += 1; } catch (Exception e) { for (Throwable cause : Throwables.getCausalChain(e)) { Throwables.propagateIfInstanceOf(cause, IOException.class); } throw new IOException("Failed to read next row", e); } return true; }
java
public boolean setNextKeyValue(Text key, Row value) throws IOException { if (!_rows.hasNext()) { Closeables.close(this, true); return false; } try { Map<String, Object> content = _rows.next(); key.set(Coordinate.fromJson(content).toString()); value.set(content); _rowsRead += 1; } catch (Exception e) { for (Throwable cause : Throwables.getCausalChain(e)) { Throwables.propagateIfInstanceOf(cause, IOException.class); } throw new IOException("Failed to read next row", e); } return true; }
[ "public", "boolean", "setNextKeyValue", "(", "Text", "key", ",", "Row", "value", ")", "throws", "IOException", "{", "if", "(", "!", "_rows", ".", "hasNext", "(", ")", ")", "{", "Closeables", ".", "close", "(", "this", ",", "true", ")", ";", "return", ...
Read the next row from the split, storing the coordinate in "key" and the content in "value". If there are no more rows then false is returned and "key" and "value" are not modified. @return true if a row was read, false if there were no more rows
[ "Read", "the", "next", "row", "from", "the", "split", "storing", "the", "coordinate", "in", "key", "and", "the", "content", "in", "value", ".", "If", "there", "are", "no", "more", "rows", "then", "false", "is", "returned", "and", "key", "and", "value", ...
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/BaseRecordReader.java#L52-L71
motown-io/motown
samples/authentication/src/main/java/io/motown/sample/authentication/rest/TokenUtils.java
TokenUtils.validateToken
public static boolean validateToken(String authToken, UserDetails userDetails) { String[] parts = authToken.split(TOKEN_SEPARATOR); long expires = Long.parseLong(parts[1]); String signature = parts[2]; return expires >= System.currentTimeMillis() && signature.equals(TokenUtils.computeSignature(userDetails, expires)); }
java
public static boolean validateToken(String authToken, UserDetails userDetails) { String[] parts = authToken.split(TOKEN_SEPARATOR); long expires = Long.parseLong(parts[1]); String signature = parts[2]; return expires >= System.currentTimeMillis() && signature.equals(TokenUtils.computeSignature(userDetails, expires)); }
[ "public", "static", "boolean", "validateToken", "(", "String", "authToken", ",", "UserDetails", "userDetails", ")", "{", "String", "[", "]", "parts", "=", "authToken", ".", "split", "(", "TOKEN_SEPARATOR", ")", ";", "long", "expires", "=", "Long", ".", "pars...
Validates the token signature against the user details and the current system time. @param authToken authorization token. @param userDetails user details. @return true if token is not expired and is equal to computed signature on base of user details.
[ "Validates", "the", "token", "signature", "against", "the", "user", "details", "and", "the", "current", "system", "time", "." ]
train
https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/samples/authentication/src/main/java/io/motown/sample/authentication/rest/TokenUtils.java#L101-L107
RestComm/sip-servlets
containers/sip-servlets-as8-drop-in/jboss-as-restcomm/src/main/java/org/mobicents/as8/deployment/SIPWebContext.java
SIPWebContext.getSipContextAnchorDu
public static DeploymentUnit getSipContextAnchorDu(final DeploymentUnit du) { // attach context to top-level deploymentUnit so it can be used to get context resources (SipFactory, etc.) DeploymentUnit parentDu = du.getParent(); if (parentDu == null) { // this is a war only deployment return du; } else if (DeploymentTypeMarker.isType(DeploymentType.EAR, parentDu)) { return parentDu; } else { logger.error("Can't find proper anchor deployment unit for " + du.getName() + " - This is probably a bug"); return null; } }
java
public static DeploymentUnit getSipContextAnchorDu(final DeploymentUnit du) { // attach context to top-level deploymentUnit so it can be used to get context resources (SipFactory, etc.) DeploymentUnit parentDu = du.getParent(); if (parentDu == null) { // this is a war only deployment return du; } else if (DeploymentTypeMarker.isType(DeploymentType.EAR, parentDu)) { return parentDu; } else { logger.error("Can't find proper anchor deployment unit for " + du.getName() + " - This is probably a bug"); return null; } }
[ "public", "static", "DeploymentUnit", "getSipContextAnchorDu", "(", "final", "DeploymentUnit", "du", ")", "{", "// attach context to top-level deploymentUnit so it can be used to get context resources (SipFactory, etc.)", "DeploymentUnit", "parentDu", "=", "du", ".", "getParent", "...
returns the anchor deployment unit that will have attached a SIPWebContext
[ "returns", "the", "anchor", "deployment", "unit", "that", "will", "have", "attached", "a", "SIPWebContext" ]
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/containers/sip-servlets-as8-drop-in/jboss-as-restcomm/src/main/java/org/mobicents/as8/deployment/SIPWebContext.java#L592-L604
kobakei/Android-RateThisApp
ratethisapp/src/main/java/com/kobakei/ratethisapp/RateThisApp.java
RateThisApp.printStatus
private static void printStatus(final Context context) { SharedPreferences pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); log("*** RateThisApp Status ***"); log("Install Date: " + new Date(pref.getLong(KEY_INSTALL_DATE, 0))); log("Launch Times: " + pref.getInt(KEY_LAUNCH_TIMES, 0)); log("Opt out: " + pref.getBoolean(KEY_OPT_OUT, false)); }
java
private static void printStatus(final Context context) { SharedPreferences pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); log("*** RateThisApp Status ***"); log("Install Date: " + new Date(pref.getLong(KEY_INSTALL_DATE, 0))); log("Launch Times: " + pref.getInt(KEY_LAUNCH_TIMES, 0)); log("Opt out: " + pref.getBoolean(KEY_OPT_OUT, false)); }
[ "private", "static", "void", "printStatus", "(", "final", "Context", "context", ")", "{", "SharedPreferences", "pref", "=", "context", ".", "getSharedPreferences", "(", "PREF_NAME", ",", "Context", ".", "MODE_PRIVATE", ")", ";", "log", "(", "\"*** RateThisApp Stat...
Print values in SharedPreferences (used for debug) @param context
[ "Print", "values", "in", "SharedPreferences", "(", "used", "for", "debug", ")" ]
train
https://github.com/kobakei/Android-RateThisApp/blob/c3d007c8c02beb6ff196745c2310c259737f5c81/ratethisapp/src/main/java/com/kobakei/ratethisapp/RateThisApp.java#L368-L374
atomix/atomix
protocols/log/src/main/java/io/atomix/protocols/log/DistributedLogProtocolBuilder.java
DistributedLogProtocolBuilder.withRetryDelay
public DistributedLogProtocolBuilder withRetryDelay(long retryDelay, TimeUnit timeUnit) { return withRetryDelay(Duration.ofMillis(timeUnit.toMillis(retryDelay))); }
java
public DistributedLogProtocolBuilder withRetryDelay(long retryDelay, TimeUnit timeUnit) { return withRetryDelay(Duration.ofMillis(timeUnit.toMillis(retryDelay))); }
[ "public", "DistributedLogProtocolBuilder", "withRetryDelay", "(", "long", "retryDelay", ",", "TimeUnit", "timeUnit", ")", "{", "return", "withRetryDelay", "(", "Duration", ".", "ofMillis", "(", "timeUnit", ".", "toMillis", "(", "retryDelay", ")", ")", ")", ";", ...
Sets the operation retry delay. @param retryDelay the delay between operation retries @param timeUnit the delay time unit @return the proxy builder @throws NullPointerException if the time unit is null
[ "Sets", "the", "operation", "retry", "delay", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/log/src/main/java/io/atomix/protocols/log/DistributedLogProtocolBuilder.java#L109-L111
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/Predicates.java
Predicates.lessEqual
public static Predicate lessEqual(String attribute, Comparable value) { return new GreaterLessPredicate(attribute, value, true, true); }
java
public static Predicate lessEqual(String attribute, Comparable value) { return new GreaterLessPredicate(attribute, value, true, true); }
[ "public", "static", "Predicate", "lessEqual", "(", "String", "attribute", ",", "Comparable", "value", ")", "{", "return", "new", "GreaterLessPredicate", "(", "attribute", ",", "value", ",", "true", ",", "true", ")", ";", "}" ]
Creates a <b>less than or equal to</b> predicate that will pass items if the value stored under the given item {@code attribute} is less than or equal to the given {@code value}. <p> See also <i>Special Attributes</i>, <i>Attribute Paths</i>, <i>Handling of {@code null}</i> and <i>Implicit Type Conversion</i> sections of {@link Predicates}. @param attribute the left-hand side attribute to fetch the value for comparison from. @param value the right-hand side value to compare the attribute value against. @return the created <b>less than or equal to</b> predicate. @throws IllegalArgumentException if the {@code attribute} does not exist.
[ "Creates", "a", "<b", ">", "less", "than", "or", "equal", "to<", "/", "b", ">", "predicate", "that", "will", "pass", "items", "if", "the", "value", "stored", "under", "the", "given", "item", "{", "@code", "attribute", "}", "is", "less", "than", "or", ...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/Predicates.java#L392-L394
lukas-krecan/lambda-param-name-extractor
src/main/java/net/javacrumbs/lambdaextractor/ParameterNameExtractor.java
ParameterNameExtractor.lambdaMethod
private static Method lambdaMethod(SerializedLambda serializedLambda) { Class<?> containingClass = getClassForName(serializedLambda.getImplClass()); String implMethodName = serializedLambda.getImplMethodName(); return getMethod(containingClass, implMethodName); }
java
private static Method lambdaMethod(SerializedLambda serializedLambda) { Class<?> containingClass = getClassForName(serializedLambda.getImplClass()); String implMethodName = serializedLambda.getImplMethodName(); return getMethod(containingClass, implMethodName); }
[ "private", "static", "Method", "lambdaMethod", "(", "SerializedLambda", "serializedLambda", ")", "{", "Class", "<", "?", ">", "containingClass", "=", "getClassForName", "(", "serializedLambda", ".", "getImplClass", "(", ")", ")", ";", "String", "implMethodName", "...
<ol> <li>Serializes lambda to SerializedLambda</li> <li>Finds containing class - class where the lambda method is implemented</li> <li>Finds the method in the containing class</li> </ol>
[ "<ol", ">", "<li", ">", "Serializes", "lambda", "to", "SerializedLambda<", "/", "li", ">", "<li", ">", "Finds", "containing", "class", "-", "class", "where", "the", "lambda", "method", "is", "implemented<", "/", "li", ">", "<li", ">", "Finds", "the", "me...
train
https://github.com/lukas-krecan/lambda-param-name-extractor/blob/dec73479df14797771c8ec92819577f32a679362/src/main/java/net/javacrumbs/lambdaextractor/ParameterNameExtractor.java#L83-L87
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.createProject_POST
public OvhNewProject createProject_POST(Long credit, String description, String voucher) throws IOException { String qPath = "/cloud/createProject"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "credit", credit); addBody(o, "description", description); addBody(o, "voucher", voucher); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhNewProject.class); }
java
public OvhNewProject createProject_POST(Long credit, String description, String voucher) throws IOException { String qPath = "/cloud/createProject"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "credit", credit); addBody(o, "description", description); addBody(o, "voucher", voucher); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhNewProject.class); }
[ "public", "OvhNewProject", "createProject_POST", "(", "Long", "credit", ",", "String", "description", ",", "String", "voucher", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/createProject\"", ";", "StringBuilder", "sb", "=", "path", "(", "qP...
Start a new cloud project REST: POST /cloud/createProject @param credit [required] Amount of cloud credit to purchase. Unit is base currency. @param description [required] Project description @param voucher [required] Voucher code
[ "Start", "a", "new", "cloud", "project" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2356-L2365
airlift/resolver
resolver/src/main/java/io/airlift/resolver/internal/Slf4jLoggerManager.java
Slf4jLoggerManager.getLoggerForComponent
public Logger getLoggerForComponent(String role, String hint) { return (null == hint ? getLoggerForComponent(role) : new Slf4jLogger(loggerFactory.getLogger(role + '.' + hint))); }
java
public Logger getLoggerForComponent(String role, String hint) { return (null == hint ? getLoggerForComponent(role) : new Slf4jLogger(loggerFactory.getLogger(role + '.' + hint))); }
[ "public", "Logger", "getLoggerForComponent", "(", "String", "role", ",", "String", "hint", ")", "{", "return", "(", "null", "==", "hint", "?", "getLoggerForComponent", "(", "role", ")", ":", "new", "Slf4jLogger", "(", "loggerFactory", ".", "getLogger", "(", ...
The logger name for a component with a non-null hint is <code>role.hint</code>. <b>Warning</b>: this does not conform to logger name as class name convention. (and what about <code>null</code> and <code>default</code> hint equivalence?)
[ "The", "logger", "name", "for", "a", "component", "with", "a", "non", "-", "null", "hint", "is", "<code", ">", "role", ".", "hint<", "/", "code", ">", ".", "<b", ">", "Warning<", "/", "b", ">", ":", "this", "does", "not", "conform", "to", "logger",...
train
https://github.com/airlift/resolver/blob/d34a9f3f9c5b0b94007a324d61771bf7eeb27592/resolver/src/main/java/io/airlift/resolver/internal/Slf4jLoggerManager.java#L53-L58
lessthanoptimal/ejml
main/ejml-core/src/org/ejml/data/DMatrixRMaj.java
DMatrixRMaj.get
@Override public double get( int row , int col ) { if( col < 0 || col >= numCols || row < 0 || row >= numRows ) { throw new IllegalArgumentException("Specified element is out of bounds: "+row+" "+col); } return data[ row * numCols + col ]; }
java
@Override public double get( int row , int col ) { if( col < 0 || col >= numCols || row < 0 || row >= numRows ) { throw new IllegalArgumentException("Specified element is out of bounds: "+row+" "+col); } return data[ row * numCols + col ]; }
[ "@", "Override", "public", "double", "get", "(", "int", "row", ",", "int", "col", ")", "{", "if", "(", "col", "<", "0", "||", "col", ">=", "numCols", "||", "row", "<", "0", "||", "row", ">=", "numRows", ")", "{", "throw", "new", "IllegalArgumentExc...
Returns the value of the specified matrix element. Performs a bounds check to make sure the requested element is part of the matrix. @param row The row of the element. @param col The column of the element. @return The value of the element.
[ "Returns", "the", "value", "of", "the", "specified", "matrix", "element", ".", "Performs", "a", "bounds", "check", "to", "make", "sure", "the", "requested", "element", "is", "part", "of", "the", "matrix", "." ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/data/DMatrixRMaj.java#L254-L261
bullhorn/sdk-rest
src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java
StandardBullhornData.handleGetFileContent
protected FileContent handleGetFileContent(Class<? extends FileEntity> type, Integer entityId, Integer fileId) { Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetFile(BullhornEntityInfo.getTypesRestEntityName(type), entityId, fileId); String url = restUrlFactory.assembleGetFileUrl(); String jsonString = this.performGetRequest(url, String.class, uriVariables); FileContent fileContent = restJsonConverter.jsonToEntityUnwrapRoot(jsonString, StandardFileContent.class); fileContent.setId(fileId); return fileContent; }
java
protected FileContent handleGetFileContent(Class<? extends FileEntity> type, Integer entityId, Integer fileId) { Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetFile(BullhornEntityInfo.getTypesRestEntityName(type), entityId, fileId); String url = restUrlFactory.assembleGetFileUrl(); String jsonString = this.performGetRequest(url, String.class, uriVariables); FileContent fileContent = restJsonConverter.jsonToEntityUnwrapRoot(jsonString, StandardFileContent.class); fileContent.setId(fileId); return fileContent; }
[ "protected", "FileContent", "handleGetFileContent", "(", "Class", "<", "?", "extends", "FileEntity", ">", "type", ",", "Integer", "entityId", ",", "Integer", "fileId", ")", "{", "Map", "<", "String", ",", "String", ">", "uriVariables", "=", "restUriVariablesFact...
Makes the api call to get the file content @param type @param entityId @param fileId @return
[ "Makes", "the", "api", "call", "to", "get", "the", "file", "content" ]
train
https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1599-L1607
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java
MesosArtifactServer.addFile
public synchronized URL addFile(File localFile, String remoteFile) throws IOException, MalformedURLException { return addPath(new Path(localFile.toURI()), new Path(remoteFile)); }
java
public synchronized URL addFile(File localFile, String remoteFile) throws IOException, MalformedURLException { return addPath(new Path(localFile.toURI()), new Path(remoteFile)); }
[ "public", "synchronized", "URL", "addFile", "(", "File", "localFile", ",", "String", "remoteFile", ")", "throws", "IOException", ",", "MalformedURLException", "{", "return", "addPath", "(", "new", "Path", "(", "localFile", ".", "toURI", "(", ")", ")", ",", "...
Adds a file to the artifact server. @param localFile the local file to serve. @param remoteFile the remote path with which to locate the file. @return the fully-qualified remote path to the file. @throws MalformedURLException if the remote path is invalid.
[ "Adds", "a", "file", "to", "the", "artifact", "server", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java#L198-L200
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
SimpleDocTreeVisitor.visitIndex
@Override public R visitIndex(IndexTree node, P p) { return defaultAction(node, p); }
java
@Override public R visitIndex(IndexTree node, P p) { return defaultAction(node, p); }
[ "@", "Override", "public", "R", "visitIndex", "(", "IndexTree", "node", ",", "P", "p", ")", "{", "return", "defaultAction", "(", "node", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction}
[ "{", "@inheritDoc", "}", "This", "implementation", "calls", "{", "@code", "defaultAction", "}", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L237-L240
looly/hutool
hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java
SqlBuilder.buildCondition
private String buildCondition(LogicalOperator logicalOperator, Condition... conditions) { if (ArrayUtil.isEmpty(conditions)) { return StrUtil.EMPTY; } if (null == logicalOperator) { logicalOperator = LogicalOperator.AND; } final StringBuilder conditionStrBuilder = new StringBuilder(); boolean isFirst = true; for (Condition condition : conditions) { // 添加逻辑运算符 if (isFirst) { isFirst = false; } else { // " AND " 或者 " OR " conditionStrBuilder.append(StrUtil.SPACE).append(logicalOperator).append(StrUtil.SPACE); } // 构建条件部分:"name = ?"、"name IN (?,?,?)"、"name BETWEEN ?AND ?"、"name LIKE ?" conditionStrBuilder.append(condition.toString(this.paramValues)); } return conditionStrBuilder.toString(); }
java
private String buildCondition(LogicalOperator logicalOperator, Condition... conditions) { if (ArrayUtil.isEmpty(conditions)) { return StrUtil.EMPTY; } if (null == logicalOperator) { logicalOperator = LogicalOperator.AND; } final StringBuilder conditionStrBuilder = new StringBuilder(); boolean isFirst = true; for (Condition condition : conditions) { // 添加逻辑运算符 if (isFirst) { isFirst = false; } else { // " AND " 或者 " OR " conditionStrBuilder.append(StrUtil.SPACE).append(logicalOperator).append(StrUtil.SPACE); } // 构建条件部分:"name = ?"、"name IN (?,?,?)"、"name BETWEEN ?AND ?"、"name LIKE ?" conditionStrBuilder.append(condition.toString(this.paramValues)); } return conditionStrBuilder.toString(); }
[ "private", "String", "buildCondition", "(", "LogicalOperator", "logicalOperator", ",", "Condition", "...", "conditions", ")", "{", "if", "(", "ArrayUtil", ".", "isEmpty", "(", "conditions", ")", ")", "{", "return", "StrUtil", ".", "EMPTY", ";", "}", "if", "(...
构建组合条件<br> 例如:name = ? AND type IN (?, ?) AND other LIKE ? @param logicalOperator 逻辑运算符 @param conditions 条件对象 @return 构建后的SQL语句条件部分
[ "构建组合条件<br", ">", "例如:name", "=", "?", "AND", "type", "IN", "(", "?", "?", ")", "AND", "other", "LIKE", "?" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L587-L611
aol/cyclops
cyclops/src/main/java/com/oath/cyclops/util/box/MutableLong.java
MutableLong.fromExternal
public static MutableLong fromExternal(final LongSupplier s, final LongConsumer c) { return new MutableLong() { @Override public long getAsLong() { return s.getAsLong(); } @Override public Long get() { return getAsLong(); } @Override public MutableLong set(final long value) { c.accept(value); return this; } }; }
java
public static MutableLong fromExternal(final LongSupplier s, final LongConsumer c) { return new MutableLong() { @Override public long getAsLong() { return s.getAsLong(); } @Override public Long get() { return getAsLong(); } @Override public MutableLong set(final long value) { c.accept(value); return this; } }; }
[ "public", "static", "MutableLong", "fromExternal", "(", "final", "LongSupplier", "s", ",", "final", "LongConsumer", "c", ")", "{", "return", "new", "MutableLong", "(", ")", "{", "@", "Override", "public", "long", "getAsLong", "(", ")", "{", "return", "s", ...
Construct a MutableLong that gets and sets an external value using the provided Supplier and Consumer e.g. <pre> {@code MutableLong mutable = MutableLong.fromExternal(()->!this.value,val->!this.value); } </pre> @param s Supplier of an external value @param c Consumer that sets an external value @return MutableLong that gets / sets an external (mutable) value
[ "Construct", "a", "MutableLong", "that", "gets", "and", "sets", "an", "external", "value", "using", "the", "provided", "Supplier", "and", "Consumer" ]
train
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/com/oath/cyclops/util/box/MutableLong.java#L81-L99
apache/flink
flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java
PropertiesUtil.getLong
public static long getLong(Properties config, String key, long defaultValue) { String val = config.getProperty(key); if (val == null) { return defaultValue; } else { try { return Long.parseLong(val); } catch (NumberFormatException nfe) { throw new IllegalArgumentException("Value for configuration key='" + key + "' is not set correctly. " + "Entered value='" + val + "'. Default value='" + defaultValue + "'"); } } }
java
public static long getLong(Properties config, String key, long defaultValue) { String val = config.getProperty(key); if (val == null) { return defaultValue; } else { try { return Long.parseLong(val); } catch (NumberFormatException nfe) { throw new IllegalArgumentException("Value for configuration key='" + key + "' is not set correctly. " + "Entered value='" + val + "'. Default value='" + defaultValue + "'"); } } }
[ "public", "static", "long", "getLong", "(", "Properties", "config", ",", "String", "key", ",", "long", "defaultValue", ")", "{", "String", "val", "=", "config", ".", "getProperty", "(", "key", ")", ";", "if", "(", "val", "==", "null", ")", "{", "return...
Get long from properties. This method throws an exception if the long is not valid. @param config Properties @param key key in Properties @param defaultValue default value if value is not set @return default or value of key
[ "Get", "long", "from", "properties", ".", "This", "method", "throws", "an", "exception", "if", "the", "long", "is", "not", "valid", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/PropertiesUtil.java#L61-L73
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java
CassandraSchemaManager.onSetRepairChance
private void onSetRepairChance(CfDef cfDef, Properties cfProperties, StringBuilder builder) { String readRepairChance = cfProperties.getProperty(CassandraConstants.READ_REPAIR_CHANCE); if (readRepairChance != null) { try { if (builder != null) { appendPropertyToBuilder(builder, readRepairChance, CassandraConstants.READ_REPAIR_CHANCE); } else { cfDef.setRead_repair_chance(Double.parseDouble(readRepairChance)); } } catch (NumberFormatException nfe) { log.error("READ_REPAIR_CHANCE should be double type, Caused by: .", nfe); throw new SchemaGenerationException(nfe); } } }
java
private void onSetRepairChance(CfDef cfDef, Properties cfProperties, StringBuilder builder) { String readRepairChance = cfProperties.getProperty(CassandraConstants.READ_REPAIR_CHANCE); if (readRepairChance != null) { try { if (builder != null) { appendPropertyToBuilder(builder, readRepairChance, CassandraConstants.READ_REPAIR_CHANCE); } else { cfDef.setRead_repair_chance(Double.parseDouble(readRepairChance)); } } catch (NumberFormatException nfe) { log.error("READ_REPAIR_CHANCE should be double type, Caused by: .", nfe); throw new SchemaGenerationException(nfe); } } }
[ "private", "void", "onSetRepairChance", "(", "CfDef", "cfDef", ",", "Properties", "cfProperties", ",", "StringBuilder", "builder", ")", "{", "String", "readRepairChance", "=", "cfProperties", ".", "getProperty", "(", "CassandraConstants", ".", "READ_REPAIR_CHANCE", ")...
On set repair chance. @param cfDef the cf def @param cfProperties the cf properties @param builder the builder
[ "On", "set", "repair", "chance", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2402-L2424
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_voicemail_serviceName_PUT
public void billingAccount_voicemail_serviceName_PUT(String billingAccount, String serviceName, OvhVoicemail body) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); }
java
public void billingAccount_voicemail_serviceName_PUT(String billingAccount, String serviceName, OvhVoicemail body) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "billingAccount_voicemail_serviceName_PUT", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "OvhVoicemail", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/voicemail/{serviceName}\"", ";",...
Alter this object properties REST: PUT /telephony/{billingAccount}/voicemail/{serviceName} @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7767-L7771
mcxiaoke/Android-Next
core/src/main/java/com/mcxiaoke/next/utils/ReflectionUtils.java
ReflectionUtils.findMethod
public static Method findMethod(Class<?> clazz, String name, Class<?>... paramTypes) { AssertUtils.notNull(clazz, "Class must not be null"); AssertUtils.notNull(name, "Method name must not be null"); Class<?> searchType = clazz; while (searchType != null) { Method[] methods = (searchType.isInterface() ? searchType.getMethods() : searchType.getDeclaredMethods()); for (Method method : methods) { if (name.equals(method.getName()) && (paramTypes == null || Arrays.equals(paramTypes, method.getParameterTypes()))) { return method; } } searchType = searchType.getSuperclass(); } return null; }
java
public static Method findMethod(Class<?> clazz, String name, Class<?>... paramTypes) { AssertUtils.notNull(clazz, "Class must not be null"); AssertUtils.notNull(name, "Method name must not be null"); Class<?> searchType = clazz; while (searchType != null) { Method[] methods = (searchType.isInterface() ? searchType.getMethods() : searchType.getDeclaredMethods()); for (Method method : methods) { if (name.equals(method.getName()) && (paramTypes == null || Arrays.equals(paramTypes, method.getParameterTypes()))) { return method; } } searchType = searchType.getSuperclass(); } return null; }
[ "public", "static", "Method", "findMethod", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ",", "Class", "<", "?", ">", "...", "paramTypes", ")", "{", "AssertUtils", ".", "notNull", "(", "clazz", ",", "\"Class must not be null\"", ")", ";", ...
Attempt to find a {@link Method} on the supplied class with the supplied name and parameter types. Searches all superclasses up to {@code Object}. <p>Returns {@code null} if no {@link Method} can be found. @param clazz the class to introspect @param name the name of the method @param paramTypes the parameter types of the method (may be {@code null} to indicate any signature) @return the Method object, or {@code null} if none found
[ "Attempt", "to", "find", "a", "{", "@link", "Method", "}", "on", "the", "supplied", "class", "with", "the", "supplied", "name", "and", "parameter", "types", ".", "Searches", "all", "superclasses", "up", "to", "{", "@code", "Object", "}", ".", "<p", ">", ...
train
https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/ReflectionUtils.java#L182-L197
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/raw/DataDecoder.java
DataDecoder.decodeFloat
public static float decodeFloat(byte[] src, int srcOffset) throws CorruptEncodingException { int bits = decodeFloatBits(src, srcOffset); bits ^= (bits < 0) ? 0x80000000 : 0xffffffff; return Float.intBitsToFloat(bits); }
java
public static float decodeFloat(byte[] src, int srcOffset) throws CorruptEncodingException { int bits = decodeFloatBits(src, srcOffset); bits ^= (bits < 0) ? 0x80000000 : 0xffffffff; return Float.intBitsToFloat(bits); }
[ "public", "static", "float", "decodeFloat", "(", "byte", "[", "]", "src", ",", "int", "srcOffset", ")", "throws", "CorruptEncodingException", "{", "int", "bits", "=", "decodeFloatBits", "(", "src", ",", "srcOffset", ")", ";", "bits", "^=", "(", "bits", "<"...
Decodes a float from exactly 4 bytes. @param src source of encoded bytes @param srcOffset offset into source array @return float value
[ "Decodes", "a", "float", "from", "exactly", "4", "bytes", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L293-L299
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.getFromFirstExcl
@Nullable public static String getFromFirstExcl (@Nullable final String sStr, @Nullable final String sSearch) { return _getFromFirst (sStr, sSearch, false); }
java
@Nullable public static String getFromFirstExcl (@Nullable final String sStr, @Nullable final String sSearch) { return _getFromFirst (sStr, sSearch, false); }
[ "@", "Nullable", "public", "static", "String", "getFromFirstExcl", "(", "@", "Nullable", "final", "String", "sStr", ",", "@", "Nullable", "final", "String", "sSearch", ")", "{", "return", "_getFromFirst", "(", "sStr", ",", "sSearch", ",", "false", ")", ";", ...
Get everything from the string from and excluding the passed string. @param sStr The source string. May be <code>null</code>. @param sSearch The string to search. May be <code>null</code>. @return <code>null</code> if the passed string does not contain the search string. If the search string is empty, the input string is returned unmodified.
[ "Get", "everything", "from", "the", "string", "from", "and", "excluding", "the", "passed", "string", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4998-L5002
brianwhu/xillium
data/src/main/java/org/xillium/data/DataBinder.java
DataBinder.put
public <T extends DataObject> DataBinder put(T object, String... names) throws Exception { Class<?> type = object.getClass(); Object value; for (String name: names) { Field field = Beans.getKnownField(type, name); if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers()) && (value = field.get(object)) != null) { put(field.getName(), value.toString()); } } return this; }
java
public <T extends DataObject> DataBinder put(T object, String... names) throws Exception { Class<?> type = object.getClass(); Object value; for (String name: names) { Field field = Beans.getKnownField(type, name); if (!Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers()) && (value = field.get(object)) != null) { put(field.getName(), value.toString()); } } return this; }
[ "public", "<", "T", "extends", "DataObject", ">", "DataBinder", "put", "(", "T", "object", ",", "String", "...", "names", ")", "throws", "Exception", "{", "Class", "<", "?", ">", "type", "=", "object", ".", "getClass", "(", ")", ";", "Object", "value",...
Fills the data binder with a subset of non-static, non-transient fields of an Object, excluding null values. @param names - the names of the fields in the subset
[ "Fills", "the", "data", "binder", "with", "a", "subset", "of", "non", "-", "static", "non", "-", "transient", "fields", "of", "an", "Object", "excluding", "null", "values", "." ]
train
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L191-L201
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
JavacParser.reportSyntaxError
protected void reportSyntaxError(int pos, String key, Object... args) { JCDiagnostic.DiagnosticPosition diag = new JCDiagnostic.SimpleDiagnosticPosition(pos); reportSyntaxError(diag, key, args); }
java
protected void reportSyntaxError(int pos, String key, Object... args) { JCDiagnostic.DiagnosticPosition diag = new JCDiagnostic.SimpleDiagnosticPosition(pos); reportSyntaxError(diag, key, args); }
[ "protected", "void", "reportSyntaxError", "(", "int", "pos", ",", "String", "key", ",", "Object", "...", "args", ")", "{", "JCDiagnostic", ".", "DiagnosticPosition", "diag", "=", "new", "JCDiagnostic", ".", "SimpleDiagnosticPosition", "(", "pos", ")", ";", "re...
Report a syntax using the given the position parameter and arguments, unless one was already reported at the same position.
[ "Report", "a", "syntax", "using", "the", "given", "the", "position", "parameter", "and", "arguments", "unless", "one", "was", "already", "reported", "at", "the", "same", "position", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L460-L463
alkacon/opencms-core
src/org/opencms/ui/apps/A_CmsAttributeAwareApp.java
A_CmsAttributeAwareApp.openSubView
@Override public void openSubView(String state, boolean updateState) { if (updateState) { CmsAppWorkplaceUi.get().changeCurrentAppState(state); } Component comp = getComponentForState(state); if (comp != null) { updateMainComponent(comp); } else { m_rootLayout.setMainContent(new Label("Malformed path, tool not available for path: " + state)); updateAppAttributes(Collections.<String, Object> emptyMap()); } updateSubNav(getSubNavEntries(state)); updateBreadCrumb(getBreadCrumbForState(state)); }
java
@Override public void openSubView(String state, boolean updateState) { if (updateState) { CmsAppWorkplaceUi.get().changeCurrentAppState(state); } Component comp = getComponentForState(state); if (comp != null) { updateMainComponent(comp); } else { m_rootLayout.setMainContent(new Label("Malformed path, tool not available for path: " + state)); updateAppAttributes(Collections.<String, Object> emptyMap()); } updateSubNav(getSubNavEntries(state)); updateBreadCrumb(getBreadCrumbForState(state)); }
[ "@", "Override", "public", "void", "openSubView", "(", "String", "state", ",", "boolean", "updateState", ")", "{", "if", "(", "updateState", ")", "{", "CmsAppWorkplaceUi", ".", "get", "(", ")", ".", "changeCurrentAppState", "(", "state", ")", ";", "}", "Co...
Opens the requested sub view.<p> @param state the state @param updateState <code>true</code> to update the state URL token
[ "Opens", "the", "requested", "sub", "view", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/A_CmsAttributeAwareApp.java#L65-L81
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.trimStart
@Nullable @CheckReturnValue public static String trimStart (@Nullable final String sSrc, @Nullable final String sLead) { return startsWith (sSrc, sLead) ? sSrc.substring (sLead.length (), sSrc.length ()) : sSrc; }
java
@Nullable @CheckReturnValue public static String trimStart (@Nullable final String sSrc, @Nullable final String sLead) { return startsWith (sSrc, sLead) ? sSrc.substring (sLead.length (), sSrc.length ()) : sSrc; }
[ "@", "Nullable", "@", "CheckReturnValue", "public", "static", "String", "trimStart", "(", "@", "Nullable", "final", "String", "sSrc", ",", "@", "Nullable", "final", "String", "sLead", ")", "{", "return", "startsWith", "(", "sSrc", ",", "sLead", ")", "?", "...
Trim the passed lead from the source value. If the source value does not start with the passed lead, nothing happens. @param sSrc The input source string @param sLead The string to be trimmed of the beginning @return The trimmed string, or the original input string, if the lead was not found @see #trimEnd(String, String) @see #trimStartAndEnd(String, String) @see #trimStartAndEnd(String, String, String)
[ "Trim", "the", "passed", "lead", "from", "the", "source", "value", ".", "If", "the", "source", "value", "does", "not", "start", "with", "the", "passed", "lead", "nothing", "happens", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3284-L3289
VoltDB/voltdb
src/frontend/org/voltdb/planner/SubPlanAssembler.java
SubPlanAssembler.getScanAccessPlanForTable
private static AbstractScanPlanNode getScanAccessPlanForTable(StmtTableScan tableScan, AccessPath path) { // build the scan node SeqScanPlanNode scanNode = new SeqScanPlanNode(tableScan); // build the predicate scanNode.setPredicate(path.otherExprs); return scanNode; }
java
private static AbstractScanPlanNode getScanAccessPlanForTable(StmtTableScan tableScan, AccessPath path) { // build the scan node SeqScanPlanNode scanNode = new SeqScanPlanNode(tableScan); // build the predicate scanNode.setPredicate(path.otherExprs); return scanNode; }
[ "private", "static", "AbstractScanPlanNode", "getScanAccessPlanForTable", "(", "StmtTableScan", "tableScan", ",", "AccessPath", "path", ")", "{", "// build the scan node", "SeqScanPlanNode", "scanNode", "=", "new", "SeqScanPlanNode", "(", "tableScan", ")", ";", "// build ...
Get a sequential scan access plan for a table. For multi-site plans/tables, scans at all partitions. @param table The table to scan. @param path The access path to access the data in the table (index/scan/etc). @return A scan plan node
[ "Get", "a", "sequential", "scan", "access", "plan", "for", "a", "table", ".", "For", "multi", "-", "site", "plans", "/", "tables", "scans", "at", "all", "partitions", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/SubPlanAssembler.java#L2171-L2179
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnszone_binding.java
dnszone_binding.get
public static dnszone_binding get(nitro_service service, String zonename) throws Exception{ dnszone_binding obj = new dnszone_binding(); obj.set_zonename(zonename); dnszone_binding response = (dnszone_binding) obj.get_resource(service); return response; }
java
public static dnszone_binding get(nitro_service service, String zonename) throws Exception{ dnszone_binding obj = new dnszone_binding(); obj.set_zonename(zonename); dnszone_binding response = (dnszone_binding) obj.get_resource(service); return response; }
[ "public", "static", "dnszone_binding", "get", "(", "nitro_service", "service", ",", "String", "zonename", ")", "throws", "Exception", "{", "dnszone_binding", "obj", "=", "new", "dnszone_binding", "(", ")", ";", "obj", ".", "set_zonename", "(", "zonename", ")", ...
Use this API to fetch dnszone_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "dnszone_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnszone_binding.java#L103-L108
FaritorKang/unmz-common-util
src/main/java/net/unmz/java/util/security/MD5Utils.java
MD5Utils.sign
public static String sign(String text, String key, String input_charset) { text = text + key; return DigestUtils.md5Hex(getContentBytes(text, input_charset)); }
java
public static String sign(String text, String key, String input_charset) { text = text + key; return DigestUtils.md5Hex(getContentBytes(text, input_charset)); }
[ "public", "static", "String", "sign", "(", "String", "text", ",", "String", "key", ",", "String", "input_charset", ")", "{", "text", "=", "text", "+", "key", ";", "return", "DigestUtils", ".", "md5Hex", "(", "getContentBytes", "(", "text", ",", "input_char...
签名字符串 @param text 需要签名的字符串 @param key 密钥 @param input_charset 编码格式 @return 签名结果
[ "签名字符串" ]
train
https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/security/MD5Utils.java#L135-L138
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/util/ReflectionHelper.java
ReflectionHelper.getAnnotation
public <A extends Annotation> A getAnnotation(Class<A> annotationClass, AnnotatedElement element) { A annotation; Map<AnnotatedElement, Annotation> cacheMap = cache.get(annotationClass); if (cacheMap == null) { cacheMap = new HashMap<AnnotatedElement, Annotation>(); cache.put(annotationClass, cacheMap); } if (cacheMap.containsKey(element)) { annotation = (A) cacheMap.get(element); } else { annotation = element.getAnnotation(annotationClass); if (annotation == null && element instanceof Method) { annotation = getOverriddenAnnotation(annotationClass, (Method) element); } cacheMap.put(element, annotation); } return annotation; }
java
public <A extends Annotation> A getAnnotation(Class<A> annotationClass, AnnotatedElement element) { A annotation; Map<AnnotatedElement, Annotation> cacheMap = cache.get(annotationClass); if (cacheMap == null) { cacheMap = new HashMap<AnnotatedElement, Annotation>(); cache.put(annotationClass, cacheMap); } if (cacheMap.containsKey(element)) { annotation = (A) cacheMap.get(element); } else { annotation = element.getAnnotation(annotationClass); if (annotation == null && element instanceof Method) { annotation = getOverriddenAnnotation(annotationClass, (Method) element); } cacheMap.put(element, annotation); } return annotation; }
[ "public", "<", "A", "extends", "Annotation", ">", "A", "getAnnotation", "(", "Class", "<", "A", ">", "annotationClass", ",", "AnnotatedElement", "element", ")", "{", "A", "annotation", ";", "Map", "<", "AnnotatedElement", ",", "Annotation", ">", "cacheMap", ...
Finds the supplied annotation if present on the element, or on its parents. The parents in this sense are the super types and interfaces if the element is a class. Or, in case of a Method, the (overridden) method declaration by its super types or interfaces. @param annotationClass class of annotation looked for. @param element element (class or method) to look for the annotation on. @param <A> type of annotation. @return annotation if present, <code>null</code> otherwise.
[ "Finds", "the", "supplied", "annotation", "if", "present", "on", "the", "element", "or", "on", "its", "parents", ".", "The", "parents", "in", "this", "sense", "are", "the", "super", "types", "and", "interfaces", "if", "the", "element", "is", "a", "class", ...
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/ReflectionHelper.java#L25-L43
michel-kraemer/citeproc-java
citeproc-java/src/main/java/de/undercouch/citeproc/BibliographyFileReader.java
BibliographyFileReader.readBibliographyFile
public ItemDataProvider readBibliographyFile(InputStream bibstream, String filename) throws IOException { BufferedInputStream bis; if (bibstream instanceof BufferedInputStream) { bis = (BufferedInputStream)bibstream; } else { bis = new BufferedInputStream(bibstream); } //determine file format FileFormat ff = determineFileFormat(bis, filename); //read stream return readBibliographyFile(bis, ff); }
java
public ItemDataProvider readBibliographyFile(InputStream bibstream, String filename) throws IOException { BufferedInputStream bis; if (bibstream instanceof BufferedInputStream) { bis = (BufferedInputStream)bibstream; } else { bis = new BufferedInputStream(bibstream); } //determine file format FileFormat ff = determineFileFormat(bis, filename); //read stream return readBibliographyFile(bis, ff); }
[ "public", "ItemDataProvider", "readBibliographyFile", "(", "InputStream", "bibstream", ",", "String", "filename", ")", "throws", "IOException", "{", "BufferedInputStream", "bis", ";", "if", "(", "bibstream", "instanceof", "BufferedInputStream", ")", "{", "bis", "=", ...
Reads all items from an input stream and returns a provider serving these items. Note that you can supply an additional file name to help the method to determine the exact bibliography file format. If you don't know the file name you can pass null, but in this case the method's result might try to read the input stream using the wrong file format (depending on the input stream's contents). Also note that the caller is responsible for closing the given input stream. @param bibstream the input stream @param filename the name of the input file (can be null if you don't know the name) @return the provider @throws IOException if the input stream could not be read
[ "Reads", "all", "items", "from", "an", "input", "stream", "and", "returns", "a", "provider", "serving", "these", "items", ".", "Note", "that", "you", "can", "supply", "an", "additional", "file", "name", "to", "help", "the", "method", "to", "determine", "th...
train
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/BibliographyFileReader.java#L130-L144
SUSE/salt-netapi-client
src/main/java/com/suse/salt/netapi/parser/XorTypeAdapterFactory.java
XorTypeAdapterFactory.xorAdapter
private <L, R> TypeAdapter<Xor<L, R>> xorAdapter(TypeAdapter<L> leftAdapter, TypeAdapter<R> rightAdapter) { return new TypeAdapter<Xor<L, R>>() { @Override public Xor<L, R> read(JsonReader in) throws IOException { JsonElement json = TypeAdapters.JSON_ELEMENT.read(in); try { R value = rightAdapter.fromJsonTree(json); return Xor.right(value); } catch (Throwable e) { L value = leftAdapter.fromJsonTree(json); return Xor.left(value); } } @Override public void write(JsonWriter out, Xor<L, R> xor) throws IOException { throw new JsonParseException("Writing Xor is not supported"); } }; }
java
private <L, R> TypeAdapter<Xor<L, R>> xorAdapter(TypeAdapter<L> leftAdapter, TypeAdapter<R> rightAdapter) { return new TypeAdapter<Xor<L, R>>() { @Override public Xor<L, R> read(JsonReader in) throws IOException { JsonElement json = TypeAdapters.JSON_ELEMENT.read(in); try { R value = rightAdapter.fromJsonTree(json); return Xor.right(value); } catch (Throwable e) { L value = leftAdapter.fromJsonTree(json); return Xor.left(value); } } @Override public void write(JsonWriter out, Xor<L, R> xor) throws IOException { throw new JsonParseException("Writing Xor is not supported"); } }; }
[ "private", "<", "L", ",", "R", ">", "TypeAdapter", "<", "Xor", "<", "L", ",", "R", ">", ">", "xorAdapter", "(", "TypeAdapter", "<", "L", ">", "leftAdapter", ",", "TypeAdapter", "<", "R", ">", "rightAdapter", ")", "{", "return", "new", "TypeAdapter", ...
Creates a generic Xor adapter by combining two other adapters - one for each side of the Xor type. It will first try to parse incoming JSON data as the right type and, if that does not succeed, it will try again with the left type. All exceptions besides the possible parsing Exception of the left type are not caught. @param <L> the generic type for the left side of the Xor @param <R> the generic type for the right side of the Xor @param leftAdapter the left adapter @param rightAdapter the right adapter @return the Xor adapter
[ "Creates", "a", "generic", "Xor", "adapter", "by", "combining", "two", "other", "adapters", "-", "one", "for", "each", "side", "of", "the", "Xor", "type", ".", "It", "will", "first", "try", "to", "parse", "incoming", "JSON", "data", "as", "the", "right",...
train
https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/parser/XorTypeAdapterFactory.java#L70-L90
gallandarakhneorg/afc
core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java
AbstractTriangle3F.containsProjectionOf
@Pure public boolean containsProjectionOf(double x, double y, double z) { Point3f proj = (Point3f) getPlane().getProjection(x, y, z); if (proj == null) { return false; } return contains(proj); }
java
@Pure public boolean containsProjectionOf(double x, double y, double z) { Point3f proj = (Point3f) getPlane().getProjection(x, y, z); if (proj == null) { return false; } return contains(proj); }
[ "@", "Pure", "public", "boolean", "containsProjectionOf", "(", "double", "x", ",", "double", "y", ",", "double", "z", ")", "{", "Point3f", "proj", "=", "(", "Point3f", ")", "getPlane", "(", ")", ".", "getProjection", "(", "x", ",", "y", ",", "z", ")"...
Checks if the projection of a point on the triangle's plane is inside the triangle. @param x @param y @param z @return <code>true</code> if the projection of the point is in the triangle, otherwise <code>false</code>.
[ "Checks", "if", "the", "projection", "of", "a", "point", "on", "the", "triangle", "s", "plane", "is", "inside", "the", "triangle", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java#L2066-L2073
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/WorkbinsApi.java
WorkbinsApi.unsubscribeToWorkbinNotifications
public ApiSuccessResponse unsubscribeToWorkbinNotifications(String workbinId, UnsubscribeToWorkbinNotificationsData unsubscribeToWorkbinNotificationsData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = unsubscribeToWorkbinNotificationsWithHttpInfo(workbinId, unsubscribeToWorkbinNotificationsData); return resp.getData(); }
java
public ApiSuccessResponse unsubscribeToWorkbinNotifications(String workbinId, UnsubscribeToWorkbinNotificationsData unsubscribeToWorkbinNotificationsData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = unsubscribeToWorkbinNotificationsWithHttpInfo(workbinId, unsubscribeToWorkbinNotificationsData); return resp.getData(); }
[ "public", "ApiSuccessResponse", "unsubscribeToWorkbinNotifications", "(", "String", "workbinId", ",", "UnsubscribeToWorkbinNotificationsData", "unsubscribeToWorkbinNotificationsData", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", ...
Unsubscribe to the notifications of changes of the content of a Workbin. @param workbinId Id of the Workbin (required) @param unsubscribeToWorkbinNotificationsData (required) @return ApiSuccessResponse @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Unsubscribe", "to", "the", "notifications", "of", "changes", "of", "the", "content", "of", "a", "Workbin", "." ]
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/WorkbinsApi.java#L1029-L1032
Samsung/GearVRf
GVRf/Extensions/MixedReality/src/main/java/org/gearvrf/mixedreality/arcore/ARCoreSession.java
ARCoreSession.onResolveCloudAnchor
synchronized protected void onResolveCloudAnchor(String anchorId, CloudAnchorCallback cb) { Anchor newAnchor = mSession.resolveCloudAnchor(anchorId); pendingAnchors.put(newAnchor, cb); }
java
synchronized protected void onResolveCloudAnchor(String anchorId, CloudAnchorCallback cb) { Anchor newAnchor = mSession.resolveCloudAnchor(anchorId); pendingAnchors.put(newAnchor, cb); }
[ "synchronized", "protected", "void", "onResolveCloudAnchor", "(", "String", "anchorId", ",", "CloudAnchorCallback", "cb", ")", "{", "Anchor", "newAnchor", "=", "mSession", ".", "resolveCloudAnchor", "(", "anchorId", ")", ";", "pendingAnchors", ".", "put", "(", "ne...
This method resolves an anchor. The {@link IAnchorEvents} will be invoked when the results are available.
[ "This", "method", "resolves", "an", "anchor", ".", "The", "{" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/MixedReality/src/main/java/org/gearvrf/mixedreality/arcore/ARCoreSession.java#L453-L456
Alluxio/alluxio
core/common/src/main/java/alluxio/AbstractClient.java
AbstractClient.retryRPC
protected synchronized <V> V retryRPC(RpcCallable<V> rpc, String rpcName) throws AlluxioStatusException { try (Timer.Context ctx = MetricsSystem.timer(getQualifiedMetricName(rpcName)).time()) { return retryRPCInternal(rpc, () -> { MetricsSystem.counter(getQualifiedRetryMetricName(rpcName)).inc(); return null; }); } catch (Exception e) { MetricsSystem.counter(getQualifiedFailureMetricName(rpcName)).inc(); throw e; } }
java
protected synchronized <V> V retryRPC(RpcCallable<V> rpc, String rpcName) throws AlluxioStatusException { try (Timer.Context ctx = MetricsSystem.timer(getQualifiedMetricName(rpcName)).time()) { return retryRPCInternal(rpc, () -> { MetricsSystem.counter(getQualifiedRetryMetricName(rpcName)).inc(); return null; }); } catch (Exception e) { MetricsSystem.counter(getQualifiedFailureMetricName(rpcName)).inc(); throw e; } }
[ "protected", "synchronized", "<", "V", ">", "V", "retryRPC", "(", "RpcCallable", "<", "V", ">", "rpc", ",", "String", "rpcName", ")", "throws", "AlluxioStatusException", "{", "try", "(", "Timer", ".", "Context", "ctx", "=", "MetricsSystem", ".", "timer", "...
Tries to execute an RPC defined as a {@link RpcCallable}. Metrics will be recorded based on the provided rpc name. If a {@link UnavailableException} occurs, a reconnection will be tried through {@link #connect()} and the action will be re-executed. @param rpc the RPC call to be executed @param rpcName the human readable name of the RPC call @param <V> type of return value of the RPC call @return the return value of the RPC call
[ "Tries", "to", "execute", "an", "RPC", "defined", "as", "a", "{", "@link", "RpcCallable", "}", ".", "Metrics", "will", "be", "recorded", "based", "on", "the", "provided", "rpc", "name", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/AbstractClient.java#L349-L360
morimekta/providence
providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java
BaseTypeRegistry.finalTypename
protected String finalTypename(String typeName, String programContext) { String qualifiedName = qualifiedTypenameInternal(typeName, programContext); if (typedefs.containsKey(qualifiedName)) { String resolved = typedefs.get(qualifiedName); return finalTypename(resolved, programContext); } return qualifiedName; }
java
protected String finalTypename(String typeName, String programContext) { String qualifiedName = qualifiedTypenameInternal(typeName, programContext); if (typedefs.containsKey(qualifiedName)) { String resolved = typedefs.get(qualifiedName); return finalTypename(resolved, programContext); } return qualifiedName; }
[ "protected", "String", "finalTypename", "(", "String", "typeName", ",", "String", "programContext", ")", "{", "String", "qualifiedName", "=", "qualifiedTypenameInternal", "(", "typeName", ",", "programContext", ")", ";", "if", "(", "typedefs", ".", "containsKey", ...
Get the final typename of the given identifier within the context. @param typeName The identifier name. @param programContext The program context. @return The final typename.
[ "Get", "the", "final", "typename", "of", "the", "given", "identifier", "within", "the", "context", "." ]
train
https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java#L166-L175
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableUtils.java
PortableUtils.getPortableArrayCellPosition
static int getPortableArrayCellPosition(BufferObjectDataInput in, int streamPosition, int cellIndex) throws IOException { return in.readInt(streamPosition + cellIndex * Bits.INT_SIZE_IN_BYTES); }
java
static int getPortableArrayCellPosition(BufferObjectDataInput in, int streamPosition, int cellIndex) throws IOException { return in.readInt(streamPosition + cellIndex * Bits.INT_SIZE_IN_BYTES); }
[ "static", "int", "getPortableArrayCellPosition", "(", "BufferObjectDataInput", "in", ",", "int", "streamPosition", ",", "int", "cellIndex", ")", "throws", "IOException", "{", "return", "in", ".", "readInt", "(", "streamPosition", "+", "cellIndex", "*", "Bits", "."...
Calculates and reads the position of the Portable object stored in a Portable array under the given index. @param in data input stream @param streamPosition streamPosition to begin the reading from @param cellIndex index of the cell @return the position of the given portable object in the stream @throws IOException on any stream errors
[ "Calculates", "and", "reads", "the", "position", "of", "the", "Portable", "object", "stored", "in", "a", "Portable", "array", "under", "the", "given", "index", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortableUtils.java#L65-L68
roboconf/roboconf-platform
core/roboconf-target-iaas-occi/src/main/java/net/roboconf/target/occi/internal/OcciVMUtils.java
OcciVMUtils.isVMRunning
public static boolean isVMRunning(String hostIpPort, String id) throws TargetException { boolean result = false; String ip = OcciVMUtils.getVMIP(hostIpPort, id); try { InetAddress inet = InetAddress.getByName(ip); result = inet.isReachable(5000); } catch (Exception e) { result = false; final Logger logger = Logger.getLogger( OcciVMUtils.class.getName()); logger.info(e.getMessage()); } return result; }
java
public static boolean isVMRunning(String hostIpPort, String id) throws TargetException { boolean result = false; String ip = OcciVMUtils.getVMIP(hostIpPort, id); try { InetAddress inet = InetAddress.getByName(ip); result = inet.isReachable(5000); } catch (Exception e) { result = false; final Logger logger = Logger.getLogger( OcciVMUtils.class.getName()); logger.info(e.getMessage()); } return result; }
[ "public", "static", "boolean", "isVMRunning", "(", "String", "hostIpPort", ",", "String", "id", ")", "throws", "TargetException", "{", "boolean", "result", "=", "false", ";", "String", "ip", "=", "OcciVMUtils", ".", "getVMIP", "(", "hostIpPort", ",", "id", "...
Checks if VM is running. @param hostIpPort @param id @return @throws TargetException
[ "Checks", "if", "VM", "is", "running", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-occi/src/main/java/net/roboconf/target/occi/internal/OcciVMUtils.java#L630-L645
synchronoss/cpo-api
cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java
JdbcCpoXaAdapter.persistObjects
@Override public <T> long persistObjects(String name, Collection<T> coll) throws CpoException { return getCurrentResource().persistObjects(name, coll); }
java
@Override public <T> long persistObjects(String name, Collection<T> coll) throws CpoException { return getCurrentResource().persistObjects(name, coll); }
[ "@", "Override", "public", "<", "T", ">", "long", "persistObjects", "(", "String", "name", ",", "Collection", "<", "T", ">", "coll", ")", "throws", "CpoException", "{", "return", "getCurrentResource", "(", ")", ".", "persistObjects", "(", "name", ",", "col...
Persists a collection of Objects into the datasource. The CpoAdapter will check to see if this object exists in the datasource. If it exists, the object is updated in the datasource If the object does not exist, then it is created in the datasource. This method stores the object in the datasource. The objects in the collection will be treated as one transaction, meaning that if one of the objects fail being inserted or updated in the datasource then the entire collection will be rolled back. <p> <pre>Example: <code> <p> class SomeObject so = null; class CpoAdapter cpo = null; <p> try { cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false)); } catch (CpoException ce) { // Handle the error cpo = null; } <p> if (cpo!=null) { ArrayList al = new ArrayList(); for (int i=0; i<3; i++){ so = new SomeObject(); so.setId(1); so.setName("SomeName"); al.add(so); } <p> try{ cpo.persistObjects("myPersist",al); } catch (CpoException ce) { // Handle the error } } </code> </pre> @param name The name which identifies which EXISTS, INSERT, and UPDATE Function Groups to execute to persist the object. @param coll This is a collection of objects that have been defined within the metadata of the datasource. If the class is not defined an exception will be thrown. @return DOCUMENT ME! @throws CpoException Thrown if there are errors accessing the datasource @see #existsObject @see #insertObject @see #updateObject
[ "Persists", "a", "collection", "of", "Objects", "into", "the", "datasource", ".", "The", "CpoAdapter", "will", "check", "to", "see", "if", "this", "object", "exists", "in", "the", "datasource", ".", "If", "it", "exists", "the", "object", "is", "updated", "...
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L1257-L1260
qiujuer/Genius-Android
caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java
Blur.onStackBlurClip
public static Bitmap onStackBlurClip(Bitmap original, int radius, int parts) { Bitmap bitmap = checkSource(original, radius); if (parts < 2 || parts > 12) { throw new RuntimeException("Blur bitmap parts must >= 2 and <=12."); } if (original.getHeight() / parts < radius + radius) { throw new RuntimeException("Blur bitmap height/partsCount must > radius+radius values."); } //Jni BitMap Blur nativeStackBlurBitmapClip(bitmap, radius, parts); return (bitmap); }
java
public static Bitmap onStackBlurClip(Bitmap original, int radius, int parts) { Bitmap bitmap = checkSource(original, radius); if (parts < 2 || parts > 12) { throw new RuntimeException("Blur bitmap parts must >= 2 and <=12."); } if (original.getHeight() / parts < radius + radius) { throw new RuntimeException("Blur bitmap height/partsCount must > radius+radius values."); } //Jni BitMap Blur nativeStackBlurBitmapClip(bitmap, radius, parts); return (bitmap); }
[ "public", "static", "Bitmap", "onStackBlurClip", "(", "Bitmap", "original", ",", "int", "radius", ",", "int", "parts", ")", "{", "Bitmap", "bitmap", "=", "checkSource", "(", "original", ",", "radius", ")", ";", "if", "(", "parts", "<", "2", "||", "parts"...
StackBlur By Jni Bitmap in this we will cut the source bitmap to some parts. We'll deal(blur) with it one by one. This will reduce the memory consumption. @param original Original Image @param radius Blur radius @param parts Blur cut parts count @return Image Bitmap
[ "StackBlur", "By", "Jni", "Bitmap", "in", "this", "we", "will", "cut", "the", "source", "bitmap", "to", "some", "parts", ".", "We", "ll", "deal", "(", "blur", ")", "with", "it", "one", "by", "one", ".", "This", "will", "reduce", "the", "memory", "con...
train
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/graphics/src/main/java/net/qiujuer/genius/graphics/Blur.java#L116-L130
Azure/azure-sdk-for-java
servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java
ClientFactory.acceptSessionFromEntityPathAsync
public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, String sessionId, ClientSettings clientSettings, ReceiveMode receiveMode) { Utils.assertNonNull("namespaceEndpointURI", namespaceEndpointURI); Utils.assertNonNull("entityPath", entityPath); MessageSession session = new MessageSession(namespaceEndpointURI, entityPath, null, sessionId, clientSettings, receiveMode); return session.initializeAsync().thenApply((v) -> session); }
java
public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, String sessionId, ClientSettings clientSettings, ReceiveMode receiveMode) { Utils.assertNonNull("namespaceEndpointURI", namespaceEndpointURI); Utils.assertNonNull("entityPath", entityPath); MessageSession session = new MessageSession(namespaceEndpointURI, entityPath, null, sessionId, clientSettings, receiveMode); return session.initializeAsync().thenApply((v) -> session); }
[ "public", "static", "CompletableFuture", "<", "IMessageSession", ">", "acceptSessionFromEntityPathAsync", "(", "URI", "namespaceEndpointURI", ",", "String", "entityPath", ",", "String", "sessionId", ",", "ClientSettings", "clientSettings", ",", "ReceiveMode", "receiveMode",...
Asynchronously accepts a session from service bus using the client settings. Session Id can be null, if null, service will return the first available session. @param namespaceEndpointURI endpoint uri of entity namespace @param entityPath path of entity @param sessionId session id, if null, service will return the first available session, otherwise, service will return specified session @param clientSettings client settings @param receiveMode PeekLock or ReceiveAndDelete @return a CompletableFuture representing the pending session accepting
[ "Asynchronously", "accepts", "a", "session", "from", "service", "bus", "using", "the", "client", "settings", ".", "Session", "Id", "can", "be", "null", "if", "null", "service", "will", "return", "the", "first", "available", "session", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L710-L715
lessthanoptimal/ejml
main/ejml-simple/src/org/ejml/equation/Operation.java
Operation.extractSimpleExtents
private static boolean extractSimpleExtents(Variable var, Extents e, boolean row, int length) { int lower; int upper; if( var.getType() == VariableType.INTEGER_SEQUENCE ) { IntegerSequence sequence = ((VariableIntegerSequence)var).sequence; if( sequence.getType() == IntegerSequence.Type.FOR ) { IntegerSequence.For seqFor = (IntegerSequence.For)sequence; seqFor.initialize(length); if( seqFor.getStep() == 1 ) { lower = seqFor.getStart(); upper = seqFor.getEnd(); } else { return false; } } else { return false; } } else if( var.getType() == VariableType.SCALAR ) { lower = upper = ((VariableInteger)var).value; } else { throw new RuntimeException("How did a bad variable get put here?!?!"); } if( row ) { e.row0 = lower; e.row1 = upper; } else { e.col0 = lower; e.col1 = upper; } return true; }
java
private static boolean extractSimpleExtents(Variable var, Extents e, boolean row, int length) { int lower; int upper; if( var.getType() == VariableType.INTEGER_SEQUENCE ) { IntegerSequence sequence = ((VariableIntegerSequence)var).sequence; if( sequence.getType() == IntegerSequence.Type.FOR ) { IntegerSequence.For seqFor = (IntegerSequence.For)sequence; seqFor.initialize(length); if( seqFor.getStep() == 1 ) { lower = seqFor.getStart(); upper = seqFor.getEnd(); } else { return false; } } else { return false; } } else if( var.getType() == VariableType.SCALAR ) { lower = upper = ((VariableInteger)var).value; } else { throw new RuntimeException("How did a bad variable get put here?!?!"); } if( row ) { e.row0 = lower; e.row1 = upper; } else { e.col0 = lower; e.col1 = upper; } return true; }
[ "private", "static", "boolean", "extractSimpleExtents", "(", "Variable", "var", ",", "Extents", "e", ",", "boolean", "row", ",", "int", "length", ")", "{", "int", "lower", ";", "int", "upper", ";", "if", "(", "var", ".", "getType", "(", ")", "==", "Var...
See if a simple sequence can be used to extract the array. A simple extent is a continuous block from a min to max index @return true if it is a simple range or false if not
[ "See", "if", "a", "simple", "sequence", "can", "be", "used", "to", "extract", "the", "array", ".", "A", "simple", "extent", "is", "a", "continuous", "block", "from", "a", "min", "to", "max", "index" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/Operation.java#L1686-L1716
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOSCBodyReadCallback.java
HttpOSCBodyReadCallback.complete
public void complete(VirtualConnection vc, TCPReadRequestContext rsc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "complete() called: vc=" + vc); } HttpOutboundServiceContextImpl mySC = (HttpOutboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPOSC); mySC.continueRead(); }
java
public void complete(VirtualConnection vc, TCPReadRequestContext rsc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "complete() called: vc=" + vc); } HttpOutboundServiceContextImpl mySC = (HttpOutboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPOSC); mySC.continueRead(); }
[ "public", "void", "complete", "(", "VirtualConnection", "vc", ",", "TCPReadRequestContext", "rsc", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", ...
Called by the channel below us when a read has finished. @param vc @param rsc
[ "Called", "by", "the", "channel", "below", "us", "when", "a", "read", "has", "finished", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOSCBodyReadCallback.java#L55-L62
querydsl/querydsl
querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java
AbstractMySQLQuery.noCache
@WithBridgeMethods(value = MySQLQuery.class, castRequired = true) public C noCache() { return addFlag(Position.AFTER_SELECT, SQL_NO_CACHE); }
java
@WithBridgeMethods(value = MySQLQuery.class, castRequired = true) public C noCache() { return addFlag(Position.AFTER_SELECT, SQL_NO_CACHE); }
[ "@", "WithBridgeMethods", "(", "value", "=", "MySQLQuery", ".", "class", ",", "castRequired", "=", "true", ")", "public", "C", "noCache", "(", ")", "{", "return", "addFlag", "(", "Position", ".", "AFTER_SELECT", ",", "SQL_NO_CACHE", ")", ";", "}" ]
With SQL_NO_CACHE, the server does not use the query cache. It neither checks the query cache to see whether the result is already cached, nor does it cache the query result. @return the current object
[ "With", "SQL_NO_CACHE", "the", "server", "does", "not", "use", "the", "query", "cache", ".", "It", "neither", "checks", "the", "query", "cache", "to", "see", "whether", "the", "result", "is", "already", "cached", "nor", "does", "it", "cache", "the", "query...
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java#L178-L181
Red5/red5-io
src/main/java/org/red5/io/mp4/impl/MP4Reader.java
MP4Reader.processVideoBox
private void processVideoBox(SampleTableBox stbl, long scale) { AvcConfigurationBox avcC = (AvcConfigurationBox) Path.getPath(isoFile, "/moov/trak/mdia/minf/stbl/stsd/drmi/avcC"); if (avcC != null) { long videoConfigContentSize = avcC.getContentSize(); log.debug("AVCC size: {}", videoConfigContentSize); // ByteBuffer byteBuffer = ByteBuffer.allocate((int) videoConfigContentSize); // avc1.avcDecoderConfigurationRecord.getContent(byteBuffer); // byteBuffer.flip(); // videoDecoderBytes = new byte[byteBuffer.limit()]; // byteBuffer.get(videoDecoderBytes); } else { log.warn("avcC atom not found"); } processVideoStbl(stbl, scale); }
java
private void processVideoBox(SampleTableBox stbl, long scale) { AvcConfigurationBox avcC = (AvcConfigurationBox) Path.getPath(isoFile, "/moov/trak/mdia/minf/stbl/stsd/drmi/avcC"); if (avcC != null) { long videoConfigContentSize = avcC.getContentSize(); log.debug("AVCC size: {}", videoConfigContentSize); // ByteBuffer byteBuffer = ByteBuffer.allocate((int) videoConfigContentSize); // avc1.avcDecoderConfigurationRecord.getContent(byteBuffer); // byteBuffer.flip(); // videoDecoderBytes = new byte[byteBuffer.limit()]; // byteBuffer.get(videoDecoderBytes); } else { log.warn("avcC atom not found"); } processVideoStbl(stbl, scale); }
[ "private", "void", "processVideoBox", "(", "SampleTableBox", "stbl", ",", "long", "scale", ")", "{", "AvcConfigurationBox", "avcC", "=", "(", "AvcConfigurationBox", ")", "Path", ".", "getPath", "(", "isoFile", ",", "\"/moov/trak/mdia/minf/stbl/stsd/drmi/avcC\"", ")", ...
Process the video information contained in the atoms. @param stbl @param scale timescale
[ "Process", "the", "video", "information", "contained", "in", "the", "atoms", "." ]
train
https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/mp4/impl/MP4Reader.java#L601-L615
rpau/javalang-compiler
src/main/java/org/walkmod/javalang/compiler/symbols/SymbolType.java
SymbolType.typeVariableOf
public static SymbolType typeVariableOf(final String typeVariable, final Class<Object> clazz) { return new SymbolType(clazz, typeVariable); }
java
public static SymbolType typeVariableOf(final String typeVariable, final Class<Object> clazz) { return new SymbolType(clazz, typeVariable); }
[ "public", "static", "SymbolType", "typeVariableOf", "(", "final", "String", "typeVariable", ",", "final", "Class", "<", "Object", ">", "clazz", ")", "{", "return", "new", "SymbolType", "(", "clazz", ",", "typeVariable", ")", ";", "}" ]
Builds a symbol for a type variable from a Java class. @param typeVariable the name of the variable @param clazz the (upper bound) type of the variable @return a SymbolType that represents a variable (for generics)
[ "Builds", "a", "symbol", "for", "a", "type", "variable", "from", "a", "Java", "class", "." ]
train
https://github.com/rpau/javalang-compiler/blob/d7da81359161feef2bc7ff186c4e1b73c6a5a8ef/src/main/java/org/walkmod/javalang/compiler/symbols/SymbolType.java#L794-L796
gallandarakhneorg/afc
core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java
Sphere3d.setProperties
public void setProperties(Point3d center, DoubleProperty radius1) { setProperties(center.xProperty,center.yProperty,center.zProperty, radius1); }
java
public void setProperties(Point3d center, DoubleProperty radius1) { setProperties(center.xProperty,center.yProperty,center.zProperty, radius1); }
[ "public", "void", "setProperties", "(", "Point3d", "center", ",", "DoubleProperty", "radius1", ")", "{", "setProperties", "(", "center", ".", "xProperty", ",", "center", ".", "yProperty", ",", "center", ".", "zProperty", ",", "radius1", ")", ";", "}" ]
Bind the frame of the sphere with center and radisu properties. @param center @param radius1
[ "Bind", "the", "frame", "of", "the", "sphere", "with", "center", "and", "radisu", "properties", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java#L145-L147
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java
InternalUtilities.capitalizeFirstLetterOfString
static String capitalizeFirstLetterOfString(String text, Locale locale) { if (text == null || text.length() < 1) { return text; } String textCapitalized = text.substring(0, 1).toUpperCase(locale) + text.substring(1); return textCapitalized; }
java
static String capitalizeFirstLetterOfString(String text, Locale locale) { if (text == null || text.length() < 1) { return text; } String textCapitalized = text.substring(0, 1).toUpperCase(locale) + text.substring(1); return textCapitalized; }
[ "static", "String", "capitalizeFirstLetterOfString", "(", "String", "text", ",", "Locale", "locale", ")", "{", "if", "(", "text", "==", "null", "||", "text", ".", "length", "(", ")", "<", "1", ")", "{", "return", "text", ";", "}", "String", "textCapitali...
capitalizeFirstLetterOfString, This capitalizes the first letter of the supplied string, in a way that is sensitive to the specified locale.
[ "capitalizeFirstLetterOfString", "This", "capitalizes", "the", "first", "letter", "of", "the", "supplied", "string", "in", "a", "way", "that", "is", "sensitive", "to", "the", "specified", "locale", "." ]
train
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java#L328-L334
facebookarchive/hadoop-20
src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java
StreamKeyValUtil.readLine
public static int readLine(LineReader lineReader, Text out) throws IOException { out.clear(); return lineReader.readLine(out); }
java
public static int readLine(LineReader lineReader, Text out) throws IOException { out.clear(); return lineReader.readLine(out); }
[ "public", "static", "int", "readLine", "(", "LineReader", "lineReader", ",", "Text", "out", ")", "throws", "IOException", "{", "out", ".", "clear", "(", ")", ";", "return", "lineReader", ".", "readLine", "(", "out", ")", ";", "}" ]
Read a utf8 encoded line from a data input stream. @param lineReader LineReader to read the line from. @param out Text to read into @return number of bytes read @throws IOException
[ "Read", "a", "utf8", "encoded", "line", "from", "a", "data", "input", "stream", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java#L152-L156
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java
CmsDomUtil.getCurrentStyleFloat
public static double getCurrentStyleFloat(Element element, Style style) { String currentStyle = getCurrentStyle(element, style); return CmsClientStringUtil.parseFloat(currentStyle); }
java
public static double getCurrentStyleFloat(Element element, Style style) { String currentStyle = getCurrentStyle(element, style); return CmsClientStringUtil.parseFloat(currentStyle); }
[ "public", "static", "double", "getCurrentStyleFloat", "(", "Element", "element", ",", "Style", "style", ")", "{", "String", "currentStyle", "=", "getCurrentStyle", "(", "element", ",", "style", ")", ";", "return", "CmsClientStringUtil", ".", "parseFloat", "(", "...
Returns the computed style of the given element as floating point number.<p> @param element the element @param style the CSS property @return the currently computed style
[ "Returns", "the", "computed", "style", "of", "the", "given", "element", "as", "floating", "point", "number", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L1218-L1222
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java
SeaGlassLookAndFeel.defineArrowButtons
private void defineArrowButtons(UIDefaults d) { String c = PAINTER_PREFIX + "ArrowButtonPainter"; String p = "ArrowButton"; d.put(p + ".States", "Enabled,MouseOver,Disabled,Pressed"); d.put(p + "[Disabled].foreground", new ColorUIResource(0x9ba8cf)); d.put(p + "[Enabled].foreground", new ColorUIResource(0x5b7ea4)); // getDerivedColor("seaGlassBlueGrey", -0.6111111f, -0.110526316f, -0.34509805f, 0, true)); // JTabbedPane arrows no longer black: Nimbus dependency should be replaced with color value? d.put(p + "[Pressed].foreground", new ColorUIResource(0x134D8C)); d.put(p + "[Disabled].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_DISABLED)); d.put(p + "[Enabled].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_ENABLED)); d.put(p + "[MouseOver].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_ENABLED)); d.put(p + "[Pressed].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_PRESSED)); }
java
private void defineArrowButtons(UIDefaults d) { String c = PAINTER_PREFIX + "ArrowButtonPainter"; String p = "ArrowButton"; d.put(p + ".States", "Enabled,MouseOver,Disabled,Pressed"); d.put(p + "[Disabled].foreground", new ColorUIResource(0x9ba8cf)); d.put(p + "[Enabled].foreground", new ColorUIResource(0x5b7ea4)); // getDerivedColor("seaGlassBlueGrey", -0.6111111f, -0.110526316f, -0.34509805f, 0, true)); // JTabbedPane arrows no longer black: Nimbus dependency should be replaced with color value? d.put(p + "[Pressed].foreground", new ColorUIResource(0x134D8C)); d.put(p + "[Disabled].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_DISABLED)); d.put(p + "[Enabled].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_ENABLED)); d.put(p + "[MouseOver].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_ENABLED)); d.put(p + "[Pressed].foregroundPainter", new LazyPainter(c, ArrowButtonPainter.Which.FOREGROUND_PRESSED)); }
[ "private", "void", "defineArrowButtons", "(", "UIDefaults", "d", ")", "{", "String", "c", "=", "PAINTER_PREFIX", "+", "\"ArrowButtonPainter\"", ";", "String", "p", "=", "\"ArrowButton\"", ";", "d", ".", "put", "(", "p", "+", "\".States\"", ",", "\"Enabled,Mous...
Initialize the arrow button settings. @param d the UI defaults map.
[ "Initialize", "the", "arrow", "button", "settings", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L915-L928
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-text/src/main/java/org/xwiki/text/StringUtils.java
StringUtils.doubleChar
public static String doubleChar(final String str, final char c) { if (isEmpty(str)) { return str; } int start = 0; int end = str.indexOf(c, start); if (end == INDEX_NOT_FOUND) { return str; } final StringBuilder buf = new StringBuilder(str.length() + 1); do { end += 1; buf.append(str.substring(start, end)).append(c); start = end; end = str.indexOf(c, start); } while (end != INDEX_NOT_FOUND); buf.append(str.substring(start)); return buf.toString(); }
java
public static String doubleChar(final String str, final char c) { if (isEmpty(str)) { return str; } int start = 0; int end = str.indexOf(c, start); if (end == INDEX_NOT_FOUND) { return str; } final StringBuilder buf = new StringBuilder(str.length() + 1); do { end += 1; buf.append(str.substring(start, end)).append(c); start = end; end = str.indexOf(c, start); } while (end != INDEX_NOT_FOUND); buf.append(str.substring(start)); return buf.toString(); }
[ "public", "static", "String", "doubleChar", "(", "final", "String", "str", ",", "final", "char", "c", ")", "{", "if", "(", "isEmpty", "(", "str", ")", ")", "{", "return", "str", ";", "}", "int", "start", "=", "0", ";", "int", "end", "=", "str", "...
An attempt to make doubling a character (usually for escaping purposes) as fast as it can be. A lot faster than the usual <code>mystring.replace("a", "aa")</code> for example. @param str the string to modify @param c the character to double @return the modified string
[ "An", "attempt", "to", "make", "doubling", "a", "character", "(", "usually", "for", "escaping", "purposes", ")", "as", "fast", "as", "it", "can", "be", ".", "A", "lot", "faster", "than", "the", "usual", "<code", ">", "mystring", ".", "replace", "(", "a...
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-text/src/main/java/org/xwiki/text/StringUtils.java#L42-L67
cdk/cdk
storage/pdb/src/main/java/org/openscience/cdk/tools/ProteinBuilderTool.java
ProteinBuilderTool.createProtein
public static IBioPolymer createProtein(String sequence, IChemObjectBuilder builder) throws CDKException { Map<String, IAminoAcid> templates = AminoAcids.getHashMapBySingleCharCode(); IBioPolymer protein = builder.newInstance(IBioPolymer.class); IStrand strand = builder.newInstance(IStrand.class); IAminoAcid previousAA = null; for (int i = 0; i < sequence.length(); i++) { String aminoAcidCode = "" + sequence.charAt(i); logger.debug("Adding AA: " + aminoAcidCode); if (aminoAcidCode.equals(" ")) { // fine, just skip spaces } else { IAminoAcid aminoAcid = (IAminoAcid) templates.get(aminoAcidCode); if (aminoAcid == null) { throw new CDKException("Cannot build sequence! Unknown amino acid: " + aminoAcidCode); } try { aminoAcid = (IAminoAcid) aminoAcid.clone(); } catch (CloneNotSupportedException e) { throw new CDKException("Cannot build sequence! Clone exception: " + e.getMessage(), e); } aminoAcid.setMonomerName(aminoAcidCode + i); logger.debug("protein: ", protein); logger.debug("strand: ", strand); addAminoAcidAtCTerminus(protein, aminoAcid, strand, previousAA); previousAA = aminoAcid; } } // add the last oxygen of the protein IAtom oxygen = builder.newInstance(IAtom.class, "O"); // ... to amino acid previousAA.addAtom(oxygen); IBond bond = builder.newInstance(IBond.class, oxygen, previousAA.getCTerminus(), IBond.Order.SINGLE); previousAA.addBond(bond); // ... and to protein protein.addAtom(oxygen, previousAA, strand); protein.addBond(bond); return protein; }
java
public static IBioPolymer createProtein(String sequence, IChemObjectBuilder builder) throws CDKException { Map<String, IAminoAcid> templates = AminoAcids.getHashMapBySingleCharCode(); IBioPolymer protein = builder.newInstance(IBioPolymer.class); IStrand strand = builder.newInstance(IStrand.class); IAminoAcid previousAA = null; for (int i = 0; i < sequence.length(); i++) { String aminoAcidCode = "" + sequence.charAt(i); logger.debug("Adding AA: " + aminoAcidCode); if (aminoAcidCode.equals(" ")) { // fine, just skip spaces } else { IAminoAcid aminoAcid = (IAminoAcid) templates.get(aminoAcidCode); if (aminoAcid == null) { throw new CDKException("Cannot build sequence! Unknown amino acid: " + aminoAcidCode); } try { aminoAcid = (IAminoAcid) aminoAcid.clone(); } catch (CloneNotSupportedException e) { throw new CDKException("Cannot build sequence! Clone exception: " + e.getMessage(), e); } aminoAcid.setMonomerName(aminoAcidCode + i); logger.debug("protein: ", protein); logger.debug("strand: ", strand); addAminoAcidAtCTerminus(protein, aminoAcid, strand, previousAA); previousAA = aminoAcid; } } // add the last oxygen of the protein IAtom oxygen = builder.newInstance(IAtom.class, "O"); // ... to amino acid previousAA.addAtom(oxygen); IBond bond = builder.newInstance(IBond.class, oxygen, previousAA.getCTerminus(), IBond.Order.SINGLE); previousAA.addBond(bond); // ... and to protein protein.addAtom(oxygen, previousAA, strand); protein.addBond(bond); return protein; }
[ "public", "static", "IBioPolymer", "createProtein", "(", "String", "sequence", ",", "IChemObjectBuilder", "builder", ")", "throws", "CDKException", "{", "Map", "<", "String", ",", "IAminoAcid", ">", "templates", "=", "AminoAcids", ".", "getHashMapBySingleCharCode", ...
Creates a BioPolymer from a sequence of amino acid as identified by a the sequence of their one letter codes. It uses the given {@link IChemObjectBuilder} to create a data model. <p>For example: <pre> BioPolymer protein = ProteinBuilderTool.createProtein( "GAGA", SilentChemObjectBuilder.getInstance() ); </pre> @see #createProtein(String)
[ "Creates", "a", "BioPolymer", "from", "a", "sequence", "of", "amino", "acid", "as", "identified", "by", "a", "the", "sequence", "of", "their", "one", "letter", "codes", ".", "It", "uses", "the", "given", "{", "@link", "IChemObjectBuilder", "}", "to", "crea...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/pdb/src/main/java/org/openscience/cdk/tools/ProteinBuilderTool.java#L128-L165
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java
ProjectedCentroid.make
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation, DBIDs ids) { ProjectedCentroid c = new ProjectedCentroid(dims, RelationUtil.dimensionality(relation)); for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { c.put(relation.get(iter)); } return c; }
java
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation, DBIDs ids) { ProjectedCentroid c = new ProjectedCentroid(dims, RelationUtil.dimensionality(relation)); for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { c.put(relation.get(iter)); } return c; }
[ "public", "static", "ProjectedCentroid", "make", "(", "long", "[", "]", "dims", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ",", "DBIDs", "ids", ")", "{", "ProjectedCentroid", "c", "=", "new", "ProjectedCentroid", "(", "dims", ",",...
Static Constructor from a relation. @param dims Dimensions to use (indexed with 0) @param relation Relation to process @param ids IDs to process @return Centroid
[ "Static", "Constructor", "from", "a", "relation", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java#L154-L160
alipay/sofa-rpc
core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConfigs.java
RpcConfigs.getEnumValue
public static <T extends Enum<T>> T getEnumValue(String primaryKey, Class<T> enumClazz) { String val = (String) CFG.get(primaryKey); if (val == null) { throw new SofaRpcRuntimeException("Not Found Key: " + primaryKey); } else { return Enum.valueOf(enumClazz, val); } }
java
public static <T extends Enum<T>> T getEnumValue(String primaryKey, Class<T> enumClazz) { String val = (String) CFG.get(primaryKey); if (val == null) { throw new SofaRpcRuntimeException("Not Found Key: " + primaryKey); } else { return Enum.valueOf(enumClazz, val); } }
[ "public", "static", "<", "T", "extends", "Enum", "<", "T", ">", ">", "T", "getEnumValue", "(", "String", "primaryKey", ",", "Class", "<", "T", ">", "enumClazz", ")", "{", "String", "val", "=", "(", "String", ")", "CFG", ".", "get", "(", "primaryKey",...
Gets enum value. @param <T> the type parameter @param primaryKey the primary key @param enumClazz the enum clazz @return the enum value
[ "Gets", "enum", "value", "." ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConfigs.java#L236-L243
windy1/google-places-api-java
src/main/java/se/walkercrou/places/exception/GooglePlacesException.java
GooglePlacesException.parse
public static GooglePlacesException parse(String statusCode, String errorMessage) { Class<?> clazz = statusClassMap.get(statusCode); if (clazz == null) return null; try { if (errorMessage == null || errorMessage.isEmpty()) return (GooglePlacesException) clazz.newInstance(); else { Constructor<?> constructor = clazz.getConstructor(String.class); return (GooglePlacesException) constructor.newInstance(errorMessage); } } catch (Exception e) { // Should never happen! throw new GooglePlacesException(e); } }
java
public static GooglePlacesException parse(String statusCode, String errorMessage) { Class<?> clazz = statusClassMap.get(statusCode); if (clazz == null) return null; try { if (errorMessage == null || errorMessage.isEmpty()) return (GooglePlacesException) clazz.newInstance(); else { Constructor<?> constructor = clazz.getConstructor(String.class); return (GooglePlacesException) constructor.newInstance(errorMessage); } } catch (Exception e) { // Should never happen! throw new GooglePlacesException(e); } }
[ "public", "static", "GooglePlacesException", "parse", "(", "String", "statusCode", ",", "String", "errorMessage", ")", "{", "Class", "<", "?", ">", "clazz", "=", "statusClassMap", ".", "get", "(", "statusCode", ")", ";", "if", "(", "clazz", "==", "null", "...
Returns the correct exception from a server-given status code and error message. @param statusCode to find exception for @param errorMessage error message from server @return exception that matches the specified status code
[ "Returns", "the", "correct", "exception", "from", "a", "server", "-", "given", "status", "code", "and", "error", "message", "." ]
train
https://github.com/windy1/google-places-api-java/blob/a5f2a18a7d1ca03fc0480637eae255fe92fc8b86/src/main/java/se/walkercrou/places/exception/GooglePlacesException.java#L81-L96
alkacon/opencms-core
src/org/opencms/widgets/dataview/CmsDataViewQuery.java
CmsDataViewQuery.setFilterValues
public void setFilterValues(LinkedHashMap<String, String> filterValues) { m_filterValues = new LinkedHashMap<String, String>(filterValues); }
java
public void setFilterValues(LinkedHashMap<String, String> filterValues) { m_filterValues = new LinkedHashMap<String, String>(filterValues); }
[ "public", "void", "setFilterValues", "(", "LinkedHashMap", "<", "String", ",", "String", ">", "filterValues", ")", "{", "m_filterValues", "=", "new", "LinkedHashMap", "<", "String", ",", "String", ">", "(", "filterValues", ")", ";", "}" ]
Sets the selected filter values.<p> @param filterValues the filter values
[ "Sets", "the", "selected", "filter", "values", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/dataview/CmsDataViewQuery.java#L99-L102
grails/grails-core
grails-core/src/main/groovy/grails/util/GrailsClassUtils.java
GrailsClassUtils.isMatchBetweenPrimativeAndWrapperTypes
@SuppressWarnings("rawtypes") public static boolean isMatchBetweenPrimativeAndWrapperTypes(Class leftType, Class rightType) { if (leftType == null) { throw new NullPointerException("Left type is null!"); } if (rightType == null) { throw new NullPointerException("Right type is null!"); } Class<?> r = PRIMITIVE_TYPE_COMPATIBLE_CLASSES.get(leftType); return r == rightType; }
java
@SuppressWarnings("rawtypes") public static boolean isMatchBetweenPrimativeAndWrapperTypes(Class leftType, Class rightType) { if (leftType == null) { throw new NullPointerException("Left type is null!"); } if (rightType == null) { throw new NullPointerException("Right type is null!"); } Class<?> r = PRIMITIVE_TYPE_COMPATIBLE_CLASSES.get(leftType); return r == rightType; }
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "static", "boolean", "isMatchBetweenPrimativeAndWrapperTypes", "(", "Class", "leftType", ",", "Class", "rightType", ")", "{", "if", "(", "leftType", "==", "null", ")", "{", "throw", "new", "NullPointerEx...
Detect if left and right types are matching types. In particular, test if one is a primitive type and the other is the corresponding Java wrapper type. Primitive and wrapper classes may be passed to either arguments. @param leftType @param rightType @return true if one of the classes is a native type and the other the object representation of the same native type
[ "Detect", "if", "left", "and", "right", "types", "are", "matching", "types", ".", "In", "particular", "test", "if", "one", "is", "a", "primitive", "type", "and", "the", "other", "is", "the", "corresponding", "Java", "wrapper", "type", ".", "Primitive", "an...
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L457-L467
hal/elemento
template-processor/src/main/java/org/jboss/gwt/elemento/processor/TemplatedProcessor.java
TemplatedProcessor.abortWithError
private void abortWithError(Element element, String msg, Object... args) throws AbortProcessingException { error(element, msg, args); throw new AbortProcessingException(); }
java
private void abortWithError(Element element, String msg, Object... args) throws AbortProcessingException { error(element, msg, args); throw new AbortProcessingException(); }
[ "private", "void", "abortWithError", "(", "Element", "element", ",", "String", "msg", ",", "Object", "...", "args", ")", "throws", "AbortProcessingException", "{", "error", "(", "element", ",", "msg", ",", "args", ")", ";", "throw", "new", "AbortProcessingExce...
Issue a compilation error and abandon the processing of this template. This does not prevent the processing of other templates.
[ "Issue", "a", "compilation", "error", "and", "abandon", "the", "processing", "of", "this", "template", ".", "This", "does", "not", "prevent", "the", "processing", "of", "other", "templates", "." ]
train
https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/template-processor/src/main/java/org/jboss/gwt/elemento/processor/TemplatedProcessor.java#L711-L714
redisson/redisson
redisson/src/main/java/org/redisson/misc/HighwayHash.java
HighwayHash.hash64
public static long hash64(byte[] data, int offset, int length, long[] key) { HighwayHash h = new HighwayHash(key); h.processAll(data, offset, length); return h.finalize64(); }
java
public static long hash64(byte[] data, int offset, int length, long[] key) { HighwayHash h = new HighwayHash(key); h.processAll(data, offset, length); return h.finalize64(); }
[ "public", "static", "long", "hash64", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "int", "length", ",", "long", "[", "]", "key", ")", "{", "HighwayHash", "h", "=", "new", "HighwayHash", "(", "key", ")", ";", "h", ".", "processAll", "(...
NOTE: The 64-bit HighwayHash algorithm is declared stable and no longer subject to change. @param data array with data bytes @param offset position of first byte of data to read from @param length number of bytes from data to read @param key array of size 4 with the key to initialize the hash with @return 64-bit hash for the given data
[ "NOTE", ":", "The", "64", "-", "bit", "HighwayHash", "algorithm", "is", "declared", "stable", "and", "no", "longer", "subject", "to", "change", "." ]
train
https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/misc/HighwayHash.java#L290-L294
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java
NetworkInterfacesInner.beginGetEffectiveRouteTable
public EffectiveRouteListResultInner beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); }
java
public EffectiveRouteListResultInner beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body(); }
[ "public", "EffectiveRouteListResultInner", "beginGetEffectiveRouteTable", "(", "String", "resourceGroupName", ",", "String", "networkInterfaceName", ")", "{", "return", "beginGetEffectiveRouteTableWithServiceResponseAsync", "(", "resourceGroupName", ",", "networkInterfaceName", ")"...
Gets all route tables applied to a network interface. @param resourceGroupName The name of the resource group. @param networkInterfaceName The name of the network interface. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the EffectiveRouteListResultInner object if successful.
[ "Gets", "all", "route", "tables", "applied", "to", "a", "network", "interface", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L1259-L1261
VoltDB/voltdb
src/frontend/org/voltdb/exportclient/ExportDecoderBase.java
ExportDecoderBase.decodeRow
protected ExportRowData decodeRow(byte[] rowData) throws IOException { ExportRow row = ExportRow.decodeRow(m_legacyRow, getPartition(), m_startTS, rowData); return new ExportRowData(row.values, row.partitionValue, row.partitionId); }
java
protected ExportRowData decodeRow(byte[] rowData) throws IOException { ExportRow row = ExportRow.decodeRow(m_legacyRow, getPartition(), m_startTS, rowData); return new ExportRowData(row.values, row.partitionValue, row.partitionId); }
[ "protected", "ExportRowData", "decodeRow", "(", "byte", "[", "]", "rowData", ")", "throws", "IOException", "{", "ExportRow", "row", "=", "ExportRow", ".", "decodeRow", "(", "m_legacyRow", ",", "getPartition", "(", ")", ",", "m_startTS", ",", "rowData", ")", ...
Decode a byte array of row data into ExportRowData @param rowData @return ExportRowData @throws IOException
[ "Decode", "a", "byte", "array", "of", "row", "data", "into", "ExportRowData" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/exportclient/ExportDecoderBase.java#L119-L122
Azure/azure-sdk-for-java
dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/ZonesInner.java
ZonesInner.beginDeleteAsync
public Observable<ZoneDeleteResultInner> beginDeleteAsync(String resourceGroupName, String zoneName, String ifMatch) { return beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).map(new Func1<ServiceResponse<ZoneDeleteResultInner>, ZoneDeleteResultInner>() { @Override public ZoneDeleteResultInner call(ServiceResponse<ZoneDeleteResultInner> response) { return response.body(); } }); }
java
public Observable<ZoneDeleteResultInner> beginDeleteAsync(String resourceGroupName, String zoneName, String ifMatch) { return beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).map(new Func1<ServiceResponse<ZoneDeleteResultInner>, ZoneDeleteResultInner>() { @Override public ZoneDeleteResultInner call(ServiceResponse<ZoneDeleteResultInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "ZoneDeleteResultInner", ">", "beginDeleteAsync", "(", "String", "resourceGroupName", ",", "String", "zoneName", ",", "String", "ifMatch", ")", "{", "return", "beginDeleteWithServiceResponseAsync", "(", "resourceGroupName", ",", "zoneName", ...
Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. @param resourceGroupName The name of the resource group. @param zoneName The name of the DNS zone (without a terminating dot). @param ifMatch The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the ZoneDeleteResultInner object
[ "Deletes", "a", "DNS", "zone", ".", "WARNING", ":", "All", "DNS", "records", "in", "the", "zone", "will", "also", "be", "deleted", ".", "This", "operation", "cannot", "be", "undone", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/ZonesInner.java#L553-L560
Netflix/netflix-graph
src/main/java/com/netflix/nfgraph/NFGraph.java
NFGraph.getConnection
public int getConnection(String nodeType, int ordinal, String propertyName) { return getConnection(0, nodeType, ordinal, propertyName); }
java
public int getConnection(String nodeType, int ordinal, String propertyName) { return getConnection(0, nodeType, ordinal, propertyName); }
[ "public", "int", "getConnection", "(", "String", "nodeType", ",", "int", "ordinal", ",", "String", "propertyName", ")", "{", "return", "getConnection", "(", "0", ",", "nodeType", ",", "ordinal", ",", "propertyName", ")", ";", "}" ]
Retrieve a single connected ordinal, given the type and ordinal of the originating node, and the property by which this node is connected. @return the connected ordinal, or -1 if there is no such ordinal
[ "Retrieve", "a", "single", "connected", "ordinal", "given", "the", "type", "and", "ordinal", "of", "the", "originating", "node", "and", "the", "property", "by", "which", "this", "node", "is", "connected", "." ]
train
https://github.com/Netflix/netflix-graph/blob/ee129252a08a9f51dd296d6fca2f0b28b7be284e/src/main/java/com/netflix/nfgraph/NFGraph.java#L106-L108
Jasig/uPortal
uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java
RDBMEntityGroupStore.contains
@Override public boolean contains(IEntityGroup group, IGroupMember member) throws GroupsException { return (member.isGroup()) ? containsGroup(group, (IEntityGroup) member) : containsEntity(group, member); }
java
@Override public boolean contains(IEntityGroup group, IGroupMember member) throws GroupsException { return (member.isGroup()) ? containsGroup(group, (IEntityGroup) member) : containsEntity(group, member); }
[ "@", "Override", "public", "boolean", "contains", "(", "IEntityGroup", "group", ",", "IGroupMember", "member", ")", "throws", "GroupsException", "{", "return", "(", "member", ".", "isGroup", "(", ")", ")", "?", "containsGroup", "(", "group", ",", "(", "IEnti...
Answers if <code>IGroupMember</code> member is a member of <code>group</code>. @return boolean @param group IEntityGroup @param member IGroupMember
[ "Answers", "if", "<code", ">", "IGroupMember<", "/", "code", ">", "member", "is", "a", "member", "of", "<code", ">", "group<", "/", "code", ">", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java#L169-L174
raphw/byte-buddy
byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java
Dynamic.ofInvocation
public static Dynamic ofInvocation(Method method, List<?> rawArguments) { return ofInvocation(new MethodDescription.ForLoadedMethod(method), rawArguments); }
java
public static Dynamic ofInvocation(Method method, List<?> rawArguments) { return ofInvocation(new MethodDescription.ForLoadedMethod(method), rawArguments); }
[ "public", "static", "Dynamic", "ofInvocation", "(", "Method", "method", ",", "List", "<", "?", ">", "rawArguments", ")", "{", "return", "ofInvocation", "(", "new", "MethodDescription", ".", "ForLoadedMethod", "(", "method", ")", ",", "rawArguments", ")", ";", ...
Represents a constant that is resolved by invoking a {@code static} factory method. @param method The method to invoke to create the represented constant value. @param rawArguments The method's constant arguments. @return A dynamic constant that is resolved by the supplied factory method.
[ "Represents", "a", "constant", "that", "is", "resolved", "by", "invoking", "a", "{", "@code", "static", "}", "factory", "method", "." ]
train
https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java#L1531-L1533
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JawrApplicationConfigManager.java
JawrApplicationConfigManager.setStringValue
public void setStringValue(String property, String value) { try { if (jsMBean != null) { setProperty(jsMBean, property, value); } if (cssMBean != null) { setProperty(cssMBean, property, value); } if (binaryMBean != null) { setProperty(binaryMBean, property, value); } } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new JmxConfigException("Exception while setting the string value", e); } }
java
public void setStringValue(String property, String value) { try { if (jsMBean != null) { setProperty(jsMBean, property, value); } if (cssMBean != null) { setProperty(cssMBean, property, value); } if (binaryMBean != null) { setProperty(binaryMBean, property, value); } } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new JmxConfigException("Exception while setting the string value", e); } }
[ "public", "void", "setStringValue", "(", "String", "property", ",", "String", "value", ")", "{", "try", "{", "if", "(", "jsMBean", "!=", "null", ")", "{", "setProperty", "(", "jsMBean", ",", "property", ",", "value", ")", ";", "}", "if", "(", "cssMBean...
Update the property with the string value in each config manager. @param property the property to update @param value the value to set
[ "Update", "the", "property", "with", "the", "string", "value", "in", "each", "config", "manager", "." ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JawrApplicationConfigManager.java#L557-L571
gallandarakhneorg/afc
advanced/attributes/src/main/java/org/arakhne/afc/attrs/collection/HeapAttributeCollection.java
HeapAttributeCollection.getStoredAttribute
@Pure protected Attribute getStoredAttribute(String name, AttributeType expectedType) { Object val = this.heap.get(name); if (val != null) { final AttributeType currentType = AttributeType.fromValue(val); val = unprotectNull(val); final Attribute attr = new AttributeImpl(name); if (expectedType == null) { attr.castAndSet(currentType, val); } else { attr.castAndSet(expectedType, val); } return attr; } return null; }
java
@Pure protected Attribute getStoredAttribute(String name, AttributeType expectedType) { Object val = this.heap.get(name); if (val != null) { final AttributeType currentType = AttributeType.fromValue(val); val = unprotectNull(val); final Attribute attr = new AttributeImpl(name); if (expectedType == null) { attr.castAndSet(currentType, val); } else { attr.castAndSet(expectedType, val); } return attr; } return null; }
[ "@", "Pure", "protected", "Attribute", "getStoredAttribute", "(", "String", "name", ",", "AttributeType", "expectedType", ")", "{", "Object", "val", "=", "this", ".", "heap", ".", "get", "(", "name", ")", ";", "if", "(", "val", "!=", "null", ")", "{", ...
Replies the attribute with the given name. @param name is the name of the attribute to retreive @param expectedType is the expected type for the attribute. @return the value or <code>null</code>
[ "Replies", "the", "attribute", "with", "the", "given", "name", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/attributes/src/main/java/org/arakhne/afc/attrs/collection/HeapAttributeCollection.java#L251-L266
Azure/azure-sdk-for-java
network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java
VirtualNetworkGatewayConnectionsInner.resetSharedKey
public ConnectionResetSharedKeyInner resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().last().body(); }
java
public ConnectionResetSharedKeyInner resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) { return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().last().body(); }
[ "public", "ConnectionResetSharedKeyInner", "resetSharedKey", "(", "String", "resourceGroupName", ",", "String", "virtualNetworkGatewayConnectionName", ",", "int", "keyLength", ")", "{", "return", "resetSharedKeyWithServiceResponseAsync", "(", "resourceGroupName", ",", "virtualN...
The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. @param resourceGroupName The name of the resource group. @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. @param keyLength The virtual network connection reset shared key length, should between 1 and 128. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the ConnectionResetSharedKeyInner object if successful.
[ "The", "VirtualNetworkGatewayConnectionResetSharedKey", "operation", "resets", "the", "virtual", "network", "gateway", "connection", "shared", "key", "for", "passed", "virtual", "network", "gateway", "connection", "in", "the", "specified", "resource", "group", "through", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L1223-L1225
Ordinastie/MalisisCore
src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java
IconProviderBuilder.withValue
public IconProviderBuilder withValue(Object value, Icon icon) { if (currentProperty == null) throw new IllegalStateException("You must set the property first."); if (!currentProperty.getAllowedValues().contains(value)) throw new IllegalStateException("The property " + currentProperty + "(" + currentProperty.getClass().getSimpleName() + ") doesn't not contain value " + value); stateIcons.put(currentProperty, value, checkNotNull(icon)); return this; }
java
public IconProviderBuilder withValue(Object value, Icon icon) { if (currentProperty == null) throw new IllegalStateException("You must set the property first."); if (!currentProperty.getAllowedValues().contains(value)) throw new IllegalStateException("The property " + currentProperty + "(" + currentProperty.getClass().getSimpleName() + ") doesn't not contain value " + value); stateIcons.put(currentProperty, value, checkNotNull(icon)); return this; }
[ "public", "IconProviderBuilder", "withValue", "(", "Object", "value", ",", "Icon", "icon", ")", "{", "if", "(", "currentProperty", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"You must set the property first.\"", ")", ";", "if", "(", "!", ...
Sets the {@link Icon} to use for the state value.<br> {@link #forProperty(IProperty)} must be called before with the corresponding {@link IProperty}. @param value the value @param icon the icon @return the icon provider builder
[ "Sets", "the", "{", "@link", "Icon", "}", "to", "use", "for", "the", "state", "value", ".", "<br", ">", "{", "@link", "#forProperty", "(", "IProperty", ")", "}", "must", "be", "called", "before", "with", "the", "corresponding", "{", "@link", "IProperty",...
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java#L209-L219
alkacon/opencms-core
src/org/opencms/file/CmsProperty.java
CmsProperty.replaceDelimiter
private String replaceDelimiter(String value, char delimiter, String delimiterReplacement) { return CmsStringUtil.substitute(value, String.valueOf(delimiter), delimiterReplacement); }
java
private String replaceDelimiter(String value, char delimiter, String delimiterReplacement) { return CmsStringUtil.substitute(value, String.valueOf(delimiter), delimiterReplacement); }
[ "private", "String", "replaceDelimiter", "(", "String", "value", ",", "char", "delimiter", ",", "String", "delimiterReplacement", ")", "{", "return", "CmsStringUtil", ".", "substitute", "(", "value", ",", "String", ".", "valueOf", "(", "delimiter", ")", ",", "...
Replaces the given delimiter character with the replacement string.<p> @param value the string that is scanned @param delimiter the delimiter character to replace @param delimiterReplacement the replacement string for the delimiter character @return the substituted string
[ "Replaces", "the", "given", "delimiter", "character", "with", "the", "replacement", "string", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsProperty.java#L1350-L1353
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.nodeAttribute
private boolean nodeAttribute(Node node, String attributeName, boolean defaultValue) { boolean value = defaultValue; if (node.hasAttributes()) { Node attribute = node.getAttributes().getNamedItem(attributeName); if (attribute != null) { value = Boolean.valueOf(attribute.getNodeValue()); } } return value; }
java
private boolean nodeAttribute(Node node, String attributeName, boolean defaultValue) { boolean value = defaultValue; if (node.hasAttributes()) { Node attribute = node.getAttributes().getNamedItem(attributeName); if (attribute != null) { value = Boolean.valueOf(attribute.getNodeValue()); } } return value; }
[ "private", "boolean", "nodeAttribute", "(", "Node", "node", ",", "String", "attributeName", ",", "boolean", "defaultValue", ")", "{", "boolean", "value", "=", "defaultValue", ";", "if", "(", "node", ".", "hasAttributes", "(", ")", ")", "{", "Node", "attribut...
Return node attribute value, if exists or default attribute value @param node XML-node @param attributeName attributeName @param defaultValue attribute default value @return attribute value or default value
[ "Return", "node", "attribute", "value", "if", "exists", "or", "default", "attribute", "value" ]
train
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L602-L611
fuinorg/objects4j
src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java
DayOpeningHours.asAddedChanges
public List<Change> asAddedChanges() { final List<Change> changes = new ArrayList<>(); for (final HourRange hr : hourRanges) { changes.add(new Change(ChangeType.ADDED, dayOfTheWeek, hr)); } return changes; }
java
public List<Change> asAddedChanges() { final List<Change> changes = new ArrayList<>(); for (final HourRange hr : hourRanges) { changes.add(new Change(ChangeType.ADDED, dayOfTheWeek, hr)); } return changes; }
[ "public", "List", "<", "Change", ">", "asAddedChanges", "(", ")", "{", "final", "List", "<", "Change", ">", "changes", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "final", "HourRange", "hr", ":", "hourRanges", ")", "{", "changes", ".", ...
Returns all hour ranges of this day as if they were added. @return Added day changes.
[ "Returns", "all", "hour", "ranges", "of", "this", "day", "as", "if", "they", "were", "added", "." ]
train
https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/DayOpeningHours.java#L364-L370
ThreeTen/threeten-extra
src/main/java/org/threeten/extra/scale/TaiInstant.java
TaiInstant.plus
public TaiInstant plus(Duration duration) { long secsToAdd = duration.getSeconds(); int nanosToAdd = duration.getNano(); if ((secsToAdd | nanosToAdd) == 0) { return this; } long secs = Math.addExact(seconds, secsToAdd); long nanoAdjustment = ((long) nanos) + nanosToAdd; // safe int+int return ofTaiSeconds(secs, nanoAdjustment); }
java
public TaiInstant plus(Duration duration) { long secsToAdd = duration.getSeconds(); int nanosToAdd = duration.getNano(); if ((secsToAdd | nanosToAdd) == 0) { return this; } long secs = Math.addExact(seconds, secsToAdd); long nanoAdjustment = ((long) nanos) + nanosToAdd; // safe int+int return ofTaiSeconds(secs, nanoAdjustment); }
[ "public", "TaiInstant", "plus", "(", "Duration", "duration", ")", "{", "long", "secsToAdd", "=", "duration", ".", "getSeconds", "(", ")", ";", "int", "nanosToAdd", "=", "duration", ".", "getNano", "(", ")", ";", "if", "(", "(", "secsToAdd", "|", "nanosTo...
Returns a copy of this instant with the specified duration added. <p> The duration is added using simple addition of the seconds and nanoseconds in the duration to the seconds and nanoseconds of this instant. As a result, the duration is treated as being measured in TAI compatible seconds for the purpose of this method. <p> This instance is immutable and unaffected by this method call. @param duration the duration to add, not null @return a {@code TaiInstant} based on this instant with the duration added, not null @throws ArithmeticException if the calculation exceeds the supported range
[ "Returns", "a", "copy", "of", "this", "instant", "with", "the", "specified", "duration", "added", ".", "<p", ">", "The", "duration", "is", "added", "using", "simple", "addition", "of", "the", "seconds", "and", "nanoseconds", "in", "the", "duration", "to", ...
train
https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/scale/TaiInstant.java#L308-L317
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java
MarshallUtil.isSafeClass
public static boolean isSafeClass(String className, List<String> whitelist) { for (String whiteRegExp : whitelist) { Pattern whitePattern = Pattern.compile(whiteRegExp); Matcher whiteMatcher = whitePattern.matcher(className); if (whiteMatcher.find()) { if (log.isTraceEnabled()) log.tracef("Whitelist match: '%s'", className); return true; } } return false; }
java
public static boolean isSafeClass(String className, List<String> whitelist) { for (String whiteRegExp : whitelist) { Pattern whitePattern = Pattern.compile(whiteRegExp); Matcher whiteMatcher = whitePattern.matcher(className); if (whiteMatcher.find()) { if (log.isTraceEnabled()) log.tracef("Whitelist match: '%s'", className); return true; } } return false; }
[ "public", "static", "boolean", "isSafeClass", "(", "String", "className", ",", "List", "<", "String", ">", "whitelist", ")", "{", "for", "(", "String", "whiteRegExp", ":", "whitelist", ")", "{", "Pattern", "whitePattern", "=", "Pattern", ".", "compile", "(",...
Checks whether class name is matched by the class name white list regular expressions provided. @param className class to verify @param whitelist list of regular expressions to match class name against @return true if the class matched at least one of the regular expressions, false otherwise
[ "Checks", "whether", "class", "name", "is", "matched", "by", "the", "class", "name", "white", "list", "regular", "expressions", "provided", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L509-L522
Stratio/bdt
src/main/java/com/stratio/qa/specs/DatabaseSpec.java
DatabaseSpec.assertRowNumberOfTableOnCassandraKeyspace
@Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with '(.+?)' rows$") public void assertRowNumberOfTableOnCassandraKeyspace(String keyspace, String tableName, String numberRows) { Long numberRowsLong = Long.parseLong(numberRows); commonspec.getCassandraClient().useKeyspace(keyspace); assertThat(commonspec.getCassandraClient().executeQuery("SELECT COUNT(*) FROM " + tableName + ";").all().get(0).getLong(0)).as("The table " + tableName + "exists on cassandra"). isEqualTo(numberRowsLong); }
java
@Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with '(.+?)' rows$") public void assertRowNumberOfTableOnCassandraKeyspace(String keyspace, String tableName, String numberRows) { Long numberRowsLong = Long.parseLong(numberRows); commonspec.getCassandraClient().useKeyspace(keyspace); assertThat(commonspec.getCassandraClient().executeQuery("SELECT COUNT(*) FROM " + tableName + ";").all().get(0).getLong(0)).as("The table " + tableName + "exists on cassandra"). isEqualTo(numberRowsLong); }
[ "@", "Then", "(", "\"^a Cassandra keyspace '(.+?)' contains a table '(.+?)' with '(.+?)' rows$\"", ")", "public", "void", "assertRowNumberOfTableOnCassandraKeyspace", "(", "String", "keyspace", ",", "String", "tableName", ",", "String", "numberRows", ")", "{", "Long", "number...
Checks the number of rows in a cassandra table. @param keyspace @param tableName @param numberRows
[ "Checks", "the", "number", "of", "rows", "in", "a", "cassandra", "table", "." ]
train
https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L680-L686
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
ResourceGroovyMethods.newWriter
public static BufferedWriter newWriter(File file, String charset, boolean append) throws IOException { if (append) { return new EncodingAwareBufferedWriter(new OutputStreamWriter(new FileOutputStream(file, append), charset)); } else { // first write the Byte Order Mark for Unicode encodings FileOutputStream stream = new FileOutputStream(file); writeUTF16BomIfRequired(charset, stream); return new EncodingAwareBufferedWriter(new OutputStreamWriter(stream, charset)); } }
java
public static BufferedWriter newWriter(File file, String charset, boolean append) throws IOException { if (append) { return new EncodingAwareBufferedWriter(new OutputStreamWriter(new FileOutputStream(file, append), charset)); } else { // first write the Byte Order Mark for Unicode encodings FileOutputStream stream = new FileOutputStream(file); writeUTF16BomIfRequired(charset, stream); return new EncodingAwareBufferedWriter(new OutputStreamWriter(stream, charset)); } }
[ "public", "static", "BufferedWriter", "newWriter", "(", "File", "file", ",", "String", "charset", ",", "boolean", "append", ")", "throws", "IOException", "{", "if", "(", "append", ")", "{", "return", "new", "EncodingAwareBufferedWriter", "(", "new", "OutputStrea...
Helper method to create a buffered writer for a file. If the given charset is "UTF-16BE" or "UTF-16LE", the requisite byte order mark is written to the stream before the writer is returned. @param file a File @param charset the name of the encoding used to write in this file @param append true if in append mode @return a BufferedWriter @throws IOException if an IOException occurs. @since 1.0
[ "Helper", "method", "to", "create", "a", "buffered", "writer", "for", "a", "file", ".", "If", "the", "given", "charset", "is", "UTF", "-", "16BE", "or", "UTF", "-", "16LE", "the", "requisite", "byte", "order", "mark", "is", "written", "to", "the", "str...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1784-L1793
rzwitserloot/lombok
src/core/lombok/javac/JavacNode.java
JavacNode.addWarning
public void addWarning(String message, DiagnosticPosition pos) { ast.printMessage(Diagnostic.Kind.WARNING, message, null, pos, false); }
java
public void addWarning(String message, DiagnosticPosition pos) { ast.printMessage(Diagnostic.Kind.WARNING, message, null, pos, false); }
[ "public", "void", "addWarning", "(", "String", "message", ",", "DiagnosticPosition", "pos", ")", "{", "ast", ".", "printMessage", "(", "Diagnostic", ".", "Kind", ".", "WARNING", ",", "message", ",", "null", ",", "pos", ",", "false", ")", ";", "}" ]
Generates a compiler warning focused on the AST node represented by this node object.
[ "Generates", "a", "compiler", "warning", "focused", "on", "the", "AST", "node", "represented", "by", "this", "node", "object", "." ]
train
https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/JavacNode.java#L276-L278
knowm/XChange
xchange-coinsuper/src/main/java/org/knowm/xchange/coinsuper/CoinsuperAdapters.java
CoinsuperAdapters.adaptOrder
public static CoinsuperGenericOrder adaptOrder(String orderId, OrderList orderList) { BigDecimal averagePrice = new BigDecimal(orderList.getPriceLimit()); BigDecimal cumulativeAmount = new BigDecimal(orderList.getQuantity()); BigDecimal totalFee = new BigDecimal(orderList.getFee()); BigDecimal amount = new BigDecimal(orderList.getQuantity()); OrderType action = OrderType.ASK; if (orderList.getAction().equals("Buy")) { action = OrderType.BID; } // Order Status UNDEAL:Not Executed,PARTDEAL:Partially Executed,DEAL:Order Complete,CANCEL: // Canceled OrderStatus orderStatus = OrderStatus.PENDING_NEW; if (orderList.getState().equals("UNDEAL")) { orderStatus = OrderStatus.PENDING_NEW; } else if (orderList.getState().equals("Canceled")) { orderStatus = OrderStatus.CANCELED; } CoinsuperGenericOrder coinsuperGenericOrder = new CoinsuperGenericOrder( action, amount, new CurrencyPair(orderList.getSymbol()), orderId, CommonUtil.timeStampToDate(orderList.getUtcCreate()), averagePrice, cumulativeAmount, totalFee, orderStatus); return coinsuperGenericOrder; }
java
public static CoinsuperGenericOrder adaptOrder(String orderId, OrderList orderList) { BigDecimal averagePrice = new BigDecimal(orderList.getPriceLimit()); BigDecimal cumulativeAmount = new BigDecimal(orderList.getQuantity()); BigDecimal totalFee = new BigDecimal(orderList.getFee()); BigDecimal amount = new BigDecimal(orderList.getQuantity()); OrderType action = OrderType.ASK; if (orderList.getAction().equals("Buy")) { action = OrderType.BID; } // Order Status UNDEAL:Not Executed,PARTDEAL:Partially Executed,DEAL:Order Complete,CANCEL: // Canceled OrderStatus orderStatus = OrderStatus.PENDING_NEW; if (orderList.getState().equals("UNDEAL")) { orderStatus = OrderStatus.PENDING_NEW; } else if (orderList.getState().equals("Canceled")) { orderStatus = OrderStatus.CANCELED; } CoinsuperGenericOrder coinsuperGenericOrder = new CoinsuperGenericOrder( action, amount, new CurrencyPair(orderList.getSymbol()), orderId, CommonUtil.timeStampToDate(orderList.getUtcCreate()), averagePrice, cumulativeAmount, totalFee, orderStatus); return coinsuperGenericOrder; }
[ "public", "static", "CoinsuperGenericOrder", "adaptOrder", "(", "String", "orderId", ",", "OrderList", "orderList", ")", "{", "BigDecimal", "averagePrice", "=", "new", "BigDecimal", "(", "orderList", ".", "getPriceLimit", "(", ")", ")", ";", "BigDecimal", "cumulat...
There is no method to discern market versus limit order type - so this returns a generic GenericOrder as a status @param @return
[ "There", "is", "no", "method", "to", "discern", "market", "versus", "limit", "order", "type", "-", "so", "this", "returns", "a", "generic", "GenericOrder", "as", "a", "status" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinsuper/src/main/java/org/knowm/xchange/coinsuper/CoinsuperAdapters.java#L162-L194
liyiorg/weixin-popular
src/main/java/weixin/popular/api/SnsAPI.java
SnsAPI.connectOauth2Authorize
public static String connectOauth2Authorize(String appid,String redirect_uri,boolean snsapi_userinfo,String state,String component_appid){ try { StringBuilder sb = new StringBuilder(); sb.append(OPEN_URI + "/connect/oauth2/authorize?") .append("appid=").append(appid) .append("&redirect_uri=").append(URLEncoder.encode(redirect_uri, "utf-8")) .append("&response_type=code") .append("&scope=").append(snsapi_userinfo?"snsapi_userinfo":"snsapi_base") .append("&state=").append(state==null?"":state); if(component_appid!=null){ sb.append("&component_appid=").append(component_appid); } sb.append("#wechat_redirect"); return sb.toString(); } catch (UnsupportedEncodingException e) { logger.error("", e); } return null; }
java
public static String connectOauth2Authorize(String appid,String redirect_uri,boolean snsapi_userinfo,String state,String component_appid){ try { StringBuilder sb = new StringBuilder(); sb.append(OPEN_URI + "/connect/oauth2/authorize?") .append("appid=").append(appid) .append("&redirect_uri=").append(URLEncoder.encode(redirect_uri, "utf-8")) .append("&response_type=code") .append("&scope=").append(snsapi_userinfo?"snsapi_userinfo":"snsapi_base") .append("&state=").append(state==null?"":state); if(component_appid!=null){ sb.append("&component_appid=").append(component_appid); } sb.append("#wechat_redirect"); return sb.toString(); } catch (UnsupportedEncodingException e) { logger.error("", e); } return null; }
[ "public", "static", "String", "connectOauth2Authorize", "(", "String", "appid", ",", "String", "redirect_uri", ",", "boolean", "snsapi_userinfo", ",", "String", "state", ",", "String", "component_appid", ")", "{", "try", "{", "StringBuilder", "sb", "=", "new", "...
生成网页授权 URL (第三方平台开发) @param appid appid @param redirect_uri 自动URLEncoder @param snsapi_userinfo snsapi_userinfo @param state 可以为空 @param component_appid 第三方平台开发,可以为空。 服务方的appid,在申请创建公众号服务成功后,可在公众号服务详情页找到 @return url
[ "生成网页授权", "URL", "(", "第三方平台开发", ")" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/SnsAPI.java#L182-L200
grpc/grpc-java
api/src/main/java/io/grpc/CallOptions.java
CallOptions.withOption
public <T> CallOptions withOption(Key<T> key, T value) { Preconditions.checkNotNull(key, "key"); Preconditions.checkNotNull(value, "value"); CallOptions newOptions = new CallOptions(this); int existingIdx = -1; for (int i = 0; i < customOptions.length; i++) { if (key.equals(customOptions[i][0])) { existingIdx = i; break; } } newOptions.customOptions = new Object[customOptions.length + (existingIdx == -1 ? 1 : 0)][2]; System.arraycopy(customOptions, 0, newOptions.customOptions, 0, customOptions.length); if (existingIdx == -1) { // Add a new option newOptions.customOptions[customOptions.length] = new Object[] {key, value}; } else { // Replace an existing option newOptions.customOptions[existingIdx] = new Object[] {key, value}; } return newOptions; }
java
public <T> CallOptions withOption(Key<T> key, T value) { Preconditions.checkNotNull(key, "key"); Preconditions.checkNotNull(value, "value"); CallOptions newOptions = new CallOptions(this); int existingIdx = -1; for (int i = 0; i < customOptions.length; i++) { if (key.equals(customOptions[i][0])) { existingIdx = i; break; } } newOptions.customOptions = new Object[customOptions.length + (existingIdx == -1 ? 1 : 0)][2]; System.arraycopy(customOptions, 0, newOptions.customOptions, 0, customOptions.length); if (existingIdx == -1) { // Add a new option newOptions.customOptions[customOptions.length] = new Object[] {key, value}; } else { // Replace an existing option newOptions.customOptions[existingIdx] = new Object[] {key, value}; } return newOptions; }
[ "public", "<", "T", ">", "CallOptions", "withOption", "(", "Key", "<", "T", ">", "key", ",", "T", "value", ")", "{", "Preconditions", ".", "checkNotNull", "(", "key", ",", "\"key\"", ")", ";", "Preconditions", ".", "checkNotNull", "(", "value", ",", "\...
Sets a custom option. Any existing value for the key is overwritten. @param key The option key @param value The option value. @since 1.13.0
[ "Sets", "a", "custom", "option", ".", "Any", "existing", "value", "for", "the", "key", "is", "overwritten", "." ]
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/CallOptions.java#L316-L341
EsotericSoftware/kryo
src/com/esotericsoftware/kryo/Kryo.java
Kryo.addDefaultSerializer
public void addDefaultSerializer (Class type, Class<? extends Serializer> serializerClass) { if (type == null) throw new IllegalArgumentException("type cannot be null."); if (serializerClass == null) throw new IllegalArgumentException("serializerClass cannot be null."); insertDefaultSerializer(type, new ReflectionSerializerFactory(serializerClass)); }
java
public void addDefaultSerializer (Class type, Class<? extends Serializer> serializerClass) { if (type == null) throw new IllegalArgumentException("type cannot be null."); if (serializerClass == null) throw new IllegalArgumentException("serializerClass cannot be null."); insertDefaultSerializer(type, new ReflectionSerializerFactory(serializerClass)); }
[ "public", "void", "addDefaultSerializer", "(", "Class", "type", ",", "Class", "<", "?", "extends", "Serializer", ">", "serializerClass", ")", "{", "if", "(", "type", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"type cannot be null.\"", ...
Instances of the specified class will use the specified serializer when {@link #register(Class)} or {@link #register(Class, int)} are called. Serializer instances are created as needed via {@link ReflectionSerializerFactory#newSerializer(Kryo, Class, Class)}. By default, the following classes have a default serializer set: <p> <table> <tr> <td>boolean</td> <td>Boolean</td> <td>byte</td> <td>Byte</td> <td>char</td> <tr> </tr> <td>Character</td> <td>short</td> <td>Short</td> <td>int</td> <td>Integer</td> <tr> </tr> <td>long</td> <td>Long</td> <td>float</td> <td>Float</td> <td>double</td> <tr> </tr> <td>Double</td> <td>String</td> <td>byte[]</td> <td>char[]</td> <td>short[]</td> <tr> </tr> <td>int[]</td> <td>long[]</td> <td>float[]</td> <td>double[]</td> <td>String[]</td> <tr> </tr> <td>Object[]</td> <td>Map</td> <td>BigInteger</td> <td>BigDecimal</td> <td>KryoSerializable</td> </tr> <tr> <td>Collection</td> <td>Date</td> <td>Collections.emptyList</td> <td>Collections.singleton</td> <td>Currency</td> </tr> <tr> <td>StringBuilder</td> <td>Enum</td> <td>Collections.emptyMap</td> <td>Collections.emptySet</td> <td>Calendar</td> </tr> <tr> <td>StringBuffer</td> <td>Class</td> <td>Collections.singletonList</td> <td>Collections.singletonMap</td> <td>TimeZone</td> </tr> <tr> <td>TreeMap</td> <td>EnumSet</td> </tr> </table> <p> Note that the order default serializers are added is important for a class that may match multiple types. The above default serializers always have a lower priority than subsequent default serializers that are added.
[ "Instances", "of", "the", "specified", "class", "will", "use", "the", "specified", "serializer", "when", "{" ]
train
https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L352-L356
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.removeEmpty
public static <T extends CharSequence> T[] removeEmpty(T[] array) { return filter(array, new Filter<T>() { @Override public boolean accept(T t) { return false == StrUtil.isEmpty(t); } }); }
java
public static <T extends CharSequence> T[] removeEmpty(T[] array) { return filter(array, new Filter<T>() { @Override public boolean accept(T t) { return false == StrUtil.isEmpty(t); } }); }
[ "public", "static", "<", "T", "extends", "CharSequence", ">", "T", "[", "]", "removeEmpty", "(", "T", "[", "]", "array", ")", "{", "return", "filter", "(", "array", ",", "new", "Filter", "<", "T", ">", "(", ")", "{", "@", "Override", "public", "boo...
去除{@code null}或者"" 元素 @param array 数组 @return 处理后的数组 @since 3.2.2
[ "去除", "{", "@code", "null", "}", "或者", "元素" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L798-L805
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java
Uris.getRawFragment
public static String getRawFragment(final URI uri, final boolean strict) { return esc(strict).escapeFragment(Strings.emptyToNull(uri.getRawFragment())); }
java
public static String getRawFragment(final URI uri, final boolean strict) { return esc(strict).escapeFragment(Strings.emptyToNull(uri.getRawFragment())); }
[ "public", "static", "String", "getRawFragment", "(", "final", "URI", "uri", ",", "final", "boolean", "strict", ")", "{", "return", "esc", "(", "strict", ")", ".", "escapeFragment", "(", "Strings", ".", "emptyToNull", "(", "uri", ".", "getRawFragment", "(", ...
Returns the raw (and normalized) fragment of the given URI, or null if it is empty. @param uri the URI to extract fragment from @param strict whether or not to do strict escaping @return the fragment or null if it is undefined
[ "Returns", "the", "raw", "(", "and", "normalized", ")", "fragment", "of", "the", "given", "URI", "or", "null", "if", "it", "is", "empty", "." ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java#L273-L275
MenoData/Time4J
base/src/main/java/net/time4j/range/DateInterval.java
DateInterval.streamDaily
public static Stream<PlainDate> streamDaily( PlainDate start, PlainDate end ) { long s = start.getDaysSinceEpochUTC(); long e = end.getDaysSinceEpochUTC(); if (s > e) { throw new IllegalArgumentException("Start after end: " + start + "/" + end); } return StreamSupport.stream(new DailySpliterator(start, s, e), false); }
java
public static Stream<PlainDate> streamDaily( PlainDate start, PlainDate end ) { long s = start.getDaysSinceEpochUTC(); long e = end.getDaysSinceEpochUTC(); if (s > e) { throw new IllegalArgumentException("Start after end: " + start + "/" + end); } return StreamSupport.stream(new DailySpliterator(start, s, e), false); }
[ "public", "static", "Stream", "<", "PlainDate", ">", "streamDaily", "(", "PlainDate", "start", ",", "PlainDate", "end", ")", "{", "long", "s", "=", "start", ".", "getDaysSinceEpochUTC", "(", ")", ";", "long", "e", "=", "end", ".", "getDaysSinceEpochUTC", "...
/*[deutsch] <p>Erzeugt einen {@code Stream}, der &uuml;ber jedes Kalenderdatum zwischen den angegebenen Intervallgrenzen geht. </p> <p>Diese statische Methode vermeidet die Kosten der Intervallerzeugung. </p> @param start start boundary - inclusive @param end end boundary - inclusive @throws IllegalArgumentException if start is after end @return daily stream @see #streamDaily() @since 4.18
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Erzeugt", "einen", "{", "@code", "Stream", "}", "der", "&uuml", ";", "ber", "jedes", "Kalenderdatum", "zwischen", "den", "angegebenen", "Intervallgrenzen", "geht", ".", "<", "/", "p", ">" ]
train
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/DateInterval.java#L840-L854
code4everything/util
src/main/java/com/zhazhapan/util/MailSender.java
MailSender.sendMail
public static void sendMail(String to, String title, String content, String from, String key) throws Exception { setFrom(from); setKey(key); sendMail(to, title, content); }
java
public static void sendMail(String to, String title, String content, String from, String key) throws Exception { setFrom(from); setKey(key); sendMail(to, title, content); }
[ "public", "static", "void", "sendMail", "(", "String", "to", ",", "String", "title", ",", "String", "content", ",", "String", "from", ",", "String", "key", ")", "throws", "Exception", "{", "setFrom", "(", "from", ")", ";", "setKey", "(", "key", ")", ";...
发送邮件,调用此方法前请先检查邮件服务器是否已经设置,如果没有设置,请先设置{@link MailSender#setHost(String)}, 如不设置将使用默认的QQ邮件服务器 @param to 收件箱 @param title 标题 @param content 内容 @param from 发件箱 @param key 密码 @throws Exception 异常
[ "发送邮件,调用此方法前请先检查邮件服务器是否已经设置,如果没有设置,请先设置", "{", "@link", "MailSender#setHost", "(", "String", ")", "}", ",", "如不设置将使用默认的QQ邮件服务器" ]
train
https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/MailSender.java#L179-L183
apache/flink
flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java
HadoopInputs.readHadoopFile
public static <K, V> org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<K, V> readHadoopFile( org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K, V> mapreduceInputFormat, Class<K> key, Class<V> value, String inputPath, Job job) throws IOException { // set input path in Job org.apache.hadoop.mapreduce.lib.input.FileInputFormat.addInputPath(job, new org.apache.hadoop.fs.Path(inputPath)); // return wrapping InputFormat return createHadoopInput(mapreduceInputFormat, key, value, job); }
java
public static <K, V> org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<K, V> readHadoopFile( org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K, V> mapreduceInputFormat, Class<K> key, Class<V> value, String inputPath, Job job) throws IOException { // set input path in Job org.apache.hadoop.mapreduce.lib.input.FileInputFormat.addInputPath(job, new org.apache.hadoop.fs.Path(inputPath)); // return wrapping InputFormat return createHadoopInput(mapreduceInputFormat, key, value, job); }
[ "public", "static", "<", "K", ",", "V", ">", "org", ".", "apache", ".", "flink", ".", "api", ".", "java", ".", "hadoop", ".", "mapreduce", ".", "HadoopInputFormat", "<", "K", ",", "V", ">", "readHadoopFile", "(", "org", ".", "apache", ".", "hadoop", ...
Creates a Flink {@link InputFormat} that wraps the given Hadoop {@link org.apache.hadoop.mapreduce.lib.input.FileInputFormat}. @return A Flink InputFormat that wraps the Hadoop FileInputFormat.
[ "Creates", "a", "Flink", "{", "@link", "InputFormat", "}", "that", "wraps", "the", "given", "Hadoop", "{", "@link", "org", ".", "apache", ".", "hadoop", ".", "mapreduce", ".", "lib", ".", "input", ".", "FileInputFormat", "}", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java#L89-L95
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java
CompositeComponentELUtils.saveCompositeComponentForResolver
public static void saveCompositeComponentForResolver(FacesContext facesContext, Location location, int ccLevel) { UIComponent cc = ccLevel > 0 ? getCompositeComponentBasedOnLocation(facesContext, location, ccLevel) : getCompositeComponentBasedOnLocation(facesContext, location); List<UIComponent> list = (List<UIComponent>) facesContext.getAttributes().get(CURRENT_COMPOSITE_COMPONENT_KEY); if (list == null) { list = new ArrayList<UIComponent>(); facesContext.getAttributes().put(CURRENT_COMPOSITE_COMPONENT_KEY, list); } list.add(cc); }
java
public static void saveCompositeComponentForResolver(FacesContext facesContext, Location location, int ccLevel) { UIComponent cc = ccLevel > 0 ? getCompositeComponentBasedOnLocation(facesContext, location, ccLevel) : getCompositeComponentBasedOnLocation(facesContext, location); List<UIComponent> list = (List<UIComponent>) facesContext.getAttributes().get(CURRENT_COMPOSITE_COMPONENT_KEY); if (list == null) { list = new ArrayList<UIComponent>(); facesContext.getAttributes().put(CURRENT_COMPOSITE_COMPONENT_KEY, list); } list.add(cc); }
[ "public", "static", "void", "saveCompositeComponentForResolver", "(", "FacesContext", "facesContext", ",", "Location", "location", ",", "int", "ccLevel", ")", "{", "UIComponent", "cc", "=", "ccLevel", ">", "0", "?", "getCompositeComponentBasedOnLocation", "(", "facesC...
Trys to get the composite component using getCompositeComponentBasedOnLocation() and saves it in an attribute on the FacesContext, which is then used by CompositeComponentImplicitObject. @param facesContext @param location
[ "Trys", "to", "get", "the", "composite", "component", "using", "getCompositeComponentBasedOnLocation", "()", "and", "saves", "it", "in", "an", "attribute", "on", "the", "FacesContext", "which", "is", "then", "used", "by", "CompositeComponentImplicitObject", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java#L436-L447
timewalker74/ffmq
core/src/main/java/net/timewalker/ffmq4/local/destination/LocalQueue.java
LocalQueue.redeliverLocked
public boolean redeliverLocked( TransactionItem[] items , MessageLockSet locks ) throws JMSException { checkNotClosed(); checkTransactionLock(); int volatileRollbacked = 0; int persistentRollbacked = 0; synchronized (storeLock) { for (int n = 0 ; n < items.length ; n++) { TransactionItem transactionItem = items[n]; if (transactionItem.getDestination() != this) continue; // Not for us MessageStore store = transactionItem.getDeliveryMode() == DeliveryMode.PERSISTENT ? persistentStore : volatileStore; int handle = transactionItem.getHandle(); // Retrieve message content AbstractMessage msg = store.retrieve(handle); // Update redelivered flag both in memory and message store msg.setJMSRedelivered(true); handle = store.replace(handle, msg); if (redeliveryDelay > 0) { // Keep the message locked so it cannot be re-consumed immediately // and schedule message unlock after redeliveryDelay milliseconds redeliveryTimer.schedule(new RedeliveryTask(msg,store,handle), redeliveryDelay); } else { // Store lock for later release locks.add(handle, store.getDeliveryMode(), this, msg); } if (transactionItem.getDeliveryMode() == DeliveryMode.PERSISTENT) persistentRollbacked++; else volatileRollbacked++; } } rollbackedGetCount.addAndGet(volatileRollbacked + persistentRollbacked); if (persistentRollbacked > 0 && requiresTransactionalUpdate()) { pendingChanges = true; return true; } else return false; }
java
public boolean redeliverLocked( TransactionItem[] items , MessageLockSet locks ) throws JMSException { checkNotClosed(); checkTransactionLock(); int volatileRollbacked = 0; int persistentRollbacked = 0; synchronized (storeLock) { for (int n = 0 ; n < items.length ; n++) { TransactionItem transactionItem = items[n]; if (transactionItem.getDestination() != this) continue; // Not for us MessageStore store = transactionItem.getDeliveryMode() == DeliveryMode.PERSISTENT ? persistentStore : volatileStore; int handle = transactionItem.getHandle(); // Retrieve message content AbstractMessage msg = store.retrieve(handle); // Update redelivered flag both in memory and message store msg.setJMSRedelivered(true); handle = store.replace(handle, msg); if (redeliveryDelay > 0) { // Keep the message locked so it cannot be re-consumed immediately // and schedule message unlock after redeliveryDelay milliseconds redeliveryTimer.schedule(new RedeliveryTask(msg,store,handle), redeliveryDelay); } else { // Store lock for later release locks.add(handle, store.getDeliveryMode(), this, msg); } if (transactionItem.getDeliveryMode() == DeliveryMode.PERSISTENT) persistentRollbacked++; else volatileRollbacked++; } } rollbackedGetCount.addAndGet(volatileRollbacked + persistentRollbacked); if (persistentRollbacked > 0 && requiresTransactionalUpdate()) { pendingChanges = true; return true; } else return false; }
[ "public", "boolean", "redeliverLocked", "(", "TransactionItem", "[", "]", "items", ",", "MessageLockSet", "locks", ")", "throws", "JMSException", "{", "checkNotClosed", "(", ")", ";", "checkTransactionLock", "(", ")", ";", "int", "volatileRollbacked", "=", "0", ...
Rollback get operations on this queue (messages are unlocked).. Consumers are notified of rollbacked messages availability @return true if a commit is required to ensure data safety
[ "Rollback", "get", "operations", "on", "this", "queue", "(", "messages", "are", "unlocked", ")", "..", "Consumers", "are", "notified", "of", "rollbacked", "messages", "availability" ]
train
https://github.com/timewalker74/ffmq/blob/638773ee29a4a5f9c6119ed74ad14ac9c46382b3/core/src/main/java/net/timewalker/ffmq4/local/destination/LocalQueue.java#L307-L361
deephacks/confit
api-admin/src/main/java/org/deephacks/confit/admin/query/BeanQueryBuilder.java
BeanQueryBuilder.greaterThan
public static <A extends Comparable<A>> BeanRestriction greaterThan(String property, A value) { return new GreaterThan<>(property, value); }
java
public static <A extends Comparable<A>> BeanRestriction greaterThan(String property, A value) { return new GreaterThan<>(property, value); }
[ "public", "static", "<", "A", "extends", "Comparable", "<", "A", ">", ">", "BeanRestriction", "greaterThan", "(", "String", "property", ",", "A", "value", ")", "{", "return", "new", "GreaterThan", "<>", "(", "property", ",", "value", ")", ";", "}" ]
Query which asserts that a property is greater than (but not equal to) a value. @param property field to query @param value value to query for @return restriction to be added to {@link BeanQuery}.
[ "Query", "which", "asserts", "that", "a", "property", "is", "greater", "than", "(", "but", "not", "equal", "to", ")", "a", "value", "." ]
train
https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-admin/src/main/java/org/deephacks/confit/admin/query/BeanQueryBuilder.java#L58-L60
sarl/sarl
docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java
SarlLinkFactory.setBoundsLinkInfo
protected void setBoundsLinkInfo(LinkInfo linkInfo, Type bound) { Reflect.callProc(this, LinkFactory.class, "setBoundsLinkInfo", //$NON-NLS-1$ new Class<?>[]{LinkInfo.class, Type.class}, linkInfo, bound); }
java
protected void setBoundsLinkInfo(LinkInfo linkInfo, Type bound) { Reflect.callProc(this, LinkFactory.class, "setBoundsLinkInfo", //$NON-NLS-1$ new Class<?>[]{LinkInfo.class, Type.class}, linkInfo, bound); }
[ "protected", "void", "setBoundsLinkInfo", "(", "LinkInfo", "linkInfo", ",", "Type", "bound", ")", "{", "Reflect", ".", "callProc", "(", "this", ",", "LinkFactory", ".", "class", ",", "\"setBoundsLinkInfo\"", ",", "//$NON-NLS-1$", "new", "Class", "<", "?", ">",...
Change the bounds into the link info. @param linkInfo the link info. @param bound the new bounds.
[ "Change", "the", "bounds", "into", "the", "link", "info", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L145-L149
fcrepo3/fcrepo
fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/util/ContextUtil.java
ContextUtil.setupSubjects
public List<Subject> setupSubjects(List<Map<URI, List<AttributeValue>>> subjs) { if (subjs == null || subjs.size() == 0) { return Collections.singletonList(new Subject(new ArrayList<Attribute>())); } List<Subject> subjects = new ArrayList<Subject>(subjs.size()); // Go through each of the subjects for (Map<URI, List<AttributeValue>> s : subjs) { List<Attribute> attributes = new ArrayList<Attribute>(); // Extract and create the attributes for this subject and add them // to the set for (URI uri : s.keySet()) { List<AttributeValue> attributeValues = s.get(uri); if (attributeValues != null && attributeValues.size() > 0) { attributes.add( new BasicAttribute(uri, attributeValues.get(0).getType(), null, null, attributeValues)); } } // Create a new subject and add the attributes for this subject subjects.add(new Subject(attributes)); } return subjects; }
java
public List<Subject> setupSubjects(List<Map<URI, List<AttributeValue>>> subjs) { if (subjs == null || subjs.size() == 0) { return Collections.singletonList(new Subject(new ArrayList<Attribute>())); } List<Subject> subjects = new ArrayList<Subject>(subjs.size()); // Go through each of the subjects for (Map<URI, List<AttributeValue>> s : subjs) { List<Attribute> attributes = new ArrayList<Attribute>(); // Extract and create the attributes for this subject and add them // to the set for (URI uri : s.keySet()) { List<AttributeValue> attributeValues = s.get(uri); if (attributeValues != null && attributeValues.size() > 0) { attributes.add( new BasicAttribute(uri, attributeValues.get(0).getType(), null, null, attributeValues)); } } // Create a new subject and add the attributes for this subject subjects.add(new Subject(attributes)); } return subjects; }
[ "public", "List", "<", "Subject", ">", "setupSubjects", "(", "List", "<", "Map", "<", "URI", ",", "List", "<", "AttributeValue", ">", ">", ">", "subjs", ")", "{", "if", "(", "subjs", "==", "null", "||", "subjs", ".", "size", "(", ")", "==", "0", ...
Sets up the Subject section of the request. Takes a list of Maps of URI/AttributeValue pairs. Each list element represents one subject which contains a map of URI/AttributeValues. @return a Set of Subject instances for inclusion in a Request
[ "Sets", "up", "the", "Subject", "section", "of", "the", "request", ".", "Takes", "a", "list", "of", "Maps", "of", "URI", "/", "AttributeValue", "pairs", ".", "Each", "list", "element", "represents", "one", "subject", "which", "contains", "a", "map", "of", ...
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/util/ContextUtil.java#L103-L130
intive-FDV/DynamicJasper
src/main/java/ar/com/fdvs/dj/util/ExpressionUtils.java
ExpressionUtils.createExpression
@Deprecated public static JRDesignExpression createExpression(String name, CustomExpression expression) { return createExpression(name, expression, false); }
java
@Deprecated public static JRDesignExpression createExpression(String name, CustomExpression expression) { return createExpression(name, expression, false); }
[ "@", "Deprecated", "public", "static", "JRDesignExpression", "createExpression", "(", "String", "name", ",", "CustomExpression", "expression", ")", "{", "return", "createExpression", "(", "name", ",", "expression", ",", "false", ")", ";", "}" ]
Use {@link #createAndRegisterExpression(DynamicJasperDesign, String, CustomExpression)} This deprecated version may cause wrong field values when expression is executed in a group footer @param name @param expression @return
[ "Use", "{" ]
train
https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/util/ExpressionUtils.java#L221-L224
ow2-chameleon/fuchsia
importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java
ZWaveController.sendValue
public void sendValue(int nodeId, int endpoint, int value) { ZWaveNode node = this.getNode(nodeId); ZWaveSetCommands zwaveCommandClass = null; SerialMessage serialMessage = null; for (ZWaveCommandClass.CommandClass commandClass : new ZWaveCommandClass.CommandClass[] { ZWaveCommandClass.CommandClass.SWITCH_MULTILEVEL, ZWaveCommandClass.CommandClass.SWITCH_BINARY, ZWaveCommandClass.CommandClass.BASIC }) { zwaveCommandClass = (ZWaveSetCommands)node.resolveCommandClass(commandClass, endpoint); if (zwaveCommandClass != null) break; } if (zwaveCommandClass == null) { logger.error("No Command Class found on node {}, instance/endpoint {} to request level.", nodeId, endpoint); return; } serialMessage = node.encapsulate(zwaveCommandClass.setValueMessage(value), (ZWaveCommandClass)zwaveCommandClass, endpoint); if (serialMessage != null) this.sendData(serialMessage); // read back level on "ON" command if (((ZWaveCommandClass)zwaveCommandClass).getCommandClass() == ZWaveCommandClass.CommandClass.SWITCH_MULTILEVEL && value == 255) this.requestValue(nodeId, endpoint); }
java
public void sendValue(int nodeId, int endpoint, int value) { ZWaveNode node = this.getNode(nodeId); ZWaveSetCommands zwaveCommandClass = null; SerialMessage serialMessage = null; for (ZWaveCommandClass.CommandClass commandClass : new ZWaveCommandClass.CommandClass[] { ZWaveCommandClass.CommandClass.SWITCH_MULTILEVEL, ZWaveCommandClass.CommandClass.SWITCH_BINARY, ZWaveCommandClass.CommandClass.BASIC }) { zwaveCommandClass = (ZWaveSetCommands)node.resolveCommandClass(commandClass, endpoint); if (zwaveCommandClass != null) break; } if (zwaveCommandClass == null) { logger.error("No Command Class found on node {}, instance/endpoint {} to request level.", nodeId, endpoint); return; } serialMessage = node.encapsulate(zwaveCommandClass.setValueMessage(value), (ZWaveCommandClass)zwaveCommandClass, endpoint); if (serialMessage != null) this.sendData(serialMessage); // read back level on "ON" command if (((ZWaveCommandClass)zwaveCommandClass).getCommandClass() == ZWaveCommandClass.CommandClass.SWITCH_MULTILEVEL && value == 255) this.requestValue(nodeId, endpoint); }
[ "public", "void", "sendValue", "(", "int", "nodeId", ",", "int", "endpoint", ",", "int", "value", ")", "{", "ZWaveNode", "node", "=", "this", ".", "getNode", "(", "nodeId", ")", ";", "ZWaveSetCommands", "zwaveCommandClass", "=", "null", ";", "SerialMessage",...
Send value to node. @param nodeId the node Id to send the value to. @param endpoint the endpoint to send the value to. @param value the value to send
[ "Send", "value", "to", "node", "." ]
train
https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java#L1000-L1024
netplex/json-smart-v2
accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java
ASMUtil.autoBoxing
public static void autoBoxing(MethodVisitor mv, Class<?> clz) { autoBoxing(mv, Type.getType(clz)); }
java
public static void autoBoxing(MethodVisitor mv, Class<?> clz) { autoBoxing(mv, Type.getType(clz)); }
[ "public", "static", "void", "autoBoxing", "(", "MethodVisitor", "mv", ",", "Class", "<", "?", ">", "clz", ")", "{", "autoBoxing", "(", "mv", ",", "Type", ".", "getType", "(", "clz", ")", ")", ";", "}" ]
Append the call of proper autoboxing method for the given primitif type.
[ "Append", "the", "call", "of", "proper", "autoboxing", "method", "for", "the", "given", "primitif", "type", "." ]
train
https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java#L38-L40
defei/codelogger-utils
src/main/java/org/codelogger/utils/ClassUtils.java
ClassUtils.instantiateClass
public static <T> T instantiateClass(final Class<T> clazz, final Class<?>[] parameterTypes, final Object[] parameterValues) throws BeanInstantiationException { if (clazz.isInterface()) { throw new BeanInstantiationException(clazz, CLASS_IS_INTERFACE); } try { Constructor<T> constructor = clazz.getConstructor(parameterTypes); T newInstance = constructor.newInstance(parameterValues); return newInstance; } catch (Exception e) { throw new BeanInstantiationException(clazz, NO_DEFAULT_CONSTRUCTOR_FOUND, e); } }
java
public static <T> T instantiateClass(final Class<T> clazz, final Class<?>[] parameterTypes, final Object[] parameterValues) throws BeanInstantiationException { if (clazz.isInterface()) { throw new BeanInstantiationException(clazz, CLASS_IS_INTERFACE); } try { Constructor<T> constructor = clazz.getConstructor(parameterTypes); T newInstance = constructor.newInstance(parameterValues); return newInstance; } catch (Exception e) { throw new BeanInstantiationException(clazz, NO_DEFAULT_CONSTRUCTOR_FOUND, e); } }
[ "public", "static", "<", "T", ">", "T", "instantiateClass", "(", "final", "Class", "<", "T", ">", "clazz", ",", "final", "Class", "<", "?", ">", "[", "]", "parameterTypes", ",", "final", "Object", "[", "]", "parameterValues", ")", "throws", "BeanInstanti...
Create and initialize a new instance of the given class by given parameterTypes and parameterValues. @param clazz can not be null. @param parameterTypes constructor parameters class type array. @param parameterValues constructor parameters value array. @return a newly allocated instance of the class represented by this class. @throws BeanInstantiationException if given class no given parameter types constructor found.
[ "Create", "and", "initialize", "a", "new", "instance", "of", "the", "given", "class", "by", "given", "parameterTypes", "and", "parameterValues", "." ]
train
https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/ClassUtils.java#L198-L211