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
alipay/sofa-rpc
extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/transport/bolt/BoltClientTransport.java
BoltClientTransport.doOneWay
protected void doOneWay(SofaRequest request, InvokeContext invokeContext, int timeoutMillis) throws RemotingException, InterruptedException { """ 同步调用 @param request 请求对象 @param invokeContext 调用上下文 @param timeoutMillis 超时时间(毫秒) @throws RemotingException 远程调用异常 @throws InterruptedException 中...
java
protected void doOneWay(SofaRequest request, InvokeContext invokeContext, int timeoutMillis) throws RemotingException, InterruptedException { RPC_CLIENT.oneway(url, request, invokeContext); }
[ "protected", "void", "doOneWay", "(", "SofaRequest", "request", ",", "InvokeContext", "invokeContext", ",", "int", "timeoutMillis", ")", "throws", "RemotingException", ",", "InterruptedException", "{", "RPC_CLIENT", ".", "oneway", "(", "url", ",", "request", ",", ...
同步调用 @param request 请求对象 @param invokeContext 调用上下文 @param timeoutMillis 超时时间(毫秒) @throws RemotingException 远程调用异常 @throws InterruptedException 中断异常 @since 5.2.0
[ "同步调用" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/transport/bolt/BoltClientTransport.java#L309-L312
realtime-framework/RealtimeStorage-Android
library/src/main/java/co/realtime/storage/TableRef.java
TableRef.notContains
public TableRef notContains(String attributeName, ItemAttribute value) { """ Applies a filter to the table. When fetched, it will return the items that does not contains the filter property value. <pre> StorageRef storage = new StorageRef("your_app_key", "your_token"); TableRef tableRef = storage.table("you...
java
public TableRef notContains(String attributeName, ItemAttribute value){ filters.add(new Filter(StorageFilter.NOTCONTAINS, attributeName, value, null)); return this; }
[ "public", "TableRef", "notContains", "(", "String", "attributeName", ",", "ItemAttribute", "value", ")", "{", "filters", ".", "add", "(", "new", "Filter", "(", "StorageFilter", ".", "NOTCONTAINS", ",", "attributeName", ",", "value", ",", "null", ")", ")", ";...
Applies a filter to the table. When fetched, it will return the items that does not contains the filter property value. <pre> StorageRef storage = new StorageRef("your_app_key", "your_token"); TableRef tableRef = storage.table("your_table"); // Retrieve all items with property "itemProperty" contains the value "xpto...
[ "Applies", "a", "filter", "to", "the", "table", ".", "When", "fetched", "it", "will", "return", "the", "items", "that", "does", "not", "contains", "the", "filter", "property", "value", "." ]
train
https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/TableRef.java#L897-L900
apache/reef
lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ConfigurationModule.java
ConfigurationModule.set
public final <T> ConfigurationModule set(final Param<List> opt, final List implList) { """ Binds a list to a specific optional/required Param using ConfigurationModule. @param opt target optional/required Param @param implList List object to be injected @param <T> type @return the Configuration mod...
java
public final <T> ConfigurationModule set(final Param<List> opt, final List implList) { final ConfigurationModule c = deepCopy(); c.processSet(opt); c.setParamLists.put(opt, implList); return c; }
[ "public", "final", "<", "T", ">", "ConfigurationModule", "set", "(", "final", "Param", "<", "List", ">", "opt", ",", "final", "List", "implList", ")", "{", "final", "ConfigurationModule", "c", "=", "deepCopy", "(", ")", ";", "c", ".", "processSet", "(", ...
Binds a list to a specific optional/required Param using ConfigurationModule. @param opt target optional/required Param @param implList List object to be injected @param <T> type @return the Configuration module
[ "Binds", "a", "list", "to", "a", "specific", "optional", "/", "required", "Param", "using", "ConfigurationModule", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ConfigurationModule.java#L196-L201
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java
AnnotationTypeBuilder.buildAnnotationTypeOptionalMemberDetails
public void buildAnnotationTypeOptionalMemberDetails(XMLNode node, Content memberDetailsTree) throws DocletException { """ Build the annotation type optional member documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to wh...
java
public void buildAnnotationTypeOptionalMemberDetails(XMLNode node, Content memberDetailsTree) throws DocletException { configuration.getBuilderFactory(). getAnnotationTypeOptionalMemberBuilder(writer).buildChildren(node, memberDetailsTree); }
[ "public", "void", "buildAnnotationTypeOptionalMemberDetails", "(", "XMLNode", "node", ",", "Content", "memberDetailsTree", ")", "throws", "DocletException", "{", "configuration", ".", "getBuilderFactory", "(", ")", ".", "getAnnotationTypeOptionalMemberBuilder", "(", "writer...
Build the annotation type optional member documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added @throws DocletException if there is a problem building the documentation
[ "Build", "the", "annotation", "type", "optional", "member", "documentation", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java#L255-L259
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/RequestHandler.java
RequestHandler.addNode
public Observable<LifecycleState> addNode(final NetworkAddress hostname, final NetworkAddress alternate) { """ Add a {@link Node} identified by its hostname. @param hostname the hostname of the node. @return the states of the node (most probably {@link LifecycleState#CONNECTED}). """ Node node = no...
java
public Observable<LifecycleState> addNode(final NetworkAddress hostname, final NetworkAddress alternate) { Node node = nodeBy(hostname); if (node != null) { LOGGER.debug("Node {} already registered, skipping.", hostname); return Observable.just(node.state()); } re...
[ "public", "Observable", "<", "LifecycleState", ">", "addNode", "(", "final", "NetworkAddress", "hostname", ",", "final", "NetworkAddress", "alternate", ")", "{", "Node", "node", "=", "nodeBy", "(", "hostname", ")", ";", "if", "(", "node", "!=", "null", ")", ...
Add a {@link Node} identified by its hostname. @param hostname the hostname of the node. @return the states of the node (most probably {@link LifecycleState#CONNECTED}).
[ "Add", "a", "{", "@link", "Node", "}", "identified", "by", "its", "hostname", "." ]
train
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/RequestHandler.java#L294-L301
groupby/api-java
src/main/java/com/groupbyinc/api/Query.java
Query.addBias
public Query addBias(String name, String content, Bias.Strength strength) { """ <code> See {@link Query#setBiasing(Biasing)}. This is a convenience method to add an individual bias. </code> @param name The name of the field to bias on @param content The value to bias @param strength The strength of t...
java
public Query addBias(String name, String content, Bias.Strength strength) { biasing.getBiases().add(new Bias().setName(name).setContent(content).setStrength(strength)); return this; }
[ "public", "Query", "addBias", "(", "String", "name", ",", "String", "content", ",", "Bias", ".", "Strength", "strength", ")", "{", "biasing", ".", "getBiases", "(", ")", ".", "add", "(", "new", "Bias", "(", ")", ".", "setName", "(", "name", ")", ".",...
<code> See {@link Query#setBiasing(Biasing)}. This is a convenience method to add an individual bias. </code> @param name The name of the field to bias on @param content The value to bias @param strength The strength of the bias. Legal values are: "Absolute_Increase", "Strong_Increase", "Medium_Increase", "Weak_Incr...
[ "<code", ">" ]
train
https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/api/Query.java#L1434-L1437
pmlopes/yoke
framework/src/main/java/com/jetdrone/vertx/yoke/middleware/YokeRequest.java
YokeRequest.getFormAttribute
public String getFormAttribute(@NotNull final String name, String defaultValue) { """ Allow getting form parameters in a generified way and return defaultValue if the key does not exist. @param name The key to get @param defaultValue value returned when the key does not exist @return {String} The found object...
java
public String getFormAttribute(@NotNull final String name, String defaultValue) { String value = request.formAttributes().get(name); if (value == null) { return defaultValue; } return value; }
[ "public", "String", "getFormAttribute", "(", "@", "NotNull", "final", "String", "name", ",", "String", "defaultValue", ")", "{", "String", "value", "=", "request", ".", "formAttributes", "(", ")", ".", "get", "(", "name", ")", ";", "if", "(", "value", "=...
Allow getting form parameters in a generified way and return defaultValue if the key does not exist. @param name The key to get @param defaultValue value returned when the key does not exist @return {String} The found object
[ "Allow", "getting", "form", "parameters", "in", "a", "generified", "way", "and", "return", "defaultValue", "if", "the", "key", "does", "not", "exist", "." ]
train
https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/middleware/YokeRequest.java#L647-L655
jcuda/jcusolver
JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java
JCusolverRf.cusolverRfSetupHost
public static int cusolverRfSetupHost( int n, int nnzA, Pointer h_csrRowPtrA, Pointer h_csrColIndA, Pointer h_csrValA, int nnzL, Pointer h_csrRowPtrL, Pointer h_csrColIndL, Pointer h_csrValL, int nnzU, Pointer h...
java
public static int cusolverRfSetupHost( int n, int nnzA, Pointer h_csrRowPtrA, Pointer h_csrColIndA, Pointer h_csrValA, int nnzL, Pointer h_csrRowPtrL, Pointer h_csrColIndL, Pointer h_csrValL, int nnzU, Pointer h...
[ "public", "static", "int", "cusolverRfSetupHost", "(", "int", "n", ",", "int", "nnzA", ",", "Pointer", "h_csrRowPtrA", ",", "Pointer", "h_csrColIndA", ",", "Pointer", "h_csrValA", ",", "int", "nnzL", ",", "Pointer", "h_csrRowPtrL", ",", "Pointer", "h_csrColIndL"...
CUSOLVERRF setup of internal structures from host or device memory
[ "CUSOLVERRF", "setup", "of", "internal", "structures", "from", "host", "or", "device", "memory" ]
train
https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java#L200-L220
mgormley/pacaya
src/main/java/edu/jhu/pacaya/util/files/QFiles.java
QFiles.getTempPath
private static File getTempPath(String prefix, File parentDir) throws IOException { """ Creates a file object of a currently available path, but does not create the file. This method is not thread safe. """ final int maxI = (int)Math.pow(10, NUM_DIGITS); String formatStr = "%s_%0"+NUM_DIGITS+"...
java
private static File getTempPath(String prefix, File parentDir) throws IOException { final int maxI = (int)Math.pow(10, NUM_DIGITS); String formatStr = "%s_%0"+NUM_DIGITS+"d"; File path; int i; for (i=0; i<maxI; i++) { path = new File(parentDir, String.format(formatStr...
[ "private", "static", "File", "getTempPath", "(", "String", "prefix", ",", "File", "parentDir", ")", "throws", "IOException", "{", "final", "int", "maxI", "=", "(", "int", ")", "Math", ".", "pow", "(", "10", ",", "NUM_DIGITS", ")", ";", "String", "formatS...
Creates a file object of a currently available path, but does not create the file. This method is not thread safe.
[ "Creates", "a", "file", "object", "of", "a", "currently", "available", "path", "but", "does", "not", "create", "the", "file", ".", "This", "method", "is", "not", "thread", "safe", "." ]
train
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/util/files/QFiles.java#L98-L115
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java
HttpFields.put
public void put(String name,List list) { """ Set a field. @param name the name of the field @param list the List value of the field. If null the field is cleared. """ if (list==null || list.size()==0) { remove(name); return; } Object v=list.get...
java
public void put(String name,List list) { if (list==null || list.size()==0) { remove(name); return; } Object v=list.get(0); if (v!=null) put(name,v.toString()); else remove(name); if (list.size()...
[ "public", "void", "put", "(", "String", "name", ",", "List", "list", ")", "{", "if", "(", "list", "==", "null", "||", "list", ".", "size", "(", ")", "==", "0", ")", "{", "remove", "(", "name", ")", ";", "return", ";", "}", "Object", "v", "=", ...
Set a field. @param name the name of the field @param list the List value of the field. If null the field is cleared.
[ "Set", "a", "field", "." ]
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L854-L879
lastaflute/lasta-di
src/main/java/org/lastaflute/di/util/LdiSrl.java
LdiSrl.frontstring
public static String frontstring(final String str, final int index) { """ Extract front sub-string by index. <pre> rearstring("flute", 2) returns "fl" </pre> @param str The target string. (NotNull) @param index The index from rear. @return The rear string. (NotNull) """ assertStringNotNull(str);...
java
public static String frontstring(final String str, final int index) { assertStringNotNull(str); if (str.length() < index) { String msg = "The length of the string was smaller than the index:"; msg = msg + " str=" + str + " index=" + index; throw new StringIndexOutOfBo...
[ "public", "static", "String", "frontstring", "(", "final", "String", "str", ",", "final", "int", "index", ")", "{", "assertStringNotNull", "(", "str", ")", ";", "if", "(", "str", ".", "length", "(", ")", "<", "index", ")", "{", "String", "msg", "=", ...
Extract front sub-string by index. <pre> rearstring("flute", 2) returns "fl" </pre> @param str The target string. (NotNull) @param index The index from rear. @return The rear string. (NotNull)
[ "Extract", "front", "sub", "-", "string", "by", "index", ".", "<pre", ">", "rearstring", "(", "flute", "2", ")", "returns", "fl", "<", "/", "pre", ">" ]
train
https://github.com/lastaflute/lasta-di/blob/c4e123610c53a04cc836c5e456660e32d613447b/src/main/java/org/lastaflute/di/util/LdiSrl.java#L587-L595
alkacon/opencms-core
src/org/opencms/configuration/CmsParameterConfiguration.java
CmsParameterConfiguration.appendToXml
public Element appendToXml(Element parentNode, List<String> parametersToIgnore) { """ Serializes this parameter configuration for the OpenCms XML configuration.<p> For each parameter, a XML node like this<br> <code> &lt;param name="theName"&gt;theValue&lt;/param&gt; </code><br> is generated and appended to ...
java
public Element appendToXml(Element parentNode, List<String> parametersToIgnore) { for (Map.Entry<String, Serializable> entry : m_configurationObjects.entrySet()) { String name = entry.getKey(); // check if the parameter should be ignored if ((parametersToIgnore == null)...
[ "public", "Element", "appendToXml", "(", "Element", "parentNode", ",", "List", "<", "String", ">", "parametersToIgnore", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Serializable", ">", "entry", ":", "m_configurationObjects", ".", "entrySet"...
Serializes this parameter configuration for the OpenCms XML configuration.<p> For each parameter, a XML node like this<br> <code> &lt;param name="theName"&gt;theValue&lt;/param&gt; </code><br> is generated and appended to the provided parent node.<p> @param parentNode the parent node where the parameter nodes are app...
[ "Serializes", "this", "parameter", "configuration", "for", "the", "OpenCms", "XML", "configuration", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsParameterConfiguration.java#L427-L459
OpenLiberty/open-liberty
dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsCreator.java
StatsCreator.addSubStatsToParent
public static void addSubStatsToParent(SPIStats parentStats, SPIStats subStats) { """ This method adds one Stats object as a subStats of another Stats object @param parentStats This Stats is the parent @param subStats This Stats is the child """ StatsImpl p = (StatsImpl) parentStats; StatsI...
java
public static void addSubStatsToParent(SPIStats parentStats, SPIStats subStats) { StatsImpl p = (StatsImpl) parentStats; StatsImpl s = (StatsImpl) subStats; p.add(s); }
[ "public", "static", "void", "addSubStatsToParent", "(", "SPIStats", "parentStats", ",", "SPIStats", "subStats", ")", "{", "StatsImpl", "p", "=", "(", "StatsImpl", ")", "parentStats", ";", "StatsImpl", "s", "=", "(", "StatsImpl", ")", "subStats", ";", "p", "....
This method adds one Stats object as a subStats of another Stats object @param parentStats This Stats is the parent @param subStats This Stats is the child
[ "This", "method", "adds", "one", "Stats", "object", "as", "a", "subStats", "of", "another", "Stats", "object" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsCreator.java#L135-L139
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuGraphGetNodes
public static int cuGraphGetNodes(CUgraph hGraph, CUgraphNode nodes[], long numNodes[]) { """ Returns a graph's nodes.<br> <br> Returns a list of \p hGraph's nodes. \p nodes may be NULL, in which case this function will return the number of nodes in \p numNodes. Otherwise, \p numNodes entries will be filled in...
java
public static int cuGraphGetNodes(CUgraph hGraph, CUgraphNode nodes[], long numNodes[]) { return checkResult(cuGraphGetNodesNative(hGraph, nodes, numNodes)); }
[ "public", "static", "int", "cuGraphGetNodes", "(", "CUgraph", "hGraph", ",", "CUgraphNode", "nodes", "[", "]", ",", "long", "numNodes", "[", "]", ")", "{", "return", "checkResult", "(", "cuGraphGetNodesNative", "(", "hGraph", ",", "nodes", ",", "numNodes", "...
Returns a graph's nodes.<br> <br> Returns a list of \p hGraph's nodes. \p nodes may be NULL, in which case this function will return the number of nodes in \p numNodes. Otherwise, \p numNodes entries will be filled in. If \p numNodes is higher than the actual number of nodes, the remaining entries in \p nodes will be s...
[ "Returns", "a", "graph", "s", "nodes", ".", "<br", ">", "<br", ">", "Returns", "a", "list", "of", "\\", "p", "hGraph", "s", "nodes", ".", "\\", "p", "nodes", "may", "be", "NULL", "in", "which", "case", "this", "function", "will", "return", "the", "...
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12676-L12679
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerValue.java
DerValue.getBigInteger
public BigInteger getBigInteger() throws IOException { """ Returns an ASN.1 INTEGER value as a BigInteger. @return the integer held in this DER value as a BigInteger. """ if (tag != tag_Integer) throw new IOException("DerValue.getBigInteger, not an int " + tag); return buffer.get...
java
public BigInteger getBigInteger() throws IOException { if (tag != tag_Integer) throw new IOException("DerValue.getBigInteger, not an int " + tag); return buffer.getBigInteger(data.available(), false); }
[ "public", "BigInteger", "getBigInteger", "(", ")", "throws", "IOException", "{", "if", "(", "tag", "!=", "tag_Integer", ")", "throw", "new", "IOException", "(", "\"DerValue.getBigInteger, not an int \"", "+", "tag", ")", ";", "return", "buffer", ".", "getBigIntege...
Returns an ASN.1 INTEGER value as a BigInteger. @return the integer held in this DER value as a BigInteger.
[ "Returns", "an", "ASN", ".", "1", "INTEGER", "value", "as", "a", "BigInteger", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/DerValue.java#L522-L526
mockito/mockito
src/main/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilter.java
StackTraceFilter.findSourceFile
public String findSourceFile(StackTraceElement[] target, String defaultValue) { """ Finds the source file of the target stack trace. Returns the default value if source file cannot be found. """ for (StackTraceElement e : target) { if (CLEANER.isIn(e)) { return e.getFileNam...
java
public String findSourceFile(StackTraceElement[] target, String defaultValue) { for (StackTraceElement e : target) { if (CLEANER.isIn(e)) { return e.getFileName(); } } return defaultValue; }
[ "public", "String", "findSourceFile", "(", "StackTraceElement", "[", "]", "target", ",", "String", "defaultValue", ")", "{", "for", "(", "StackTraceElement", "e", ":", "target", ")", "{", "if", "(", "CLEANER", ".", "isIn", "(", "e", ")", ")", "{", "retur...
Finds the source file of the target stack trace. Returns the default value if source file cannot be found.
[ "Finds", "the", "source", "file", "of", "the", "target", "stack", "trace", ".", "Returns", "the", "default", "value", "if", "source", "file", "cannot", "be", "found", "." ]
train
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilter.java#L125-L132
beangle/beangle3
commons/model/src/main/java/org/beangle/commons/entity/metadata/impl/DefaultModelMeta.java
DefaultModelMeta.newInstance
public <T extends Entity<ID>, ID extends Serializable> T newInstance(final Class<T> clazz, final ID id) { """ <p> newInstance. </p> @param clazz a {@link java.lang.Class} object. @param id a {@link java.io.Serializable} object. @param <T> a T object. @return a T object. """ EntityType type = getEnt...
java
public <T extends Entity<ID>, ID extends Serializable> T newInstance(final Class<T> clazz, final ID id) { EntityType type = getEntityType(clazz); @SuppressWarnings("unchecked") T entity = (T) type.newInstance(); try { PropertyUtils.setProperty(entity, type.getIdName(), id); } catch (Exception ...
[ "public", "<", "T", "extends", "Entity", "<", "ID", ">", ",", "ID", "extends", "Serializable", ">", "T", "newInstance", "(", "final", "Class", "<", "T", ">", "clazz", ",", "final", "ID", "id", ")", "{", "EntityType", "type", "=", "getEntityType", "(", ...
<p> newInstance. </p> @param clazz a {@link java.lang.Class} object. @param id a {@link java.io.Serializable} object. @param <T> a T object. @return a T object.
[ "<p", ">", "newInstance", ".", "<", "/", "p", ">" ]
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/model/src/main/java/org/beangle/commons/entity/metadata/impl/DefaultModelMeta.java#L70-L80
eserating/siren4j
src/main/java/com/google/code/siren4j/util/ComponentUtils.java
ComponentUtils.getSubEntityByRel
public static Entity getSubEntityByRel(Entity entity, String... rel) { """ Retrieve a sub entity by its relationship. @param entity cannot be <code>null</code>. @param rel cannot be <code>null</code> or empty. @return the located entity or <code>null</code> if not found. """ if(entity == null) { ...
java
public static Entity getSubEntityByRel(Entity entity, String... rel) { if(entity == null) { throw new IllegalArgumentException("entity cannot be null."); } if(ArrayUtils.isEmpty(rel)) { throw new IllegalArgumentException("rel cannot be null or empty"); } ...
[ "public", "static", "Entity", "getSubEntityByRel", "(", "Entity", "entity", ",", "String", "...", "rel", ")", "{", "if", "(", "entity", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"entity cannot be null.\"", ")", ";", "}", "if", ...
Retrieve a sub entity by its relationship. @param entity cannot be <code>null</code>. @param rel cannot be <code>null</code> or empty. @return the located entity or <code>null</code> if not found.
[ "Retrieve", "a", "sub", "entity", "by", "its", "relationship", "." ]
train
https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/util/ComponentUtils.java#L50-L68
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java
TimePickerDialog.setTimeInterval
public void setTimeInterval(@IntRange(from=1, to=24) int hourInterval, @IntRange(from=1, to=60) int minuteInterval, @IntRange(from=1, to=60) int secondInterval) { """ Set the interval for selectable times in the TimePickerDialog This is a convenience...
java
public void setTimeInterval(@IntRange(from=1, to=24) int hourInterval, @IntRange(from=1, to=60) int minuteInterval, @IntRange(from=1, to=60) int secondInterval) { List<Timepoint> timepoints = new ArrayList<>(); int hour = 0; while ...
[ "public", "void", "setTimeInterval", "(", "@", "IntRange", "(", "from", "=", "1", ",", "to", "=", "24", ")", "int", "hourInterval", ",", "@", "IntRange", "(", "from", "=", "1", ",", "to", "=", "60", ")", "int", "minuteInterval", ",", "@", "IntRange",...
Set the interval for selectable times in the TimePickerDialog This is a convenience wrapper around {@link TimePickerDialog#setSelectableTimes(Timepoint[])} The interval for all three time components can be set independently If you are not using the seconds / minutes picker, set the respective item to 60 for better perf...
[ "Set", "the", "interval", "for", "selectable", "times", "in", "the", "TimePickerDialog", "This", "is", "a", "convenience", "wrapper", "around", "{" ]
train
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java#L428-L447
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java
URLTemplatesFactory.initServletContext
public static void initServletContext( ServletContext servletContext, URLTemplatesFactory templatesFactory ) { """ Adds a given URLTemplatesFactory instance as an attribute on the ServletContext. @param servletContext the current ServletContext. @param templatesFactory the URLTemplatesFactory instance to add a...
java
public static void initServletContext( ServletContext servletContext, URLTemplatesFactory templatesFactory ) { assert servletContext != null : "The ServletContext cannot be null."; if ( servletContext == null ) { throw new IllegalArgumentException( "The ServletContext cannot be ...
[ "public", "static", "void", "initServletContext", "(", "ServletContext", "servletContext", ",", "URLTemplatesFactory", "templatesFactory", ")", "{", "assert", "servletContext", "!=", "null", ":", "\"The ServletContext cannot be null.\"", ";", "if", "(", "servletContext", ...
Adds a given URLTemplatesFactory instance as an attribute on the ServletContext. @param servletContext the current ServletContext. @param templatesFactory the URLTemplatesFactory instance to add as an attribute of the context
[ "Adds", "a", "given", "URLTemplatesFactory", "instance", "as", "an", "attribute", "on", "the", "ServletContext", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplatesFactory.java#L82-L92
LevelFourAB/commons
commons-types/src/main/java/se/l4/commons/types/internal/ExtendedTypeBuilderImpl.java
ExtendedTypeBuilderImpl.createFunction
@SuppressWarnings( { """ Create the actual function that creates instances. @param contextType the context type being used @param typeToExtend the type being extended @param invokers the resolved invokers """ "unchecked", "rawtypes" }) private static <CT, I> Function<CT, I> createFunction( Class<CT>...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) private static <CT, I> Function<CT, I> createFunction( Class<CT> contextType, Class<I> typeToExtend, Map<Method, MethodInvocationHandler<CT>> invokers ) { try { DynamicType.Builder builder = new ByteBuddy() .subclass(typeToExtend); // Add the contex...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "private", "static", "<", "CT", ",", "I", ">", "Function", "<", "CT", ",", "I", ">", "createFunction", "(", "Class", "<", "CT", ">", "contextType", ",", "Class", "<", "I...
Create the actual function that creates instances. @param contextType the context type being used @param typeToExtend the type being extended @param invokers the resolved invokers
[ "Create", "the", "actual", "function", "that", "creates", "instances", "." ]
train
https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-types/src/main/java/se/l4/commons/types/internal/ExtendedTypeBuilderImpl.java#L146-L191
alkacon/opencms-core
src/org/opencms/site/CmsSiteManagerImpl.java
CmsSiteManagerImpl.addAliasToConfigSite
public void addAliasToConfigSite(String alias, String redirect, String offset) { """ Adds an alias to the currently configured site. @param alias the URL of the alias server @param redirect <code>true</code> to always redirect to main URL @param offset the optional time offset for this alias """ ...
java
public void addAliasToConfigSite(String alias, String redirect, String offset) { long timeOffset = 0; try { timeOffset = Long.parseLong(offset); } catch (Throwable e) { // ignore } CmsSiteMatcher siteMatcher = new CmsSiteMatcher(alias, timeOffset); ...
[ "public", "void", "addAliasToConfigSite", "(", "String", "alias", ",", "String", "redirect", ",", "String", "offset", ")", "{", "long", "timeOffset", "=", "0", ";", "try", "{", "timeOffset", "=", "Long", ".", "parseLong", "(", "offset", ")", ";", "}", "c...
Adds an alias to the currently configured site. @param alias the URL of the alias server @param redirect <code>true</code> to always redirect to main URL @param offset the optional time offset for this alias
[ "Adds", "an", "alias", "to", "the", "currently", "configured", "site", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L207-L219
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java
FeaturesImpl.updatePhraseListAsync
public Observable<OperationStatus> updatePhraseListAsync(UUID appId, String versionId, int phraselistId, UpdatePhraseListOptionalParameter updatePhraseListOptionalParameter) { """ Updates the phrases, the state and the name of the phraselist feature. @param appId The application ID. @param versionId The versio...
java
public Observable<OperationStatus> updatePhraseListAsync(UUID appId, String versionId, int phraselistId, UpdatePhraseListOptionalParameter updatePhraseListOptionalParameter) { return updatePhraseListWithServiceResponseAsync(appId, versionId, phraselistId, updatePhraseListOptionalParameter).map(new Func1<Service...
[ "public", "Observable", "<", "OperationStatus", ">", "updatePhraseListAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "int", "phraselistId", ",", "UpdatePhraseListOptionalParameter", "updatePhraseListOptionalParameter", ")", "{", "return", "updatePhraseListWi...
Updates the phrases, the state and the name of the phraselist feature. @param appId The application ID. @param versionId The version ID. @param phraselistId The ID of the feature to be updated. @param updatePhraseListOptionalParameter the object representing the optional parameters to be set before calling this API @t...
[ "Updates", "the", "phrases", "the", "state", "and", "the", "name", "of", "the", "phraselist", "feature", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java#L675-L682
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.payment_thod_GET
public ArrayList<Long> payment_thod_GET(String paymentType, OvhStatus status) throws IOException { """ Retrieve payment method ID list REST: GET /me/payment/method @param status [required] Status @param paymentType [required] Payment method type API beta """ String qPath = "/me/payment/method"; Str...
java
public ArrayList<Long> payment_thod_GET(String paymentType, OvhStatus status) throws IOException { String qPath = "/me/payment/method"; StringBuilder sb = path(qPath); query(sb, "paymentType", paymentType); query(sb, "status", status); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(...
[ "public", "ArrayList", "<", "Long", ">", "payment_thod_GET", "(", "String", "paymentType", ",", "OvhStatus", "status", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/me/payment/method\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ")"...
Retrieve payment method ID list REST: GET /me/payment/method @param status [required] Status @param paymentType [required] Payment method type API beta
[ "Retrieve", "payment", "method", "ID", "list" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1011-L1018
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java
Log.logWarn
public static void logWarn(String message, Throwable t) { """ Warning logging with cause. @param message message @param t cause """ logWarn(message + SEP + getMessage(t)); }
java
public static void logWarn(String message, Throwable t) { logWarn(message + SEP + getMessage(t)); }
[ "public", "static", "void", "logWarn", "(", "String", "message", ",", "Throwable", "t", ")", "{", "logWarn", "(", "message", "+", "SEP", "+", "getMessage", "(", "t", ")", ")", ";", "}" ]
Warning logging with cause. @param message message @param t cause
[ "Warning", "logging", "with", "cause", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/Log.java#L119-L121
attribyte/acp
src/main/java/org/attribyte/sql/pool/TypesafeConfig.java
TypesafeConfig.segmentFromConfig
static final ConnectionPoolSegment.Initializer segmentFromConfig(String poolName, String segmentName, final Config config, ...
java
static final ConnectionPoolSegment.Initializer segmentFromConfig(String poolName, String segmentName, final Config config, ...
[ "static", "final", "ConnectionPoolSegment", ".", "Initializer", "segmentFromConfig", "(", "String", "poolName", ",", "String", "segmentName", ",", "final", "Config", "config", ",", "ConnectionPoolSegment", ".", "Initializer", "initializer", ",", "Map", "<", "String", ...
Sets initializer properties from properties. @param poolName The pool name. @param segmentName The segment name. @param config The config. @param initializer An initializer. @param connectionMap A map of connection vs. name. @return The segment initializer. @throws InitializationException if configuration is invalid.
[ "Sets", "initializer", "properties", "from", "properties", "." ]
train
https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/TypesafeConfig.java#L244-L302
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/utils/FastDateFormat.java
FastDateFormat.parseObject
public Object parseObject(String source, ParsePosition pos) { """ <p>Parsing is not supported.</p> @param source the string to parse @param pos the parsing position @return <code>null</code> as not supported """ pos.setIndex(0); pos.setErrorIndex(0); return null; }
java
public Object parseObject(String source, ParsePosition pos) { pos.setIndex(0); pos.setErrorIndex(0); return null; }
[ "public", "Object", "parseObject", "(", "String", "source", ",", "ParsePosition", "pos", ")", "{", "pos", ".", "setIndex", "(", "0", ")", ";", "pos", ".", "setErrorIndex", "(", "0", ")", ";", "return", "null", ";", "}" ]
<p>Parsing is not supported.</p> @param source the string to parse @param pos the parsing position @return <code>null</code> as not supported
[ "<p", ">", "Parsing", "is", "not", "supported", ".", "<", "/", "p", ">" ]
train
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/FastDateFormat.java#L905-L909
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/OutputProperties.java
OutputProperties.setQNameProperties
public void setQNameProperties(String key, Vector v) { """ Set an output property with a QName list value. The QNames will be turned into strings with the namespace in curly brackets. @param key the key to be placed into the property list. @param v non-null list of QNames corresponding to <tt>key</tt>. @see...
java
public void setQNameProperties(String key, Vector v) { int s = v.size(); // Just an initial guess at reasonable tuning parameters FastStringBuffer fsb = new FastStringBuffer(9,9); for (int i = 0; i < s; i++) { QName qname = (QName) v.elementAt(i); fsb.append(qname.toNamespacedStrin...
[ "public", "void", "setQNameProperties", "(", "String", "key", ",", "Vector", "v", ")", "{", "int", "s", "=", "v", ".", "size", "(", ")", ";", "// Just an initial guess at reasonable tuning parameters", "FastStringBuffer", "fsb", "=", "new", "FastStringBuffer", "("...
Set an output property with a QName list value. The QNames will be turned into strings with the namespace in curly brackets. @param key the key to be placed into the property list. @param v non-null list of QNames corresponding to <tt>key</tt>. @see javax.xml.transform.OutputKeys
[ "Set", "an", "output", "property", "with", "a", "QName", "list", "value", ".", "The", "QNames", "will", "be", "turned", "into", "strings", "with", "the", "namespace", "in", "curly", "brackets", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/OutputProperties.java#L417-L436
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java
DateUtil.isSameDay
public static boolean isSameDay(Calendar cal1, Calendar cal2) { """ 比较两个日期是否为同一天 @param cal1 日期1 @param cal2 日期2 @return 是否为同一天 @since 4.1.13 """ if (cal1 == null || cal2 == null) { throw new IllegalArgumentException("The date must not be null"); } return cal1.get(Calendar.DAY_OF_YEAR) == ca...
java
public static boolean isSameDay(Calendar cal1, Calendar cal2) { if (cal1 == null || cal2 == null) { throw new IllegalArgumentException("The date must not be null"); } return cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR) && // cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && // ...
[ "public", "static", "boolean", "isSameDay", "(", "Calendar", "cal1", ",", "Calendar", "cal2", ")", "{", "if", "(", "cal1", "==", "null", "||", "cal2", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The date must not be null\"", ")"...
比较两个日期是否为同一天 @param cal1 日期1 @param cal2 日期2 @return 是否为同一天 @since 4.1.13
[ "比较两个日期是否为同一天" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1409-L1416
wonderpush/wonderpush-android-sdk
sdk/src/main/java/com/wonderpush/sdk/WonderPush.java
WonderPush.showPotentialNotification
static boolean showPotentialNotification(final Activity activity, Intent intent) { """ @param activity The current {@link Activity}. @param intent The intent the activity received. @return <code>true</code> if handled, <code>false</code> otherwise. """ try { return NotificationManager...
java
static boolean showPotentialNotification(final Activity activity, Intent intent) { try { return NotificationManager.showPotentialNotification(activity, intent); } catch (Exception e) { Log.e(WonderPush.TAG, "Unexpected error while showing potential notification", e); } ...
[ "static", "boolean", "showPotentialNotification", "(", "final", "Activity", "activity", ",", "Intent", "intent", ")", "{", "try", "{", "return", "NotificationManager", ".", "showPotentialNotification", "(", "activity", ",", "intent", ")", ";", "}", "catch", "(", ...
@param activity The current {@link Activity}. @param intent The intent the activity received. @return <code>true</code> if handled, <code>false</code> otherwise.
[ "@param", "activity", "The", "current", "{", "@link", "Activity", "}", ".", "@param", "intent", "The", "intent", "the", "activity", "received", "." ]
train
https://github.com/wonderpush/wonderpush-android-sdk/blob/ba0a1568f705cdd6206639bfab1e5cf529084b59/sdk/src/main/java/com/wonderpush/sdk/WonderPush.java#L430-L437
mockito/mockito
src/main/java/org/mockito/internal/configuration/injection/MockInjection.java
MockInjection.onFields
public static OngoingMockInjection onFields(Set<Field> fields, Object ofInstance) { """ Create a new configuration setup for fields @param fields Fields needing mock injection @param ofInstance Instance owning the <code>field</code> @return New configuration builder """ return new OngoingMockInj...
java
public static OngoingMockInjection onFields(Set<Field> fields, Object ofInstance) { return new OngoingMockInjection(fields, ofInstance); }
[ "public", "static", "OngoingMockInjection", "onFields", "(", "Set", "<", "Field", ">", "fields", ",", "Object", "ofInstance", ")", "{", "return", "new", "OngoingMockInjection", "(", "fields", ",", "ofInstance", ")", ";", "}" ]
Create a new configuration setup for fields @param fields Fields needing mock injection @param ofInstance Instance owning the <code>field</code> @return New configuration builder
[ "Create", "a", "new", "configuration", "setup", "for", "fields" ]
train
https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/configuration/injection/MockInjection.java#L47-L49
riversun/string-grabber
src/main/java/org/riversun/string_grabber/StringGrabber.java
StringGrabber.replaceCaseTo
private StringGrabber replaceCaseTo(int startPos, int endPos, ECase toCase) { """ convert string in the specified position(range) to specified case @param sb @param startPos @param endPos """ StringBuilder sbRange = new StringBuilder(); try { for (int i = startPos; i < endPos; i++) { sbRa...
java
private StringGrabber replaceCaseTo(int startPos, int endPos, ECase toCase) { StringBuilder sbRange = new StringBuilder(); try { for (int i = startPos; i < endPos; i++) { sbRange.append(String.valueOf(sb.charAt(i))); } } catch (Exception e) { e.printStackTrace(); } final String caseConvertedRa...
[ "private", "StringGrabber", "replaceCaseTo", "(", "int", "startPos", ",", "int", "endPos", ",", "ECase", "toCase", ")", "{", "StringBuilder", "sbRange", "=", "new", "StringBuilder", "(", ")", ";", "try", "{", "for", "(", "int", "i", "=", "startPos", ";", ...
convert string in the specified position(range) to specified case @param sb @param startPos @param endPos
[ "convert", "string", "in", "the", "specified", "position", "(", "range", ")", "to", "specified", "case" ]
train
https://github.com/riversun/string-grabber/blob/b5aadc21fe15f50d35392188dec6ab81dcf8d464/src/main/java/org/riversun/string_grabber/StringGrabber.java#L327-L352
sai-pullabhotla/catatumbo
src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java
EntityIntrospector.processIdentifierField
private void processIdentifierField(Field field) { """ Processes the identifier field and builds the identifier metadata. @param field the identifier field """ Identifier identifier = field.getAnnotation(Identifier.class); boolean autoGenerated = identifier.autoGenerated(); IdentifierMetadata i...
java
private void processIdentifierField(Field field) { Identifier identifier = field.getAnnotation(Identifier.class); boolean autoGenerated = identifier.autoGenerated(); IdentifierMetadata identifierMetadata = new IdentifierMetadata(field, autoGenerated); entityMetadata.setIdentifierMetadata(identifierMetad...
[ "private", "void", "processIdentifierField", "(", "Field", "field", ")", "{", "Identifier", "identifier", "=", "field", ".", "getAnnotation", "(", "Identifier", ".", "class", ")", ";", "boolean", "autoGenerated", "=", "identifier", ".", "autoGenerated", "(", ")"...
Processes the identifier field and builds the identifier metadata. @param field the identifier field
[ "Processes", "the", "identifier", "field", "and", "builds", "the", "identifier", "metadata", "." ]
train
https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityIntrospector.java#L259-L264
RestComm/media-core
rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java
MediaChannel.bindRtcp
public void bindRtcp(boolean isLocal, int port) throws IOException, IllegalStateException { """ Binds the RTCP component to a suitable address and port. @param isLocal Whether the binding address must be in local range. @param port A specific port to bind to @throws IOException When the RTCP component cann...
java
public void bindRtcp(boolean isLocal, int port) throws IOException, IllegalStateException { if(this.ice) { throw new IllegalStateException("Cannot bind when ICE is enabled"); } this.rtcpChannel.bind(isLocal, port); this.rtcpMux = (port == this.rtpChannel.getLocalPort()); }
[ "public", "void", "bindRtcp", "(", "boolean", "isLocal", ",", "int", "port", ")", "throws", "IOException", ",", "IllegalStateException", "{", "if", "(", "this", ".", "ice", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Cannot bind when ICE is enabled\...
Binds the RTCP component to a suitable address and port. @param isLocal Whether the binding address must be in local range. @param port A specific port to bind to @throws IOException When the RTCP component cannot be bound to an address. @throws IllegalStateException The binding operation is not allowed if ICE is acti...
[ "Binds", "the", "RTCP", "component", "to", "a", "suitable", "address", "and", "port", "." ]
train
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L522-L528
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.headerFragment
public T headerFragment(Object model, Marshaller marshaller) { """ Expect this message header data as model object which is marshalled to a character sequence using the default object to xml mapper before validation is performed. @param model @param marshaller @return """ StringResult result = new ...
java
public T headerFragment(Object model, Marshaller marshaller) { StringResult result = new StringResult(); try { marshaller.marshal(model, result); } catch (XmlMappingException e) { throw new CitrusRuntimeException("Failed to marshal object graph for message header data", ...
[ "public", "T", "headerFragment", "(", "Object", "model", ",", "Marshaller", "marshaller", ")", "{", "StringResult", "result", "=", "new", "StringResult", "(", ")", ";", "try", "{", "marshaller", ".", "marshal", "(", "model", ",", "result", ")", ";", "}", ...
Expect this message header data as model object which is marshalled to a character sequence using the default object to xml mapper before validation is performed. @param model @param marshaller @return
[ "Expect", "this", "message", "header", "data", "as", "model", "object", "which", "is", "marshalled", "to", "a", "character", "sequence", "using", "the", "default", "object", "to", "xml", "mapper", "before", "validation", "is", "performed", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L385-L397
igniterealtime/Smack
smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java
OmemoService.hasSession
private boolean hasSession(OmemoDevice userDevice, OmemoDevice contactsDevice) { """ Return true, if the OmemoManager of userDevice has a session with the contactsDevice. @param userDevice our OmemoDevice. @param contactsDevice OmemoDevice of the contact. @return true if userDevice has session with contactsDe...
java
private boolean hasSession(OmemoDevice userDevice, OmemoDevice contactsDevice) { return getOmemoStoreBackend().loadRawSession(userDevice, contactsDevice) != null; }
[ "private", "boolean", "hasSession", "(", "OmemoDevice", "userDevice", ",", "OmemoDevice", "contactsDevice", ")", "{", "return", "getOmemoStoreBackend", "(", ")", ".", "loadRawSession", "(", "userDevice", ",", "contactsDevice", ")", "!=", "null", ";", "}" ]
Return true, if the OmemoManager of userDevice has a session with the contactsDevice. @param userDevice our OmemoDevice. @param contactsDevice OmemoDevice of the contact. @return true if userDevice has session with contactsDevice.
[ "Return", "true", "if", "the", "OmemoManager", "of", "userDevice", "has", "a", "session", "with", "the", "contactsDevice", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java#L868-L870
azkaban/azkaban
azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java
InMemoryMetricEmitter.cleanUsingTime
private void cleanUsingTime(final String metricName, final Date firstAllowedDate) { """ Remove snapshots to maintain reporting interval @param metricName Name of the metric @param firstAllowedDate End date of the interval """ if (this.historyListMapping.containsKey(metricName) && this.historyLi...
java
private void cleanUsingTime(final String metricName, final Date firstAllowedDate) { if (this.historyListMapping.containsKey(metricName) && this.historyListMapping.get(metricName) != null) { synchronized (this.historyListMapping.get(metricName)) { InMemoryHistoryNode firstNode = this.historyLi...
[ "private", "void", "cleanUsingTime", "(", "final", "String", "metricName", ",", "final", "Date", "firstAllowedDate", ")", "{", "if", "(", "this", ".", "historyListMapping", ".", "containsKey", "(", "metricName", ")", "&&", "this", ".", "historyListMapping", ".",...
Remove snapshots to maintain reporting interval @param metricName Name of the metric @param firstAllowedDate End date of the interval
[ "Remove", "snapshots", "to", "maintain", "reporting", "interval" ]
train
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/metric/inmemoryemitter/InMemoryMetricEmitter.java#L207-L231
Netflix/zuul
zuul-core/src/main/java/com/netflix/zuul/scriptManager/FilterInfo.java
FilterInfo.buildFilterID
public static String buildFilterID(String application_name, FilterType filter_type, String filter_name) { """ builds the unique filter_id key @param application_name @param filter_type @param filter_name @return key is application_name:filter_name:filter_type """ return application_name + ":" + fil...
java
public static String buildFilterID(String application_name, FilterType filter_type, String filter_name) { return application_name + ":" + filter_name + ":" + filter_type.toString(); }
[ "public", "static", "String", "buildFilterID", "(", "String", "application_name", ",", "FilterType", "filter_type", ",", "String", "filter_name", ")", "{", "return", "application_name", "+", "\":\"", "+", "filter_name", "+", "\":\"", "+", "filter_type", ".", "toSt...
builds the unique filter_id key @param application_name @param filter_type @param filter_name @return key is application_name:filter_name:filter_type
[ "builds", "the", "unique", "filter_id", "key" ]
train
https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/scriptManager/FilterInfo.java#L207-L209
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeNameValuePair
public void writeNameValuePair(String name, String value) throws IOException { """ Write a string attribute. @param name attribute name @param value attribute value """ internalWriteNameValuePair(name, escapeString(value)); }
java
public void writeNameValuePair(String name, String value) throws IOException { internalWriteNameValuePair(name, escapeString(value)); }
[ "public", "void", "writeNameValuePair", "(", "String", "name", ",", "String", "value", ")", "throws", "IOException", "{", "internalWriteNameValuePair", "(", "name", ",", "escapeString", "(", "value", ")", ")", ";", "}" ]
Write a string attribute. @param name attribute name @param value attribute value
[ "Write", "a", "string", "attribute", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L140-L143
HotelsDotCom/corc
corc-core/src/main/java/com/hotels/corc/mapred/CorcInputFormat.java
CorcInputFormat.setSearchArgumentKryo
public static void setSearchArgumentKryo(Configuration conf, String searchArgumentKryo) { """ Sets the SearchArgument predicate pushdown in the configuration """ if (searchArgumentKryo != null) { conf.set(SEARCH_ARGUMENT, searchArgumentKryo); } }
java
public static void setSearchArgumentKryo(Configuration conf, String searchArgumentKryo) { if (searchArgumentKryo != null) { conf.set(SEARCH_ARGUMENT, searchArgumentKryo); } }
[ "public", "static", "void", "setSearchArgumentKryo", "(", "Configuration", "conf", ",", "String", "searchArgumentKryo", ")", "{", "if", "(", "searchArgumentKryo", "!=", "null", ")", "{", "conf", ".", "set", "(", "SEARCH_ARGUMENT", ",", "searchArgumentKryo", ")", ...
Sets the SearchArgument predicate pushdown in the configuration
[ "Sets", "the", "SearchArgument", "predicate", "pushdown", "in", "the", "configuration" ]
train
https://github.com/HotelsDotCom/corc/blob/37ecb5966315e4cf630a878ffcbada61c50bdcd3/corc-core/src/main/java/com/hotels/corc/mapred/CorcInputFormat.java#L152-L156
Jasig/uPortal
uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/ILFBuilder.java
ILFBuilder.mergeAllowed
private static boolean mergeAllowed(Element child, IAuthorizationPrincipal ap) throws AuthorizationException { """ Tests to see if channels to be merged from ILF can be rendered by the end user. If not then they are discarded from the merge. @param child @param person @return @throws Authorizati...
java
private static boolean mergeAllowed(Element child, IAuthorizationPrincipal ap) throws AuthorizationException { if (!child.getTagName().equals("channel")) return true; String channelPublishId = child.getAttribute("chanID"); return ap.canRender(channelPublishId); }
[ "private", "static", "boolean", "mergeAllowed", "(", "Element", "child", ",", "IAuthorizationPrincipal", "ap", ")", "throws", "AuthorizationException", "{", "if", "(", "!", "child", ".", "getTagName", "(", ")", ".", "equals", "(", "\"channel\"", ")", ")", "ret...
Tests to see if channels to be merged from ILF can be rendered by the end user. If not then they are discarded from the merge. @param child @param person @return @throws AuthorizationException @throws NumberFormatException
[ "Tests", "to", "see", "if", "channels", "to", "be", "merged", "from", "ILF", "can", "be", "rendered", "by", "the", "end", "user", ".", "If", "not", "then", "they", "are", "discarded", "from", "the", "merge", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/ILFBuilder.java#L169-L175
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/RowService.java
RowService.cleanExpired
protected ColumnFamily cleanExpired(ColumnFamily columnFamily, long timestamp) { """ Returns a {@link ColumnFamily} composed by the non expired {@link Cell}s of the specified {@link ColumnFamily}. @param columnFamily A {@link ColumnFamily}. @param timestamp The max allowed timestamp for the {@link Cell}s. ...
java
protected ColumnFamily cleanExpired(ColumnFamily columnFamily, long timestamp) { ColumnFamily cleanColumnFamily = ArrayBackedSortedColumns.factory.create(baseCfs.metadata); for (Cell cell : columnFamily) { if (cell.isLive(timestamp)) { cleanColumnFamily.addColumn(cell); ...
[ "protected", "ColumnFamily", "cleanExpired", "(", "ColumnFamily", "columnFamily", ",", "long", "timestamp", ")", "{", "ColumnFamily", "cleanColumnFamily", "=", "ArrayBackedSortedColumns", ".", "factory", ".", "create", "(", "baseCfs", ".", "metadata", ")", ";", "for...
Returns a {@link ColumnFamily} composed by the non expired {@link Cell}s of the specified {@link ColumnFamily}. @param columnFamily A {@link ColumnFamily}. @param timestamp The max allowed timestamp for the {@link Cell}s. @return A {@link ColumnFamily} composed by the non expired {@link Cell}s of the specified {@...
[ "Returns", "a", "{", "@link", "ColumnFamily", "}", "composed", "by", "the", "non", "expired", "{", "@link", "Cell", "}", "s", "of", "the", "specified", "{", "@link", "ColumnFamily", "}", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/RowService.java#L379-L387
Azure/azure-sdk-for-java
redis/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/redis/v2018_03_01/implementation/LinkedServersInner.java
LinkedServersInner.createAsync
public Observable<RedisLinkedServerWithPropertiesInner> createAsync(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParameters parameters) { """ Adds a linked server to the Redis cache (requires Premium SKU). @param resourceGroupName The name of the resource group. @param...
java
public Observable<RedisLinkedServerWithPropertiesInner> createAsync(String resourceGroupName, String name, String linkedServerName, RedisLinkedServerCreateParameters parameters) { return createWithServiceResponseAsync(resourceGroupName, name, linkedServerName, parameters).map(new Func1<ServiceResponse<RedisLink...
[ "public", "Observable", "<", "RedisLinkedServerWithPropertiesInner", ">", "createAsync", "(", "String", "resourceGroupName", ",", "String", "name", ",", "String", "linkedServerName", ",", "RedisLinkedServerCreateParameters", "parameters", ")", "{", "return", "createWithServ...
Adds a linked server to the Redis cache (requires Premium SKU). @param resourceGroupName The name of the resource group. @param name The name of the Redis cache. @param linkedServerName The name of the linked server that is being added to the Redis cache. @param parameters Parameters supplied to the Create Linked serv...
[ "Adds", "a", "linked", "server", "to", "the", "Redis", "cache", "(", "requires", "Premium", "SKU", ")", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/redis/v2018_03_01/implementation/LinkedServersInner.java#L132-L139
Wolfgang-Schuetzelhofer/jcypher
src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java
AbstractDomainQuery.WHERE
public BooleanOperation WHERE(IPredicateOperand1 value) { """ Start formulating a predicate expression. A predicate expression yields a boolean value. <br/>Takes an expression like 'person.stringAttribute("name")', yielding an attribute, <br/>e.g. WHERE(person.stringAttribute("name")).EQUALS(...) @param value ...
java
public BooleanOperation WHERE(IPredicateOperand1 value) { IPredicateOperand1 pVal = value; if (value instanceof DomainObjectMatch<?>) { DomainObjectMatch<?> delegate = APIAccess.getDelegate((DomainObjectMatch<?>) value); if (delegate != null) // generic model pVal = delegate; } PredicateExpression pe ...
[ "public", "BooleanOperation", "WHERE", "(", "IPredicateOperand1", "value", ")", "{", "IPredicateOperand1", "pVal", "=", "value", ";", "if", "(", "value", "instanceof", "DomainObjectMatch", "<", "?", ">", ")", "{", "DomainObjectMatch", "<", "?", ">", "delegate", ...
Start formulating a predicate expression. A predicate expression yields a boolean value. <br/>Takes an expression like 'person.stringAttribute("name")', yielding an attribute, <br/>e.g. WHERE(person.stringAttribute("name")).EQUALS(...) @param value the value(expression) to formulate the predicate expression upon. @retu...
[ "Start", "formulating", "a", "predicate", "expression", ".", "A", "predicate", "expression", "yields", "a", "boolean", "value", ".", "<br", "/", ">", "Takes", "an", "expression", "like", "person", ".", "stringAttribute", "(", "name", ")", "yielding", "an", "...
train
https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L216-L228
dmfs/xmlobjects
src/org/dmfs/xmlobjects/serializer/XmlObjectSerializer.java
XmlObjectSerializer.useNamespace
public void useNamespace(SerializerContext serializerContext, String namespace) { """ Inform the serializer that the given namespace will be used. This allows the serializer to bind a prefix early. @param namespace The namespace that will be used. """ if (namespace != null && namespace.length() > 0) { ...
java
public void useNamespace(SerializerContext serializerContext, String namespace) { if (namespace != null && namespace.length() > 0) { if (serializerContext.knownNamespaces == null) { serializerContext.knownNamespaces = new HashSet<String>(8); } serializerContext.knownNamespaces.add(namespace); } ...
[ "public", "void", "useNamespace", "(", "SerializerContext", "serializerContext", ",", "String", "namespace", ")", "{", "if", "(", "namespace", "!=", "null", "&&", "namespace", ".", "length", "(", ")", ">", "0", ")", "{", "if", "(", "serializerContext", ".", ...
Inform the serializer that the given namespace will be used. This allows the serializer to bind a prefix early. @param namespace The namespace that will be used.
[ "Inform", "the", "serializer", "that", "the", "given", "namespace", "will", "be", "used", ".", "This", "allows", "the", "serializer", "to", "bind", "a", "prefix", "early", "." ]
train
https://github.com/dmfs/xmlobjects/blob/b68ddd0ce994d804fc2ec6da1096bf0d883b37f9/src/org/dmfs/xmlobjects/serializer/XmlObjectSerializer.java#L245-L255
jbundle/jbundle
model/base/src/main/java/org/jbundle/model/util/DataConverters.java
DataConverters.convertObjectToDatatype
public static Object convertObjectToDatatype(Object objData, Class<?> classData, Object objDefault) throws Exception { """ Get this property from the map and convert it to the target class. @param properties The map object to get the property from. @param strKey The key of the property. @param classData...
java
public static Object convertObjectToDatatype(Object objData, Class<?> classData, Object objDefault) throws Exception { return DataConverters.convertObjectToDatatype(objData, classData, objDefault, -1); }
[ "public", "static", "Object", "convertObjectToDatatype", "(", "Object", "objData", ",", "Class", "<", "?", ">", "classData", ",", "Object", "objDefault", ")", "throws", "Exception", "{", "return", "DataConverters", ".", "convertObjectToDatatype", "(", "objData", "...
Get this property from the map and convert it to the target class. @param properties The map object to get the property from. @param strKey The key of the property. @param classData The target class to convert the property to. @param objDefault The default value. @return The data in the correct class.
[ "Get", "this", "property", "from", "the", "map", "and", "convert", "it", "to", "the", "target", "class", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/DataConverters.java#L148-L152
threerings/nenya
core/src/main/java/com/threerings/resource/ResourceManager.java
ResourceManager.loadImage
public static BufferedImage loadImage (InputStream iis, boolean useFastIO) throws IOException { """ Loads an image from the given input stream. Supports formats supported by {@link ImageIO} as well as {@link FastImageIO} based on the useFastIO param. """ if (iis == null) { return n...
java
public static BufferedImage loadImage (InputStream iis, boolean useFastIO) throws IOException { if (iis == null) { return null; } else if (useFastIO) { return FastImageIO.read(iis); } return ImageIO.read(iis); }
[ "public", "static", "BufferedImage", "loadImage", "(", "InputStream", "iis", ",", "boolean", "useFastIO", ")", "throws", "IOException", "{", "if", "(", "iis", "==", "null", ")", "{", "return", "null", ";", "}", "else", "if", "(", "useFastIO", ")", "{", "...
Loads an image from the given input stream. Supports formats supported by {@link ImageIO} as well as {@link FastImageIO} based on the useFastIO param.
[ "Loads", "an", "image", "from", "the", "given", "input", "stream", ".", "Supports", "formats", "supported", "by", "{" ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L895-L904
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.idleAwaitWork
private void idleAwaitWork(WorkQueue w, long currentCtl, long prevCtl) { """ If inactivating worker w has caused the pool to become quiescent, checks for pool termination, and, so long as this is not the only worker, waits for event for up to SHRINK_RATE nanosecs. On timeout, if ctl has not changed, terminates...
java
private void idleAwaitWork(WorkQueue w, long currentCtl, long prevCtl) { if (w.eventCount < 0 && !tryTerminate(false, false) && (int)prevCtl != 0 && !hasQueuedSubmissions() && ctl == currentCtl) { Thread wt = Thread.currentThread(); Thread.yield(); // yield before ...
[ "private", "void", "idleAwaitWork", "(", "WorkQueue", "w", ",", "long", "currentCtl", ",", "long", "prevCtl", ")", "{", "if", "(", "w", ".", "eventCount", "<", "0", "&&", "!", "tryTerminate", "(", "false", ",", "false", ")", "&&", "(", "int", ")", "p...
If inactivating worker w has caused the pool to become quiescent, checks for pool termination, and, so long as this is not the only worker, waits for event for up to SHRINK_RATE nanosecs. On timeout, if ctl has not changed, terminates the worker, which will in turn wake up another worker to possibly repeat this proces...
[ "If", "inactivating", "worker", "w", "has", "caused", "the", "pool", "to", "become", "quiescent", "checks", "for", "pool", "termination", "and", "so", "long", "as", "this", "is", "not", "the", "only", "worker", "waits", "for", "event", "for", "up", "to", ...
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L1615-L1639
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/MutableURI.java
MutableURI.setURI
public void setURI( String uriString, boolean encoded ) throws URISyntaxException { """ Set the value of the <code>MutableURI</code>. <p> This method can also be used to clear the <code>MutableURI</code>. </p> @param uriString the string to be parsed into a URI @param encoded Flag indicating whether the s...
java
public void setURI( String uriString, boolean encoded ) throws URISyntaxException { if ( uriString == null ) { setScheme( null ); setUserInfo( null ); setHost( null ); setPort( UNDEFINED_PORT ); setPath( null ); setQuery( null )...
[ "public", "void", "setURI", "(", "String", "uriString", ",", "boolean", "encoded", ")", "throws", "URISyntaxException", "{", "if", "(", "uriString", "==", "null", ")", "{", "setScheme", "(", "null", ")", ";", "setUserInfo", "(", "null", ")", ";", "setHost"...
Set the value of the <code>MutableURI</code>. <p> This method can also be used to clear the <code>MutableURI</code>. </p> @param uriString the string to be parsed into a URI @param encoded Flag indicating whether the string is already encoded.
[ "Set", "the", "value", "of", "the", "<code", ">", "MutableURI<", "/", "code", ">", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/MutableURI.java#L224-L253
baratine/baratine
framework/src/main/java/com/caucho/v5/ramp/store/StoreRamp.java
StoreRamp.put
public void put(String key, Object value, Result<Void> result) { """ /* public void findOne(String sql, Result<Object> result, Object ...args) { _root.findOneImpl(_path, sql, result, args); } public void find(ResultStream result, String sql, Object ...args) { System.out.println("RAND: " + result); _root....
java
public void put(String key, Object value, Result<Void> result) { _root.put(_path + key, value, result); }
[ "public", "void", "put", "(", "String", "key", ",", "Object", "value", ",", "Result", "<", "Void", ">", "result", ")", "{", "_root", ".", "put", "(", "_path", "+", "key", ",", "value", ",", "result", ")", ";", "}" ]
/* public void findOne(String sql, Result<Object> result, Object ...args) { _root.findOneImpl(_path, sql, result, args); } public void find(ResultStream result, String sql, Object ...args) { System.out.println("RAND: " + result); _root.findImpl(_path, sql, args, result); } public void findLocal(ResultStream result, S...
[ "/", "*", "public", "void", "findOne", "(", "String", "sql", "Result<Object", ">", "result", "Object", "...", "args", ")", "{", "_root", ".", "findOneImpl", "(", "_path", "sql", "result", "args", ")", ";", "}" ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/ramp/store/StoreRamp.java#L87-L90
code4everything/util
src/main/java/com/zhazhapan/util/Utils.java
Utils.loadJsonToBean
public static <T> T loadJsonToBean(String jsonPath, Class<T> clazz) throws IOException { """ 加载JSON配置文件,使用系统默认编码 @param jsonPath JSON文件路径 @param clazz 类 @param <T> 类型值 @return Bean @throws IOException 异常 @since 1.0.8 """ return loadJsonToBean(jsonPath, ValueConsts.NULL_STRING, clazz); }
java
public static <T> T loadJsonToBean(String jsonPath, Class<T> clazz) throws IOException { return loadJsonToBean(jsonPath, ValueConsts.NULL_STRING, clazz); }
[ "public", "static", "<", "T", ">", "T", "loadJsonToBean", "(", "String", "jsonPath", ",", "Class", "<", "T", ">", "clazz", ")", "throws", "IOException", "{", "return", "loadJsonToBean", "(", "jsonPath", ",", "ValueConsts", ".", "NULL_STRING", ",", "clazz", ...
加载JSON配置文件,使用系统默认编码 @param jsonPath JSON文件路径 @param clazz 类 @param <T> 类型值 @return Bean @throws IOException 异常 @since 1.0.8
[ "加载JSON配置文件,使用系统默认编码" ]
train
https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Utils.java#L108-L110
msgpack/msgpack-java
msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java
MessageUnpacker.unpackBigInteger
public BigInteger unpackBigInteger() throws IOException { """ Reads a BigInteger. @return the read value @throws MessageTypeException when value is not MessagePack Integer type @throws IOException when underlying input throws IOException """ byte b = readByte(); if (Code.isFixI...
java
public BigInteger unpackBigInteger() throws IOException { byte b = readByte(); if (Code.isFixInt(b)) { return BigInteger.valueOf((long) b); } switch (b) { case Code.UINT8: // unsigned int 8 byte u8 = readByte(); retu...
[ "public", "BigInteger", "unpackBigInteger", "(", ")", "throws", "IOException", "{", "byte", "b", "=", "readByte", "(", ")", ";", "if", "(", "Code", ".", "isFixInt", "(", "b", ")", ")", "{", "return", "BigInteger", ".", "valueOf", "(", "(", "long", ")",...
Reads a BigInteger. @return the read value @throws MessageTypeException when value is not MessagePack Integer type @throws IOException when underlying input throws IOException
[ "Reads", "a", "BigInteger", "." ]
train
https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java#L1023-L1068
xvik/generics-resolver
src/main/java/ru/vyarus/java/generics/resolver/util/GenericInfoUtils.java
GenericInfoUtils.create
public static GenericsInfo create(final Class<?> type, final Class<?>... ignoreClasses) { """ Root class analysis. If root class has generics - they will be resolved as lower known bound. <p> The result must be cached. @param type class to analyze @param ignoreClasses exclude classes from hierarchy ...
java
public static GenericsInfo create(final Class<?> type, final Class<?>... ignoreClasses) { // root class may contain generics or it may be inner class final LinkedHashMap<String, Type> generics = GenericsResolutionUtils.resolveRawGenerics(type); return create(type, generics, null, ignoreClasses);...
[ "public", "static", "GenericsInfo", "create", "(", "final", "Class", "<", "?", ">", "type", ",", "final", "Class", "<", "?", ">", "...", "ignoreClasses", ")", "{", "// root class may contain generics or it may be inner class", "final", "LinkedHashMap", "<", "String"...
Root class analysis. If root class has generics - they will be resolved as lower known bound. <p> The result must be cached. @param type class to analyze @param ignoreClasses exclude classes from hierarchy analysis @return analyzed type generics info
[ "Root", "class", "analysis", ".", "If", "root", "class", "has", "generics", "-", "they", "will", "be", "resolved", "as", "lower", "known", "bound", ".", "<p", ">", "The", "result", "must", "be", "cached", "." ]
train
https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/GenericInfoUtils.java#L40-L44
jingwei/krati
krati-main/src/main/java/krati/core/array/basic/ArrayFile.java
ArrayFile.resetAll
public synchronized void resetAll(long value, long maxScn) throws IOException { """ Resets all element values to the specified long value the max SCN (System Change Number).. @param value - the element value. @param maxScn - the system change number for the low and high water marks. @throws IOException "...
java
public synchronized void resetAll(long value, long maxScn) throws IOException { resetAll(value); _log.info("update hwmScn and lwmScn:" + maxScn); writeHwmScn(maxScn); writeLwmScn(maxScn); flush(); }
[ "public", "synchronized", "void", "resetAll", "(", "long", "value", ",", "long", "maxScn", ")", "throws", "IOException", "{", "resetAll", "(", "value", ")", ";", "_log", ".", "info", "(", "\"update hwmScn and lwmScn:\"", "+", "maxScn", ")", ";", "writeHwmScn",...
Resets all element values to the specified long value the max SCN (System Change Number).. @param value - the element value. @param maxScn - the system change number for the low and high water marks. @throws IOException
[ "Resets", "all", "element", "values", "to", "the", "specified", "long", "value", "the", "max", "SCN", "(", "System", "Change", "Number", ")", ".." ]
train
https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/basic/ArrayFile.java#L840-L847
jenkinsci/jenkins
core/src/main/java/hudson/diagnosis/OldDataMonitor.java
OldDataMonitor.doDiscard
@RequirePOST public HttpResponse doDiscard(StaplerRequest req, StaplerResponse rsp) { """ Save all files containing only unreadable data (no data upgrades), which discards this data. Remove those items from the data map. """ saveAndRemoveEntries( new Predicate<Map.Entry<SaveableReference,VersionRa...
java
@RequirePOST public HttpResponse doDiscard(StaplerRequest req, StaplerResponse rsp) { saveAndRemoveEntries( new Predicate<Map.Entry<SaveableReference,VersionRange>>() { @Override public boolean apply(Map.Entry<SaveableReference, VersionRange> entry) { return entry.get...
[ "@", "RequirePOST", "public", "HttpResponse", "doDiscard", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "{", "saveAndRemoveEntries", "(", "new", "Predicate", "<", "Map", ".", "Entry", "<", "SaveableReference", ",", "VersionRange", ">", ">", ...
Save all files containing only unreadable data (no data upgrades), which discards this data. Remove those items from the data map.
[ "Save", "all", "files", "containing", "only", "unreadable", "data", "(", "no", "data", "upgrades", ")", "which", "discards", "this", "data", ".", "Remove", "those", "items", "from", "the", "data", "map", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/diagnosis/OldDataMonitor.java#L343-L353
alkacon/opencms-core
src/org/opencms/xml/containerpage/CmsADECacheSettings.java
CmsADECacheSettings.getIntValue
private int getIntValue(String str, int defaultValue) { """ Turns a string into an int.<p> @param str the string to be converted @param defaultValue a default value to be returned in case the string could not be parsed or the parsed int value is <= 0 @return the int value of the string """ try { ...
java
private int getIntValue(String str, int defaultValue) { try { int intValue = Integer.parseInt(str); return (intValue > 0) ? intValue : defaultValue; } catch (NumberFormatException e) { // intentionally left blank } return defaultValue; }
[ "private", "int", "getIntValue", "(", "String", "str", ",", "int", "defaultValue", ")", "{", "try", "{", "int", "intValue", "=", "Integer", ".", "parseInt", "(", "str", ")", ";", "return", "(", "intValue", ">", "0", ")", "?", "intValue", ":", "defaultV...
Turns a string into an int.<p> @param str the string to be converted @param defaultValue a default value to be returned in case the string could not be parsed or the parsed int value is <= 0 @return the int value of the string
[ "Turns", "a", "string", "into", "an", "int", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsADECacheSettings.java#L162-L171
kaazing/gateway
management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java
MonitorFileWriterImpl.fillServiceMetadata
private void fillServiceMetadata(final String serviceName, final int index) { """ Method adding services metadata @param monitorMetaDataBuffer - the metadata buffer """ final int servAreaOffset = noOfServicesOffset + BitUtil.SIZE_OF_INT; metaDataBuffer.putInt(noOfServicesOffset, metaDataBuffer...
java
private void fillServiceMetadata(final String serviceName, final int index) { final int servAreaOffset = noOfServicesOffset + BitUtil.SIZE_OF_INT; metaDataBuffer.putInt(noOfServicesOffset, metaDataBuffer.getInt(noOfServicesOffset) + 1); int serviceNameOffset = getServiceNameOffset(servAreaOffset...
[ "private", "void", "fillServiceMetadata", "(", "final", "String", "serviceName", ",", "final", "int", "index", ")", "{", "final", "int", "servAreaOffset", "=", "noOfServicesOffset", "+", "BitUtil", ".", "SIZE_OF_INT", ";", "metaDataBuffer", ".", "putInt", "(", "...
Method adding services metadata @param monitorMetaDataBuffer - the metadata buffer
[ "Method", "adding", "services", "metadata" ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java#L210-L220
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java
CommercePriceEntryPersistenceImpl.findByGroupId
@Override public List<CommercePriceEntry> findByGroupId(long groupId) { """ Returns all the commerce price entries where groupId = &#63;. @param groupId the group ID @return the matching commerce price entries """ return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CommercePriceEntry> findByGroupId(long groupId) { return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CommercePriceEntry", ">", "findByGroupId", "(", "long", "groupId", ")", "{", "return", "findByGroupId", "(", "groupId", ",", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_POS", ",", "null", ")", ";", "}" ]
Returns all the commerce price entries where groupId = &#63;. @param groupId the group ID @return the matching commerce price entries
[ "Returns", "all", "the", "commerce", "price", "entries", "where", "groupId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java#L1518-L1521
netheosgithub/pcs_api
java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java
CloudMe.createIntermediateFolders
private CMFolder createIntermediateFolders( CMFolder cmRoot, CPath cpath ) { """ Creates folder with given path, with required intermediate folders. @param cmRoot contains the whole folders structure @param cpath path of folder to create @return the createdfolder corresponding to targeted cpath @throws CInva...
java
private CMFolder createIntermediateFolders( CMFolder cmRoot, CPath cpath ) { List<String> baseNames = cpath.split(); CMFolder currentFolder = cmRoot; CMFolder childFolder = null; boolean firstFolderCreation = true; for ( String baseName : baseNames ) { childFold...
[ "private", "CMFolder", "createIntermediateFolders", "(", "CMFolder", "cmRoot", ",", "CPath", "cpath", ")", "{", "List", "<", "String", ">", "baseNames", "=", "cpath", ".", "split", "(", ")", ";", "CMFolder", "currentFolder", "=", "cmRoot", ";", "CMFolder", "...
Creates folder with given path, with required intermediate folders. @param cmRoot contains the whole folders structure @param cpath path of folder to create @return the createdfolder corresponding to targeted cpath @throws CInvalidFileTypeException if a blob exists along that path
[ "Creates", "folder", "with", "given", "path", "with", "required", "intermediate", "folders", "." ]
train
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CloudMe.java#L427-L465
Putnami/putnami-web-toolkit
core/src/main/java/com/google/gwt/event/shared/HandlerManager.java
HandlerManager.addHandler
public <H extends EventHandler> HandlerRegistration addHandler(GwtEvent.Type<H> type, final H handler) { """ Adds a handler. @param <H> The type of handler @param type the event type associated with this handler @param handler the handler @return the handler registration, can be stored in order to remove the...
java
public <H extends EventHandler> HandlerRegistration addHandler(GwtEvent.Type<H> type, final H handler) { if (type != null && handler != null) { return new LegacyHandlerWrapper(this.eventBus.addHandler(type, handler)); } return null; }
[ "public", "<", "H", "extends", "EventHandler", ">", "HandlerRegistration", "addHandler", "(", "GwtEvent", ".", "Type", "<", "H", ">", "type", ",", "final", "H", "handler", ")", "{", "if", "(", "type", "!=", "null", "&&", "handler", "!=", "null", ")", "...
Adds a handler. @param <H> The type of handler @param type the event type associated with this handler @param handler the handler @return the handler registration, can be stored in order to remove the handler later
[ "Adds", "a", "handler", "." ]
train
https://github.com/Putnami/putnami-web-toolkit/blob/129aa781d1bda508e579d194693ca3034b4d470b/core/src/main/java/com/google/gwt/event/shared/HandlerManager.java#L102-L107
igniterealtime/Smack
smack-experimental/src/main/java/org/jivesoftware/smackx/spoiler/element/SpoilerElement.java
SpoilerElement.addSpoiler
public static void addSpoiler(Message message, String hint) { """ Add a SpoilerElement with a hint to a message. @param message Message to add the Spoiler to. @param hint Hint about the Spoilers content. """ message.addExtension(new SpoilerElement(null, hint)); }
java
public static void addSpoiler(Message message, String hint) { message.addExtension(new SpoilerElement(null, hint)); }
[ "public", "static", "void", "addSpoiler", "(", "Message", "message", ",", "String", "hint", ")", "{", "message", ".", "addExtension", "(", "new", "SpoilerElement", "(", "null", ",", "hint", ")", ")", ";", "}" ]
Add a SpoilerElement with a hint to a message. @param message Message to add the Spoiler to. @param hint Hint about the Spoilers content.
[ "Add", "a", "SpoilerElement", "with", "a", "hint", "to", "a", "message", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/spoiler/element/SpoilerElement.java#L79-L81
alkacon/opencms-core
src/org/opencms/main/CmsSessionManager.java
CmsSessionManager.sendBroadcast
public void sendBroadcast(CmsObject cms, String message, String sessionId) { """ Sends a broadcast to the specified user session.<p> @param cms the OpenCms user context of the user sending the broadcast @param message the message to broadcast @param sessionId the OpenCms session uuid target (receiver) of th...
java
public void sendBroadcast(CmsObject cms, String message, String sessionId) { sendBroadcast(cms, message, sessionId, false); }
[ "public", "void", "sendBroadcast", "(", "CmsObject", "cms", ",", "String", "message", ",", "String", "sessionId", ")", "{", "sendBroadcast", "(", "cms", ",", "message", ",", "sessionId", ",", "false", ")", ";", "}" ]
Sends a broadcast to the specified user session.<p> @param cms the OpenCms user context of the user sending the broadcast @param message the message to broadcast @param sessionId the OpenCms session uuid target (receiver) of the broadcast
[ "Sends", "a", "broadcast", "to", "the", "specified", "user", "session", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsSessionManager.java#L377-L381
samskivert/samskivert
src/main/java/com/samskivert/util/IntSets.java
IntSets.difference
public static IntSet difference (IntSet set1, IntSet set2) { """ Creates a new IntSet, initially populated with ints contained in set1 but not in set2. Set2 may also contain elements not present in set1, these are ignored. """ return and(set1, notView(set2)); }
java
public static IntSet difference (IntSet set1, IntSet set2) { return and(set1, notView(set2)); }
[ "public", "static", "IntSet", "difference", "(", "IntSet", "set1", ",", "IntSet", "set2", ")", "{", "return", "and", "(", "set1", ",", "notView", "(", "set2", ")", ")", ";", "}" ]
Creates a new IntSet, initially populated with ints contained in set1 but not in set2. Set2 may also contain elements not present in set1, these are ignored.
[ "Creates", "a", "new", "IntSet", "initially", "populated", "with", "ints", "contained", "in", "set1", "but", "not", "in", "set2", ".", "Set2", "may", "also", "contain", "elements", "not", "present", "in", "set1", "these", "are", "ignored", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntSets.java#L131-L134
m-m-m/util
version/src/main/java/net/sf/mmm/util/version/impl/VersionIdentifierFormatterVersionSegments.java
VersionIdentifierFormatterVersionSegments.doFormatSegment
protected CharSequence doFormatSegment(VersionIdentifier value, int index) { """ This method formats the {@link VersionIdentifier#getVersionSegment(int) segment} at the given {@code index}. @param value is the {@link VersionIdentifier}. @param index is the index of the {@link VersionIdentifier#getVersionSegme...
java
protected CharSequence doFormatSegment(VersionIdentifier value, int index) { int segment = value.getVersionSegment(index); return AbstractVersionIdentifierFormatterNumber.padNumber(segment, this.segmentPadding, 10); }
[ "protected", "CharSequence", "doFormatSegment", "(", "VersionIdentifier", "value", ",", "int", "index", ")", "{", "int", "segment", "=", "value", ".", "getVersionSegment", "(", "index", ")", ";", "return", "AbstractVersionIdentifierFormatterNumber", ".", "padNumber", ...
This method formats the {@link VersionIdentifier#getVersionSegment(int) segment} at the given {@code index}. @param value is the {@link VersionIdentifier}. @param index is the index of the {@link VersionIdentifier#getVersionSegment(int) segment} to format. @return the formatted segment.
[ "This", "method", "formats", "the", "{", "@link", "VersionIdentifier#getVersionSegment", "(", "int", ")", "segment", "}", "at", "the", "given", "{", "@code", "index", "}", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/version/src/main/java/net/sf/mmm/util/version/impl/VersionIdentifierFormatterVersionSegments.java#L87-L91
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java
InboundNatRulesInner.getAsync
public Observable<InboundNatRuleInner> getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { """ Gets the specified load balancer inbound nat rule. @param resourceGroupName The name of the resource group. @param loadBalancerName The name of the load balancer. ...
java
public Observable<InboundNatRuleInner> getAsync(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).map(new Func1<ServiceResponse<InboundNatRuleInner>, InboundNatRuleInn...
[ "public", "Observable", "<", "InboundNatRuleInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "loadBalancerName", ",", "String", "inboundNatRuleName", ",", "String", "expand", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGro...
Gets the specified load balancer inbound nat rule. @param resourceGroupName The name of the resource group. @param loadBalancerName The name of the load balancer. @param inboundNatRuleName The name of the inbound nat rule. @param expand Expands referenced resources. @throws IllegalArgumentException thrown if parameter...
[ "Gets", "the", "specified", "load", "balancer", "inbound", "nat", "rule", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InboundNatRulesInner.java#L506-L513
alkacon/opencms-core
src/org/opencms/jsp/CmsJspTagInclude.java
CmsJspTagInclude.addParameter
public static void addParameter(Map<String, String[]> parameters, String name, String value, boolean overwrite) { """ Adds parameters to a parameter Map that can be used for a http request.<p> @param parameters the Map to add the parameters to @param name the name to add @param value the value to add @param ...
java
public static void addParameter(Map<String, String[]> parameters, String name, String value, boolean overwrite) { // No null values allowed in parameters if ((parameters == null) || (name == null) || (value == null)) { return; } // Check if the parameter name (key) exists ...
[ "public", "static", "void", "addParameter", "(", "Map", "<", "String", ",", "String", "[", "]", ">", "parameters", ",", "String", "name", ",", "String", "value", ",", "boolean", "overwrite", ")", "{", "// No null values allowed in parameters", "if", "(", "(", ...
Adds parameters to a parameter Map that can be used for a http request.<p> @param parameters the Map to add the parameters to @param name the name to add @param value the value to add @param overwrite if <code>true</code>, a parameter in the map will be overwritten by a parameter with the same name, otherwise the requ...
[ "Adds", "parameters", "to", "a", "parameter", "Map", "that", "can", "be", "used", "for", "a", "http", "request", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagInclude.java#L118-L138
phax/ph-commons
ph-json/src/main/java/com/helger/json/serialize/JsonReader.java
JsonReader.isValidJson
public static boolean isValidJson (@Nonnull final Path aPath, @Nonnull final Charset aFallbackCharset) { """ Check if the passed Path can be resembled to valid Json content. This is accomplished by fully parsing the Json file each time the method is called. This consumes <b>less memory</b> than calling any of th...
java
public static boolean isValidJson (@Nonnull final Path aPath, @Nonnull final Charset aFallbackCharset) { return isValidJson (new FileSystemResource (aPath), aFallbackCharset); }
[ "public", "static", "boolean", "isValidJson", "(", "@", "Nonnull", "final", "Path", "aPath", ",", "@", "Nonnull", "final", "Charset", "aFallbackCharset", ")", "{", "return", "isValidJson", "(", "new", "FileSystemResource", "(", "aPath", ")", ",", "aFallbackChars...
Check if the passed Path can be resembled to valid Json content. This is accomplished by fully parsing the Json file each time the method is called. This consumes <b>less memory</b> than calling any of the <code>read...</code> methods and checking for a non-<code>null</code> result. @param aPath The file to be parsed....
[ "Check", "if", "the", "passed", "Path", "can", "be", "resembled", "to", "valid", "Json", "content", ".", "This", "is", "accomplished", "by", "fully", "parsing", "the", "Json", "file", "each", "time", "the", "method", "is", "called", ".", "This", "consumes"...
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L258-L261
wisdom-framework/wisdom
core/wisdom-api/src/main/java/org/wisdom/api/utils/CookieDataCodec.java
CookieDataCodec.safeEquals
public static boolean safeEquals(String a, String b) { """ Constant time for same length String comparison, to prevent timing attacks. """ if (a.length() != b.length()) { return false; } else { char equal = 0; for (int i = 0; i < a.length(); i++) { ...
java
public static boolean safeEquals(String a, String b) { if (a.length() != b.length()) { return false; } else { char equal = 0; for (int i = 0; i < a.length(); i++) { equal |= a.charAt(i) ^ b.charAt(i); } return equal == 0; ...
[ "public", "static", "boolean", "safeEquals", "(", "String", "a", ",", "String", "b", ")", "{", "if", "(", "a", ".", "length", "(", ")", "!=", "b", ".", "length", "(", ")", ")", "{", "return", "false", ";", "}", "else", "{", "char", "equal", "=", ...
Constant time for same length String comparison, to prevent timing attacks.
[ "Constant", "time", "for", "same", "length", "String", "comparison", "to", "prevent", "timing", "attacks", "." ]
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/utils/CookieDataCodec.java#L87-L97
briandilley/jsonrpc4j
src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java
JsonRpcClient.writeRequest
private void writeRequest(String methodName, Object argument, OutputStream output, String id) throws IOException { """ Writes a JSON-RPC request to the given {@link OutputStream}. If the value passed for argument is null then the {@code params} property is omitted from the JSON-RPC request. If the argument is ...
java
private void writeRequest(String methodName, Object argument, OutputStream output, String id) throws IOException { internalWriteRequest(methodName, argument, output, id); }
[ "private", "void", "writeRequest", "(", "String", "methodName", ",", "Object", "argument", ",", "OutputStream", "output", ",", "String", "id", ")", "throws", "IOException", "{", "internalWriteRequest", "(", "methodName", ",", "argument", ",", "output", ",", "id"...
Writes a JSON-RPC request to the given {@link OutputStream}. If the value passed for argument is null then the {@code params} property is omitted from the JSON-RPC request. If the argument is not not null then it is used as the value of the {@code params} property. This means that if a POJO is passed as the argument ...
[ "Writes", "a", "JSON", "-", "RPC", "request", "to", "the", "given", "{", "@link", "OutputStream", "}", ".", "If", "the", "value", "passed", "for", "argument", "is", "null", "then", "the", "{", "@code", "params", "}", "property", "is", "omitted", "from", ...
train
https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L241-L243
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XObject.java
XObject.castToType
public Object castToType(int t, XPathContext support) throws javax.xml.transform.TransformerException { """ Cast object to type t. @param t Type of object to cast this to @param support XPath context to use for the conversion @return This object as the given type t @throws javax.xml.transform.T...
java
public Object castToType(int t, XPathContext support) throws javax.xml.transform.TransformerException { Object result; switch (t) { case CLASS_STRING : result = str(); break; case CLASS_NUMBER : result = new Double(num()); break; case CLASS_NODESET : r...
[ "public", "Object", "castToType", "(", "int", "t", ",", "XPathContext", "support", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "Object", "result", ";", "switch", "(", "t", ")", "{", "case", "CLASS_STRING", ":", "...
Cast object to type t. @param t Type of object to cast this to @param support XPath context to use for the conversion @return This object as the given type t @throws javax.xml.transform.TransformerException
[ "Cast", "object", "to", "type", "t", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XObject.java#L489-L526
nohana/Amalgam
amalgam/src/main/java/com/amalgam/content/ContentProviderUtils.java
ContentProviderUtils.notifyChange
public static void notifyChange(ContentProvider provider, Uri uri, ContentObserver observer) { """ Notify data-set change to the observer. @param provider the provider, must not be null. @param uri the changed uri. @param observer the observer, can be null. """ notifyChange(provider.getContext(), ur...
java
public static void notifyChange(ContentProvider provider, Uri uri, ContentObserver observer) { notifyChange(provider.getContext(), uri, observer); }
[ "public", "static", "void", "notifyChange", "(", "ContentProvider", "provider", ",", "Uri", "uri", ",", "ContentObserver", "observer", ")", "{", "notifyChange", "(", "provider", ".", "getContext", "(", ")", ",", "uri", ",", "observer", ")", ";", "}" ]
Notify data-set change to the observer. @param provider the provider, must not be null. @param uri the changed uri. @param observer the observer, can be null.
[ "Notify", "data", "-", "set", "change", "to", "the", "observer", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/ContentProviderUtils.java#L57-L59
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java
GeneratedDi18nDaoImpl.queryByUpdatedDate
public Iterable<Di18n> queryByUpdatedDate(java.util.Date updatedDate) { """ query-by method for field updatedDate @param updatedDate the specified attribute @return an Iterable of Di18ns for the specified updatedDate """ return queryByField(null, Di18nMapper.Field.UPDATEDDATE.getFieldName(), updatedDate)...
java
public Iterable<Di18n> queryByUpdatedDate(java.util.Date updatedDate) { return queryByField(null, Di18nMapper.Field.UPDATEDDATE.getFieldName(), updatedDate); }
[ "public", "Iterable", "<", "Di18n", ">", "queryByUpdatedDate", "(", "java", ".", "util", ".", "Date", "updatedDate", ")", "{", "return", "queryByField", "(", "null", ",", "Di18nMapper", ".", "Field", ".", "UPDATEDDATE", ".", "getFieldName", "(", ")", ",", ...
query-by method for field updatedDate @param updatedDate the specified attribute @return an Iterable of Di18ns for the specified updatedDate
[ "query", "-", "by", "method", "for", "field", "updatedDate" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java#L106-L108
grails/grails-core
grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java
GrailsASTUtils.buildGetPropertyExpression
public static MethodCallExpression buildGetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode) { """ Build static direct call to getter of a property @param objectExpression @param propertyName @param targetClassNode @return The method call expres...
java
public static MethodCallExpression buildGetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode) { return buildGetPropertyExpression(objectExpression, propertyName, targetClassNode, false); }
[ "public", "static", "MethodCallExpression", "buildGetPropertyExpression", "(", "final", "Expression", "objectExpression", ",", "final", "String", "propertyName", ",", "final", "ClassNode", "targetClassNode", ")", "{", "return", "buildGetPropertyExpression", "(", "objectExpr...
Build static direct call to getter of a property @param objectExpression @param propertyName @param targetClassNode @return The method call expression
[ "Build", "static", "direct", "call", "to", "getter", "of", "a", "property" ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1301-L1303
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/BloomCalculations.java
BloomCalculations.computeBloomSpec
public static BloomSpecification computeBloomSpec(int bucketsPerElement) { """ Given the number of buckets that can be used per element, return a specification that minimizes the false positive rate. @param bucketsPerElement The number of buckets per element for the filter. @return A spec that minimizes the f...
java
public static BloomSpecification computeBloomSpec(int bucketsPerElement) { assert bucketsPerElement >= 1; assert bucketsPerElement <= probs.length - 1; return new BloomSpecification(optKPerBuckets[bucketsPerElement], bucketsPerElement); }
[ "public", "static", "BloomSpecification", "computeBloomSpec", "(", "int", "bucketsPerElement", ")", "{", "assert", "bucketsPerElement", ">=", "1", ";", "assert", "bucketsPerElement", "<=", "probs", ".", "length", "-", "1", ";", "return", "new", "BloomSpecification",...
Given the number of buckets that can be used per element, return a specification that minimizes the false positive rate. @param bucketsPerElement The number of buckets per element for the filter. @return A spec that minimizes the false positive rate.
[ "Given", "the", "number", "of", "buckets", "that", "can", "be", "used", "per", "element", "return", "a", "specification", "that", "minimizes", "the", "false", "positive", "rate", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/BloomCalculations.java#L97-L102
undertow-io/undertow
core/src/main/java/io/undertow/websockets/core/WebSockets.java
WebSockets.sendCloseBlocking
public static void sendCloseBlocking(final CloseMessage closeMessage, final WebSocketChannel wsChannel) throws IOException { """ Sends a complete close message, invoking the callback when complete @param closeMessage the close message @param wsChannel The web socket channel """ wsChannel.setCloseRe...
java
public static void sendCloseBlocking(final CloseMessage closeMessage, final WebSocketChannel wsChannel) throws IOException { wsChannel.setCloseReason(closeMessage.getReason()); wsChannel.setCloseCode(closeMessage.getCode()); sendBlockingInternal(closeMessage.toByteBuffer(), WebSocketFrameType.CL...
[ "public", "static", "void", "sendCloseBlocking", "(", "final", "CloseMessage", "closeMessage", ",", "final", "WebSocketChannel", "wsChannel", ")", "throws", "IOException", "{", "wsChannel", ".", "setCloseReason", "(", "closeMessage", ".", "getReason", "(", ")", ")",...
Sends a complete close message, invoking the callback when complete @param closeMessage the close message @param wsChannel The web socket channel
[ "Sends", "a", "complete", "close", "message", "invoking", "the", "callback", "when", "complete" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L865-L869
Netflix/servo
servo-core/src/main/java/com/netflix/servo/publish/JmxMetricPoller.java
JmxMetricPoller.extractValues
private void extractValues(String path, Map<String, Object> values, CompositeData obj) { """ Recursively extracts simple numeric values from composite data objects. The map {@code values} will be populated with a path to the value as the key and the simple object as the value. """ for (String key : obj.g...
java
private void extractValues(String path, Map<String, Object> values, CompositeData obj) { for (String key : obj.getCompositeType().keySet()) { String newPath = (path == null) ? key : path + "." + key; Object value = obj.get(key); if (value instanceof CompositeData) { extractValues(newPath, ...
[ "private", "void", "extractValues", "(", "String", "path", ",", "Map", "<", "String", ",", "Object", ">", "values", ",", "CompositeData", "obj", ")", "{", "for", "(", "String", "key", ":", "obj", ".", "getCompositeType", "(", ")", ".", "keySet", "(", "...
Recursively extracts simple numeric values from composite data objects. The map {@code values} will be populated with a path to the value as the key and the simple object as the value.
[ "Recursively", "extracts", "simple", "numeric", "values", "from", "composite", "data", "objects", ".", "The", "map", "{" ]
train
https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/publish/JmxMetricPoller.java#L170-L180
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDisjointClassesAxiomImpl_CustomFieldSerializer.java
OWLDisjointClassesAxiomImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLDisjointClassesAxiomImpl instance) throws SerializationException { """ Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google...
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLDisjointClassesAxiomImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLDisjointClassesAxiomImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.clie...
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{", "@link", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "rpc", ".", "SerializationStreamWriter", "}", "." ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDisjointClassesAxiomImpl_CustomFieldSerializer.java#L74-L77
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlStyleUtil.java
VmlStyleUtil.applyStyle
public static void applyStyle(Element element, Style style) { """ Apply the given style onto a DOM element. This decoder will decide how to handle all the details. @param element The target element onto whom we apply a style object. @param style The style object to be applied. """ if (style != null && ...
java
public static void applyStyle(Element element, Style style) { if (style != null && element != null) { if (style instanceof ShapeStyle) { applyShapeStyle(element, (ShapeStyle) style); } else if (style instanceof FontStyle) { FontStyle fontStyle = (FontStyle) style; element.getStyle().setProperty("fon...
[ "public", "static", "void", "applyStyle", "(", "Element", "element", ",", "Style", "style", ")", "{", "if", "(", "style", "!=", "null", "&&", "element", "!=", "null", ")", "{", "if", "(", "style", "instanceof", "ShapeStyle", ")", "{", "applyShapeStyle", ...
Apply the given style onto a DOM element. This decoder will decide how to handle all the details. @param element The target element onto whom we apply a style object. @param style The style object to be applied.
[ "Apply", "the", "given", "style", "onto", "a", "DOM", "element", ".", "This", "decoder", "will", "decide", "how", "to", "handle", "all", "the", "details", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlStyleUtil.java#L46-L66
groovy/gmaven
gmaven-adapter-impl/src/main/java/org/codehaus/gmaven/adapter/impl/GroovyRuntimeImpl.java
GroovyRuntimeImpl.createBinding
public Binding createBinding(final Map<String, Object> context) { """ Create script binding, handling conversion of {@link ClosureTarget} and {@link MagicContext} entries. """ Binding binding = new Binding(); log.debug("Binding:"); for (Entry<String, Object> entry : context.entrySet()) { Str...
java
public Binding createBinding(final Map<String, Object> context) { Binding binding = new Binding(); log.debug("Binding:"); for (Entry<String, Object> entry : context.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof ClosureTarget) { v...
[ "public", "Binding", "createBinding", "(", "final", "Map", "<", "String", ",", "Object", ">", "context", ")", "{", "Binding", "binding", "=", "new", "Binding", "(", ")", ";", "log", ".", "debug", "(", "\"Binding:\"", ")", ";", "for", "(", "Entry", "<",...
Create script binding, handling conversion of {@link ClosureTarget} and {@link MagicContext} entries.
[ "Create", "script", "binding", "handling", "conversion", "of", "{" ]
train
https://github.com/groovy/gmaven/blob/6978316bbc29d9cc6793494e0d1a0a057e47de6c/gmaven-adapter-impl/src/main/java/org/codehaus/gmaven/adapter/impl/GroovyRuntimeImpl.java#L185-L205
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/config/Config.java
Config.setPNCounterConfigs
public Config setPNCounterConfigs(Map<String, PNCounterConfig> pnCounterConfigs) { """ Sets the map of PN counter configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future. @param pnCounterConfigs the PN counter configuration map to set...
java
public Config setPNCounterConfigs(Map<String, PNCounterConfig> pnCounterConfigs) { this.pnCounterConfigs.clear(); this.pnCounterConfigs.putAll(pnCounterConfigs); for (Entry<String, PNCounterConfig> entry : pnCounterConfigs.entrySet()) { entry.getValue().setName(entry.getKey()); ...
[ "public", "Config", "setPNCounterConfigs", "(", "Map", "<", "String", ",", "PNCounterConfig", ">", "pnCounterConfigs", ")", "{", "this", ".", "pnCounterConfigs", ".", "clear", "(", ")", ";", "this", ".", "pnCounterConfigs", ".", "putAll", "(", "pnCounterConfigs"...
Sets the map of PN counter configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future. @param pnCounterConfigs the PN counter configuration map to set @return this config instance
[ "Sets", "the", "map", "of", "PN", "counter", "configurations", "mapped", "by", "config", "name", ".", "The", "config", "name", "may", "be", "a", "pattern", "with", "which", "the", "configuration", "will", "be", "obtained", "in", "the", "future", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L2267-L2274
NICTA/t3as-snomedct-service
snomed-coder-ui-web/src/main/java/org/t3as/snomedct/gwt/client/gwt/AnalyseHandler.java
AnalyseHandler.sendTextToServer
private void sendTextToServer() { """ send the text from the mainTextArea to the server and accept an async response """ statusLabel.setText(""); conceptList.clear(); // don't do anything if we have no text final String text = mainTextArea.getText(); if (text.length() <...
java
private void sendTextToServer() { statusLabel.setText(""); conceptList.clear(); // don't do anything if we have no text final String text = mainTextArea.getText(); if (text.length() < 1) { statusLabel.setText(messages.pleaseEnterTextLabel()); return; ...
[ "private", "void", "sendTextToServer", "(", ")", "{", "statusLabel", ".", "setText", "(", "\"\"", ")", ";", "conceptList", ".", "clear", "(", ")", ";", "// don't do anything if we have no text", "final", "String", "text", "=", "mainTextArea", ".", "getText", "("...
send the text from the mainTextArea to the server and accept an async response
[ "send", "the", "text", "from", "the", "mainTextArea", "to", "the", "server", "and", "accept", "an", "async", "response" ]
train
https://github.com/NICTA/t3as-snomedct-service/blob/70a82d5c889f97eef2d17a648970575c152983e9/snomed-coder-ui-web/src/main/java/org/t3as/snomedct/gwt/client/gwt/AnalyseHandler.java#L86-L132
radkovo/CSSBox
src/main/java/org/fit/cssbox/layout/Box.java
Box.applyClip
protected Rectangle applyClip(Shape current, Rectangle newclip) { """ Computes a new clipping region from the current one and the eventual clipping box @param current current clipping region @param newclip new clipping box to be used @return the new clipping rectangle """ if (current == null) ...
java
protected Rectangle applyClip(Shape current, Rectangle newclip) { if (current == null) return newclip; else { if (current instanceof Rectangle) return ((Rectangle) current).intersection(newclip); else return current.getBound...
[ "protected", "Rectangle", "applyClip", "(", "Shape", "current", ",", "Rectangle", "newclip", ")", "{", "if", "(", "current", "==", "null", ")", "return", "newclip", ";", "else", "{", "if", "(", "current", "instanceof", "Rectangle", ")", "return", "(", "(",...
Computes a new clipping region from the current one and the eventual clipping box @param current current clipping region @param newclip new clipping box to be used @return the new clipping rectangle
[ "Computes", "a", "new", "clipping", "region", "from", "the", "current", "one", "and", "the", "eventual", "clipping", "box" ]
train
https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/Box.java#L848-L859
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java
Start.oneArg
private void oneArg(String[] args, int index) { """ Set one arg option. Error and exit if one argument is not provided. """ if ((index + 1) < args.length) { setOption(args[index], args[index+1]); } else { usageError("main.requires_argument", args[index]); } ...
java
private void oneArg(String[] args, int index) { if ((index + 1) < args.length) { setOption(args[index], args[index+1]); } else { usageError("main.requires_argument", args[index]); } }
[ "private", "void", "oneArg", "(", "String", "[", "]", "args", ",", "int", "index", ")", "{", "if", "(", "(", "index", "+", "1", ")", "<", "args", ".", "length", ")", "{", "setOption", "(", "args", "[", "index", "]", ",", "args", "[", "index", "...
Set one arg option. Error and exit if one argument is not provided.
[ "Set", "one", "arg", "option", ".", "Error", "and", "exit", "if", "one", "argument", "is", "not", "provided", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java#L528-L534
stratosphere/stratosphere
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/dag/OptimizerNode.java
OptimizerNode.setBroadcastInputs
public void setBroadcastInputs(Map<Operator<?>, OptimizerNode> operatorToNode) throws CompilerException { """ This function is for plan translation purposes. Upon invocation, this method creates a {@link PactConnection} for each one of the broadcast inputs associated with the {@code Operator} referenced by this n...
java
public void setBroadcastInputs(Map<Operator<?>, OptimizerNode> operatorToNode) throws CompilerException { // skip for Operators that don't support broadcast variables if (!(getPactContract() instanceof AbstractUdfOperator<?, ?>)) { return; } // get all broadcast inputs AbstractUdfOperator<?, ?> operator...
[ "public", "void", "setBroadcastInputs", "(", "Map", "<", "Operator", "<", "?", ">", ",", "OptimizerNode", ">", "operatorToNode", ")", "throws", "CompilerException", "{", "// skip for Operators that don't support broadcast variables ", "if", "(", "!", "(", "getPactContra...
This function is for plan translation purposes. Upon invocation, this method creates a {@link PactConnection} for each one of the broadcast inputs associated with the {@code Operator} referenced by this node. <p> The {@code PactConnections} must set its shipping strategy type to BROADCAST. @param operatorToNode The ma...
[ "This", "function", "is", "for", "plan", "translation", "purposes", ".", "Upon", "invocation", "this", "method", "creates", "a", "{", "@link", "PactConnection", "}", "for", "each", "one", "of", "the", "broadcast", "inputs", "associated", "with", "the", "{", ...
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-compiler/src/main/java/eu/stratosphere/compiler/dag/OptimizerNode.java#L181-L198
Azure/azure-sdk-for-java
compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionsInner.java
VirtualMachineExtensionsInner.updateAsync
public Observable<VirtualMachineExtensionInner> updateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { """ The operation to update the extension. @param resourceGroupName The name of the resource group. @param vmName The name of the vir...
java
public Observable<VirtualMachineExtensionInner> updateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { return updateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).map(new Func1<ServiceResponse<V...
[ "public", "Observable", "<", "VirtualMachineExtensionInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "vmName", ",", "String", "vmExtensionName", ",", "VirtualMachineExtensionUpdate", "extensionParameters", ")", "{", "return", "updateWithServic...
The operation to update the extension. @param resourceGroupName The name of the resource group. @param vmName The name of the virtual machine where the extension should be updated. @param vmExtensionName The name of the virtual machine extension. @param extensionParameters Parameters supplied to the Update Virtual Mac...
[ "The", "operation", "to", "update", "the", "extension", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionsInner.java#L317-L324
h2oai/h2o-2
src/main/java/hex/drf/TreeMeasuresCollector.java
TreeMeasuresCollector.collectVotes
public static TreeVotes collectVotes(CompressedTree[/*nclass || 1 for regression*/] tree, int nclasses, Frame f, int ncols, float rate, int variable) { """ /* For bulk scoring public static TreeVotes collect(TreeModel tmodel, Frame f, int ncols, float rate, int variable) { CompressedTree[][] trees = new Compress...
java
public static TreeVotes collectVotes(CompressedTree[/*nclass || 1 for regression*/] tree, int nclasses, Frame f, int ncols, float rate, int variable) { return new TreeMeasuresCollector(new CompressedTree[][] {tree}, nclasses, ncols, rate, variable).doAll(f).resultVotes(); }
[ "public", "static", "TreeVotes", "collectVotes", "(", "CompressedTree", "[", "/*nclass || 1 for regression*/", "]", "tree", ",", "int", "nclasses", ",", "Frame", "f", ",", "int", "ncols", ",", "float", "rate", ",", "int", "variable", ")", "{", "return", "new",...
/* For bulk scoring public static TreeVotes collect(TreeModel tmodel, Frame f, int ncols, float rate, int variable) { CompressedTree[][] trees = new CompressedTree[tmodel.ntrees()][]; for (int tidx = 0; tidx < tmodel.ntrees(); tidx++) trees[tidx] = tmodel.ctree(tidx); return new TreeVotesCollector(trees, tmodel.nclasse...
[ "/", "*", "For", "bulk", "scoring", "public", "static", "TreeVotes", "collect", "(", "TreeModel", "tmodel", "Frame", "f", "int", "ncols", "float", "rate", "int", "variable", ")", "{", "CompressedTree", "[]", "[]", "trees", "=", "new", "CompressedTree", "[", ...
train
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/drf/TreeMeasuresCollector.java#L126-L128
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java
RouteFiltersInner.beginUpdate
public RouteFilterInner beginUpdate(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { """ Updates a route filter in a specified resource group. @param resourceGroupName The name of the resource group. @param routeFilterName The name of the route filter. @param routeFi...
java
public RouteFilterInner beginUpdate(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().single().body(); }
[ "public", "RouteFilterInner", "beginUpdate", "(", "String", "resourceGroupName", ",", "String", "routeFilterName", ",", "PatchRouteFilter", "routeFilterParameters", ")", "{", "return", "beginUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "routeFilterName", ",...
Updates a route filter in a specified resource group. @param resourceGroupName The name of the resource group. @param routeFilterName The name of the route filter. @param routeFilterParameters Parameters supplied to the update route filter operation. @throws IllegalArgumentException thrown if parameters fail the valid...
[ "Updates", "a", "route", "filter", "in", "a", "specified", "resource", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java#L686-L688
netkicorp/java-wns-resolver
src/main/java/com/netki/tlsa/TLSAValidator.java
TLSAValidator.getUrlCerts
public List<Certificate> getUrlCerts(URL url) { """ Gets all certificates from an HTTPS endpoint URL @param url URL to get certificates from @return List of certificates retrieves from SSL/TLS endpoint """ SSLSocket socket = null; TrustManager trm = new X509TrustManager() { pu...
java
public List<Certificate> getUrlCerts(URL url) { SSLSocket socket = null; TrustManager trm = new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String authTy...
[ "public", "List", "<", "Certificate", ">", "getUrlCerts", "(", "URL", "url", ")", "{", "SSLSocket", "socket", "=", "null", ";", "TrustManager", "trm", "=", "new", "X509TrustManager", "(", ")", "{", "public", "X509Certificate", "[", "]", "getAcceptedIssuers", ...
Gets all certificates from an HTTPS endpoint URL @param url URL to get certificates from @return List of certificates retrieves from SSL/TLS endpoint
[ "Gets", "all", "certificates", "from", "an", "HTTPS", "endpoint", "URL" ]
train
https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/TLSAValidator.java#L189-L227
grpc/grpc-java
core/src/main/java/io/grpc/internal/ReadableBuffers.java
ReadableBuffers.readAsString
public static String readAsString(ReadableBuffer buffer, Charset charset) { """ Reads the entire {@link ReadableBuffer} to a new {@link String} with the given charset. """ Preconditions.checkNotNull(charset, "charset"); byte[] bytes = readArray(buffer); return new String(bytes, charset); }
java
public static String readAsString(ReadableBuffer buffer, Charset charset) { Preconditions.checkNotNull(charset, "charset"); byte[] bytes = readArray(buffer); return new String(bytes, charset); }
[ "public", "static", "String", "readAsString", "(", "ReadableBuffer", "buffer", ",", "Charset", "charset", ")", "{", "Preconditions", ".", "checkNotNull", "(", "charset", ",", "\"charset\"", ")", ";", "byte", "[", "]", "bytes", "=", "readArray", "(", "buffer", ...
Reads the entire {@link ReadableBuffer} to a new {@link String} with the given charset.
[ "Reads", "the", "entire", "{" ]
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/ReadableBuffers.java#L83-L87
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/util/FileIoUtil.java
FileIoUtil.readStringFromResources
public static String readStringFromResources(InputStream _stream, String _charset) { """ Read a Resource-file (eg. Text) to String. @param _stream @param _charset @return the file as string, or null on error """ if (_stream == null) { LOGGER.error("Error: null-Stream received!"); ...
java
public static String readStringFromResources(InputStream _stream, String _charset) { if (_stream == null) { LOGGER.error("Error: null-Stream received!"); return null; } StringBuilder sb = new StringBuilder(100); BufferedReader br; try { br = ...
[ "public", "static", "String", "readStringFromResources", "(", "InputStream", "_stream", ",", "String", "_charset", ")", "{", "if", "(", "_stream", "==", "null", ")", "{", "LOGGER", ".", "error", "(", "\"Error: null-Stream received!\"", ")", ";", "return", "null"...
Read a Resource-file (eg. Text) to String. @param _stream @param _charset @return the file as string, or null on error
[ "Read", "a", "Resource", "-", "file", "(", "eg", ".", "Text", ")", "to", "String", "." ]
train
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L283-L302
zaproxy/zaproxy
src/org/parosproxy/paros/extension/filter/AllFilterTableEditor.java
AllFilterTableEditor.getTableCellEditorComponent
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int rowIndex, int vColIndex) { """ This method is called when a cell value is edited by the user. """ // 'value' is value contained in the cell located at (rowIndex, vColIndex) ...
java
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int rowIndex, int vColIndex) { // 'value' is value contained in the cell located at (rowIndex, vColIndex) if (isSelected) { // cell (and perhaps other cells) ...
[ "@", "Override", "public", "Component", "getTableCellEditorComponent", "(", "JTable", "table", ",", "Object", "value", ",", "boolean", "isSelected", ",", "int", "rowIndex", ",", "int", "vColIndex", ")", "{", "// 'value' is value contained in the cell located at (rowIndex,...
This method is called when a cell value is edited by the user.
[ "This", "method", "is", "called", "when", "a", "cell", "value", "is", "edited", "by", "the", "user", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/filter/AllFilterTableEditor.java#L66-L82
alkacon/opencms-core
src/org/opencms/search/documents/A_CmsVfsDocument.java
A_CmsVfsDocument.getDocumentKey
public static String getDocumentKey(String type, String mimeType) { """ Creates a document factory lookup key for the given resource type name / MIME type configuration.<p> If the given <code>mimeType</code> is <code>null</code>, this indicates that the key should match all VFS resource of the given resource t...
java
public static String getDocumentKey(String type, String mimeType) { StringBuffer result = new StringBuffer(16); result.append(I_CmsSearchDocument.VFS_DOCUMENT_KEY_PREFIX); result.append('_'); result.append(type); if (mimeType != null) { result.append(':'); ...
[ "public", "static", "String", "getDocumentKey", "(", "String", "type", ",", "String", "mimeType", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", "16", ")", ";", "result", ".", "append", "(", "I_CmsSearchDocument", ".", "VFS_DOCUMENT_KEY_PRE...
Creates a document factory lookup key for the given resource type name / MIME type configuration.<p> If the given <code>mimeType</code> is <code>null</code>, this indicates that the key should match all VFS resource of the given resource type regardless of the MIME type.<p> @param type the resource type name to use @...
[ "Creates", "a", "document", "factory", "lookup", "key", "for", "the", "given", "resource", "type", "name", "/", "MIME", "type", "configuration", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/A_CmsVfsDocument.java#L88-L99
lightblueseas/file-worker
src/main/java/de/alpharogroup/file/zip/Zip4jExtensions.java
Zip4jExtensions.zipFiles
public static void zipFiles(final ZipFile zipFile4j, final File... toAdd) throws ZipException { """ Adds a file or several files to the given zip file with the parameters Zip4jConstants.COMP_DEFLATE for the compression method and Zip4jConstants.DEFLATE_LEVEL_NORMAL as the compression level. @param zipFile4j ...
java
public static void zipFiles(final ZipFile zipFile4j, final File... toAdd) throws ZipException { zipFiles(zipFile4j, Zip4jConstants.COMP_DEFLATE, Zip4jConstants.DEFLATE_LEVEL_NORMAL, toAdd); }
[ "public", "static", "void", "zipFiles", "(", "final", "ZipFile", "zipFile4j", ",", "final", "File", "...", "toAdd", ")", "throws", "ZipException", "{", "zipFiles", "(", "zipFile4j", ",", "Zip4jConstants", ".", "COMP_DEFLATE", ",", "Zip4jConstants", ".", "DEFLATE...
Adds a file or several files to the given zip file with the parameters Zip4jConstants.COMP_DEFLATE for the compression method and Zip4jConstants.DEFLATE_LEVEL_NORMAL as the compression level. @param zipFile4j the zip file4j @param toAdd the to add @throws ZipException the zip exception
[ "Adds", "a", "file", "or", "several", "files", "to", "the", "given", "zip", "file", "with", "the", "parameters", "Zip4jConstants", ".", "COMP_DEFLATE", "for", "the", "compression", "method", "and", "Zip4jConstants", ".", "DEFLATE_LEVEL_NORMAL", "as", "the", "com...
train
https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/zip/Zip4jExtensions.java#L78-L82
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java
SecureCredentialsManager.requireAuthentication
public boolean requireAuthentication(@NonNull Activity activity, @IntRange(from = 1, to = 255) int requestCode, @Nullable String title, @Nullable String description) { """ Require the user to authenticate using the configured LockScreen before accessing the credentials. This feature is disabled by default and wil...
java
public boolean requireAuthentication(@NonNull Activity activity, @IntRange(from = 1, to = 255) int requestCode, @Nullable String title, @Nullable String description) { if (requestCode < 1 || requestCode > 255) { throw new IllegalArgumentException("Request code must be a value between 1 and 255."); ...
[ "public", "boolean", "requireAuthentication", "(", "@", "NonNull", "Activity", "activity", ",", "@", "IntRange", "(", "from", "=", "1", ",", "to", "=", "255", ")", "int", "requestCode", ",", "@", "Nullable", "String", "title", ",", "@", "Nullable", "String...
Require the user to authenticate using the configured LockScreen before accessing the credentials. This feature is disabled by default and will only work if the device is running on Android version 21 or up and if the user has configured a secure LockScreen (PIN, Pattern, Password or Fingerprint). <p> The activity pass...
[ "Require", "the", "user", "to", "authenticate", "using", "the", "configured", "LockScreen", "before", "accessing", "the", "credentials", ".", "This", "feature", "is", "disabled", "by", "default", "and", "will", "only", "work", "if", "the", "device", "is", "run...
train
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java#L92-L106
umeding/fuzzer
src/main/java/com/uwemeding/fuzzer/java/Java.java
Java.emitCommentIndentN
private static void emitCommentIndentN(PrintWriter fp, String text, int indent, boolean type) { """ Write a comment at some indentation level. @param fp @param text @param indent @param type """ synchronized (lock) { String cc = type ? "/**" : "/*"; fp.println(cc); String comment = emitCommen...
java
private static void emitCommentIndentN(PrintWriter fp, String text, int indent, boolean type) { synchronized (lock) { String cc = type ? "/**" : "/*"; fp.println(cc); String comment = emitCommentIndentNOnly(fp, text, indent); fp.println(comment + "/"); } }
[ "private", "static", "void", "emitCommentIndentN", "(", "PrintWriter", "fp", ",", "String", "text", ",", "int", "indent", ",", "boolean", "type", ")", "{", "synchronized", "(", "lock", ")", "{", "String", "cc", "=", "type", "?", "\"/**\"", ":", "\"/*\"", ...
Write a comment at some indentation level. @param fp @param text @param indent @param type
[ "Write", "a", "comment", "at", "some", "indentation", "level", "." ]
train
https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/java/Java.java#L101-L110
OpenHFT/Chronicle-Map
src/main/java/net/openhft/chronicle/set/ChronicleSetBuilder.java
ChronicleSetBuilder.entryOperations
public ChronicleSetBuilder<K> entryOperations(SetEntryOperations<K, ?> entryOperations) { """ Inject your SPI code around basic {@code ChronicleSet}'s operations with entries: removing entries and inserting new entries. <p> <p>This affects behaviour of ordinary set.add(), set.remove(), calls, as well as removes...
java
public ChronicleSetBuilder<K> entryOperations(SetEntryOperations<K, ?> entryOperations) { chronicleMapBuilder.entryOperations(new MapEntryOperations<K, DummyValue, Object>() { @Override public Object remove(@NotNull MapEntry<K, DummyValue> entry) { //noinspection unchecke...
[ "public", "ChronicleSetBuilder", "<", "K", ">", "entryOperations", "(", "SetEntryOperations", "<", "K", ",", "?", ">", "entryOperations", ")", "{", "chronicleMapBuilder", ".", "entryOperations", "(", "new", "MapEntryOperations", "<", "K", ",", "DummyValue", ",", ...
Inject your SPI code around basic {@code ChronicleSet}'s operations with entries: removing entries and inserting new entries. <p> <p>This affects behaviour of ordinary set.add(), set.remove(), calls, as well as removes <i>during iterations</i>, updates during <i>remote calls</i> and <i>internal replication operations</...
[ "Inject", "your", "SPI", "code", "around", "basic", "{" ]
train
https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/set/ChronicleSetBuilder.java#L288-L304
geomajas/geomajas-project-server
plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java
PdfContext.moveRectangleTo
public void moveRectangleTo(Rectangle rect, float x, float y) { """ Move this rectangle to the specified bottom-left point. @param rect rectangle to move @param x new x origin @param y new y origin """ float width = rect.getWidth(); float height = rect.getHeight(); rect.setLeft(x); rect.setBottom(...
java
public void moveRectangleTo(Rectangle rect, float x, float y) { float width = rect.getWidth(); float height = rect.getHeight(); rect.setLeft(x); rect.setBottom(y); rect.setRight(rect.getLeft() + width); rect.setTop(rect.getBottom() + height); }
[ "public", "void", "moveRectangleTo", "(", "Rectangle", "rect", ",", "float", "x", ",", "float", "y", ")", "{", "float", "width", "=", "rect", ".", "getWidth", "(", ")", ";", "float", "height", "=", "rect", ".", "getHeight", "(", ")", ";", "rect", "."...
Move this rectangle to the specified bottom-left point. @param rect rectangle to move @param x new x origin @param y new y origin
[ "Move", "this", "rectangle", "to", "the", "specified", "bottom", "-", "left", "point", "." ]
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java#L302-L309
trustathsh/ifmapj
src/main/java/util/DomHelpers.java
DomHelpers.removePrefixFromChildren
private static void removePrefixFromChildren(Element el, String prefix) throws MarshalException { """ If any child of el has prefix as prefix, remove it. drop all namespace decls on the way. If we find an element with a different prefix, go crazy. @param el @param prefix @throws MarshalException """ ...
java
private static void removePrefixFromChildren(Element el, String prefix) throws MarshalException { NodeList nl = el.getChildNodes(); String localPrefix = null; for (int i = 0; i < nl.getLength(); i++) { Node n = nl.item(i); if (n.getNodeType() != Node.ELEMENT_NODE) { continue; } localPrefix =...
[ "private", "static", "void", "removePrefixFromChildren", "(", "Element", "el", ",", "String", "prefix", ")", "throws", "MarshalException", "{", "NodeList", "nl", "=", "el", ".", "getChildNodes", "(", ")", ";", "String", "localPrefix", "=", "null", ";", "for", ...
If any child of el has prefix as prefix, remove it. drop all namespace decls on the way. If we find an element with a different prefix, go crazy. @param el @param prefix @throws MarshalException
[ "If", "any", "child", "of", "el", "has", "prefix", "as", "prefix", "remove", "it", ".", "drop", "all", "namespace", "decls", "on", "the", "way", ".", "If", "we", "find", "an", "element", "with", "a", "different", "prefix", "go", "crazy", "." ]
train
https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/util/DomHelpers.java#L410-L440
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/JspHelper.java
JspHelper.getUrlParam
public static String getUrlParam(String name, String val) { """ Returns the url parameter for the given bpid string. @param name parameter name @param val parameter value @return url parameter """ return val == null ? "" : "&" + name + "=" + val; }
java
public static String getUrlParam(String name, String val) { return val == null ? "" : "&" + name + "=" + val; }
[ "public", "static", "String", "getUrlParam", "(", "String", "name", ",", "String", "val", ")", "{", "return", "val", "==", "null", "?", "\"\"", ":", "\"&\"", "+", "name", "+", "\"=\"", "+", "val", ";", "}" ]
Returns the url parameter for the given bpid string. @param name parameter name @param val parameter value @return url parameter
[ "Returns", "the", "url", "parameter", "for", "the", "given", "bpid", "string", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/JspHelper.java#L573-L575
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java
ConfigUtils.configToProperties
public static Properties configToProperties(Config config, String prefix) { """ Convert a given {@link Config} instance to a {@link Properties} instance. @param config the given {@link Config} instance @param prefix only properties whose name starts with the prefix will be returned. @return a {@link Propertie...
java
public static Properties configToProperties(Config config, String prefix) { return configToProperties(config, Optional.of(prefix)); }
[ "public", "static", "Properties", "configToProperties", "(", "Config", "config", ",", "String", "prefix", ")", "{", "return", "configToProperties", "(", "config", ",", "Optional", ".", "of", "(", "prefix", ")", ")", ";", "}" ]
Convert a given {@link Config} instance to a {@link Properties} instance. @param config the given {@link Config} instance @param prefix only properties whose name starts with the prefix will be returned. @return a {@link Properties} instance
[ "Convert", "a", "given", "{", "@link", "Config", "}", "instance", "to", "a", "{", "@link", "Properties", "}", "instance", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java#L121-L123