repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
line/armeria
spring/boot-autoconfigure/src/main/java/com/linecorp/armeria/spring/AbstractServiceRegistrationBean.java
AbstractServiceRegistrationBean.setDecorators
@SafeVarargs public final U setDecorators( Function<Service<HttpRequest, HttpResponse>, ? extends Service<HttpRequest, HttpResponse>>... decorators) { """ Sets the decorator of the annotated service object. {@code decorators} are applied to {@code service} in order. """ ...
java
@SafeVarargs public final U setDecorators( Function<Service<HttpRequest, HttpResponse>, ? extends Service<HttpRequest, HttpResponse>>... decorators) { return setDecorators(ImmutableList.copyOf(requireNonNull(decorators, "decorators"))); }
[ "@", "SafeVarargs", "public", "final", "U", "setDecorators", "(", "Function", "<", "Service", "<", "HttpRequest", ",", "HttpResponse", ">", ",", "?", "extends", "Service", "<", "HttpRequest", ",", "HttpResponse", ">", ">", "...", "decorators", ")", "{", "ret...
Sets the decorator of the annotated service object. {@code decorators} are applied to {@code service} in order.
[ "Sets", "the", "decorator", "of", "the", "annotated", "service", "object", ".", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/spring/boot-autoconfigure/src/main/java/com/linecorp/armeria/spring/AbstractServiceRegistrationBean.java#L116-L121
dickschoeller/gedbrowser
gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java
AbstractGedObjectFactory.getToken
private GedToken getToken(final String tag) { """ Find the token processor for this tag. Defaults to attribute. @param tag the tag. @return the token processor. """ GedToken gedToken = tokens.get(tag); if (gedToken == null) { // Any unknown token is an attribute, retaining its t...
java
private GedToken getToken(final String tag) { GedToken gedToken = tokens.get(tag); if (gedToken == null) { // Any unknown token is an attribute, retaining its tag. gedToken = new GedToken(tag, ATTR_FACTORY); } return gedToken; }
[ "private", "GedToken", "getToken", "(", "final", "String", "tag", ")", "{", "GedToken", "gedToken", "=", "tokens", ".", "get", "(", "tag", ")", ";", "if", "(", "gedToken", "==", "null", ")", "{", "// Any unknown token is an attribute, retaining its tag.", "gedTo...
Find the token processor for this tag. Defaults to attribute. @param tag the tag. @return the token processor.
[ "Find", "the", "token", "processor", "for", "this", "tag", ".", "Defaults", "to", "attribute", "." ]
train
https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java#L615-L622
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/WrapperInvocationHandler.java
WrapperInvocationHandler.getCreatedOrPreparedStatementSurrogate
protected Object getCreatedOrPreparedStatementSurrogate( final Method method, final Object[] args) throws Throwable { """ Surrogate for any method of the delegate that returns an instance of <tt>Statement</tt>. <p> @param method returning instance of <tt>Statement</tt> @param args to the method @...
java
protected Object getCreatedOrPreparedStatementSurrogate( final Method method, final Object[] args) throws Throwable { WrapperInvocationHandler handler; Object stmt = null; StatementKey key = new StatementKey(method, args); StatementPool ...
[ "protected", "Object", "getCreatedOrPreparedStatementSurrogate", "(", "final", "Method", "method", ",", "final", "Object", "[", "]", "args", ")", "throws", "Throwable", "{", "WrapperInvocationHandler", "handler", ";", "Object", "stmt", "=", "null", ";", "StatementKe...
Surrogate for any method of the delegate that returns an instance of <tt>Statement</tt>. <p> @param method returning instance of <tt>Statement</tt> @param args to the method @throws java.lang.Throwable the exception, if any, thrown by invoking the given method with the given arguments upon the delegate @return surroga...
[ "Surrogate", "for", "any", "method", "of", "the", "delegate", "that", "returns", "an", "instance", "of", "<tt", ">", "Statement<", "/", "tt", ">", ".", "<p", ">" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/WrapperInvocationHandler.java#L896-L922
blinkfox/zealot
src/main/java/com/blinkfox/zealot/core/ZealotKhala.java
ZealotKhala.andNotLike
public ZealotKhala andNotLike(String field, Object value) { """ 生成带" AND "前缀的" NOT LIKE "模糊查询的SQL片段. <p>示例:传入 {"b.title", "Spring"} 两个参数,生成的SQL片段为:" AND b.title NOT LIKE ? ", SQL参数为:{"%Spring%"}</p> @param field 数据库字段 @param value 值 @return ZealotKhala实例 """ return this.doLike(ZealotConst.AND_PRE...
java
public ZealotKhala andNotLike(String field, Object value) { return this.doLike(ZealotConst.AND_PREFIX, field, value, true, false); }
[ "public", "ZealotKhala", "andNotLike", "(", "String", "field", ",", "Object", "value", ")", "{", "return", "this", ".", "doLike", "(", "ZealotConst", ".", "AND_PREFIX", ",", "field", ",", "value", ",", "true", ",", "false", ")", ";", "}" ]
生成带" AND "前缀的" NOT LIKE "模糊查询的SQL片段. <p>示例:传入 {"b.title", "Spring"} 两个参数,生成的SQL片段为:" AND b.title NOT LIKE ? ", SQL参数为:{"%Spring%"}</p> @param field 数据库字段 @param value 值 @return ZealotKhala实例
[ "生成带", "AND", "前缀的", "NOT", "LIKE", "模糊查询的SQL片段", ".", "<p", ">", "示例:传入", "{", "b", ".", "title", "Spring", "}", "两个参数,生成的SQL片段为:", "AND", "b", ".", "title", "NOT", "LIKE", "?", "SQL参数为", ":", "{", "%Spring%", "}", "<", "/", "p", ">" ]
train
https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L990-L992
the-fascinator/plugin-subscriber-solrEventLog
src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java
SolrEventLogSubscriber.onEvent
@Override public void onEvent(Map<String, String> param) throws SubscriberException { """ Method to fire for incoming events @param param : Map of key/value pairs to add to the index @throws SubscriberException if there was an error """ try { addToIndex(param); } catch (Exce...
java
@Override public void onEvent(Map<String, String> param) throws SubscriberException { try { addToIndex(param); } catch (Exception e) { throw new SubscriberException("Fail to add log to solr" + e.getMessage()); } }
[ "@", "Override", "public", "void", "onEvent", "(", "Map", "<", "String", ",", "String", ">", "param", ")", "throws", "SubscriberException", "{", "try", "{", "addToIndex", "(", "param", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "...
Method to fire for incoming events @param param : Map of key/value pairs to add to the index @throws SubscriberException if there was an error
[ "Method", "to", "fire", "for", "incoming", "events" ]
train
https://github.com/the-fascinator/plugin-subscriber-solrEventLog/blob/2c9da188887a622a6d43d33ea9099aff53a0516d/src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java#L464-L472
facebookarchive/hadoop-20
src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java
PoolManager.getRunningTasks
public int getRunningTasks(String poolName, TaskType type) { """ Get the number of running tasks in a pool @param poolName name of the pool @param type type of task to be set @return number of running tasks """ Map<String, Integer> runningMap = (type == TaskType.MAP ? ...
java
public int getRunningTasks(String poolName, TaskType type) { Map<String, Integer> runningMap = (type == TaskType.MAP ? poolRunningMaps : poolRunningReduces); return (runningMap.containsKey(poolName) ? runningMap.get(poolName) : 0); }
[ "public", "int", "getRunningTasks", "(", "String", "poolName", ",", "TaskType", "type", ")", "{", "Map", "<", "String", ",", "Integer", ">", "runningMap", "=", "(", "type", "==", "TaskType", ".", "MAP", "?", "poolRunningMaps", ":", "poolRunningReduces", ")",...
Get the number of running tasks in a pool @param poolName name of the pool @param type type of task to be set @return number of running tasks
[ "Get", "the", "number", "of", "running", "tasks", "in", "a", "pool" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java#L741-L746
jboss/jboss-jstl-api_spec
src/main/java/org/apache/taglibs/standard/util/XmlUtil.java
XmlUtil.runWithOurClassLoader
private static <T, E extends Exception> T runWithOurClassLoader(final Callable<T> action, Class<E> allowed) throws E { """ Performs an action using this Class's ClassLoader as the Thread context ClassLoader. @param action the action to perform @param allowed an Exception that might be thrown by the action @pa...
java
private static <T, E extends Exception> T runWithOurClassLoader(final Callable<T> action, Class<E> allowed) throws E { PrivilegedExceptionAction<T> actionWithClassloader = new PrivilegedExceptionAction<T>() { public T run() throws Exception { ClassLoader original = Thread.currentThre...
[ "private", "static", "<", "T", ",", "E", "extends", "Exception", ">", "T", "runWithOurClassLoader", "(", "final", "Callable", "<", "T", ">", "action", ",", "Class", "<", "E", ">", "allowed", ")", "throws", "E", "{", "PrivilegedExceptionAction", "<", "T", ...
Performs an action using this Class's ClassLoader as the Thread context ClassLoader. @param action the action to perform @param allowed an Exception that might be thrown by the action @param <T> the type of the result @param <E> the type of the allowed Exception @return the result of the action @throws E if the action...
[ "Performs", "an", "action", "using", "this", "Class", "s", "ClassLoader", "as", "the", "Thread", "context", "ClassLoader", "." ]
train
https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/util/XmlUtil.java#L384-L412
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/utility/MessagingSecurityUtility.java
MessagingSecurityUtility.createAuthenticationData
public static AuthenticationData createAuthenticationData(Certificate[] certs, UserRegistry userRegistry) { """ Create AuthenticationData object from the Certificate @param certs @param userRegistry @return """ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.en...
java
public static AuthenticationData createAuthenticationData(Certificate[] certs, UserRegistry userRegistry) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, CLASS_NAME + "createAuthenticationData", certs); } AuthenticationData authData = new WSAuthen...
[ "public", "static", "AuthenticationData", "createAuthenticationData", "(", "Certificate", "[", "]", "certs", ",", "UserRegistry", "userRegistry", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", "...
Create AuthenticationData object from the Certificate @param certs @param userRegistry @return
[ "Create", "AuthenticationData", "object", "from", "the", "Certificate" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/utility/MessagingSecurityUtility.java#L130-L151
DiUS/pact-jvm
pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslWithState.java
PactDslWithState.given
public PactDslWithState given(String stateDesc, Map<String, Object> params) { """ Adds another provider state to this interaction @param stateDesc Description of the state @param params State data parameters """ state.add(new ProviderState(stateDesc, params)); return this; }
java
public PactDslWithState given(String stateDesc, Map<String, Object> params) { state.add(new ProviderState(stateDesc, params)); return this; }
[ "public", "PactDslWithState", "given", "(", "String", "stateDesc", ",", "Map", "<", "String", ",", "Object", ">", "params", ")", "{", "state", ".", "add", "(", "new", "ProviderState", "(", "stateDesc", ",", "params", ")", ")", ";", "return", "this", ";",...
Adds another provider state to this interaction @param stateDesc Description of the state @param params State data parameters
[ "Adds", "another", "provider", "state", "to", "this", "interaction" ]
train
https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslWithState.java#L59-L62
ops4j/org.ops4j.pax.logging
pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java
PaxLoggingServiceImpl.setJULLevel
private static void setJULLevel( java.util.logging.Logger logger, String log4jLevelConfig ) { """ Set the log level to the specified JUL logger. @param logger The logger to configure @param log4jLevelConfig The value contained in the property file. (For example: "ERROR, file") """ java.util.logging...
java
private static void setJULLevel( java.util.logging.Logger logger, String log4jLevelConfig ) { java.util.logging.Level level = log4jLevelToJULLevel( log4jLevelConfig ); logger.setLevel( level ); }
[ "private", "static", "void", "setJULLevel", "(", "java", ".", "util", ".", "logging", ".", "Logger", "logger", ",", "String", "log4jLevelConfig", ")", "{", "java", ".", "util", ".", "logging", ".", "Level", "level", "=", "log4jLevelToJULLevel", "(", "log4jLe...
Set the log level to the specified JUL logger. @param logger The logger to configure @param log4jLevelConfig The value contained in the property file. (For example: "ERROR, file")
[ "Set", "the", "log", "level", "to", "the", "specified", "JUL", "logger", "." ]
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java#L520-L524
arxanchain/java-common
src/main/java/com/arxanfintech/common/util/RLP.java
RLP.encodeLength
public static byte[] encodeLength(int length, int offset) { """ Integer limitation goes up to 2^31-1 so length can never be bigger than MAX_ITEM_LENGTH @param length length @param offset offset @return byte[] """ if (length < SIZE_THRESHOLD) { byte firstByte = (byte) (length + offse...
java
public static byte[] encodeLength(int length, int offset) { if (length < SIZE_THRESHOLD) { byte firstByte = (byte) (length + offset); return new byte[] { firstByte }; } else if (length < MAX_ITEM_LENGTH) { byte[] binaryLength; if (length > 0xFF) ...
[ "public", "static", "byte", "[", "]", "encodeLength", "(", "int", "length", ",", "int", "offset", ")", "{", "if", "(", "length", "<", "SIZE_THRESHOLD", ")", "{", "byte", "firstByte", "=", "(", "byte", ")", "(", "length", "+", "offset", ")", ";", "ret...
Integer limitation goes up to 2^31-1 so length can never be bigger than MAX_ITEM_LENGTH @param length length @param offset offset @return byte[]
[ "Integer", "limitation", "goes", "up", "to", "2^31", "-", "1", "so", "length", "can", "never", "be", "bigger", "than", "MAX_ITEM_LENGTH" ]
train
https://github.com/arxanchain/java-common/blob/3ddfedfd948f5bab3fee0b74b85cdce4702ed84e/src/main/java/com/arxanfintech/common/util/RLP.java#L437-L452
samskivert/samskivert
src/main/java/com/samskivert/jdbc/JDBCUtil.java
JDBCUtil.makeCollector
public static Connection makeCollector (final Connection conn, final List<Statement> stmts) { """ Wraps the given connection in a proxied instance that will add all statements returned by methods called on the proxy (such as {@link Connection#createStatement}) to the supplied list. Thus you can create the proxy,...
java
public static Connection makeCollector (final Connection conn, final List<Statement> stmts) { return (Connection)Proxy.newProxyInstance( Connection.class.getClassLoader(), PROXY_IFACES, new InvocationHandler() { public Object invoke (Object proxy, Method method, Object[] args) throws...
[ "public", "static", "Connection", "makeCollector", "(", "final", "Connection", "conn", ",", "final", "List", "<", "Statement", ">", "stmts", ")", "{", "return", "(", "Connection", ")", "Proxy", ".", "newProxyInstance", "(", "Connection", ".", "class", ".", "...
Wraps the given connection in a proxied instance that will add all statements returned by methods called on the proxy (such as {@link Connection#createStatement}) to the supplied list. Thus you can create the proxy, pass the proxy to code that creates and uses statements and then close any statements created by the cod...
[ "Wraps", "the", "given", "connection", "in", "a", "proxied", "instance", "that", "will", "add", "all", "statements", "returned", "by", "methods", "called", "on", "the", "proxy", "(", "such", "as", "{" ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JDBCUtil.java#L75-L87
briandilley/jsonrpc4j
src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java
JsonRpcBasicServer.findBestMethodForVarargs
private AMethodWithItsArgs findBestMethodForVarargs(Set<Method> methods, JsonNode paramsNode) { """ Finds the {@link Method} from the supplied {@link Set} that matches the method name annotation and have varargs. it as a {@link AMethodWithItsArgs} class. @param methods the {@link Method}s @param paramsNod...
java
private AMethodWithItsArgs findBestMethodForVarargs(Set<Method> methods, JsonNode paramsNode) { for (Method method : methods) { if (method.getParameterTypes().length != 1) { continue; } if (method.isVarArgs()) { return new AMethodWithItsArgs(method, paramsNod...
[ "private", "AMethodWithItsArgs", "findBestMethodForVarargs", "(", "Set", "<", "Method", ">", "methods", ",", "JsonNode", "paramsNode", ")", "{", "for", "(", "Method", "method", ":", "methods", ")", "{", "if", "(", "method", ".", "getParameterTypes", "(", ")", ...
Finds the {@link Method} from the supplied {@link Set} that matches the method name annotation and have varargs. it as a {@link AMethodWithItsArgs} class. @param methods the {@link Method}s @param paramsNode the {@link JsonNode} of request @return the {@link AMethodWithItsArgs}
[ "Finds", "the", "{", "@link", "Method", "}", "from", "the", "supplied", "{", "@link", "Set", "}", "that", "matches", "the", "method", "name", "annotation", "and", "have", "varargs", ".", "it", "as", "a", "{", "@link", "AMethodWithItsArgs", "}", "class", ...
train
https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L696-L706
infinispan/infinispan
core/src/main/java/org/infinispan/configuration/cache/IndexingConfigurationBuilder.java
IndexingConfigurationBuilder.addKeyTransformer
public IndexingConfigurationBuilder addKeyTransformer(Class<?> keyClass, Class<?> keyTransformerClass) { """ Registers a transformer for a key class. @param keyClass the class of the key @param keyTransformerClass the class of the org.infinispan.query.Transformer that handles this key type @return <code>this<...
java
public IndexingConfigurationBuilder addKeyTransformer(Class<?> keyClass, Class<?> keyTransformerClass) { Map<Class<?>, Class<?>> indexedEntities = keyTransformers(); indexedEntities.put(keyClass, keyTransformerClass); attributes.attribute(KEY_TRANSFORMERS).set(indexedEntities); return this; }
[ "public", "IndexingConfigurationBuilder", "addKeyTransformer", "(", "Class", "<", "?", ">", "keyClass", ",", "Class", "<", "?", ">", "keyTransformerClass", ")", "{", "Map", "<", "Class", "<", "?", ">", ",", "Class", "<", "?", ">", ">", "indexedEntities", "...
Registers a transformer for a key class. @param keyClass the class of the key @param keyTransformerClass the class of the org.infinispan.query.Transformer that handles this key type @return <code>this</code>, for method chaining
[ "Registers", "a", "transformer", "for", "a", "key", "class", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/cache/IndexingConfigurationBuilder.java#L106-L111
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.registerWorkerStatus
public void registerWorkerStatus(ZooKeeper zk, Plan plan, WorkerStatus s) throws WorkerDaoException { """ Registers an ephemeral node representing ownership of a feed partition. Note we do not use curator here because we want a standard watch not from the main thread! @param zk @param plan @param s @throws Wo...
java
public void registerWorkerStatus(ZooKeeper zk, Plan plan, WorkerStatus s) throws WorkerDaoException{ String writeToPath = PLAN_WORKERS_ZK + "/" + plan.getName() + "/" + s.getWorkerUuid(); try { Stat planBase = zk.exists(PLAN_WORKERS_ZK + "/" + plan.getName(), false); if (planBase == null){ t...
[ "public", "void", "registerWorkerStatus", "(", "ZooKeeper", "zk", ",", "Plan", "plan", ",", "WorkerStatus", "s", ")", "throws", "WorkerDaoException", "{", "String", "writeToPath", "=", "PLAN_WORKERS_ZK", "+", "\"/\"", "+", "plan", ".", "getName", "(", ")", "+"...
Registers an ephemeral node representing ownership of a feed partition. Note we do not use curator here because we want a standard watch not from the main thread! @param zk @param plan @param s @throws WorkerDaoException
[ "Registers", "an", "ephemeral", "node", "representing", "ownership", "of", "a", "feed", "partition", ".", "Note", "we", "do", "not", "use", "curator", "here", "because", "we", "want", "a", "standard", "watch", "not", "from", "the", "main", "thread!" ]
train
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L308-L324
greese/dasein-persist
src/main/java/org/dasein/persist/PersistentFactory.java
PersistentFactory.addSingleton
public void addSingleton(String field, Class<? extends Execution> cls) { """ Adds a query for searches on a specified field. These searches return unique values. @param field the field to search on @param cls the class of the query that performs the search """ singletons.put(field, cls); }
java
public void addSingleton(String field, Class<? extends Execution> cls) { singletons.put(field, cls); }
[ "public", "void", "addSingleton", "(", "String", "field", ",", "Class", "<", "?", "extends", "Execution", ">", "cls", ")", "{", "singletons", ".", "put", "(", "field", ",", "cls", ")", ";", "}" ]
Adds a query for searches on a specified field. These searches return unique values. @param field the field to search on @param cls the class of the query that performs the search
[ "Adds", "a", "query", "for", "searches", "on", "a", "specified", "field", ".", "These", "searches", "return", "unique", "values", "." ]
train
https://github.com/greese/dasein-persist/blob/1104621ad1670a45488b093b984ec1db4c7be781/src/main/java/org/dasein/persist/PersistentFactory.java#L316-L318
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/dataformats/json/jackson/GeometryDeserializer.java
GeometryDeserializer.asMultiPolygon
private MultiPolygon asMultiPolygon(List<List<List<List>>> coords, CrsId crsId) throws IOException { """ Parses the JSON as a MultiPolygon geometry @param coords the coordinates of a multipolygon which is just a list of coordinates of polygons. @param crsId @return an instance of multipolygon @throws IOExc...
java
private MultiPolygon asMultiPolygon(List<List<List<List>>> coords, CrsId crsId) throws IOException { if (coords == null || coords.isEmpty()) { throw new IOException("A multipolygon should have at least one polyon."); } Polygon[] polygons = new Polygon[coords.size()]; for (int...
[ "private", "MultiPolygon", "asMultiPolygon", "(", "List", "<", "List", "<", "List", "<", "List", ">", ">", ">", "coords", ",", "CrsId", "crsId", ")", "throws", "IOException", "{", "if", "(", "coords", "==", "null", "||", "coords", ".", "isEmpty", "(", ...
Parses the JSON as a MultiPolygon geometry @param coords the coordinates of a multipolygon which is just a list of coordinates of polygons. @param crsId @return an instance of multipolygon @throws IOException if the given json does not correspond to a multipolygon or can be parsed as such
[ "Parses", "the", "JSON", "as", "a", "MultiPolygon", "geometry" ]
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/GeometryDeserializer.java#L216-L225
infinispan/infinispan
core/src/main/java/org/infinispan/marshall/core/BytesObjectOutput.java
BytesObjectOutput.getNewBufferSize
private int getNewBufferSize(int curSize, int minNewSize) { """ Gets the number of bytes to which the internal buffer should be resized. If not enough space, it doubles the size until the internal buffer reaches a configurable max size (default is 4MB), after which it begins growing the buffer in 25% increments...
java
private int getNewBufferSize(int curSize, int minNewSize) { if (curSize <= DEFAULT_DOUBLING_SIZE) return Math.max(curSize << 1, minNewSize); else return Math.max(curSize + (curSize >> 2), minNewSize); }
[ "private", "int", "getNewBufferSize", "(", "int", "curSize", ",", "int", "minNewSize", ")", "{", "if", "(", "curSize", "<=", "DEFAULT_DOUBLING_SIZE", ")", "return", "Math", ".", "max", "(", "curSize", "<<", "1", ",", "minNewSize", ")", ";", "else", "return...
Gets the number of bytes to which the internal buffer should be resized. If not enough space, it doubles the size until the internal buffer reaches a configurable max size (default is 4MB), after which it begins growing the buffer in 25% increments. This is intended to help prevent an OutOfMemoryError during a resize ...
[ "Gets", "the", "number", "of", "bytes", "to", "which", "the", "internal", "buffer", "should", "be", "resized", ".", "If", "not", "enough", "space", "it", "doubles", "the", "size", "until", "the", "internal", "buffer", "reaches", "a", "configurable", "max", ...
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/marshall/core/BytesObjectOutput.java#L260-L265
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java
ToUnknownStream.internalEntityDecl
public void internalEntityDecl(String arg0, String arg1) throws SAXException { """ Pass the call on to the underlying handler @see org.xml.sax.ext.DeclHandler#internalEntityDecl(String, String) """ if (m_firstTagNotEmitted) { flush(); } m_handler.internalEnt...
java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.internalEntityDecl(arg0, arg1); }
[ "public", "void", "internalEntityDecl", "(", "String", "arg0", ",", "String", "arg1", ")", "throws", "SAXException", "{", "if", "(", "m_firstTagNotEmitted", ")", "{", "flush", "(", ")", ";", "}", "m_handler", ".", "internalEntityDecl", "(", "arg0", ",", "arg...
Pass the call on to the underlying handler @see org.xml.sax.ext.DeclHandler#internalEntityDecl(String, String)
[ "Pass", "the", "call", "on", "to", "the", "underlying", "handler" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java#L763-L771
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java
Error.configNotPresent
public static void configNotPresent(Class<?> clazz,XML xml) { """ Thrown when missing the configuration belonging to clazz. @param clazz class without configuration @param xml xml path """ throw new MappingNotFoundException(MSG.INSTANCE.message(Constants.mappingNotFoundException1path, clazz.getSimpleName(...
java
public static void configNotPresent(Class<?> clazz,XML xml){ throw new MappingNotFoundException(MSG.INSTANCE.message(Constants.mappingNotFoundException1path, clazz.getSimpleName(),xml.getXmlPath())); }
[ "public", "static", "void", "configNotPresent", "(", "Class", "<", "?", ">", "clazz", ",", "XML", "xml", ")", "{", "throw", "new", "MappingNotFoundException", "(", "MSG", ".", "INSTANCE", ".", "message", "(", "Constants", ".", "mappingNotFoundException1path", ...
Thrown when missing the configuration belonging to clazz. @param clazz class without configuration @param xml xml path
[ "Thrown", "when", "missing", "the", "configuration", "belonging", "to", "clazz", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L522-L524
OpenLiberty/open-liberty
dev/com.ibm.ws.session/src/com/ibm/ws/session/StoreCallback.java
StoreCallback.sessionAttributeAccessed
public void sessionAttributeAccessed(ISession session, Object name, Object value) { """ Method sessionAttributeAccessed <p> @param session @param name @param value @see com.ibm.wsspi.session.IStoreCallback#sessionAttributeAccessed(com.ibm.wsspi.session.ISession, java.lang.Object, java.lang.Object) """ ...
java
public void sessionAttributeAccessed(ISession session, Object name, Object value) { _sessionStateEventDispatcher.sessionAttributeAccessed(session, name, value); }
[ "public", "void", "sessionAttributeAccessed", "(", "ISession", "session", ",", "Object", "name", ",", "Object", "value", ")", "{", "_sessionStateEventDispatcher", ".", "sessionAttributeAccessed", "(", "session", ",", "name", ",", "value", ")", ";", "}" ]
Method sessionAttributeAccessed <p> @param session @param name @param value @see com.ibm.wsspi.session.IStoreCallback#sessionAttributeAccessed(com.ibm.wsspi.session.ISession, java.lang.Object, java.lang.Object)
[ "Method", "sessionAttributeAccessed", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/session/StoreCallback.java#L196-L199
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_instance_instanceId_resize_POST
public OvhInstanceDetail project_serviceName_instance_instanceId_resize_POST(String serviceName, String instanceId, String flavorId) throws IOException { """ Migrate your instance to another flavor REST: POST /cloud/project/{serviceName}/instance/{instanceId}/resize @param flavorId [required] Flavor id @param...
java
public OvhInstanceDetail project_serviceName_instance_instanceId_resize_POST(String serviceName, String instanceId, String flavorId) throws IOException { String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/resize"; StringBuilder sb = path(qPath, serviceName, instanceId); HashMap<String, Object>o = ...
[ "public", "OvhInstanceDetail", "project_serviceName_instance_instanceId_resize_POST", "(", "String", "serviceName", ",", "String", "instanceId", ",", "String", "flavorId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/instance/{insta...
Migrate your instance to another flavor REST: POST /cloud/project/{serviceName}/instance/{instanceId}/resize @param flavorId [required] Flavor id @param instanceId [required] Instance id @param serviceName [required] Service name
[ "Migrate", "your", "instance", "to", "another", "flavor" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2015-L2022
mokies/ratelimitj
ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java
RequestLimitRule.of
public static RequestLimitRule of(Duration duration, long limit) { """ Initialise a request rate limit. Imagine the whole duration window as being one large bucket with a single count. @param duration The time the limit will be applied over. The duration must be greater than 1 second. @param limit A number ...
java
public static RequestLimitRule of(Duration duration, long limit) { checkDuration(duration); if (limit < 0) { throw new IllegalArgumentException("limit must be greater than zero."); } int durationSeconds = (int) duration.getSeconds(); return new RequestLimitRule(durati...
[ "public", "static", "RequestLimitRule", "of", "(", "Duration", "duration", ",", "long", "limit", ")", "{", "checkDuration", "(", "duration", ")", ";", "if", "(", "limit", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"limit must be gre...
Initialise a request rate limit. Imagine the whole duration window as being one large bucket with a single count. @param duration The time the limit will be applied over. The duration must be greater than 1 second. @param limit A number representing the maximum operations that can be performed in the given duration...
[ "Initialise", "a", "request", "rate", "limit", ".", "Imagine", "the", "whole", "duration", "window", "as", "being", "one", "large", "bucket", "with", "a", "single", "count", "." ]
train
https://github.com/mokies/ratelimitj/blob/eb15ec42055c46b2b3f6f84131d86f570e489c32/ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java#L55-L62
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java
ICUResourceBundle.getAvailableLocaleNameSet
public static Set<String> getAvailableLocaleNameSet(String bundlePrefix, ClassLoader loader) { """ Return a set of the locale names supported by a collection of resource bundles. @param bundlePrefix the prefix of the resource bundles to use. """ return getAvailEntry(bundlePrefix, loader).getLocaleN...
java
public static Set<String> getAvailableLocaleNameSet(String bundlePrefix, ClassLoader loader) { return getAvailEntry(bundlePrefix, loader).getLocaleNameSet(); }
[ "public", "static", "Set", "<", "String", ">", "getAvailableLocaleNameSet", "(", "String", "bundlePrefix", ",", "ClassLoader", "loader", ")", "{", "return", "getAvailEntry", "(", "bundlePrefix", ",", "loader", ")", ".", "getLocaleNameSet", "(", ")", ";", "}" ]
Return a set of the locale names supported by a collection of resource bundles. @param bundlePrefix the prefix of the resource bundles to use.
[ "Return", "a", "set", "of", "the", "locale", "names", "supported", "by", "a", "collection", "of", "resource", "bundles", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java#L441-L443
anotheria/configureme
src/main/java/org/configureme/util/StringUtils.java
StringUtils.getStringAfter
public static String getStringAfter(final String src, final String toSearch, final int start) { """ Get {@link java.lang.String} after given search {@link java.lang.String} from given start search index. @param src source string @param toSearch search string @param start start search index @return {@link ...
java
public static String getStringAfter(final String src, final String toSearch, final int start) { final int ind = src.indexOf(toSearch, start); if (ind == -1) return ""; return src.substring(ind + toSearch.length()); }
[ "public", "static", "String", "getStringAfter", "(", "final", "String", "src", ",", "final", "String", "toSearch", ",", "final", "int", "start", ")", "{", "final", "int", "ind", "=", "src", ".", "indexOf", "(", "toSearch", ",", "start", ")", ";", "if", ...
Get {@link java.lang.String} after given search {@link java.lang.String} from given start search index. @param src source string @param toSearch search string @param start start search index @return {@link java.lang.String}
[ "Get", "{", "@link", "java", ".", "lang", ".", "String", "}", "after", "given", "search", "{", "@link", "java", ".", "lang", ".", "String", "}", "from", "given", "start", "search", "index", "." ]
train
https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/util/StringUtils.java#L139-L144
OpenLiberty/open-liberty
dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UISelectOne.java
UISelectOne.validateValue
@Override protected void validateValue(FacesContext context, Object value) { """ Verify that the result of converting the newly submitted value is <i>equal</i> to the value property of one of the child SelectItem objects. If this is not true, a validation error is reported. @see javax.faces.component.UIInp...
java
@Override protected void validateValue(FacesContext context, Object value) { super.validateValue(context, value); if (!isValid() || value == null) { return; } // selected value must match to one of the available options // and if required is true it ...
[ "@", "Override", "protected", "void", "validateValue", "(", "FacesContext", "context", ",", "Object", "value", ")", "{", "super", ".", "validateValue", "(", "context", ",", "value", ")", ";", "if", "(", "!", "isValid", "(", ")", "||", "value", "==", "nul...
Verify that the result of converting the newly submitted value is <i>equal</i> to the value property of one of the child SelectItem objects. If this is not true, a validation error is reported. @see javax.faces.component.UIInput#validateValue(javax.faces.context.FacesContext,java.lang.Object)
[ "Verify", "that", "the", "result", "of", "converting", "the", "newly", "submitted", "value", "is", "<i", ">", "equal<", "/", "i", ">", "to", "the", "value", "property", "of", "one", "of", "the", "child", "SelectItem", "objects", ".", "If", "this", "is", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UISelectOne.java#L68-L104
wildfly/wildfly-core
logging/src/main/java/org/jboss/as/logging/LoggingSubsystemParser.java
LoggingSubsystemParser.readNameAttribute
static String readNameAttribute(final XMLExtendedStreamReader reader) throws XMLStreamException { """ Reads the single {@code name} attribute from an element. @param reader the reader to use @return the value of the {@code name} attribute @throws XMLStreamException if the {@code name} attribute is not pre...
java
static String readNameAttribute(final XMLExtendedStreamReader reader) throws XMLStreamException { return readStringAttributeElement(reader, Attribute.NAME.getLocalName()); }
[ "static", "String", "readNameAttribute", "(", "final", "XMLExtendedStreamReader", "reader", ")", "throws", "XMLStreamException", "{", "return", "readStringAttributeElement", "(", "reader", ",", "Attribute", ".", "NAME", ".", "getLocalName", "(", ")", ")", ";", "}" ]
Reads the single {@code name} attribute from an element. @param reader the reader to use @return the value of the {@code name} attribute @throws XMLStreamException if the {@code name} attribute is not present, there is more than one attribute on the element or there is content within the element.
[ "Reads", "the", "single", "{", "@code", "name", "}", "attribute", "from", "an", "element", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/LoggingSubsystemParser.java#L83-L85
jMotif/SAX
src/main/java/net/seninp/jmotif/sax/SAXProcessor.java
SAXProcessor.saxMinDist
public double saxMinDist(char[] a, char[] b, double[][] distanceMatrix, int n, int w) throws SAXException { """ This function implements SAX MINDIST function which uses alphabet based distance matrix. @param a The SAX string. @param b The SAX string. @param distanceMatrix The distance matrix to use. @...
java
public double saxMinDist(char[] a, char[] b, double[][] distanceMatrix, int n, int w) throws SAXException { if (a.length == b.length) { double dist = 0.0D; for (int i = 0; i < a.length; i++) { if (Character.isLetter(a[i]) && Character.isLetter(b[i])) { // ... forms have num...
[ "public", "double", "saxMinDist", "(", "char", "[", "]", "a", ",", "char", "[", "]", "b", ",", "double", "[", "]", "[", "]", "distanceMatrix", ",", "int", "n", ",", "int", "w", ")", "throws", "SAXException", "{", "if", "(", "a", ".", "length", "=...
This function implements SAX MINDIST function which uses alphabet based distance matrix. @param a The SAX string. @param b The SAX string. @param distanceMatrix The distance matrix to use. @param n the time series length (sliding window length). @param w the number of PAA segments. @return distance between strings. @t...
[ "This", "function", "implements", "SAX", "MINDIST", "function", "which", "uses", "alphabet", "based", "distance", "matrix", "." ]
train
https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L354-L380
graphhopper/graphhopper
core/src/main/java/com/graphhopper/storage/TurnCostExtension.java
TurnCostExtension.addTurnInfo
public void addTurnInfo(int fromEdge, int viaNode, int toEdge, long turnFlags) { """ Add an entry which is a turn restriction or cost information via the turnFlags. Overwrite existing information if it is the same edges and node. """ // no need to store turn information if (turnFlags == EMPTY_...
java
public void addTurnInfo(int fromEdge, int viaNode, int toEdge, long turnFlags) { // no need to store turn information if (turnFlags == EMPTY_FLAGS) return; mergeOrOverwriteTurnInfo(fromEdge, viaNode, toEdge, turnFlags, true); }
[ "public", "void", "addTurnInfo", "(", "int", "fromEdge", ",", "int", "viaNode", ",", "int", "toEdge", ",", "long", "turnFlags", ")", "{", "// no need to store turn information", "if", "(", "turnFlags", "==", "EMPTY_FLAGS", ")", "return", ";", "mergeOrOverwriteTurn...
Add an entry which is a turn restriction or cost information via the turnFlags. Overwrite existing information if it is the same edges and node.
[ "Add", "an", "entry", "which", "is", "a", "turn", "restriction", "or", "cost", "information", "via", "the", "turnFlags", ".", "Overwrite", "existing", "information", "if", "it", "is", "the", "same", "edges", "and", "node", "." ]
train
https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/TurnCostExtension.java#L113-L119
codeprimate-software/cp-elements
src/main/java/org/cp/elements/context/configure/AbstractConfiguration.java
AbstractConfiguration.defaultIfUnset
protected String defaultIfUnset(final String value, final String defaultValue) { """ Returns value if not blank otherwise returns default value. @param value the String to evaluate for value (containing text). @param defaultValue the String value to return if the 'value' is blank. @return value if it has text...
java
protected String defaultIfUnset(final String value, final String defaultValue) { return (StringUtils.hasText(value) ? value : defaultValue); }
[ "protected", "String", "defaultIfUnset", "(", "final", "String", "value", ",", "final", "String", "defaultValue", ")", "{", "return", "(", "StringUtils", ".", "hasText", "(", "value", ")", "?", "value", ":", "defaultValue", ")", ";", "}" ]
Returns value if not blank otherwise returns default value. @param value the String to evaluate for value (containing text). @param defaultValue the String value to return if the 'value' is blank. @return value if it has text otherwise returns the default value. @see org.cp.elements.lang.StringUtils#hasText(String)
[ "Returns", "value", "if", "not", "blank", "otherwise", "returns", "default", "value", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/context/configure/AbstractConfiguration.java#L135-L137
httpcache4j/httpcache4j
httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Conditionals.java
Conditionals.toHeaders
public Headers toHeaders() { """ Converts the Conditionals into real headers. @return real headers. """ Headers headers = new Headers(); if (!getMatch().isEmpty()) { headers = headers.add(new Header(HeaderConstants.IF_MATCH, buildTagHeaderValue(getMatch()))); } if (...
java
public Headers toHeaders() { Headers headers = new Headers(); if (!getMatch().isEmpty()) { headers = headers.add(new Header(HeaderConstants.IF_MATCH, buildTagHeaderValue(getMatch()))); } if (!getNoneMatch().isEmpty()) { headers = headers.add(new Header(HeaderConst...
[ "public", "Headers", "toHeaders", "(", ")", "{", "Headers", "headers", "=", "new", "Headers", "(", ")", ";", "if", "(", "!", "getMatch", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "headers", "=", "headers", ".", "add", "(", "new", "Header", "(",...
Converts the Conditionals into real headers. @return real headers.
[ "Converts", "the", "Conditionals", "into", "real", "headers", "." ]
train
https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/Conditionals.java#L216-L232
Jasig/uPortal
uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java
SearchPortletController.getPortalSearchResults
private PortalSearchResults getPortalSearchResults(PortletRequest request, String queryId) { """ Get the {@link PortalSearchResults} for the specified query id from the session. If there are no results null is returned. """ final PortletSession session = request.getPortletSession(); @SuppressW...
java
private PortalSearchResults getPortalSearchResults(PortletRequest request, String queryId) { final PortletSession session = request.getPortletSession(); @SuppressWarnings("unchecked") final Cache<String, PortalSearchResults> searchResultsCache = (Cache<String, PortalSearchResults...
[ "private", "PortalSearchResults", "getPortalSearchResults", "(", "PortletRequest", "request", ",", "String", "queryId", ")", "{", "final", "PortletSession", "session", "=", "request", ".", "getPortletSession", "(", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\...
Get the {@link PortalSearchResults} for the specified query id from the session. If there are no results null is returned.
[ "Get", "the", "{" ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L802-L813
beangle/beangle3
ioc/spring/src/main/java/org/beangle/inject/spring/web/ServletContextResource.java
ServletContextResource.createRelative
@Override public Resource createRelative(String relativePath) { """ This implementation creates a ServletContextResource, applying the given path relative to the path of the underlying file of this resource descriptor. """ String pathToUse = StringUtils.applyRelativePath(this.path, relativePath); re...
java
@Override public Resource createRelative(String relativePath) { String pathToUse = StringUtils.applyRelativePath(this.path, relativePath); return new ServletContextResource(this.servletContext, pathToUse); }
[ "@", "Override", "public", "Resource", "createRelative", "(", "String", "relativePath", ")", "{", "String", "pathToUse", "=", "StringUtils", ".", "applyRelativePath", "(", "this", ".", "path", ",", "relativePath", ")", ";", "return", "new", "ServletContextResource...
This implementation creates a ServletContextResource, applying the given path relative to the path of the underlying file of this resource descriptor.
[ "This", "implementation", "creates", "a", "ServletContextResource", "applying", "the", "given", "path", "relative", "to", "the", "path", "of", "the", "underlying", "file", "of", "this", "resource", "descriptor", "." ]
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/ioc/spring/src/main/java/org/beangle/inject/spring/web/ServletContextResource.java#L143-L147
Stratio/deep-spark
deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java
Cells.getByteBuffer
public ByteBuffer getByteBuffer(String nameSpace, String cellName) { """ Returns the {@code ByteBuffer} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if this Cells object contains no cell whose name is cellName. @param nameSpace the name of the owning table @param cell...
java
public ByteBuffer getByteBuffer(String nameSpace, String cellName) { return getValue(nameSpace, cellName, ByteBuffer.class); }
[ "public", "ByteBuffer", "getByteBuffer", "(", "String", "nameSpace", ",", "String", "cellName", ")", "{", "return", "getValue", "(", "nameSpace", ",", "cellName", ",", "ByteBuffer", ".", "class", ")", ";", "}" ]
Returns the {@code ByteBuffer} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if this Cells object contains no cell whose name is cellName. @param nameSpace the name of the owning table @param cellName the name of the Cell we want to retrieve from this Cells object. @return the...
[ "Returns", "the", "{", "@code", "ByteBuffer", "}", "value", "of", "the", "{", "@link", "Cell", "}", "(", "associated", "to", "{", "@code", "table", "}", ")", "whose", "name", "iscellName", "or", "null", "if", "this", "Cells", "object", "contains", "no", ...
train
https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1315-L1317
apiman/apiman
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/TimeRestrictedAccessPolicy.java
TimeRestrictedAccessPolicy.matchesDay
private boolean matchesDay(DateTime currentTime, TimeRestrictedAccess filter) { """ Returns true if the given time matches the day-of-week restrictions specified by the included filter/rule. @param currentTime @param filter """ Integer dayStart = filter.getDayStart(); Integer dayEnd = filt...
java
private boolean matchesDay(DateTime currentTime, TimeRestrictedAccess filter) { Integer dayStart = filter.getDayStart(); Integer dayEnd = filter.getDayEnd(); int dayNow = currentTime.getDayOfWeek(); if (dayStart >= dayEnd) { return dayNow >= dayStart && dayNow <= dayEnd;...
[ "private", "boolean", "matchesDay", "(", "DateTime", "currentTime", ",", "TimeRestrictedAccess", "filter", ")", "{", "Integer", "dayStart", "=", "filter", ".", "getDayStart", "(", ")", ";", "Integer", "dayEnd", "=", "filter", ".", "getDayEnd", "(", ")", ";", ...
Returns true if the given time matches the day-of-week restrictions specified by the included filter/rule. @param currentTime @param filter
[ "Returns", "true", "if", "the", "given", "time", "matches", "the", "day", "-", "of", "-", "week", "restrictions", "specified", "by", "the", "included", "filter", "/", "rule", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/TimeRestrictedAccessPolicy.java#L154-L163
m-m-m/util
io/src/main/java/net/sf/mmm/util/file/base/FileAccessPermissions.java
FileAccessPermissions.createByUmask
public static FileAccessPermissions createByUmask(int umask, boolean isDirectory) { """ This method create a new {@link FileAccessPermissions} instance according to the given <code><a href="http://en.wikipedia.org/wiki/Umask">umask</a></code> (user file creation mode mask). @param umask is the umask. @param i...
java
public static FileAccessPermissions createByUmask(int umask, boolean isDirectory) { int fullAccessMask; if (isDirectory) { fullAccessMask = MASK_FULL_DIRECTORY_ACCESS; } else { fullAccessMask = MASK_FULL_FILE_ACCESS; } int mask = fullAccessMask & ~umask; return new FileAccessPermiss...
[ "public", "static", "FileAccessPermissions", "createByUmask", "(", "int", "umask", ",", "boolean", "isDirectory", ")", "{", "int", "fullAccessMask", ";", "if", "(", "isDirectory", ")", "{", "fullAccessMask", "=", "MASK_FULL_DIRECTORY_ACCESS", ";", "}", "else", "{"...
This method create a new {@link FileAccessPermissions} instance according to the given <code><a href="http://en.wikipedia.org/wiki/Umask">umask</a></code> (user file creation mode mask). @param umask is the umask. @param isDirectory {@code true} if the the {@link FileAccessPermissions} is to be created for a directory...
[ "This", "method", "create", "a", "new", "{", "@link", "FileAccessPermissions", "}", "instance", "according", "to", "the", "given", "<code", ">", "<a", "href", "=", "http", ":", "//", "en", ".", "wikipedia", ".", "org", "/", "wiki", "/", "Umask", ">", "...
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/io/src/main/java/net/sf/mmm/util/file/base/FileAccessPermissions.java#L93-L103
cdk/cdk
base/core/src/main/java/org/openscience/cdk/ringsearch/RegularCyclicVertexSearch.java
RegularCyclicVertexSearch.indexOfFused
private int indexOfFused(int start, long cycle) { """ Find the next index that the <i>cycle</i> intersects with by at least two vertices. If the intersect of a vertex set with another contains more then two vertices it cannot be edge disjoint. @param start start searching from here @param cycle test whether ...
java
private int indexOfFused(int start, long cycle) { for (int i = start; i < cycles.size(); i++) { long intersect = cycles.get(i) & cycle; if (intersect != 0 && Long.bitCount(intersect) > 1) { return i; } } return -1; }
[ "private", "int", "indexOfFused", "(", "int", "start", ",", "long", "cycle", ")", "{", "for", "(", "int", "i", "=", "start", ";", "i", "<", "cycles", ".", "size", "(", ")", ";", "i", "++", ")", "{", "long", "intersect", "=", "cycles", ".", "get",...
Find the next index that the <i>cycle</i> intersects with by at least two vertices. If the intersect of a vertex set with another contains more then two vertices it cannot be edge disjoint. @param start start searching from here @param cycle test whether any current cycles are fused with this one @return the index of ...
[ "Find", "the", "next", "index", "that", "the", "<i", ">", "cycle<", "/", "i", ">", "intersects", "with", "by", "at", "least", "two", "vertices", ".", "If", "the", "intersect", "of", "a", "vertex", "set", "with", "another", "contains", "more", "then", "...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/ringsearch/RegularCyclicVertexSearch.java#L220-L228
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java
RecoveryHelper.shortenPathName
static String shortenPathName(Path path, int bytes) { """ Shorten an absolute path into a sanitized String of length at most bytes. This is useful for including a summary of an absolute path in a file name. <p> For example: shortenPathName("/user/gobblin/foo/bar/myFile.txt", 25) will be shortened to "_user_go...
java
static String shortenPathName(Path path, int bytes) { String pathString = path.toUri().getPath(); String replaced = pathString.replace("/", "_"); if (replaced.length() <= bytes) { return replaced; } int bytesPerHalf = (bytes - 3) / 2; return replaced.substring(0, bytesPerHalf) + "..." + ...
[ "static", "String", "shortenPathName", "(", "Path", "path", ",", "int", "bytes", ")", "{", "String", "pathString", "=", "path", ".", "toUri", "(", ")", ".", "getPath", "(", ")", ";", "String", "replaced", "=", "pathString", ".", "replace", "(", "\"/\"", ...
Shorten an absolute path into a sanitized String of length at most bytes. This is useful for including a summary of an absolute path in a file name. <p> For example: shortenPathName("/user/gobblin/foo/bar/myFile.txt", 25) will be shortened to "_user_gobbl..._myFile.txt". </p> @param path absolute {@link Path} to shor...
[ "Shorten", "an", "absolute", "path", "into", "a", "sanitized", "String", "of", "length", "at", "most", "bytes", ".", "This", "is", "useful", "for", "including", "a", "summary", "of", "an", "absolute", "path", "in", "a", "file", "name", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/recovery/RecoveryHelper.java#L175-L185
uber/AutoDispose
static-analysis/autodispose-error-prone/src/main/java/com/uber/autodispose/errorprone/AbstractReturnValueIgnored.java
AbstractReturnValueIgnored.isValidReturnValueType
private boolean isValidReturnValueType(ExpressionTree tree, VisitorState state) { """ Extracts the {@link Type} of the return value for {@link MethodInvocationTree} or {@link MemberReferenceTree}, then checks it against {@link #capturedTypeAllowed(Type, VisitorState)}. """ Type returnType = null; if (...
java
private boolean isValidReturnValueType(ExpressionTree tree, VisitorState state) { Type returnType = null; if (tree instanceof MethodInvocationTree) { returnType = getReturnType(((JCMethodInvocation) tree).getMethodSelect()); } else if (tree instanceof MemberReferenceTree) { // Get the return typ...
[ "private", "boolean", "isValidReturnValueType", "(", "ExpressionTree", "tree", ",", "VisitorState", "state", ")", "{", "Type", "returnType", "=", "null", ";", "if", "(", "tree", "instanceof", "MethodInvocationTree", ")", "{", "returnType", "=", "getReturnType", "(...
Extracts the {@link Type} of the return value for {@link MethodInvocationTree} or {@link MemberReferenceTree}, then checks it against {@link #capturedTypeAllowed(Type, VisitorState)}.
[ "Extracts", "the", "{" ]
train
https://github.com/uber/AutoDispose/blob/1115b0274f7960354289bb3ae7ba75b0c5a47457/static-analysis/autodispose-error-prone/src/main/java/com/uber/autodispose/errorprone/AbstractReturnValueIgnored.java#L227-L240
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java
LocalDateTime.withSecond
public LocalDateTime withSecond(int second) { """ Returns a copy of this {@code LocalDateTime} with the second-of-minute altered. <p> This instance is immutable and unaffected by this method call. @param second the second-of-minute to set in the result, from 0 to 59 @return a {@code LocalDateTime} based on ...
java
public LocalDateTime withSecond(int second) { LocalTime newTime = time.withSecond(second); return with(date, newTime); }
[ "public", "LocalDateTime", "withSecond", "(", "int", "second", ")", "{", "LocalTime", "newTime", "=", "time", ".", "withSecond", "(", "second", ")", ";", "return", "with", "(", "date", ",", "newTime", ")", ";", "}" ]
Returns a copy of this {@code LocalDateTime} with the second-of-minute altered. <p> This instance is immutable and unaffected by this method call. @param second the second-of-minute to set in the result, from 0 to 59 @return a {@code LocalDateTime} based on this date-time with the requested second, not null @throws D...
[ "Returns", "a", "copy", "of", "this", "{", "@code", "LocalDateTime", "}", "with", "the", "second", "-", "of", "-", "minute", "altered", ".", "<p", ">", "This", "instance", "is", "immutable", "and", "unaffected", "by", "this", "method", "call", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java#L1074-L1077
ujmp/universal-java-matrix-package
ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java
Ginv.swapCols
public static void swapCols(double[][] matrix, int col1, int col2) { """ Swap components in the two columns. @param matrix the matrix to modify @param col1 the first row @param col2 the second row """ double temp = 0; int rows = matrix.length; double[] r = null; for (int row = 0; row < rows; ro...
java
public static void swapCols(double[][] matrix, int col1, int col2) { double temp = 0; int rows = matrix.length; double[] r = null; for (int row = 0; row < rows; row++) { r = matrix[row]; temp = r[col1]; r[col1] = r[col2]; r[col2] = temp; } }
[ "public", "static", "void", "swapCols", "(", "double", "[", "]", "[", "]", "matrix", ",", "int", "col1", ",", "int", "col2", ")", "{", "double", "temp", "=", "0", ";", "int", "rows", "=", "matrix", ".", "length", ";", "double", "[", "]", "r", "="...
Swap components in the two columns. @param matrix the matrix to modify @param col1 the first row @param col2 the second row
[ "Swap", "components", "in", "the", "two", "columns", "." ]
train
https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L184-L194
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
FSNamesystem.incrementSafeBlockCount
void incrementSafeBlockCount(int replication, boolean skipCheck) { """ Increment number of blocks that reached minimal replication. @param replication current replication @param skipCheck if true the safemode will not be checked - used for processing initial block reports to skip the check for every block - ...
java
void incrementSafeBlockCount(int replication, boolean skipCheck) { if (safeMode != null && safeMode.isOn()) { if ((int) replication == minReplication) { this.blocksSafe++; if(!skipCheck) { safeMode.checkMode(); } } } }
[ "void", "incrementSafeBlockCount", "(", "int", "replication", ",", "boolean", "skipCheck", ")", "{", "if", "(", "safeMode", "!=", "null", "&&", "safeMode", ".", "isOn", "(", ")", ")", "{", "if", "(", "(", "int", ")", "replication", "==", "minReplication", ...
Increment number of blocks that reached minimal replication. @param replication current replication @param skipCheck if true the safemode will not be checked - used for processing initial block reports to skip the check for every block - at the end checkSafeMode() must be called
[ "Increment", "number", "of", "blocks", "that", "reached", "minimal", "replication", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L8575-L8584
pryzach/midao
midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java
MappingUtils.returnStaticField
public static Object returnStaticField(Class clazz, String fieldName) throws MjdbcException { """ Returns class static field value Is used to return Constants @param clazz Class static field of which would be returned @param fieldName field name @return field value @throws org.midao.jdbc.core.exception....
java
public static Object returnStaticField(Class clazz, String fieldName) throws MjdbcException { Object result = null; Field field = null; try { field = clazz.getField(fieldName); result = field.get(null); } catch (NoSuchFieldException ex) { thro...
[ "public", "static", "Object", "returnStaticField", "(", "Class", "clazz", ",", "String", "fieldName", ")", "throws", "MjdbcException", "{", "Object", "result", "=", "null", ";", "Field", "field", "=", "null", ";", "try", "{", "field", "=", "clazz", ".", "g...
Returns class static field value Is used to return Constants @param clazz Class static field of which would be returned @param fieldName field name @return field value @throws org.midao.jdbc.core.exception.MjdbcException if field is not present or access is prohibited
[ "Returns", "class", "static", "field", "value", "Is", "used", "to", "return", "Constants" ]
train
https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L426-L440
overturetool/overture
core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java
SyntaxReader.idToName
protected LexNameToken idToName(LexIdentifierToken id) { """ Convert an identifier into a name. A name is an identifier that has a module name qualifier, so this method uses the current module to convert the identifier passed in. @param id The identifier to convert @return The corresponding name. """ L...
java
protected LexNameToken idToName(LexIdentifierToken id) { LexNameToken name = new LexNameToken(reader.currentModule, id); return name; }
[ "protected", "LexNameToken", "idToName", "(", "LexIdentifierToken", "id", ")", "{", "LexNameToken", "name", "=", "new", "LexNameToken", "(", "reader", ".", "currentModule", ",", "id", ")", ";", "return", "name", ";", "}" ]
Convert an identifier into a name. A name is an identifier that has a module name qualifier, so this method uses the current module to convert the identifier passed in. @param id The identifier to convert @return The corresponding name.
[ "Convert", "an", "identifier", "into", "a", "name", ".", "A", "name", "is", "an", "identifier", "that", "has", "a", "module", "name", "qualifier", "so", "this", "method", "uses", "the", "current", "module", "to", "convert", "the", "identifier", "passed", "...
train
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java#L167-L171
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java
DomainsInner.listOwnershipIdentifiersWithServiceResponseAsync
public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> listOwnershipIdentifiersWithServiceResponseAsync(final String resourceGroupName, final String domainName) { """ Lists domain ownership identifiers. Lists domain ownership identifiers. @param resourceGroupName Name of the resource group to...
java
public Observable<ServiceResponse<Page<DomainOwnershipIdentifierInner>>> listOwnershipIdentifiersWithServiceResponseAsync(final String resourceGroupName, final String domainName) { return listOwnershipIdentifiersSinglePageAsync(resourceGroupName, domainName) .concatMap(new Func1<ServiceResponse<Page...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "DomainOwnershipIdentifierInner", ">", ">", ">", "listOwnershipIdentifiersWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "domainName", ")", "{", "return", ...
Lists domain ownership identifiers. Lists domain ownership identifiers. @param resourceGroupName Name of the resource group to which the resource belongs. @param domainName Name of domain. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;DomainOwnersh...
[ "Lists", "domain", "ownership", "identifiers", ".", "Lists", "domain", "ownership", "identifiers", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java#L1354-L1366
cesarferreira/AndroidQuickUtils
library/src/main/java/quickutils/core/categories/string.java
string.capitalizeWords
public static String capitalizeWords(String str, char[] delimiters) { """ <p> Capitalizes all the delimiter separated words in a String. Only the first letter of each word is changed. </p> <p/> <p> The delimiters represent a set of characters understood to separate words. The first string character and the f...
java
public static String capitalizeWords(String str, char[] delimiters) { int delimLen = (delimiters == null ? -1 : delimiters.length); if ((str == null) || (str.length() == 0) || (delimLen == 0)) { return str; } int strLen = str.length(); StringBuffer buffer = new String...
[ "public", "static", "String", "capitalizeWords", "(", "String", "str", ",", "char", "[", "]", "delimiters", ")", "{", "int", "delimLen", "=", "(", "delimiters", "==", "null", "?", "-", "1", ":", "delimiters", ".", "length", ")", ";", "if", "(", "(", ...
<p> Capitalizes all the delimiter separated words in a String. Only the first letter of each word is changed. </p> <p/> <p> The delimiters represent a set of characters understood to separate words. The first string character and the first non-delimiter character after a delimiter will be capitalized. </p> <p/> <p> A <...
[ "<p", ">", "Capitalizes", "all", "the", "delimiter", "separated", "words", "in", "a", "String", ".", "Only", "the", "first", "letter", "of", "each", "word", "is", "changed", ".", "<", "/", "p", ">", "<p", "/", ">", "<p", ">", "The", "delimiters", "re...
train
https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/string.java#L186-L208
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_configtemplate.java
ns_configtemplate.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ ns_configtemplate_responses result = (ns_configtemplate_responses) serv...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { ns_configtemplate_responses result = (ns_configtemplate_responses) service.get_payload_formatter().string_to_resource(ns_configtemplate_responses.class, response); if(result.errorcode != 0) { if (...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "ns_configtemplate_responses", "result", "=", "(", "ns_configtemplate_responses", ")", "service", ".", "get_pa...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_configtemplate.java#L401-L418
chr78rm/tracelogger
src/main/java/de/christofreichardt/diagnosis/AbstractTracer.java
AbstractTracer.entry
public TraceMethod entry(String returnType, Object object, String methodSignature) { """ Indicates an entering of a method which belongs to an object. If a {@link TracingContext} exists for the current thread a {@link TraceMethod} object will be created and thereupon pushed onto the stack of a {@link ThreadMap}. ...
java
public TraceMethod entry(String returnType, Object object, String methodSignature) { TraceMethod traceMethod; if (object != null) { traceMethod = new TraceMethod(returnType, object, methodSignature); methodSignature = traceMethod.getSignature(); } else { methodSignature = retu...
[ "public", "TraceMethod", "entry", "(", "String", "returnType", ",", "Object", "object", ",", "String", "methodSignature", ")", "{", "TraceMethod", "traceMethod", ";", "if", "(", "object", "!=", "null", ")", "{", "traceMethod", "=", "new", "TraceMethod", "(", ...
Indicates an entering of a method which belongs to an object. If a {@link TracingContext} exists for the current thread a {@link TraceMethod} object will be created and thereupon pushed onto the stack of a {@link ThreadMap}. @param returnType the return type of the method as string representation @param object the obj...
[ "Indicates", "an", "entering", "of", "a", "method", "which", "belongs", "to", "an", "object", ".", "If", "a", "{", "@link", "TracingContext", "}", "exists", "for", "the", "current", "thread", "a", "{", "@link", "TraceMethod", "}", "object", "will", "be", ...
train
https://github.com/chr78rm/tracelogger/blob/ad22452b20f8111ad4d367302c2b26a100a20200/src/main/java/de/christofreichardt/diagnosis/AbstractTracer.java#L428-L451
nmorel/gwt-jackson
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonSerializationContext.java
JsonSerializationContext.traceError
public RuntimeException traceError( Object value, RuntimeException cause, JsonWriter writer ) { """ Trace an error with current writer state and returns a corresponding exception. @param value current value @param cause cause of the error @param writer current writer @return a {@link JsonSerializationExcep...
java
public RuntimeException traceError( Object value, RuntimeException cause, JsonWriter writer ) { RuntimeException exception = traceError( value, cause ); traceWriterInfo( value, writer ); return exception; }
[ "public", "RuntimeException", "traceError", "(", "Object", "value", ",", "RuntimeException", "cause", ",", "JsonWriter", "writer", ")", "{", "RuntimeException", "exception", "=", "traceError", "(", "value", ",", "cause", ")", ";", "traceWriterInfo", "(", "value", ...
Trace an error with current writer state and returns a corresponding exception. @param value current value @param cause cause of the error @param writer current writer @return a {@link JsonSerializationException} if we wrap the exceptions, the cause otherwise
[ "Trace", "an", "error", "with", "current", "writer", "state", "and", "returns", "a", "corresponding", "exception", "." ]
train
https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonSerializationContext.java#L551-L555
OpenLiberty/open-liberty
dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/TaskInfo.java
TaskInfo.initThreadContext
@SuppressWarnings("unchecked") void initThreadContext(WSContextService contextSvc, Map<String, String> execProps) { """ Capture thread context. @param contextSvc thread context service. @param execProps execution properties for the persistent task. """ threadContext = contextSvc.captureThreadCo...
java
@SuppressWarnings("unchecked") void initThreadContext(WSContextService contextSvc, Map<String, String> execProps) { threadContext = contextSvc.captureThreadContext(execProps); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "void", "initThreadContext", "(", "WSContextService", "contextSvc", ",", "Map", "<", "String", ",", "String", ">", "execProps", ")", "{", "threadContext", "=", "contextSvc", ".", "captureThreadContext", "(", "exe...
Capture thread context. @param contextSvc thread context service. @param execProps execution properties for the persistent task.
[ "Capture", "thread", "context", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/TaskInfo.java#L245-L248
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/properties/RuntimeEnvironmentPropertyPage.java
RuntimeEnvironmentPropertyPage.saveProjectSpecificOptions
@SuppressWarnings("static-method") protected boolean saveProjectSpecificOptions(IProject project, boolean useSpecificOptions) { """ Save the flag that indicates if the specific project options must be used. @param project the project. @param useSpecificOptions indicates if the specific options must be used. ...
java
@SuppressWarnings("static-method") protected boolean saveProjectSpecificOptions(IProject project, boolean useSpecificOptions) { if (project != null) { try { project.setPersistentProperty( qualify(PROPERTY_NAME_HAS_PROJECT_SPECIFIC), Boolean.toString(useSpecificOptions)); return true; } catc...
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "protected", "boolean", "saveProjectSpecificOptions", "(", "IProject", "project", ",", "boolean", "useSpecificOptions", ")", "{", "if", "(", "project", "!=", "null", ")", "{", "try", "{", "project", ".", "s...
Save the flag that indicates if the specific project options must be used. @param project the project. @param useSpecificOptions indicates if the specific options must be used. @return <code>true</code> if the property was saved successfully.
[ "Save", "the", "flag", "that", "indicates", "if", "the", "specific", "project", "options", "must", "be", "used", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/properties/RuntimeEnvironmentPropertyPage.java#L149-L162
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java
MarshallUtil.marshallUUID
public static void marshallUUID(UUID uuid, ObjectOutput out, boolean checkNull) throws IOException { """ Marshall the {@link UUID} by sending the most and lest significant bits. <p> This method supports {@code null} if {@code checkNull} is set to {@code true}. @param uuid {@link UUID} to marshall. @para...
java
public static void marshallUUID(UUID uuid, ObjectOutput out, boolean checkNull) throws IOException { if (checkNull) { if (uuid == null) { out.writeBoolean(true); return; } out.writeBoolean(false); } out.writeLong(uuid.getMostSignificantBits()); ...
[ "public", "static", "void", "marshallUUID", "(", "UUID", "uuid", ",", "ObjectOutput", "out", ",", "boolean", "checkNull", ")", "throws", "IOException", "{", "if", "(", "checkNull", ")", "{", "if", "(", "uuid", "==", "null", ")", "{", "out", ".", "writeBo...
Marshall the {@link UUID} by sending the most and lest significant bits. <p> This method supports {@code null} if {@code checkNull} is set to {@code true}. @param uuid {@link UUID} to marshall. @param out {@link ObjectOutput} to write. @param checkNull If {@code true}, it checks if {@code uuid} is {@code nu...
[ "Marshall", "the", "{", "@link", "UUID", "}", "by", "sending", "the", "most", "and", "lest", "significant", "bits", ".", "<p", ">", "This", "method", "supports", "{", "@code", "null", "}", "if", "{", "@code", "checkNull", "}", "is", "set", "to", "{", ...
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L146-L156
Sciss/abc4j
abc/src/main/java/abc/ui/swing/JScoreComponent.java
JScoreComponent.setSelectedItem
public void setSelectedItem(JScoreElement elmnt) { """ Highlights the given score element in the score. If an item was previously selected, this previous item is unselected. @param elmnt The score rendition element to be highlighted in the score. <TT>null</TT> can be specified to remove highlighting. @see #s...
java
public void setSelectedItem(JScoreElement elmnt){ if (m_selectedItems!=null) { for (Object m_selectedItem : m_selectedItems) { ((JScoreElement) m_selectedItem).setColor(null); } m_selectedItems = null; } if (elmnt!=null) { m_selectedItems = new Vector(1, 0); ...
[ "public", "void", "setSelectedItem", "(", "JScoreElement", "elmnt", ")", "{", "if", "(", "m_selectedItems", "!=", "null", ")", "{", "for", "(", "Object", "m_selectedItem", ":", "m_selectedItems", ")", "{", "(", "(", "JScoreElement", ")", "m_selectedItem", ")",...
Highlights the given score element in the score. If an item was previously selected, this previous item is unselected. @param elmnt The score rendition element to be highlighted in the score. <TT>null</TT> can be specified to remove highlighting. @see #setSelectedItem(MusicElement)
[ "Highlights", "the", "given", "score", "element", "in", "the", "score", ".", "If", "an", "item", "was", "previously", "selected", "this", "previous", "item", "is", "unselected", "." ]
train
https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/JScoreComponent.java#L335-L348
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.getEntry
public CacheEntry getEntry(String cacheName, Object id, boolean ignoreCounting ) { """ This implements the method in the CacheUnit interface. This is called by DRSNotificationService and DRSMessageListener. A returned null indicates that the local cache should execute it and return the result to the coordinatin...
java
public CacheEntry getEntry(String cacheName, Object id, boolean ignoreCounting ) { if (tc.isEntryEnabled()) Tr.entry(tc, "getEntry: {0}", id); DCache cache = ServerCache.getCache(cacheName); CacheEntry cacheEntry = null; if ( cache != null ) { cacheEntry = (Cac...
[ "public", "CacheEntry", "getEntry", "(", "String", "cacheName", ",", "Object", "id", ",", "boolean", "ignoreCounting", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"getEntry: {0}\"", ",", "id", ")...
This implements the method in the CacheUnit interface. This is called by DRSNotificationService and DRSMessageListener. A returned null indicates that the local cache should execute it and return the result to the coordinating CacheUnit. @param cacheName The cache name @param id The cache id for the entry. The id can...
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "by", "DRSNotificationService", "and", "DRSMessageListener", ".", "A", "returned", "null", "indicates", "that", "the", "local", "cache", "should", "execute",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L153-L166
aws/aws-sdk-java
aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/ListCrawlersRequest.java
ListCrawlersRequest.withTags
public ListCrawlersRequest withTags(java.util.Map<String, String> tags) { """ <p> Specifies to return only these tagged resources. </p> @param tags Specifies to return only these tagged resources. @return Returns a reference to this object so that method calls can be chained together. """ setTag...
java
public ListCrawlersRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "ListCrawlersRequest", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> Specifies to return only these tagged resources. </p> @param tags Specifies to return only these tagged resources. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Specifies", "to", "return", "only", "these", "tagged", "resources", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/ListCrawlersRequest.java#L162-L165
actframework/actframework
src/main/java/act/util/ClassNode.java
ClassNode.visitSubTree
public ClassNode visitSubTree($.Visitor<ClassNode> visitor, final boolean publicOnly, final boolean noAbstract) { """ Accept a visitor that visit all descendants of the class represetned by this `ClassNode` NOT including this `ClassNode` itself. @param visitor the visitor @param publicOnly specify if only publi...
java
public ClassNode visitSubTree($.Visitor<ClassNode> visitor, final boolean publicOnly, final boolean noAbstract) { return visitSubTree($.guardedVisitor(classNodeFilter(publicOnly, noAbstract), visitor)); }
[ "public", "ClassNode", "visitSubTree", "(", "$", ".", "Visitor", "<", "ClassNode", ">", "visitor", ",", "final", "boolean", "publicOnly", ",", "final", "boolean", "noAbstract", ")", "{", "return", "visitSubTree", "(", "$", ".", "guardedVisitor", "(", "classNod...
Accept a visitor that visit all descendants of the class represetned by this `ClassNode` NOT including this `ClassNode` itself. @param visitor the visitor @param publicOnly specify if only public class shall be visited @param noAbstract specify if abstract class can be visited @return this `ClassNode` instance
[ "Accept", "a", "visitor", "that", "visit", "all", "descendants", "of", "the", "class", "represetned", "by", "this", "ClassNode", "NOT", "including", "this", "ClassNode", "itself", "." ]
train
https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/util/ClassNode.java#L241-L243
graphhopper/graphhopper
api/src/main/java/com/graphhopper/util/AngleCalc.java
AngleCalc.calcAzimuth
public double calcAzimuth(double lat1, double lon1, double lat2, double lon2) { """ Calculate the azimuth in degree for a line given by two coordinates. Direction in 'degree' where 0 is north, 90 is east, 180 is south and 270 is west. """ double orientation = Math.PI / 2 - calcOrientation(lat1, lon1, ...
java
public double calcAzimuth(double lat1, double lon1, double lat2, double lon2) { double orientation = Math.PI / 2 - calcOrientation(lat1, lon1, lat2, lon2); if (orientation < 0) orientation += 2 * Math.PI; return Math.toDegrees(Helper.round4(orientation)) % 360; }
[ "public", "double", "calcAzimuth", "(", "double", "lat1", ",", "double", "lon1", ",", "double", "lat2", ",", "double", "lon2", ")", "{", "double", "orientation", "=", "Math", ".", "PI", "/", "2", "-", "calcOrientation", "(", "lat1", ",", "lon1", ",", "...
Calculate the azimuth in degree for a line given by two coordinates. Direction in 'degree' where 0 is north, 90 is east, 180 is south and 270 is west.
[ "Calculate", "the", "azimuth", "in", "degree", "for", "a", "line", "given", "by", "two", "coordinates", ".", "Direction", "in", "degree", "where", "0", "is", "north", "90", "is", "east", "180", "is", "south", "and", "270", "is", "west", "." ]
train
https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/AngleCalc.java#L113-L119
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java
ServerAzureADAdministratorsInner.createOrUpdateAsync
public Observable<ServerAzureADAdministratorInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerAzureADAdministratorInner properties) { """ Creates a new Server Active Directory Administrator or updates an existing server Active Directory Administrator. @param resourceGroupName The nam...
java
public Observable<ServerAzureADAdministratorInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerAzureADAdministratorInner properties) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, properties).map(new Func1<ServiceResponse<ServerAzureADAdministratorInner...
[ "public", "Observable", "<", "ServerAzureADAdministratorInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "ServerAzureADAdministratorInner", "properties", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", ...
Creates a new Server Active Directory Administrator or updates an existing server Active Directory Administrator. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @p...
[ "Creates", "a", "new", "Server", "Active", "Directory", "Administrator", "or", "updates", "an", "existing", "server", "Active", "Directory", "Administrator", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java#L124-L131
Alluxio/alluxio
core/base/src/main/java/alluxio/util/io/PathUtils.java
PathUtils.hasPrefix
public static boolean hasPrefix(String path, String prefix) throws InvalidPathException { """ Checks whether the given path contains the given prefix. The comparison happens at a component granularity; for example, {@code hasPrefix(/dir/file, /dir)} should evaluate to true, while {@code hasPrefix(/dir/file, /d)}...
java
public static boolean hasPrefix(String path, String prefix) throws InvalidPathException { String[] pathComponents = getPathComponents(path); String[] prefixComponents = getPathComponents(prefix); if (pathComponents.length < prefixComponents.length) { return false; } for (int i = 0; i < prefixC...
[ "public", "static", "boolean", "hasPrefix", "(", "String", "path", ",", "String", "prefix", ")", "throws", "InvalidPathException", "{", "String", "[", "]", "pathComponents", "=", "getPathComponents", "(", "path", ")", ";", "String", "[", "]", "prefixComponents",...
Checks whether the given path contains the given prefix. The comparison happens at a component granularity; for example, {@code hasPrefix(/dir/file, /dir)} should evaluate to true, while {@code hasPrefix(/dir/file, /d)} should evaluate to false. @param path a path @param prefix a prefix @return whether the given path ...
[ "Checks", "whether", "the", "given", "path", "contains", "the", "given", "prefix", ".", "The", "comparison", "happens", "at", "a", "component", "granularity", ";", "for", "example", "{", "@code", "hasPrefix", "(", "/", "dir", "/", "file", "/", "dir", ")", ...
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/io/PathUtils.java#L196-L208
jboss/jboss-jsf-api_spec
src/main/java/javax/faces/view/facelets/DelegatingMetaTagHandler.java
DelegatingMetaTagHandler.applyNextHandler
public void applyNextHandler(FaceletContext ctx, UIComponent c) throws IOException, FacesException, ELException { """ <p class="changed_added_2_0_rev_a">Invoke the <code>apply()</code> method on this instance's {@link TagHandler#nextHandler}.</p> @param ctx the <code>FaceletContext</code> for this...
java
public void applyNextHandler(FaceletContext ctx, UIComponent c) throws IOException, FacesException, ELException { // first allow c to get populated this.nextHandler.apply(ctx, c); }
[ "public", "void", "applyNextHandler", "(", "FaceletContext", "ctx", ",", "UIComponent", "c", ")", "throws", "IOException", ",", "FacesException", ",", "ELException", "{", "// first allow c to get populated", "this", ".", "nextHandler", ".", "apply", "(", "ctx", ",",...
<p class="changed_added_2_0_rev_a">Invoke the <code>apply()</code> method on this instance's {@link TagHandler#nextHandler}.</p> @param ctx the <code>FaceletContext</code> for this view execution @param c the <code>UIComponent</code> of the component represented by this element instance. @since 2.0
[ "<p", "class", "=", "changed_added_2_0_rev_a", ">", "Invoke", "the", "<code", ">", "apply", "()", "<", "/", "code", ">", "method", "on", "this", "instance", "s", "{", "@link", "TagHandler#nextHandler", "}", ".", "<", "/", "p", ">" ]
train
https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/view/facelets/DelegatingMetaTagHandler.java#L134-L138
vigna/Sux4J
src/it/unimi/dsi/sux4j/mph/HypergraphSorter.java
HypergraphSorter.bitVectorToEdge
public static void bitVectorToEdge(final BitVector bv, final long seed, final int numVertices, final int partSize, final int e[]) { """ Turns a bit vector into a 3-hyperedge. <p>The returned edge satisfies the property that the <var>i</var>-th vertex is in the interval [<var>i</var>&middot;{@link #partSize}..<...
java
public static void bitVectorToEdge(final BitVector bv, final long seed, final int numVertices, final int partSize, final int e[]) { if (numVertices == 0) { e[0] = e[1] = e[2] = -1; return; } final long[] hash = new long[3]; Hashes.spooky4(bv, seed, hash); e[0] = (int)((hash[0] & 0x7FFFFFFFFFFFFFFFL) % p...
[ "public", "static", "void", "bitVectorToEdge", "(", "final", "BitVector", "bv", ",", "final", "long", "seed", ",", "final", "int", "numVertices", ",", "final", "int", "partSize", ",", "final", "int", "e", "[", "]", ")", "{", "if", "(", "numVertices", "==...
Turns a bit vector into a 3-hyperedge. <p>The returned edge satisfies the property that the <var>i</var>-th vertex is in the interval [<var>i</var>&middot;{@link #partSize}..<var>i</var>+1&middot;{@link #partSize}). However, if there are no edges the vector <code>e</code> will be filled with -1. @param bv a bit vecto...
[ "Turns", "a", "bit", "vector", "into", "a", "3", "-", "hyperedge", "." ]
train
https://github.com/vigna/Sux4J/blob/d57de8fa897c7d273e0e6dae7a3274174f175a5f/src/it/unimi/dsi/sux4j/mph/HypergraphSorter.java#L199-L209
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.loginUser
public String loginUser(String username, String password) throws CmsException { """ Logs a user into the Cms, if the password is correct.<p> @param username the name of the user @param password the password of the user @return the name of the logged in user @throws CmsException if the login was not succe...
java
public String loginUser(String username, String password) throws CmsException { return loginUser(username, password, m_context.getRemoteAddress()); }
[ "public", "String", "loginUser", "(", "String", "username", ",", "String", "password", ")", "throws", "CmsException", "{", "return", "loginUser", "(", "username", ",", "password", ",", "m_context", ".", "getRemoteAddress", "(", ")", ")", ";", "}" ]
Logs a user into the Cms, if the password is correct.<p> @param username the name of the user @param password the password of the user @return the name of the logged in user @throws CmsException if the login was not successful
[ "Logs", "a", "user", "into", "the", "Cms", "if", "the", "password", "is", "correct", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L2170-L2173
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java
DefaultFeatureForm.getValue
@Api public void getValue(String name, ImageUrlAttribute attribute) { """ Get an image value from the form, and place it in <code>attribute</code>. @param name attribute name @param attribute attribute to put value @since 1.11.1 """ attribute.setValue((String) formWidget.getValue(name)); }
java
@Api public void getValue(String name, ImageUrlAttribute attribute) { attribute.setValue((String) formWidget.getValue(name)); }
[ "@", "Api", "public", "void", "getValue", "(", "String", "name", ",", "ImageUrlAttribute", "attribute", ")", "{", "attribute", ".", "setValue", "(", "(", "String", ")", "formWidget", ".", "getValue", "(", "name", ")", ")", ";", "}" ]
Get an image value from the form, and place it in <code>attribute</code>. @param name attribute name @param attribute attribute to put value @since 1.11.1
[ "Get", "an", "image", "value", "from", "the", "form", "and", "place", "it", "in", "<code", ">", "attribute<", "/", "code", ">", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L752-L755
Harium/keel
src/main/java/com/harium/keel/catalano/math/distance/Distance.java
Distance.SquaredEuclidean
public static double SquaredEuclidean(double x1, double y1, double x2, double y2) { """ Gets the Squared Euclidean distance between two points. @param x1 X1 axis coordinates. @param y1 Y1 axis coordinates. @param x2 X2 axis coordinates. @param y2 Y2 axis coordinates. @return The Squared euclidean distance b...
java
public static double SquaredEuclidean(double x1, double y1, double x2, double y2) { double dx = x2 - x1; double dy = y2 - y1; return dx * dx + dy * dy; }
[ "public", "static", "double", "SquaredEuclidean", "(", "double", "x1", ",", "double", "y1", ",", "double", "x2", ",", "double", "y2", ")", "{", "double", "dx", "=", "x2", "-", "x1", ";", "double", "dy", "=", "y2", "-", "y1", ";", "return", "dx", "*...
Gets the Squared Euclidean distance between two points. @param x1 X1 axis coordinates. @param y1 Y1 axis coordinates. @param x2 X2 axis coordinates. @param y2 Y2 axis coordinates. @return The Squared euclidean distance between x and y.
[ "Gets", "the", "Squared", "Euclidean", "distance", "between", "two", "points", "." ]
train
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L821-L827
apache/flink
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/generator/EventsGenerator.java
EventsGenerator.nextInvalid
@Nullable public Event nextInvalid() { """ Creates an event for an illegal state transition of one of the internal state machines. If the generator has not yet started any state machines (for example, because no call to {@link #next(int, int)} was made, yet), this will return null. @return An event for a il...
java
@Nullable public Event nextInvalid() { final Iterator<Entry<Integer, State>> iter = states.entrySet().iterator(); if (iter.hasNext()) { final Entry<Integer, State> entry = iter.next(); State currentState = entry.getValue(); int address = entry.getKey(); iter.remove(); EventType event = currentStat...
[ "@", "Nullable", "public", "Event", "nextInvalid", "(", ")", "{", "final", "Iterator", "<", "Entry", "<", "Integer", ",", "State", ">", ">", "iter", "=", "states", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "if", "(", "iter", ".", "...
Creates an event for an illegal state transition of one of the internal state machines. If the generator has not yet started any state machines (for example, because no call to {@link #next(int, int)} was made, yet), this will return null. @return An event for a illegal state transition, or null, if not possible.
[ "Creates", "an", "event", "for", "an", "illegal", "state", "transition", "of", "one", "of", "the", "internal", "state", "machines", ".", "If", "the", "generator", "has", "not", "yet", "started", "any", "state", "machines", "(", "for", "example", "because", ...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/generator/EventsGenerator.java#L143-L159
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/ui/SeaGlassTextFieldUI.java
SeaGlassTextFieldUI.createTextFieldBorder
protected TextFieldBorder createTextFieldBorder(SeaGlassContext context) { """ DOCUMENT ME! @param context DOCUMENT ME! @return DOCUMENT ME! """ if (textFieldBorder == null) { textFieldBorder = new TextFieldBorder(this, context.getStyle().getInsets(context, null)); } ...
java
protected TextFieldBorder createTextFieldBorder(SeaGlassContext context) { if (textFieldBorder == null) { textFieldBorder = new TextFieldBorder(this, context.getStyle().getInsets(context, null)); } return textFieldBorder; }
[ "protected", "TextFieldBorder", "createTextFieldBorder", "(", "SeaGlassContext", "context", ")", "{", "if", "(", "textFieldBorder", "==", "null", ")", "{", "textFieldBorder", "=", "new", "TextFieldBorder", "(", "this", ",", "context", ".", "getStyle", "(", ")", ...
DOCUMENT ME! @param context DOCUMENT ME! @return DOCUMENT ME!
[ "DOCUMENT", "ME!" ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTextFieldUI.java#L702-L708
Red5/red5-server-common
src/main/java/org/red5/server/stream/PlaylistSubscriberStream.java
PlaylistSubscriberStream.createEngine
PlayEngine createEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) { """ Creates a play engine based on current services (scheduling service, consumer service, and provider service). This method is useful during unit testing. """ engine =...
java
PlayEngine createEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) { engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).build(); // set the max pending video frames to the play engine engine...
[ "PlayEngine", "createEngine", "(", "ISchedulingService", "schedulingService", ",", "IConsumerService", "consumerService", ",", "IProviderService", "providerService", ")", "{", "engine", "=", "new", "PlayEngine", ".", "Builder", "(", "this", ",", "schedulingService", ","...
Creates a play engine based on current services (scheduling service, consumer service, and provider service). This method is useful during unit testing.
[ "Creates", "a", "play", "engine", "based", "on", "current", "services", "(", "scheduling", "service", "consumer", "service", "and", "provider", "service", ")", ".", "This", "method", "is", "useful", "during", "unit", "testing", "." ]
train
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/PlaylistSubscriberStream.java#L143-L150
kenyee/android-ddp-client
src/com/keysolutions/ddpclient/android/DDPStateSingleton.java
DDPStateSingleton.loginWithOAuth
public void loginWithOAuth(String serviceName, String accessToken) { """ Logs in using access token -- this breaks the current convention, but the method call is dependent on some of this class's variables @param serviceName service name i.e facebook, google @param accessToken short-lived one-time code received...
java
public void loginWithOAuth(String serviceName, String accessToken) { sendOAuthHTTPRequest(serviceName, accessToken, randomSecret(), new Response.Listener<String>(){ @Override public void onResponse(String response) { //json is stored inside an html object in the response ...
[ "public", "void", "loginWithOAuth", "(", "String", "serviceName", ",", "String", "accessToken", ")", "{", "sendOAuthHTTPRequest", "(", "serviceName", ",", "accessToken", ",", "randomSecret", "(", ")", ",", "new", "Response", ".", "Listener", "<", "String", ">", ...
Logs in using access token -- this breaks the current convention, but the method call is dependent on some of this class's variables @param serviceName service name i.e facebook, google @param accessToken short-lived one-time code received, or long-lived access token for Facebook login For some logins, such as Facebook...
[ "Logs", "in", "using", "access", "token", "--", "this", "breaks", "the", "current", "convention", "but", "the", "method", "call", "is", "dependent", "on", "some", "of", "this", "class", "s", "variables", "@param", "serviceName", "service", "name", "i", ".", ...
train
https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/DDPStateSingleton.java#L432-L464
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/IndianCalendar.java
IndianCalendar.gregorianToJD
private static double gregorianToJD(int year, int month, int date) { """ /* The following function is not needed for basic calendar functioning. This routine converts a gregorian date to the corresponding Julian date" @param year The year in standard Gregorian calendar (AD/BC) . @param month The month accor...
java
private static double gregorianToJD(int year, int month, int date) { double JULIAN_EPOCH = 1721425.5; int y = year - 1; int result = (365 * y) + (y / 4) - (y / 100) + (y / 400) + (((367 * month) - 362) / 12) +...
[ "private", "static", "double", "gregorianToJD", "(", "int", "year", ",", "int", "month", ",", "int", "date", ")", "{", "double", "JULIAN_EPOCH", "=", "1721425.5", ";", "int", "y", "=", "year", "-", "1", ";", "int", "result", "=", "(", "365", "*", "y"...
/* The following function is not needed for basic calendar functioning. This routine converts a gregorian date to the corresponding Julian date" @param year The year in standard Gregorian calendar (AD/BC) . @param month The month according to Gregorian calendar (between 0 to 11) @param date The date in month
[ "/", "*", "The", "following", "function", "is", "not", "needed", "for", "basic", "calendar", "functioning", ".", "This", "routine", "converts", "a", "gregorian", "date", "to", "the", "corresponding", "Julian", "date" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/IndianCalendar.java#L478-L489
vvakame/JsonPullParser
jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java
JsonUtil.putIntegerList
public static void putIntegerList(Writer writer, List<Integer> values) throws IOException { """ Writes the given value with the given writer. @param writer @param values @throws IOException @author vvakame """ if (values == null) { writer.write("null"); } else { startArray(writer); for (int i ...
java
public static void putIntegerList(Writer writer, List<Integer> values) throws IOException { if (values == null) { writer.write("null"); } else { startArray(writer); for (int i = 0; i < values.size(); i++) { put(writer, values.get(i)); if (i != values.size() - 1) { addSeparator(writer); } ...
[ "public", "static", "void", "putIntegerList", "(", "Writer", "writer", ",", "List", "<", "Integer", ">", "values", ")", "throws", "IOException", "{", "if", "(", "values", "==", "null", ")", "{", "writer", ".", "write", "(", "\"null\"", ")", ";", "}", "...
Writes the given value with the given writer. @param writer @param values @throws IOException @author vvakame
[ "Writes", "the", "given", "value", "with", "the", "given", "writer", "." ]
train
https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L356-L369
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextServicesSupport.java
ControlBeanContextServicesSupport.revokeService
public void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow) { """ BeanContextServiceProviders wishing to remove a currently registered service from this context may do so via invocation of this method. Upon revocation of the service, the <code>Bean...
java
public void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow) { // todo: for multithreaded usage this block needs to be synchronized if (!_serviceProviders.containsKey(serviceClass)) { return; } // propagate to an...
[ "public", "void", "revokeService", "(", "Class", "serviceClass", ",", "BeanContextServiceProvider", "serviceProvider", ",", "boolean", "revokeCurrentServicesNow", ")", "{", "// todo: for multithreaded usage this block needs to be synchronized", "if", "(", "!", "_serviceProviders"...
BeanContextServiceProviders wishing to remove a currently registered service from this context may do so via invocation of this method. Upon revocation of the service, the <code>BeanContextServices</code> fires a <code>BeanContextServiceRevokedEvent</code> to its list of currently registered <code>BeanContextServiceRev...
[ "BeanContextServiceProviders", "wishing", "to", "remove", "a", "currently", "registered", "service", "from", "this", "context", "may", "do", "so", "via", "invocation", "of", "this", "method", ".", "Upon", "revocation", "of", "the", "service", "the", "<code", ">"...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextServicesSupport.java#L118-L148
google/closure-compiler
src/com/google/javascript/jscomp/deps/DepsFileParser.java
DepsFileParser.parseFile
public List<DependencyInfo> parseFile(String filePath, String fileContents) { """ Parses the given file and returns a list of dependency information that it contained. It uses the passed in fileContents instead of reading the file. @param filePath Path to the file to parse. @param fileContents The contents t...
java
public List<DependencyInfo> parseFile(String filePath, String fileContents) { return parseFileReader(filePath, new StringReader(fileContents)); }
[ "public", "List", "<", "DependencyInfo", ">", "parseFile", "(", "String", "filePath", ",", "String", "fileContents", ")", "{", "return", "parseFileReader", "(", "filePath", ",", "new", "StringReader", "(", "fileContents", ")", ")", ";", "}" ]
Parses the given file and returns a list of dependency information that it contained. It uses the passed in fileContents instead of reading the file. @param filePath Path to the file to parse. @param fileContents The contents to parse. @return A list of DependencyInfo objects.
[ "Parses", "the", "given", "file", "and", "returns", "a", "list", "of", "dependency", "information", "that", "it", "contained", ".", "It", "uses", "the", "passed", "in", "fileContents", "instead", "of", "reading", "the", "file", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/DepsFileParser.java#L118-L120
ksclarke/freelib-utils
src/main/java/info/freelibrary/util/I18nObject.java
I18nObject.getI18n
protected String getI18n(final String aMessageKey, final long aLongDetail) { """ Gets the internationalized value for the supplied message key, using a long as additional information. @param aMessageKey A message key @param aLongDetail Additional details for the message @return The internationalized message ...
java
protected String getI18n(final String aMessageKey, final long aLongDetail) { return StringUtils.normalizeWS(myBundle.get(aMessageKey, Long.toString(aLongDetail))); }
[ "protected", "String", "getI18n", "(", "final", "String", "aMessageKey", ",", "final", "long", "aLongDetail", ")", "{", "return", "StringUtils", ".", "normalizeWS", "(", "myBundle", ".", "get", "(", "aMessageKey", ",", "Long", ".", "toString", "(", "aLongDetai...
Gets the internationalized value for the supplied message key, using a long as additional information. @param aMessageKey A message key @param aLongDetail Additional details for the message @return The internationalized message
[ "Gets", "the", "internationalized", "value", "for", "the", "supplied", "message", "key", "using", "a", "long", "as", "additional", "information", "." ]
train
https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/I18nObject.java#L57-L59
negusoft/holoaccent
HoloAccent/src/com/negusoft/holoaccent/widget/AccentSearchView.java
AccentSearchView.setBackground
@SuppressWarnings("deprecation") @SuppressLint("NewApi") private void setBackground(View view, Drawable drawable) { """ Call the appropriate method to set the background to the View """ if (Build.VERSION.SDK_INT >= SET_DRAWABLE_MIN_SDK) view.setBackground(drawable); else vie...
java
@SuppressWarnings("deprecation") @SuppressLint("NewApi") private void setBackground(View view, Drawable drawable) { if (Build.VERSION.SDK_INT >= SET_DRAWABLE_MIN_SDK) view.setBackground(drawable); else view.setBackgroundDrawable(drawable); }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "@", "SuppressLint", "(", "\"NewApi\"", ")", "private", "void", "setBackground", "(", "View", "view", ",", "Drawable", "drawable", ")", "{", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "SET_...
Call the appropriate method to set the background to the View
[ "Call", "the", "appropriate", "method", "to", "set", "the", "background", "to", "the", "View" ]
train
https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/widget/AccentSearchView.java#L51-L58
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java
StructureDiagramGenerator.placeFirstBond
private IAtomContainer placeFirstBond(IBond bond, Vector2d bondVector) { """ Places the first bond of the first ring such that one atom is at (0,0) and the other one at the position given by bondVector @param bondVector A 2D vector to point to the position of the second bond atom @param bond the bond t...
java
private IAtomContainer placeFirstBond(IBond bond, Vector2d bondVector) { IAtomContainer sharedAtoms = null; bondVector.normalize(); logger.debug("placeFirstBondOfFirstRing->bondVector.length():" + bondVector.length()); bondVector.scale(bondLength); logger.debug("placeFirstBondOf...
[ "private", "IAtomContainer", "placeFirstBond", "(", "IBond", "bond", ",", "Vector2d", "bondVector", ")", "{", "IAtomContainer", "sharedAtoms", "=", "null", ";", "bondVector", ".", "normalize", "(", ")", ";", "logger", ".", "debug", "(", "\"placeFirstBondOfFirstRin...
Places the first bond of the first ring such that one atom is at (0,0) and the other one at the position given by bondVector @param bondVector A 2D vector to point to the position of the second bond atom @param bond the bond to lay out @return an IAtomContainer with the atoms of the bond and the bond itself
[ "Places", "the", "first", "bond", "of", "the", "first", "ring", "such", "that", "one", "atom", "is", "at", "(", "0", "0", ")", "and", "the", "other", "one", "at", "the", "position", "given", "by", "bondVector" ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java#L2029-L2060
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java
ApiOvhDedicatedCloud.serviceName_vmEncryption_kms_kmsId_GET
public OvhVMEncryptionAccessNetwork serviceName_vmEncryption_kms_kmsId_GET(String serviceName, Long kmsId) throws IOException { """ Get this object properties REST: GET /dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId} @param serviceName [required] Domain of the service @param kmsId [required] Id of the ...
java
public OvhVMEncryptionAccessNetwork serviceName_vmEncryption_kms_kmsId_GET(String serviceName, Long kmsId) throws IOException { String qPath = "/dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}"; StringBuilder sb = path(qPath, serviceName, kmsId); String resp = exec(qPath, "GET", sb.toString(), null); retu...
[ "public", "OvhVMEncryptionAccessNetwork", "serviceName_vmEncryption_kms_kmsId_GET", "(", "String", "serviceName", ",", "Long", "kmsId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}\"", ";", "StringBuilder", ...
Get this object properties REST: GET /dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId} @param serviceName [required] Domain of the service @param kmsId [required] Id of the VM Encryption KMS
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L607-L612
Netflix/Hystrix
hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java
HystrixCommandExecutionHook.onError
public <T> Exception onError(HystrixInvokable<T> commandInstance, FailureType failureType, Exception e) { """ Invoked when {@link HystrixInvokable} fails with an Exception. @param commandInstance The executing HystrixInvokable instance. @param failureType {@link FailureType} enum representing which type of err...
java
public <T> Exception onError(HystrixInvokable<T> commandInstance, FailureType failureType, Exception e) { return e; //by default, just pass through }
[ "public", "<", "T", ">", "Exception", "onError", "(", "HystrixInvokable", "<", "T", ">", "commandInstance", ",", "FailureType", "failureType", ",", "Exception", "e", ")", "{", "return", "e", ";", "//by default, just pass through", "}" ]
Invoked when {@link HystrixInvokable} fails with an Exception. @param commandInstance The executing HystrixInvokable instance. @param failureType {@link FailureType} enum representing which type of error @param e exception object @since 1.2
[ "Invoked", "when", "{", "@link", "HystrixInvokable", "}", "fails", "with", "an", "Exception", "." ]
train
https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java#L76-L78
VoltDB/voltdb
third_party/java/src/com/google_voltpatches/common/collect/Iterables.java
Iterables.getOnlyElement
@Nullable public static <T> T getOnlyElement(Iterable<? extends T> iterable, @Nullable T defaultValue) { """ Returns the single element contained in {@code iterable}, or {@code defaultValue} if the iterable is empty. @throws IllegalArgumentException if the iterator contains multiple elements """ ret...
java
@Nullable public static <T> T getOnlyElement(Iterable<? extends T> iterable, @Nullable T defaultValue) { return Iterators.getOnlyElement(iterable.iterator(), defaultValue); }
[ "@", "Nullable", "public", "static", "<", "T", ">", "T", "getOnlyElement", "(", "Iterable", "<", "?", "extends", "T", ">", "iterable", ",", "@", "Nullable", "T", "defaultValue", ")", "{", "return", "Iterators", ".", "getOnlyElement", "(", "iterable", ".", ...
Returns the single element contained in {@code iterable}, or {@code defaultValue} if the iterable is empty. @throws IllegalArgumentException if the iterator contains multiple elements
[ "Returns", "the", "single", "element", "contained", "in", "{", "@code", "iterable", "}", "or", "{", "@code", "defaultValue", "}", "if", "the", "iterable", "is", "empty", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Iterables.java#L304-L307
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/index/LuceneQueryUtils.java
LuceneQueryUtils.getQuery
public static String getQuery(String clazzFieldName, String clazzName, String idFieldName, String idFieldValue) { """ Returns lucene based query. @param clazzFieldName lucene field name for class @param clazzName class name @param idFieldName lucene id field name @param idFieldValue lucene id field value...
java
public static String getQuery(String clazzFieldName, String clazzName, String idFieldName, String idFieldValue) { StringBuffer sb = new StringBuffer("+"); sb.append(clazzFieldName); sb.append(":"); sb.append(clazzName); sb.append(" AND "); sb.append("+"); sb.a...
[ "public", "static", "String", "getQuery", "(", "String", "clazzFieldName", ",", "String", "clazzName", ",", "String", "idFieldName", ",", "String", "idFieldValue", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "\"+\"", ")", ";", "sb", ".", ...
Returns lucene based query. @param clazzFieldName lucene field name for class @param clazzName class name @param idFieldName lucene id field name @param idFieldValue lucene id field value @return query lucene query.
[ "Returns", "lucene", "based", "query", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/index/LuceneQueryUtils.java#L38-L50
belaban/JGroups
src/org/jgroups/util/SuppressCache.java
SuppressCache.putIfAbsent
public Value putIfAbsent(T key, long expiry_time) { """ Adds a new key to the hashmap, or updates the Value associated with the existing key if present. If expiry_time is greater than the age of the Value, the key will be removed. @param key The key @param expiry_time Expiry time (in ms) @return Null if the ke...
java
public Value putIfAbsent(T key, long expiry_time) { if(key == null) key=NULL_KEY; Value val=map.get(key); if(val == null) { val=new Value(); Value existing=map.putIfAbsent(key, val); if(existing == null) return val; val=...
[ "public", "Value", "putIfAbsent", "(", "T", "key", ",", "long", "expiry_time", ")", "{", "if", "(", "key", "==", "null", ")", "key", "=", "NULL_KEY", ";", "Value", "val", "=", "map", ".", "get", "(", "key", ")", ";", "if", "(", "val", "==", "null...
Adds a new key to the hashmap, or updates the Value associated with the existing key if present. If expiry_time is greater than the age of the Value, the key will be removed. @param key The key @param expiry_time Expiry time (in ms) @return Null if the key was present and not expired, or the Value associated with the e...
[ "Adds", "a", "new", "key", "to", "the", "hashmap", "or", "updates", "the", "Value", "associated", "with", "the", "existing", "key", "if", "present", ".", "If", "expiry_time", "is", "greater", "than", "the", "age", "of", "the", "Value", "the", "key", "wil...
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/SuppressCache.java#L29-L47
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/f/EssentialNister5.java
EssentialNister5.computeSpan
private void computeSpan( List<AssociatedPair> points ) { """ From the epipolar constraint p2^T*E*p1 = 0 construct a linear system and find its null space. """ Q.reshape(points.size(), 9); int index = 0; for( int i = 0; i < points.size(); i++ ) { AssociatedPair p = points.get(i); Point2D_F64 a ...
java
private void computeSpan( List<AssociatedPair> points ) { Q.reshape(points.size(), 9); int index = 0; for( int i = 0; i < points.size(); i++ ) { AssociatedPair p = points.get(i); Point2D_F64 a = p.p2; Point2D_F64 b = p.p1; // The points are assumed to be in homogeneous coordinates. This means z =...
[ "private", "void", "computeSpan", "(", "List", "<", "AssociatedPair", ">", "points", ")", "{", "Q", ".", "reshape", "(", "points", ".", "size", "(", ")", ",", "9", ")", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", ...
From the epipolar constraint p2^T*E*p1 = 0 construct a linear system and find its null space.
[ "From", "the", "epipolar", "constraint", "p2^T", "*", "E", "*", "p1", "=", "0", "construct", "a", "linear", "system", "and", "find", "its", "null", "space", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/EssentialNister5.java#L148-L181
atomix/atomix
utils/src/main/java/io/atomix/utils/concurrent/Retries.java
Retries.delay
public static void delay(int ms, int nanos) { """ Suspends the current thread for a specified number of millis and nanos. @param ms number of millis @param nanos number of nanos """ try { Thread.sleep(ms, nanos); } catch (InterruptedException e) { throw new RuntimeException("Interrup...
java
public static void delay(int ms, int nanos) { try { Thread.sleep(ms, nanos); } catch (InterruptedException e) { throw new RuntimeException("Interrupted", e); } }
[ "public", "static", "void", "delay", "(", "int", "ms", ",", "int", "nanos", ")", "{", "try", "{", "Thread", ".", "sleep", "(", "ms", ",", "nanos", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "throw", "new", "RuntimeException", ...
Suspends the current thread for a specified number of millis and nanos. @param ms number of millis @param nanos number of nanos
[ "Suspends", "the", "current", "thread", "for", "a", "specified", "number", "of", "millis", "and", "nanos", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/concurrent/Retries.java#L85-L91
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/media/MediaClient.java
MediaClient.createPipeline
public CreatePipelineResponse createPipeline( String pipelineName, String sourceBucket, String targetBucket) { """ Creates a pipeline which enable you to perform multiple transcodes in parallel. @param pipelineName The name of the new pipeline. @param sourceBucket The name of source bucket in Bos. ...
java
public CreatePipelineResponse createPipeline( String pipelineName, String sourceBucket, String targetBucket) { return createPipeline(pipelineName, null, sourceBucket, targetBucket, DEFAULT_PIPELINE_CAPACITY); }
[ "public", "CreatePipelineResponse", "createPipeline", "(", "String", "pipelineName", ",", "String", "sourceBucket", ",", "String", "targetBucket", ")", "{", "return", "createPipeline", "(", "pipelineName", ",", "null", ",", "sourceBucket", ",", "targetBucket", ",", ...
Creates a pipeline which enable you to perform multiple transcodes in parallel. @param pipelineName The name of the new pipeline. @param sourceBucket The name of source bucket in Bos. @param targetBucket The name of target bucket in Bos.
[ "Creates", "a", "pipeline", "which", "enable", "you", "to", "perform", "multiple", "transcodes", "in", "parallel", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L518-L521
graknlabs/grakn
server/src/server/exception/TransactionException.java
TransactionException.invalidPropertyUse
public static TransactionException invalidPropertyUse(Concept concept, Schema.VertexProperty property) { """ Thrown when trying to add a Schema.VertexProperty to a Concept which does not accept that type of Schema.VertexProperty """ return create(INVALID_PROPERTY_USE.getMessage(concept, property)); ...
java
public static TransactionException invalidPropertyUse(Concept concept, Schema.VertexProperty property) { return create(INVALID_PROPERTY_USE.getMessage(concept, property)); }
[ "public", "static", "TransactionException", "invalidPropertyUse", "(", "Concept", "concept", ",", "Schema", ".", "VertexProperty", "property", ")", "{", "return", "create", "(", "INVALID_PROPERTY_USE", ".", "getMessage", "(", "concept", ",", "property", ")", ")", ...
Thrown when trying to add a Schema.VertexProperty to a Concept which does not accept that type of Schema.VertexProperty
[ "Thrown", "when", "trying", "to", "add", "a", "Schema", ".", "VertexProperty", "to", "a", "Concept", "which", "does", "not", "accept", "that", "type", "of", "Schema", ".", "VertexProperty" ]
train
https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/TransactionException.java#L256-L258
vvakame/JsonPullParser
jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/template/Template.java
Template.writeJsonMeta
public static void writeJsonMeta(JavaFileObject fileObject, JsonModelModel model) throws IOException { """ Generates source code into the given file object from the given data model, utilizing the templating engine. @param fileObject Target file object @param model Data model for source code generation @thro...
java
public static void writeJsonMeta(JavaFileObject fileObject, JsonModelModel model) throws IOException { MvelTemplate.writeJsonMeta(fileObject, model); }
[ "public", "static", "void", "writeJsonMeta", "(", "JavaFileObject", "fileObject", ",", "JsonModelModel", "model", ")", "throws", "IOException", "{", "MvelTemplate", ".", "writeJsonMeta", "(", "fileObject", ",", "model", ")", ";", "}" ]
Generates source code into the given file object from the given data model, utilizing the templating engine. @param fileObject Target file object @param model Data model for source code generation @throws IOException @author vvakame
[ "Generates", "source", "code", "into", "the", "given", "file", "object", "from", "the", "given", "data", "model", "utilizing", "the", "templating", "engine", "." ]
train
https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/util/jsonpullparser/factory/template/Template.java#L53-L56
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/schema/constraints/DataColumnConstraints.java
DataColumnConstraints.validateRangeValue
private void validateRangeValue(String column, Object value) { """ Validate the constraint type when a range value is set @param column @param value """ if (constraintType != null && value != null && !getConstraintType().equals(DataColumnConstraintType.RANGE)) { throw new GeoPackageException("The ...
java
private void validateRangeValue(String column, Object value) { if (constraintType != null && value != null && !getConstraintType().equals(DataColumnConstraintType.RANGE)) { throw new GeoPackageException("The " + column + " must be null for " + DataColumnConstraintType.ENUM + " and " + DataColumnConst...
[ "private", "void", "validateRangeValue", "(", "String", "column", ",", "Object", "value", ")", "{", "if", "(", "constraintType", "!=", "null", "&&", "value", "!=", "null", "&&", "!", "getConstraintType", "(", ")", ".", "equals", "(", "DataColumnConstraintType"...
Validate the constraint type when a range value is set @param column @param value
[ "Validate", "the", "constraint", "type", "when", "a", "range", "value", "is", "set" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/schema/constraints/DataColumnConstraints.java#L251-L258
infinispan/infinispan
commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java
MarshallUtil.unmarshallMap
public static <K, V, T extends Map<K, V>> T unmarshallMap(ObjectInput in, MapBuilder<K, V, T> builder) throws IOException, ClassNotFoundException { """ Unmarshall the {@link Map}. <p> If the marshalled map is {@code null}, then the {@link MapBuilder} is not invoked. @param in {@link ObjectInput} to read....
java
public static <K, V, T extends Map<K, V>> T unmarshallMap(ObjectInput in, MapBuilder<K, V, T> builder) throws IOException, ClassNotFoundException { final int size = unmarshallSize(in); if (size == NULL_VALUE) { return null; } final T map = Objects.requireNonNull(builder, "MapBuilder mus...
[ "public", "static", "<", "K", ",", "V", ",", "T", "extends", "Map", "<", "K", ",", "V", ">", ">", "T", "unmarshallMap", "(", "ObjectInput", "in", ",", "MapBuilder", "<", "K", ",", "V", ",", "T", ">", "builder", ")", "throws", "IOException", ",", ...
Unmarshall the {@link Map}. <p> If the marshalled map is {@code null}, then the {@link MapBuilder} is not invoked. @param in {@link ObjectInput} to read. @param builder {@link MapBuilder} to create the concrete {@link Map} implementation. @return The populated {@link Map} created by the {@link MapBuilder} or {@co...
[ "Unmarshall", "the", "{", "@link", "Map", "}", ".", "<p", ">", "If", "the", "marshalled", "map", "is", "{", "@code", "null", "}", "then", "the", "{", "@link", "MapBuilder", "}", "is", "not", "invoked", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L79-L88
jamesagnew/hapi-fhir
hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java
ShExGenerator.genAlternativeTypes
private ST genAlternativeTypes(ElementDefinition ed, String id, String shortId) { """ Generate a set of alternative shapes @param ed Containing element definition @param id Element definition identifier @param shortId id to use in the actual definition @return ShEx list of alternative anonymous shapes separate...
java
private ST genAlternativeTypes(ElementDefinition ed, String id, String shortId) { ST shex_alt = tmplt(ALTERNATIVE_SHAPES_TEMPLATE); List<String> altEntries = new ArrayList<String>(); for(ElementDefinition.TypeRefComponent typ : ed.getType()) { altEntries.add(genAltEntry(id, typ)); } ...
[ "private", "ST", "genAlternativeTypes", "(", "ElementDefinition", "ed", ",", "String", "id", ",", "String", "shortId", ")", "{", "ST", "shex_alt", "=", "tmplt", "(", "ALTERNATIVE_SHAPES_TEMPLATE", ")", ";", "List", "<", "String", ">", "altEntries", "=", "new",...
Generate a set of alternative shapes @param ed Containing element definition @param id Element definition identifier @param shortId id to use in the actual definition @return ShEx list of alternative anonymous shapes separated by "OR"
[ "Generate", "a", "set", "of", "alternative", "shapes" ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L618-L628
julianhyde/eigenbase-properties
src/main/java/org/eigenbase/util/property/Property.java
Property.onChange
public void onChange(String oldValue, String value) { """ Called when a property's value has just changed. <p>If one of the triggers on the property throws a {@link org.eigenbase.util.property.Trigger.VetoRT} exception, this method passes it on. @param oldValue Previous value of the property @param value ...
java
public void onChange(String oldValue, String value) { if (TriggerableProperties.equals(oldValue, value)) { return; } triggerList.execute(this, value); }
[ "public", "void", "onChange", "(", "String", "oldValue", ",", "String", "value", ")", "{", "if", "(", "TriggerableProperties", ".", "equals", "(", "oldValue", ",", "value", ")", ")", "{", "return", ";", "}", "triggerList", ".", "execute", "(", "this", ",...
Called when a property's value has just changed. <p>If one of the triggers on the property throws a {@link org.eigenbase.util.property.Trigger.VetoRT} exception, this method passes it on. @param oldValue Previous value of the property @param value New value of the property @throws org.eigenbase.util.property.Trigger...
[ "Called", "when", "a", "property", "s", "value", "has", "just", "changed", "." ]
train
https://github.com/julianhyde/eigenbase-properties/blob/fb8a544fa3775a52030c9434285478f139880d58/src/main/java/org/eigenbase/util/property/Property.java#L160-L167
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java
SPUIComponentProvider.getCheckBox
public static CheckBox getCheckBox(final String caption, final String style, final String styleName, final boolean required, final String data) { """ Get Label UI component. @param caption as caption @param style combo style to add @param styleName combo style to set @param required signifies...
java
public static CheckBox getCheckBox(final String caption, final String style, final String styleName, final boolean required, final String data) { return new SPUICheckBox(caption, style, styleName, required, data); }
[ "public", "static", "CheckBox", "getCheckBox", "(", "final", "String", "caption", ",", "final", "String", "style", ",", "final", "String", "styleName", ",", "final", "boolean", "required", ",", "final", "String", "data", ")", "{", "return", "new", "SPUICheckBo...
Get Label UI component. @param caption as caption @param style combo style to add @param styleName combo style to set @param required signifies if combo is mandatory @param data combo box data @return ComboBox
[ "Get", "Label", "UI", "component", "." ]
train
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java#L93-L96
lightblueseas/file-worker
src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java
ChecksumExtensions.getChecksum
public static long getChecksum(final File file, final boolean crc) throws FileNotFoundException, IOException { """ Gets the checksum from the given file. If the flag crc is true than the CheckedInputStream is constructed with an instance of <code>java.util.zip.CRC32</code> otherwise with an instance of <code>j...
java
public static long getChecksum(final File file, final boolean crc) throws FileNotFoundException, IOException { try (CheckedInputStream cis = crc ? new CheckedInputStream(new FileInputStream(file), new CRC32()) : new CheckedInputStream(new FileInputStream(file), new Adler32());) { final int length = (int...
[ "public", "static", "long", "getChecksum", "(", "final", "File", "file", ",", "final", "boolean", "crc", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "try", "(", "CheckedInputStream", "cis", "=", "crc", "?", "new", "CheckedInputStream", "(", ...
Gets the checksum from the given file. If the flag crc is true than the CheckedInputStream is constructed with an instance of <code>java.util.zip.CRC32</code> otherwise with an instance of <code>java.util.zip.Adler32</code>. @param file The file The file from what to get the checksum. @param crc The crc If the flag cr...
[ "Gets", "the", "checksum", "from", "the", "given", "file", ".", "If", "the", "flag", "crc", "is", "true", "than", "the", "CheckedInputStream", "is", "constructed", "with", "an", "instance", "of", "<code", ">", "java", ".", "util", ".", "zip", ".", "CRC32...
train
https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java#L221-L238
tommyettinger/RegExodus
src/main/java/regexodus/Matcher.java
Matcher.setTarget
@GwtIncompatible public void setTarget(Reader in, int len) throws IOException { """ Supplies a text to search in/match with through a stream. Resets current search position to zero. @param in - a data stream; @param len - how much characters should be read; if len is -1, read the entire stream. @see Mat...
java
@GwtIncompatible public void setTarget(Reader in, int len) throws IOException { if (len < 0) { setAll(in); return; } char[] mychars = data; boolean shared = this.shared; if (mychars == null || shared || mychars.length < len) { mychars = new...
[ "@", "GwtIncompatible", "public", "void", "setTarget", "(", "Reader", "in", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "len", "<", "0", ")", "{", "setAll", "(", "in", ")", ";", "return", ";", "}", "char", "[", "]", "mychars", ...
Supplies a text to search in/match with through a stream. Resets current search position to zero. @param in - a data stream; @param len - how much characters should be read; if len is -1, read the entire stream. @see Matcher#setTarget(regexodus.Matcher, int) @see Matcher#setTarget(java.lang.CharSequence) @see Matcher...
[ "Supplies", "a", "text", "to", "search", "in", "/", "match", "with", "through", "a", "stream", ".", "Resets", "current", "search", "position", "to", "zero", "." ]
train
https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Matcher.java#L334-L354
js-lib-com/commons
src/main/java/js/util/Params.java
Params.LT
public static void LT(char parameter, char value, String name) throws IllegalArgumentException { """ Test if character parameter is strictly less than given character value. @param parameter invocation character parameter, @param value threshold value, @param name the name of invocation parameter. @throws Il...
java
public static void LT(char parameter, char value, String name) throws IllegalArgumentException { if (parameter >= value) { throw new IllegalArgumentException(String.format("%s is not less than %c.", name, value)); } }
[ "public", "static", "void", "LT", "(", "char", "parameter", ",", "char", "value", ",", "String", "name", ")", "throws", "IllegalArgumentException", "{", "if", "(", "parameter", ">=", "value", ")", "{", "throw", "new", "IllegalArgumentException", "(", "String",...
Test if character parameter is strictly less than given character value. @param parameter invocation character parameter, @param value threshold value, @param name the name of invocation parameter. @throws IllegalArgumentException if <code>parameter</code> is not less than character value.
[ "Test", "if", "character", "parameter", "is", "strictly", "less", "than", "given", "character", "value", "." ]
train
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L457-L461
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java
CassandraSchemaMgr.columnFamilyExists
public boolean columnFamilyExists(DBConn dbConn, String keyspace, String cfName) { """ Return true if the given store name currently exists in the given keyspace. This method can be used with a connection connected to any keyspace. @param dbConn Database connection to use. @param cfName Candidate Column...
java
public boolean columnFamilyExists(DBConn dbConn, String keyspace, String cfName) { KsDef ksDef = null; try { ksDef = dbConn.getClientSession().describe_keyspace(keyspace); } catch (Exception ex) { throw new RuntimeException("Failed to get keyspace definition for '" +...
[ "public", "boolean", "columnFamilyExists", "(", "DBConn", "dbConn", ",", "String", "keyspace", ",", "String", "cfName", ")", "{", "KsDef", "ksDef", "=", "null", ";", "try", "{", "ksDef", "=", "dbConn", ".", "getClientSession", "(", ")", ".", "describe_keyspa...
Return true if the given store name currently exists in the given keyspace. This method can be used with a connection connected to any keyspace. @param dbConn Database connection to use. @param cfName Candidate ColumnFamily name. @return True if the CF exists in the database.
[ "Return", "true", "if", "the", "given", "store", "name", "currently", "exists", "in", "the", "given", "keyspace", ".", "This", "method", "can", "be", "used", "with", "a", "connection", "connected", "to", "any", "keyspace", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java#L200-L215
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java
HomographyTotalLeastSquares.backsubstitution0134
static void backsubstitution0134(DMatrixRMaj P_plus, DMatrixRMaj P , DMatrixRMaj X , double H[] ) { """ Backsubstitution for solving for 0,1 and 3,4 using solution for 6,7,8 """ final int N = P.numRows; DMatrixRMaj tmp = new DMatrixRMaj(N*2, 1); double H6 = H[6]; double H7 = H[7]; double H...
java
static void backsubstitution0134(DMatrixRMaj P_plus, DMatrixRMaj P , DMatrixRMaj X , double H[] ) { final int N = P.numRows; DMatrixRMaj tmp = new DMatrixRMaj(N*2, 1); double H6 = H[6]; double H7 = H[7]; double H8 = H[8]; for (int i = 0, index = 0; i < N; i++) { double x = -X.data[index],y = ...
[ "static", "void", "backsubstitution0134", "(", "DMatrixRMaj", "P_plus", ",", "DMatrixRMaj", "P", ",", "DMatrixRMaj", "X", ",", "double", "H", "[", "]", ")", "{", "final", "int", "N", "=", "P", ".", "numRows", ";", "DMatrixRMaj", "tmp", "=", "new", "DMatr...
Backsubstitution for solving for 0,1 and 3,4 using solution for 6,7,8
[ "Backsubstitution", "for", "solving", "for", "0", "1", "and", "3", "4", "using", "solution", "for", "6", "7", "8" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyTotalLeastSquares.java#L114-L148
ironjacamar/ironjacamar
web/src/main/java/org/ironjacamar/web/console/Server.java
Server.getMBeanAttributeResultInfo
public static AttrResultInfo getMBeanAttributeResultInfo(String name, MBeanAttributeInfo attrInfo) throws JMException { """ Get MBean attribute result info @param name The bean name @param attrInfo The attribute information @return The data @exception JMException Thrown if an error occurs """ C...
java
public static AttrResultInfo getMBeanAttributeResultInfo(String name, MBeanAttributeInfo attrInfo) throws JMException { ClassLoader loader = SecurityActions.getThreadContextClassLoader(); MBeanServer server = getMBeanServer(); ObjectName objName = new ObjectName(name); String attrName =...
[ "public", "static", "AttrResultInfo", "getMBeanAttributeResultInfo", "(", "String", "name", ",", "MBeanAttributeInfo", "attrInfo", ")", "throws", "JMException", "{", "ClassLoader", "loader", "=", "SecurityActions", ".", "getThreadContextClassLoader", "(", ")", ";", "MBe...
Get MBean attribute result info @param name The bean name @param attrInfo The attribute information @return The data @exception JMException Thrown if an error occurs
[ "Get", "MBean", "attribute", "result", "info" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/Server.java#L209-L249
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java
AbstractHTMLFilter.moveChildren
protected void moveChildren(Element parent, Element destination) { """ Moves all child elements of the parent into destination element. @param parent the parent {@link Element}. @param destination the destination {@link Element}. """ NodeList children = parent.getChildNodes(); while (childr...
java
protected void moveChildren(Element parent, Element destination) { NodeList children = parent.getChildNodes(); while (children.getLength() > 0) { destination.appendChild(parent.removeChild(parent.getFirstChild())); } }
[ "protected", "void", "moveChildren", "(", "Element", "parent", ",", "Element", "destination", ")", "{", "NodeList", "children", "=", "parent", ".", "getChildNodes", "(", ")", ";", "while", "(", "children", ".", "getLength", "(", ")", ">", "0", ")", "{", ...
Moves all child elements of the parent into destination element. @param parent the parent {@link Element}. @param destination the destination {@link Element}.
[ "Moves", "all", "child", "elements", "of", "the", "parent", "into", "destination", "element", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java#L147-L153
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/AnnotationRef.java
AnnotationRef.simpleFieldWriter
private static FieldWriter simpleFieldWriter(final String name) { """ Writes an primitive valued field to the writer. <p>See {@link AnnotationVisitor#visit(String, Object)} for the valid types. """ return new FieldWriter() { @Override public void write(AnnotationVisitor visitor, Object value...
java
private static FieldWriter simpleFieldWriter(final String name) { return new FieldWriter() { @Override public void write(AnnotationVisitor visitor, Object value) { visitor.visit(name, value); } }; }
[ "private", "static", "FieldWriter", "simpleFieldWriter", "(", "final", "String", "name", ")", "{", "return", "new", "FieldWriter", "(", ")", "{", "@", "Override", "public", "void", "write", "(", "AnnotationVisitor", "visitor", ",", "Object", "value", ")", "{",...
Writes an primitive valued field to the writer. <p>See {@link AnnotationVisitor#visit(String, Object)} for the valid types.
[ "Writes", "an", "primitive", "valued", "field", "to", "the", "writer", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/AnnotationRef.java#L145-L152
unbescape/unbescape
src/main/java/org/unbescape/css/CssEscape.java
CssEscape.unescapeCss
public static void unescapeCss(final Reader reader, final Writer writer) throws IOException { """ <p> Perform a CSS <strong>unescape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> No additional configuration arguments are required. Unescape operations...
java
public static void unescapeCss(final Reader reader, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } CssUnescapeUtil.unescape(reader, writer); }
[ "public", "static", "void", "unescapeCss", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Argument 'writer' c...
<p> Perform a CSS <strong>unescape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> No additional configuration arguments are required. Unescape operations will always perform <em>complete</em> CSS unescape of backslash and hexadecimal escape sequences. </p> <p> This method ...
[ "<p", ">", "Perform", "a", "CSS", "<strong", ">", "unescape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "String<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt", ">", "Writer<", "/", "tt", ">", ".", "<", "/", "p", ...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/css/CssEscape.java#L1809-L1817
googleapis/google-cloud-java
google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java
Blob.downloadTo
public void downloadTo(Path path, BlobSourceOption... options) { """ Downloads this blob to the given file path using specified blob read options. @param path destination @param options blob read options @throws StorageException upon failure """ try (OutputStream outputStream = Files.newOutputStream(p...
java
public void downloadTo(Path path, BlobSourceOption... options) { try (OutputStream outputStream = Files.newOutputStream(path); ReadChannel reader = reader(options)) { WritableByteChannel channel = Channels.newChannel(outputStream); ByteBuffer bytes = ByteBuffer.allocate(DEFAULT_CHUNK_SIZE); ...
[ "public", "void", "downloadTo", "(", "Path", "path", ",", "BlobSourceOption", "...", "options", ")", "{", "try", "(", "OutputStream", "outputStream", "=", "Files", ".", "newOutputStream", "(", "path", ")", ";", "ReadChannel", "reader", "=", "reader", "(", "o...
Downloads this blob to the given file path using specified blob read options. @param path destination @param options blob read options @throws StorageException upon failure
[ "Downloads", "this", "blob", "to", "the", "given", "file", "path", "using", "specified", "blob", "read", "options", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java#L213-L226