repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
streamsets/datacollector
stagesupport/src/main/java/com/streamsets/pipeline/lib/util/OffsetUtil.java
OffsetUtil.serializeOffsetMap
public static String serializeOffsetMap(Map<String, String> offsetMap) throws IOException { return JSON_MAPPER.writeValueAsString(offsetMap); }
java
public static String serializeOffsetMap(Map<String, String> offsetMap) throws IOException { return JSON_MAPPER.writeValueAsString(offsetMap); }
[ "public", "static", "String", "serializeOffsetMap", "(", "Map", "<", "String", ",", "String", ">", "offsetMap", ")", "throws", "IOException", "{", "return", "JSON_MAPPER", ".", "writeValueAsString", "(", "offsetMap", ")", ";", "}" ]
Serialize the Map of table to offset to a String @param offsetMap Map of table to Offset. @return Serialized offset @throws StageException When Serialization exception happens
[ "Serialize", "the", "Map", "of", "table", "to", "offset", "to", "a", "String" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/stagesupport/src/main/java/com/streamsets/pipeline/lib/util/OffsetUtil.java#L37-L39
test
Serialize a map of offsets to a string.
Of course, here is the Java code you requested: ```java public static String serializeOffsetMap(Map<String, String> offsetMap) throws IOException { return JSON_MAPPER.writeValueAsString(offsetMap); } ``` Hope this helps!
oblac/jodd
jodd-joy/src/main/java/jodd/joy/JoyScanner.java
JoyScanner.scanClasspathOf
@Override public JoyScanner scanClasspathOf(final Class applicationClass) { requireNotStarted(classScanner); appClasses.add(applicationClass); return this; }
java
@Override public JoyScanner scanClasspathOf(final Class applicationClass) { requireNotStarted(classScanner); appClasses.add(applicationClass); return this; }
[ "@", "Override", "public", "JoyScanner", "scanClasspathOf", "(", "final", "Class", "applicationClass", ")", "{", "requireNotStarted", "(", "classScanner", ")", ";", "appClasses", ".", "add", "(", "applicationClass", ")", ";", "return", "this", ";", "}" ]
Defines class and it's classloader to scan. This is not required in Java8 and would not hurt anything if called. However, for Java9, you should pass <i>any</i> user-application class, so Jodd can figure out the real class path to scan.
[ "Defines", "class", "and", "it", "s", "classloader", "to", "scan", ".", "This", "is", "not", "required", "in", "Java8", "and", "would", "not", "hurt", "anything", "if", "called", ".", "However", "for", "Java9", "you", "should", "pass", "<i", ">", "any<",...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-joy/src/main/java/jodd/joy/JoyScanner.java#L104-L109
test
Scan classpath of application class.
Of course, here is the Java code you requested: ```java @Override public JoyScanner scanClasspathOf(final Class applicationClass) { requireNotStarted(classScanner); appClasses.add(applicationClass); return this; } ``` Hope this helps!
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.getParent
private static <K,V> Node<K,V> getParent(final Node<K,V> node, final int index) { return ((node == null) ? null : node.getParent(index)); }
java
private static <K,V> Node<K,V> getParent(final Node<K,V> node, final int index) { return ((node == null) ? null : node.getParent(index)); }
[ "private", "static", "<", "K", ",", "V", ">", "Node", "<", "K", ",", "V", ">", "getParent", "(", "final", "Node", "<", "K", ",", "V", ">", "node", ",", "final", "int", "index", ")", "{", "return", "(", "(", "node", "==", "null", ")", "?", "nu...
get a node's parent. mind you, the node, or its parent, may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE
[ "get", "a", "node", "s", "parent", ".", "mind", "you", "the", "node", "or", "its", "parent", "may", "not", "exist", ".", "no", "problem" ]
1b638be51997eafac4d368c14f62a16624a08d3e
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1289-L1294
test
Gets the parent node.
Of course, here is the Java code you requested: ```java private static <K,V> Node<K,V> getParent(final Node<K,V> node, final int index) { return ((node == null) ? null : node.getParent(index)); } ``` Hope this helps!
algolia/algoliasearch-client-android
algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java
MirroredIndex.saveMirrorSettings
private void saveMirrorSettings() { File dataDir = getDataDir(); if (!dataDir.exists()) { dataDir.mkdirs(); } mirrorSettings.save(getSettingsFile()); }
java
private void saveMirrorSettings() { File dataDir = getDataDir(); if (!dataDir.exists()) { dataDir.mkdirs(); } mirrorSettings.save(getSettingsFile()); }
[ "private", "void", "saveMirrorSettings", "(", ")", "{", "File", "dataDir", "=", "getDataDir", "(", ")", ";", "if", "(", "!", "dataDir", ".", "exists", "(", ")", ")", "{", "dataDir", ".", "mkdirs", "(", ")", ";", "}", "mirrorSettings", ".", "save", "(...
----------------------------------------------------------------------
[ "----------------------------------------------------------------------" ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java#L338-L345
test
Saves the Mirror Settings file.
Of course, here is the Java code you requested: ```java private void saveMirrorSettings() { File dataDir = getDataDir(); if (!dataDir.exists()) { dataDir.mkdirs(); } mirrorSettings.save(getSettingsFile()); } ``` Hope this helps!
patrickfav/slf4j-timber
slf4j-timber/src/main/java/org/slf4j/impl/TimberAndroidLoggerAdapter.java
TimberAndroidLoggerAdapter.warn
public void warn(String format, Object... argArray) { formatAndLog(Log.WARN, format, argArray); }
java
public void warn(String format, Object... argArray) { formatAndLog(Log.WARN, format, argArray); }
[ "public", "void", "warn", "(", "String", "format", ",", "Object", "...", "argArray", ")", "{", "formatAndLog", "(", "Log", ".", "WARN", ",", "format", ",", "argArray", ")", ";", "}" ]
Log a message at level WARN according to the specified format and arguments. <p> <p> This form avoids superfluous object creation when the logger is disabled for the WARN level. </p> @param format the format string @param argArray an array of arguments
[ "Log", "a", "message", "at", "level", "WARN", "according", "to", "the", "specified", "format", "and", "arguments", ".", "<p", ">", "<p", ">", "This", "form", "avoids", "superfluous", "object", "creation", "when", "the", "logger", "is", "disabled", "for", "...
bb6be99a0ee7c6d764c58b00e7d46f94d5b86160
https://github.com/patrickfav/slf4j-timber/blob/bb6be99a0ee7c6d764c58b00e7d46f94d5b86160/slf4j-timber/src/main/java/org/slf4j/impl/TimberAndroidLoggerAdapter.java#L383-L385
test
Perform single parameter substitution before logging the message of level WARN according to the specified format string and argument array.
Of course, here is the Java code you requested: ```java public void warn(String format, Object... argArray) { formatAndLog(Log.WARN, format, argArray); } ``` Hope this helps!
playframework/playframework
core/play/src/main/java/play/mvc/Results.java
Results.tooManyRequests
public static Result tooManyRequests(File content, String filename, FileMimeTypes fileMimeTypes) { return status(TOO_MANY_REQUESTS, content, filename, fileMimeTypes); }
java
public static Result tooManyRequests(File content, String filename, FileMimeTypes fileMimeTypes) { return status(TOO_MANY_REQUESTS, content, filename, fileMimeTypes); }
[ "public", "static", "Result", "tooManyRequests", "(", "File", "content", ",", "String", "filename", ",", "FileMimeTypes", "fileMimeTypes", ")", "{", "return", "status", "(", "TOO_MANY_REQUESTS", ",", "content", ",", "filename", ",", "fileMimeTypes", ")", ";", "}...
Generates a 429 Too Many Requests result. @param content The file to send. @param filename The name to send the file as. @param fileMimeTypes Used for file type mapping. @return the result
[ "Generates", "a", "429", "Too", "Many", "Requests", "result", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L3465-L3467
test
A Result indicating that a file is tooManyRequests.
Of course, here is the Java code you requested: ```java public static Result tooManyRequests(File content, String filename, FileMimeTypes fileMimeTypes) { return status(TOO_MANY_REQUESTS, content, filename, fileMimeTypes); } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/ConditionTerm.java
ConditionTerm.addConditionFactor
public void addConditionFactor(ConditionFactor factor) throws WebDAVException { if (conditionFactors.contains(factor)) throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseDuplicateEntry")); //$NON-NLS-1$ conditionFactors.addElement(factor); }
java
public void addConditionFactor(ConditionFactor factor) throws WebDAVException { if (conditionFactors.contains(factor)) throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseDuplicateEntry")); //$NON-NLS-1$ conditionFactors.addElement(factor); }
[ "public", "void", "addConditionFactor", "(", "ConditionFactor", "factor", ")", "throws", "WebDAVException", "{", "if", "(", "conditionFactors", ".", "contains", "(", "factor", ")", ")", "throw", "new", "WebDAVException", "(", "IResponse", ".", "SC_BAD_REQUEST", ",...
Add a ConditionFactor to a ConditionTerm. @param factor the factor to add @exception WebDAVException thrown if the term already contains the factor
[ "Add", "a", "ConditionFactor", "to", "a", "ConditionTerm", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/ConditionTerm.java#L48-L52
test
Add a new condition factor to the policy.
Of course, here is the Java code you requested: ```java public void addConditionFactor(ConditionFactor factor) throws WebDAVException { if (conditionFactors.contains(factor)) throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseDuplicateEntry")); //$NON-NLS-1$ conditi...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java
BaseNDArrayFactory.linspace
@Override public INDArray linspace(int lower, int upper, int num) { double[] data = new double[num]; for (int i = 0; i < num; i++) { double t = (double) i / (num - 1); data[i] = lower * (1 - t) + t * upper; } //edge case for scalars INDArray ret = Nd...
java
@Override public INDArray linspace(int lower, int upper, int num) { double[] data = new double[num]; for (int i = 0; i < num; i++) { double t = (double) i / (num - 1); data[i] = lower * (1 - t) + t * upper; } //edge case for scalars INDArray ret = Nd...
[ "@", "Override", "public", "INDArray", "linspace", "(", "int", "lower", ",", "int", "upper", ",", "int", "num", ")", "{", "double", "[", "]", "data", "=", "new", "double", "[", "num", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "...
Generate a linearly spaced vector @param lower upper bound @param upper lower bound @param num the step size @return the linearly spaced vector
[ "Generate", "a", "linearly", "spaced", "vector" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java#L213-L230
test
This method is used to create a random vector of the specified number of elements
Of course, here is the Java code you requested: ```java @Override public INDArray linspace(int lower, int upper, int num) { double[] data = new double[num]; for (int i = 0; i < num; i++) { double t = (double) i / (num - 1); data[i] = lower * (1 - t) + t * upper; } ...
Unidata/thredds
legacy/src/main/java/thredds/cataloggen/config/CatGenConfigMetadataFactory.java
CatGenConfigMetadataFactory.createResultServiceElement
private org.jdom2.Element createResultServiceElement( ResultService resultService) { Element rsElem = new Element("resultService", CATALOG_GEN_CONFIG_NAMESPACE_0_5); if ( resultService != null) { // Add 'name' attribute. if ( resultService.getName() != null) { rsElem.setAttribute...
java
private org.jdom2.Element createResultServiceElement( ResultService resultService) { Element rsElem = new Element("resultService", CATALOG_GEN_CONFIG_NAMESPACE_0_5); if ( resultService != null) { // Add 'name' attribute. if ( resultService.getName() != null) { rsElem.setAttribute...
[ "private", "org", ".", "jdom2", ".", "Element", "createResultServiceElement", "(", "ResultService", "resultService", ")", "{", "Element", "rsElem", "=", "new", "Element", "(", "\"resultService\"", ",", "CATALOG_GEN_CONFIG_NAMESPACE_0_5", ")", ";", "if", "(", "result...
Create a 'ResultService' JDOM element
[ "Create", "a", "ResultService", "JDOM", "element" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/cataloggen/config/CatGenConfigMetadataFactory.java#L494-L531
test
Create the resultService element.
Of course, here is the Java code you requested: ```java private org.jdom2.Element createResultServiceElement( ResultService resultService) { Element rsElem = new Element("resultService", CATALOG_GEN_CONFIG_NAMESPACE_0_5); if ( resultService != null) { // Add 'name' attribute. if ( resultServi...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3channelWriter.java
N3channelWriter.writeFromFile
public static void writeFromFile(NetcdfFile fileIn, String fileOutName) throws IOException, InvalidRangeException { try (FileOutputStream stream = new FileOutputStream(fileOutName)) { WritableByteChannel channel = stream.getChannel(); DataOutputStream dout = new DataOutputStream(Channels.newOutputStrea...
java
public static void writeFromFile(NetcdfFile fileIn, String fileOutName) throws IOException, InvalidRangeException { try (FileOutputStream stream = new FileOutputStream(fileOutName)) { WritableByteChannel channel = stream.getChannel(); DataOutputStream dout = new DataOutputStream(Channels.newOutputStrea...
[ "public", "static", "void", "writeFromFile", "(", "NetcdfFile", "fileIn", ",", "String", "fileOutName", ")", "throws", "IOException", ",", "InvalidRangeException", "{", "try", "(", "FileOutputStream", "stream", "=", "new", "FileOutputStream", "(", "fileOutName", ")"...
//////////////////////////////////////
[ "//////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3channelWriter.java#L104-L118
test
Write a file from a NetcdfFile to a file outName.
Of course, here is the Java code you requested: ```java public static void writeFromFile(NetcdfFile fileIn, String fileOutName) throws IOException, InvalidRangeException { try (FileOutputStream stream = new FileOutputStream(fileOutName)) { WritableByteChannel channel = stream.getChannel(); DataOutputS...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java
SameDiff.getInputsForFunction
public String[] getInputsForFunction(DifferentialFunction function) { if (!incomingArgsReverse.containsKey(function.getOwnName())) throw new ND4JIllegalStateException("Illegal function instance id found " + function.getOwnName()); return incomingArgsReverse.get(function.getOwnName()); }
java
public String[] getInputsForFunction(DifferentialFunction function) { if (!incomingArgsReverse.containsKey(function.getOwnName())) throw new ND4JIllegalStateException("Illegal function instance id found " + function.getOwnName()); return incomingArgsReverse.get(function.getOwnName()); }
[ "public", "String", "[", "]", "getInputsForFunction", "(", "DifferentialFunction", "function", ")", "{", "if", "(", "!", "incomingArgsReverse", ".", "containsKey", "(", "function", ".", "getOwnName", "(", ")", ")", ")", "throw", "new", "ND4JIllegalStateException",...
Returns the inputs for the given function @param function the function to get the inputs for @return the input ids for a given function
[ "Returns", "the", "inputs", "for", "the", "given", "function" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L470-L474
test
Get the inputs for a given differential function.
Of course, here is the Java code you requested: ```java public String[] getInputsForFunction(DifferentialFunction function) { if (!incomingArgsReverse.containsKey(function.getOwnName())) throw new ND4JIllegalStateException("Illegal function instance id found " + function.getOwnName()); retu...
wildfly/wildfly
connector/src/main/java/org/jboss/as/connector/deployers/ra/processors/RaNativeProcessor.java
RaNativeProcessor.deploy
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); process(deploymentRoot); }
java
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); process(deploymentRoot); }
[ "@", "Override", "public", "void", "deploy", "(", "DeploymentPhaseContext", "phaseContext", ")", "throws", "DeploymentUnitProcessingException", "{", "final", "VirtualFile", "deploymentRoot", "=", "phaseContext", ".", "getDeploymentUnit", "(", ")", ".", "getAttachment", ...
Process a deployment for standard ra deployment files. Will parse the xml file and attach a configuration discovered during processing. @param phaseContext the deployment unit context @throws DeploymentUnitProcessingException
[ "Process", "a", "deployment", "for", "standard", "ra", "deployment", "files", ".", "Will", "parse", "the", "xml", "file", "and", "attach", "a", "configuration", "discovered", "during", "processing", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/connector/src/main/java/org/jboss/as/connector/deployers/ra/processors/RaNativeProcessor.java#L59-L64
test
Process the RAAS files.
Of course, here is the Java code you requested: ```java @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); process(dep...
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java
ODistributedConfiguration.getServers
public List<String> getServers(final String iClusterName, final String iExclude) { final List<String> serverList = getClusterConfiguration(iClusterName).field(SERVERS); if (serverList != null) { // COPY AND REMOVE ANY NEW_NODE_TAG List<String> filteredServerList = new ArrayList<String>(serverList.s...
java
public List<String> getServers(final String iClusterName, final String iExclude) { final List<String> serverList = getClusterConfiguration(iClusterName).field(SERVERS); if (serverList != null) { // COPY AND REMOVE ANY NEW_NODE_TAG List<String> filteredServerList = new ArrayList<String>(serverList.s...
[ "public", "List", "<", "String", ">", "getServers", "(", "final", "String", "iClusterName", ",", "final", "String", "iExclude", ")", "{", "final", "List", "<", "String", ">", "serverList", "=", "getClusterConfiguration", "(", "iClusterName", ")", ".", "field",...
Returns the server list for the requested cluster cluster excluding any tags like <NEW_NODES> and iExclude if any. @param iClusterName Cluster name, or null for * @param iExclude Node to exclude
[ "Returns", "the", "server", "list", "for", "the", "requested", "cluster", "cluster", "excluding", "any", "tags", "like", "<NEW_NODES", ">", "and", "iExclude", "if", "any", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java#L348-L361
test
Get the list of servers for the cluster.
Of course, here is the Java code you requested: ```java public List<String> getServers(final String iClusterName, final String iExclude) { final List<String> serverList = getClusterConfiguration(iClusterName).field(SERVERS); if (serverList != null) { // COPY AND REMOVE ANY NEW_NODE_TAG List<String...
Unidata/thredds
opendap/src/main/java/opendap/servers/CEEvaluator.java
CEEvaluator.parseConstraint
public void parseConstraint(ReqState rs) throws ParseException, opendap.dap.DAP2Exception, NoSuchVariableException, NoSuchFunctionException, InvalidOperatorException, InvalidParameterException, SBHException, WrongTypeException { parseConstraint(rs.getConstraintExpressi...
java
public void parseConstraint(ReqState rs) throws ParseException, opendap.dap.DAP2Exception, NoSuchVariableException, NoSuchFunctionException, InvalidOperatorException, InvalidParameterException, SBHException, WrongTypeException { parseConstraint(rs.getConstraintExpressi...
[ "public", "void", "parseConstraint", "(", "ReqState", "rs", ")", "throws", "ParseException", ",", "opendap", ".", "dap", ".", "DAP2Exception", ",", "NoSuchVariableException", ",", "NoSuchFunctionException", ",", "InvalidOperatorException", ",", "InvalidParameterException"...
Convenience wrapper for parseConstraint. @param rs @throws ParseException @throws opendap.dap.DAP2Exception @throws NoSuchVariableException @throws NoSuchFunctionException @throws InvalidOperatorException @throws InvalidParameterException @throws SBHException @throws WrongTypeException
[ "Convenience", "wrapper", "for", "parseConstraint", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/CEEvaluator.java#L227-L233
test
Method to parse a constraint.
Of course, here is the Java code you requested: ```java public void parseConstraint(ReqState rs) throws ParseException, opendap.dap.DAP2Exception, NoSuchVariableException, NoSuchFunctionException, InvalidOperatorException, InvalidParameterException, SBHException, WrongTypeException ...
RuedigerMoeller/fast-serialization
src/main/java/org/nustaq/offheap/BinaryQueue.java
BinaryQueue.add
public void add(ByteSource source, long sourceoff, long sourcelen) { if ( sourcelen >= remaining() ) { grow(sourcelen+1); //issue85 add(source,sourceoff,sourcelen); return; } for ( int i=0; i < sourcelen; i++ ) { storage.put(addIndex++,source.get(i...
java
public void add(ByteSource source, long sourceoff, long sourcelen) { if ( sourcelen >= remaining() ) { grow(sourcelen+1); //issue85 add(source,sourceoff,sourcelen); return; } for ( int i=0; i < sourcelen; i++ ) { storage.put(addIndex++,source.get(i...
[ "public", "void", "add", "(", "ByteSource", "source", ",", "long", "sourceoff", ",", "long", "sourcelen", ")", "{", "if", "(", "sourcelen", ">=", "remaining", "(", ")", ")", "{", "grow", "(", "sourcelen", "+", "1", ")", ";", "//issue85", "add", "(", ...
add bytes to the queue. Again by using (reusable) Wrapper classes any kind of memory (offheap, byte arrays, nio bytebuffer, memory mapped) can be added. @param source @param sourceoff @param sourcelen
[ "add", "bytes", "to", "the", "queue", ".", "Again", "by", "using", "(", "reusable", ")", "Wrapper", "classes", "any", "kind", "of", "memory", "(", "offheap", "byte", "arrays", "nio", "bytebuffer", "memory", "mapped", ")", "can", "be", "added", "." ]
59f8f800b79479d0b9c80901cf55903d9b027f26
https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/offheap/BinaryQueue.java#L54-L65
test
Add a sequence of bytes from a byte source to this buffer.
Of course, here is the Java code you requested: ```java public void add(ByteSource source, long sourceoff, long sourcelen) { if ( sourcelen >= remaining() ) { grow(sourcelen+1); //issue85 add(source,sourceoff,sourcelen); return; } for ( int i=0; i < sourcelen...
Unidata/thredds
opendap/src/main/java/opendap/dap/parsers/DDSXMLParser.java
DDSXMLParser.parseArray
private void parseArray(Element ArrayElement, DArray da, String indent) throws DASException, NoSuchTypeException, BadSemanticsException { int countTemplateVars = 0; int numDims = 0; for (Element e : ArrayElement.getChildren()) { if (_Debug) System.out.println(inden...
java
private void parseArray(Element ArrayElement, DArray da, String indent) throws DASException, NoSuchTypeException, BadSemanticsException { int countTemplateVars = 0; int numDims = 0; for (Element e : ArrayElement.getChildren()) { if (_Debug) System.out.println(inden...
[ "private", "void", "parseArray", "(", "Element", "ArrayElement", ",", "DArray", "da", ",", "String", "indent", ")", "throws", "DASException", ",", "NoSuchTypeException", ",", "BadSemanticsException", "{", "int", "countTemplateVars", "=", "0", ";", "int", "numDims"...
Arrays have special parsing need as their syntax is different from that of a typical BaseType derived type or a container type. The array is based on a template variable that can have ANY structure that can be represented by the OPeNDAP data model. With the exception of (you knew this was comming, right?) of other arra...
[ "Arrays", "have", "special", "parsing", "need", "as", "their", "syntax", "is", "different", "from", "that", "of", "a", "typical", "BaseType", "derived", "type", "or", "a", "container", "type", ".", "The", "array", "is", "based", "on", "a", "template", "var...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/parsers/DDSXMLParser.java#L352-L431
test
Parses an Array element.
Of course, here is the Java code you requested: ```java private void parseArray(Element ArrayElement, DArray da, String indent) throws DASException, NoSuchTypeException, BadSemanticsException { int countTemplateVars = 0; int numDims = 0; for (Element e : ArrayElement.getChil...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/index/OCompositeIndexDefinition.java
OCompositeIndexDefinition.addIndex
public void addIndex(final OIndexDefinition indexDefinition) { indexDefinitions.add(indexDefinition); if (indexDefinition instanceof OIndexDefinitionMultiValue) { if (multiValueDefinitionIndex == -1) multiValueDefinitionIndex = indexDefinitions.size() - 1; else throw new OIndex...
java
public void addIndex(final OIndexDefinition indexDefinition) { indexDefinitions.add(indexDefinition); if (indexDefinition instanceof OIndexDefinitionMultiValue) { if (multiValueDefinitionIndex == -1) multiValueDefinitionIndex = indexDefinitions.size() - 1; else throw new OIndex...
[ "public", "void", "addIndex", "(", "final", "OIndexDefinition", "indexDefinition", ")", "{", "indexDefinitions", ".", "add", "(", "indexDefinition", ")", ";", "if", "(", "indexDefinition", "instanceof", "OIndexDefinitionMultiValue", ")", "{", "if", "(", "multiValueD...
Add new indexDefinition in current composite. @param indexDefinition Index to add.
[ "Add", "new", "indexDefinition", "in", "current", "composite", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/index/OCompositeIndexDefinition.java#L96-L106
test
Adds an index definition to the composite key.
Of course, here is the Java code you requested: ```java public void addIndex(final OIndexDefinition indexDefinition) { indexDefinitions.add(indexDefinition); if (indexDefinition instanceof OIndexDefinitionMultiValue) { if (multiValueDefinitionIndex == -1) multiValueDefinitionIndex = indexDefi...
Unidata/thredds
udunits/src/main/java/ucar/units/ScaledUnit.java
ScaledUnit.myRaiseTo
@Override protected Unit myRaiseTo(final int power) throws RaiseException { return new ScaledUnit(Math.pow(getScale(), power), getUnit().raiseTo( power)); }
java
@Override protected Unit myRaiseTo(final int power) throws RaiseException { return new ScaledUnit(Math.pow(getScale(), power), getUnit().raiseTo( power)); }
[ "@", "Override", "protected", "Unit", "myRaiseTo", "(", "final", "int", "power", ")", "throws", "RaiseException", "{", "return", "new", "ScaledUnit", "(", "Math", ".", "pow", "(", "getScale", "(", ")", ",", "power", ")", ",", "getUnit", "(", ")", ".", ...
Raises this unit to a power. @param power The power. @return The result of raising this unit to the power. @throws RaiseException Can't raise this unit to a power.
[ "Raises", "this", "unit", "to", "a", "power", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/ScaledUnit.java#L189-L193
test
Returns a new unit that is scaled to the given power.
Of course, here is the Java code you requested: ```java @Override protected Unit myRaiseTo(final int power) throws RaiseException { return new ScaledUnit(Math.pow(getScale(), power), getUnit().raiseTo( power)); } ``` Hope this helps!
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/impl/SimpleContext.java
SimpleContext.findList
public <T> List<T> findList(Class<T> clazz) { List<T> list = new ArrayList<T>(); for (Entry<String, Object> entry : contextMap.entrySet()) { if (clazz.isInstance(entry.getValue())) { list.add(clazz.cast(entry.getValue())); } } return list; }
java
public <T> List<T> findList(Class<T> clazz) { List<T> list = new ArrayList<T>(); for (Entry<String, Object> entry : contextMap.entrySet()) { if (clazz.isInstance(entry.getValue())) { list.add(clazz.cast(entry.getValue())); } } return list; }
[ "public", "<", "T", ">", "List", "<", "T", ">", "findList", "(", "Class", "<", "T", ">", "clazz", ")", "{", "List", "<", "T", ">", "list", "=", "new", "ArrayList", "<", "T", ">", "(", ")", ";", "for", "(", "Entry", "<", "String", ",", "Object...
对外部提供的查找对象实例列表方法,根据class类型查找 @param clazz @return
[ "对外部提供的查找对象实例列表方法,根据class类型查找" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/impl/SimpleContext.java#L65-L73
test
Find list of objects of type clazz.
Of course, here is the Java code you requested: ```java public <T> List<T> findList(Class<T> clazz) { List<T> list = new ArrayList<T>(); for (Entry<String, Object> entry : contextMap.entrySet()) { if (clazz.isInstance(entry.getValue())) { list.add(clazz.cast(entry.getValue())); } } return list; } ``...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/grads/GradsDataDescriptorFile.java
GradsDataDescriptorFile.getFullPath
private String getFullPath(String filename) { String file; String ddfPath = getDDFPath(); if (filename.startsWith("^")) { file = filename.replace("^", ""); file = ddfPath + file; } else { File f = new File(filename); if (!f.isAbsolute()) { file = ddfPath + file...
java
private String getFullPath(String filename) { String file; String ddfPath = getDDFPath(); if (filename.startsWith("^")) { file = filename.replace("^", ""); file = ddfPath + file; } else { File f = new File(filename); if (!f.isAbsolute()) { file = ddfPath + file...
[ "private", "String", "getFullPath", "(", "String", "filename", ")", "{", "String", "file", ";", "String", "ddfPath", "=", "getDDFPath", "(", ")", ";", "if", "(", "filename", ".", "startsWith", "(", "\"^\"", ")", ")", "{", "file", "=", "filename", ".", ...
Get the full path for a given filename @param filename the raw filename @return the full filename
[ "Get", "the", "full", "path", "for", "a", "given", "filename" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/grads/GradsDataDescriptorFile.java#L982-L999
test
Gets the full path of the file.
Of course, here is the Java code you requested: ```java private String getFullPath(String filename) { String file; String ddfPath = getDDFPath(); if (filename.startsWith("^")) { file = filename.replace("^", ""); file = ddfPath + file; } else { File f = new File(filename); ...
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/component/EJBComponentDescription.java
EJBComponentDescription.hasBeanLevelSecurityMetadata
public boolean hasBeanLevelSecurityMetadata() { // if an explicit security-domain is present, then we consider it the bean to be processed by security interceptors if (securityDomain != null) { return true; } // if a run-as is present, then we consider it the bean to be processe...
java
public boolean hasBeanLevelSecurityMetadata() { // if an explicit security-domain is present, then we consider it the bean to be processed by security interceptors if (securityDomain != null) { return true; } // if a run-as is present, then we consider it the bean to be processe...
[ "public", "boolean", "hasBeanLevelSecurityMetadata", "(", ")", "{", "// if an explicit security-domain is present, then we consider it the bean to be processed by security interceptors", "if", "(", "securityDomain", "!=", "null", ")", "{", "return", "true", ";", "}", "// if a run...
Returns true if this component description has any security metadata configured at the EJB level. Else returns false. Note that this method does *not* consider method level security metadata. @return
[ "Returns", "true", "if", "this", "component", "description", "has", "any", "security", "metadata", "configured", "at", "the", "EJB", "level", ".", "Else", "returns", "false", ".", "Note", "that", "this", "method", "does", "*", "not", "*", "consider", "method...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/component/EJBComponentDescription.java#L840-L867
test
Checks if the bean has a security metadata at the bean level.
Of course, here is the Java code you requested: ```java public boolean hasBeanLevelSecurityMetadata() { // if an explicit security-domain is present, then we consider it the bean to be processed by security interceptors if (securityDomain != null) { return true; } // if a run-a...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTxPooled.java
ODatabaseDocumentTxPooled.close
@Override public void close() { if (isClosed()) return; checkOpenness(); if (ownerPool != null && ownerPool.getConnectionsInCurrentThread(getURL(), userName) > 1) { ownerPool.release(this); return; } try { commit(true); } catch (Exception e) { OL...
java
@Override public void close() { if (isClosed()) return; checkOpenness(); if (ownerPool != null && ownerPool.getConnectionsInCurrentThread(getURL(), userName) > 1) { ownerPool.release(this); return; } try { commit(true); } catch (Exception e) { OL...
[ "@", "Override", "public", "void", "close", "(", ")", "{", "if", "(", "isClosed", "(", ")", ")", "return", ";", "checkOpenness", "(", ")", ";", "if", "(", "ownerPool", "!=", "null", "&&", "ownerPool", ".", "getConnectionsInCurrentThread", "(", "getURL", ...
Avoid to close it but rather release itself to the owner pool.
[ "Avoid", "to", "close", "it", "but", "rather", "release", "itself", "to", "the", "owner", "pool", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTxPooled.java#L109-L142
test
Close the database.
Of course, here is the Java code you requested: ```java @Override public void close() { if (isClosed()) return; checkOpenness(); if (ownerPool != null && ownerPool.getConnectionsInCurrentThread(getURL(), userName) > 1) { ownerPool.release(this); return; } try { ...
mbeiter/jaas
loginmodules/password/pwcommon/src/main/java/org/beiter/michael/authn/jaas/loginmodules/password/common/PasswordLoginModule.java
PasswordLoginModule.initMessageQueue
@SuppressWarnings("PMD.ConfusingTernary") private void initMessageQueue(final CommonProperties commonProps) { try { final String messageClassName = commonProps.getMessageQueueClassName(); // this would be harder to read when following PMD's advice - ignoring the PMD warning ...
java
@SuppressWarnings("PMD.ConfusingTernary") private void initMessageQueue(final CommonProperties commonProps) { try { final String messageClassName = commonProps.getMessageQueueClassName(); // this would be harder to read when following PMD's advice - ignoring the PMD warning ...
[ "@", "SuppressWarnings", "(", "\"PMD.ConfusingTernary\"", ")", "private", "void", "initMessageQueue", "(", "final", "CommonProperties", "commonProps", ")", "{", "try", "{", "final", "String", "messageClassName", "=", "commonProps", ".", "getMessageQueueClassName", "(", ...
Initialize the instance-global message queue object @param commonProps The parsed JAAS configuration, plus additional raw values
[ "Initialize", "the", "instance", "-", "global", "message", "queue", "object" ]
540e78af91c73291fa0e57b0df352f4a22950772
https://github.com/mbeiter/jaas/blob/540e78af91c73291fa0e57b0df352f4a22950772/loginmodules/password/pwcommon/src/main/java/org/beiter/michael/authn/jaas/loginmodules/password/common/PasswordLoginModule.java#L558-L589
test
Initialize the message queue.
Of course, here is the Java code you requested: ```java @SuppressWarnings("PMD.ConfusingTernary") private void initMessageQueue(final CommonProperties commonProps) { try { final String messageClassName = commonProps.getMessageQueueClassName(); // this would be harder to read when f...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/fonts/FontManager.java
FontManager.getAssetFonts
private static Map<String, String> getAssetFonts(Context context) { synchronized (ASSET_FONTS_BY_NAME) { /* * Let's do this only once because it's expensive and the result won't change in any case. */ if (ASSET_FONTS_BY_NAME.isEmpty()) { AssetMan...
java
private static Map<String, String> getAssetFonts(Context context) { synchronized (ASSET_FONTS_BY_NAME) { /* * Let's do this only once because it's expensive and the result won't change in any case. */ if (ASSET_FONTS_BY_NAME.isEmpty()) { AssetMan...
[ "private", "static", "Map", "<", "String", ",", "String", ">", "getAssetFonts", "(", "Context", "context", ")", "{", "synchronized", "(", "ASSET_FONTS_BY_NAME", ")", "{", "/*\n * Let's do this only once because it's expensive and the result won't change in any case....
Retrieve the fonts from the asset folder. @return A Map mapping name of the font to the file path. If the name can't be retrieved the file name will be used (e.g. arial.ttf).
[ "Retrieve", "the", "fonts", "from", "the", "asset", "folder", "." ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/fonts/FontManager.java#L145-L171
test
Get the asset fonts
Of course, here is the Java code you requested: ```java private static Map<String, String> getAssetFonts(Context context) { synchronized (ASSET_FONTS_BY_NAME) { /* * Let's do this only once because it's expensive and the result won't change in any case. */ if (...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/utils/NestedHashtable.java
NestedHashtable.get
public Object get(Object key) { Object value = localValues.get(key); if (value == null && defaults != null) return defaults.get(key); return value; }
java
public Object get(Object key) { Object value = localValues.get(key); if (value == null && defaults != null) return defaults.get(key); return value; }
[ "public", "Object", "get", "(", "Object", "key", ")", "{", "Object", "value", "=", "localValues", ".", "get", "(", "key", ")", ";", "if", "(", "value", "==", "null", "&&", "defaults", "!=", "null", ")", "return", "defaults", ".", "get", "(", "key", ...
Return the value for the given key. @param key the key to look up @return the value for the key or null if none.
[ "Return", "the", "value", "for", "the", "given", "key", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/utils/NestedHashtable.java#L61-L66
test
Get the value for the specified key.
Of course, here is the Java code you requested: ```java public Object get(Object key) { Object value = localValues.get(key); if (value == null && defaults != null) return defaults.get(key); return value; } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/xmlparser/UTF8Reader.java
UTF8Reader.read
public int read() throws IOException { // decode character int c = fSurrogate; if (fSurrogate == -1) { // NOTE: We use the index into the buffer if there are remaining // bytes from the last block read. -Ac int index = 0; // get first byte ...
java
public int read() throws IOException { // decode character int c = fSurrogate; if (fSurrogate == -1) { // NOTE: We use the index into the buffer if there are remaining // bytes from the last block read. -Ac int index = 0; // get first byte ...
[ "public", "int", "read", "(", ")", "throws", "IOException", "{", "// decode character", "int", "c", "=", "fSurrogate", ";", "if", "(", "fSurrogate", "==", "-", "1", ")", "{", "// NOTE: We use the index into the buffer if there are remaining", "// bytes from the la...
Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached. <p> Subclasses that intend to support efficient single-character input should override this method. @return The character read, as an integer in the range 0 to 16383 (<tt>0x00...
[ "Read", "a", "single", "character", ".", "This", "method", "will", "block", "until", "a", "character", "is", "available", "an", "I", "/", "O", "error", "occurs", "or", "the", "end", "of", "the", "stream", "is", "reached", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/xmlparser/UTF8Reader.java#L131-L246
test
read the next unicode code point from the input stream.
Of course, here is the Java code you requested: ```java public int read() throws IOException { // decode character int c = fSurrogate; if (fSurrogate == -1) { // NOTE: We use the index into the buffer if there are remaining // bytes from the last block read. -Ac ...
oblac/jodd
jodd-decora/src/main/java/jodd/decora/DecoraManager.java
DecoraManager.resolveDecorator
public String resolveDecorator(final HttpServletRequest request, final String actionPath) { if (actionPath.endsWith(".html")) { return DEFAULT_DECORATOR; } return null; }
java
public String resolveDecorator(final HttpServletRequest request, final String actionPath) { if (actionPath.endsWith(".html")) { return DEFAULT_DECORATOR; } return null; }
[ "public", "String", "resolveDecorator", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "actionPath", ")", "{", "if", "(", "actionPath", ".", "endsWith", "(", "\".html\"", ")", ")", "{", "return", "DEFAULT_DECORATOR", ";", "}", "return", ...
Resolves decorator path based on request and action path. If decorator is not found, returns <code>null</code>. By default applies decorator on all *.html pages.
[ "Resolves", "decorator", "path", "based", "on", "request", "and", "action", "path", ".", "If", "decorator", "is", "not", "found", "returns", "<code", ">", "null<", "/", "code", ">", ".", "By", "default", "applies", "decorator", "on", "all", "*", ".", "ht...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-decora/src/main/java/jodd/decora/DecoraManager.java#L146-L151
test
Resolve decorator.
Of course, here is the Java code you requested: ```java public String resolveDecorator(final HttpServletRequest request, final String actionPath) { if (actionPath.endsWith(".html")) { return DEFAULT_DECORATOR; } return null; } ``` Hope this helps!
playframework/playframework
web/play-java-forms/src/main/java/play/data/validation/MappedConstraintValidatorFactory.java
MappedConstraintValidatorFactory.newInstance
private <T extends ConstraintValidator<?, ?>> T newInstance(Class<T> key) { try { return key.getDeclaredConstructor().newInstance(); } catch (InstantiationException | RuntimeException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ex) { t...
java
private <T extends ConstraintValidator<?, ?>> T newInstance(Class<T> key) { try { return key.getDeclaredConstructor().newInstance(); } catch (InstantiationException | RuntimeException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ex) { t...
[ "private", "<", "T", "extends", "ConstraintValidator", "<", "?", ",", "?", ">", ">", "T", "newInstance", "(", "Class", "<", "T", ">", "key", ")", "{", "try", "{", "return", "key", ".", "getDeclaredConstructor", "(", ")", ".", "newInstance", "(", ")", ...
need to do so.
[ "need", "to", "do", "so", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/web/play-java-forms/src/main/java/play/data/validation/MappedConstraintValidatorFactory.java#L67-L77
test
Create a new instance of the specified class.
Of course, here is the Java code you requested: ```java private <T extends ConstraintValidator<?, ?>> T newInstance(Class<T> key) { try { return key.getDeclaredConstructor().newInstance(); } catch (InstantiationException | RuntimeException | IllegalAccessException | NoSuchMethodEx...
MagicTheGathering/mtg-sdk-java
src/main/java/io/magicthegathering/javasdk/api/CardAPI.java
CardAPI.getAllCards
public static List<Card> getAllCards(List<String> filters){ return getList(RESOURCE_PATH, "cards", Card.class, filters); }
java
public static List<Card> getAllCards(List<String> filters){ return getList(RESOURCE_PATH, "cards", Card.class, filters); }
[ "public", "static", "List", "<", "Card", ">", "getAllCards", "(", "List", "<", "String", ">", "filters", ")", "{", "return", "getList", "(", "RESOURCE_PATH", ",", "\"cards\"", ",", "Card", ".", "class", ",", "filters", ")", ";", "}" ]
Get all the {@link Card} that match a certain filter. @param filters List of filters supported by the web API @return List of all matching {@link Card}s. @see <a href="https://docs.magicthegathering.io/#cards"> https://docs.magicthegathering.io/#cards</a>
[ "Get", "all", "the", "{", "@link", "Card", "}", "that", "match", "a", "certain", "filter", ".", "@param", "filters", "List", "of", "filters", "supported", "by", "the", "web", "API", "@return", "List", "of", "all", "matching", "{", "@link", "Card", "}", ...
2fce7d14155c07d41ec2830d56308287ae4646d9
https://github.com/MagicTheGathering/mtg-sdk-java/blob/2fce7d14155c07d41ec2830d56308287ae4646d9/src/main/java/io/magicthegathering/javasdk/api/CardAPI.java#L79-L81
test
Returns all Card resources matching the criteria specified in the passed in filters.
Of course, here is the Java code you requested: ```java public static List<Card> getAllCards(List<String> filters){ return getList(RESOURCE_PATH, "cards", Card.class, filters); } ``` Hope this helps!
wildfly/wildfly
pojo/src/main/java/org/jboss/as/pojo/service/Configurator.java
Configurator.locateMethod
@SuppressWarnings("unchecked") private static Method locateMethod(ClassReflectionIndex classInfo, String name, String[] paramTypes, boolean isStatic, boolean isPublic, boolean strict) { Collection<Method> methods = classInfo.getMethods(); if (methods != null) { for (Method method : metho...
java
@SuppressWarnings("unchecked") private static Method locateMethod(ClassReflectionIndex classInfo, String name, String[] paramTypes, boolean isStatic, boolean isPublic, boolean strict) { Collection<Method> methods = classInfo.getMethods(); if (methods != null) { for (Method method : metho...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "Method", "locateMethod", "(", "ClassReflectionIndex", "classInfo", ",", "String", "name", ",", "String", "[", "]", "paramTypes", ",", "boolean", "isStatic", ",", "boolean", "isPublic", ",", ...
Find method info @param classInfo the class info @param name the method name @param paramTypes the parameter types @param isStatic must the method be static @param isPublic must the method be public @param strict is strict about method modifiers @return the method info or null if not found
[ "Find", "method", "info" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/pojo/src/main/java/org/jboss/as/pojo/service/Configurator.java#L200-L212
test
Locate a method in the class.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") private static Method locateMethod(ClassReflectionIndex classInfo, String name, String[] paramTypes, boolean isStatic, boolean isPublic, boolean strict) { Collection<Method> methods = classInfo.getMethods(); if (...
RestComm/jain-slee
container/usage/src/main/java/org/mobicents/slee/container/management/jmx/UsageMBeanImpl.java
UsageMBeanImpl.sendUsageNotification
public void sendUsageNotification(long value, long seqno, String usageParameterSetName, String usageParameterName, boolean isCounter) { UsageNotificationManagerMBeanImpl notificationManager = parent .getUsageNotificationManagerMBean(notificationSource); if (notificationManager == null || notificationM...
java
public void sendUsageNotification(long value, long seqno, String usageParameterSetName, String usageParameterName, boolean isCounter) { UsageNotificationManagerMBeanImpl notificationManager = parent .getUsageNotificationManagerMBean(notificationSource); if (notificationManager == null || notificationM...
[ "public", "void", "sendUsageNotification", "(", "long", "value", ",", "long", "seqno", ",", "String", "usageParameterSetName", ",", "String", "usageParameterName", ",", "boolean", "isCounter", ")", "{", "UsageNotificationManagerMBeanImpl", "notificationManager", "=", "p...
Send the notification. @param value @param seqno @param usageParameterSetName @param usageParameterName @param isCounter
[ "Send", "the", "notification", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/usage/src/main/java/org/mobicents/slee/container/management/jmx/UsageMBeanImpl.java#L168-L189
test
Sends a usage notification to all registered listeners.
Of course, here is the Java code you requested: ```java public void sendUsageNotification(long value, long seqno, String usageParameterSetName, String usageParameterName, boolean isCounter) { UsageNotificationManagerMBeanImpl notificationManager = parent .getUsageNotificationManagerMBean(notificationSource...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dt/radial/RadialCoordSys.java
RadialCoordSys.main
static public void main( String[] args) { System.out.println("1 Deg="+Math.toDegrees( 1000 * 111.0 / Earth.getRadius())); }
java
static public void main( String[] args) { System.out.println("1 Deg="+Math.toDegrees( 1000 * 111.0 / Earth.getRadius())); }
[ "static", "public", "void", "main", "(", "String", "[", "]", "args", ")", "{", "System", ".", "out", ".", "println", "(", "\"1 Deg=\"", "+", "Math", ".", "toDegrees", "(", "1000", "*", "111.0", "/", "Earth", ".", "getRadius", "(", ")", ")", ")", ";...
debug
[ "debug" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dt/radial/RadialCoordSys.java#L198-L200
test
Demonstrates how to use the CDN formula.
Of course, here is the Java code you requested: ```java static public void main( String[] args) { System.out.println("1 Deg="+Math.toDegrees( 1000 * 111.0 / Earth.getRadius())); } ``` Hope this helps!
real-logic/aeron
aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java
ChannelUriStringBuilder.build
@SuppressWarnings("MethodLength") public String build() { sb.setLength(0); if (null != prefix && !"".equals(prefix)) { sb.append(prefix).append(':'); } sb.append(ChannelUri.AERON_SCHEME).append(':').append(media).append('?'); if (null != tags) ...
java
@SuppressWarnings("MethodLength") public String build() { sb.setLength(0); if (null != prefix && !"".equals(prefix)) { sb.append(prefix).append(':'); } sb.append(ChannelUri.AERON_SCHEME).append(':').append(media).append('?'); if (null != tags) ...
[ "@", "SuppressWarnings", "(", "\"MethodLength\"", ")", "public", "String", "build", "(", ")", "{", "sb", ".", "setLength", "(", "0", ")", ";", "if", "(", "null", "!=", "prefix", "&&", "!", "\"\"", ".", "equals", "(", "prefix", ")", ")", "{", "sb", ...
Build a channel URI String for the given parameters. @return a channel URI String for the given parameters.
[ "Build", "a", "channel", "URI", "String", "for", "the", "given", "parameters", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java#L752-L861
test
Build the NCSUCTYPE string.
Of course, here is the Java code you requested: ```java @SuppressWarnings("MethodLength") public String build() { sb.setLength(0); if (null != prefix && !"".equals(prefix)) { sb.append(prefix).append(':'); } sb.append(ChannelUri.AERON_SCHEME).append(':').ap...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java
UrlAuthorizationConfigurer.getDecisionVoters
@Override @SuppressWarnings("rawtypes") final List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http) { List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<AccessDecisionVoter<? extends Object>>(); decisionVoters.add(new RoleVoter()); decisionVoters.add(new AuthenticatedVote...
java
@Override @SuppressWarnings("rawtypes") final List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http) { List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<AccessDecisionVoter<? extends Object>>(); decisionVoters.add(new RoleVoter()); decisionVoters.add(new AuthenticatedVote...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "final", "List", "<", "AccessDecisionVoter", "<", "?", "extends", "Object", ">", ">", "getDecisionVoters", "(", "H", "http", ")", "{", "List", "<", "AccessDecisionVoter", "<", "?", "extends", ...
Creates the default {@link AccessDecisionVoter} instances used if an {@link AccessDecisionManager} was not specified. @param http the builder to use
[ "Creates", "the", "default", "{", "@link", "AccessDecisionVoter", "}", "instances", "used", "if", "an", "{", "@link", "AccessDecisionManager", "}", "was", "not", "specified", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java#L173-L180
test
Override to return a list of access decision voters.
Of course, here is the Java code you requested: ```java @Override @SuppressWarnings("rawtypes") final List<AccessDecisionVoter<? extends Object>> getDecisionVoters(H http) { List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<AccessDecisionVoter<? extends Object>>(); decisionVoters.add(new...
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/ProxyInvocationHandler.java
ProxyInvocationHandler.invoke
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final Interceptor interceptor = interceptors.get(method); if (interceptor == null) { throw new NoSuchMethodError(method.toString()); } final InterceptorContext context = new ...
java
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final Interceptor interceptor = interceptors.get(method); if (interceptor == null) { throw new NoSuchMethodError(method.toString()); } final InterceptorContext context = new ...
[ "public", "Object", "invoke", "(", "final", "Object", "proxy", ",", "final", "Method", "method", ",", "final", "Object", "[", "]", "args", ")", "throws", "Throwable", "{", "final", "Interceptor", "interceptor", "=", "interceptors", ".", "get", "(", "method",...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ProxyInvocationHandler.java#L62-L82
test
Invoke the method on the component view.
Of course, here is the Java code you requested: ```java public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final Interceptor interceptor = interceptors.get(method); if (interceptor == null) { throw new NoSuchMethodError(method.toString()); ...
jcodec/jcodec
src/main/java/org/jcodec/containers/flv/FLVReader.java
FLVReader.repositionFile
public boolean repositionFile() throws IOException { int payloadSize = 0; for (int i = 0; i < REPOSITION_BUFFER_READS; i++) { while (readBuf.hasRemaining()) { payloadSize = ((payloadSize & 0xffff) << 8) | (readBuf.get() & 0xff); int pointerPos = readBuf.positi...
java
public boolean repositionFile() throws IOException { int payloadSize = 0; for (int i = 0; i < REPOSITION_BUFFER_READS; i++) { while (readBuf.hasRemaining()) { payloadSize = ((payloadSize & 0xffff) << 8) | (readBuf.get() & 0xff); int pointerPos = readBuf.positi...
[ "public", "boolean", "repositionFile", "(", ")", "throws", "IOException", "{", "int", "payloadSize", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "REPOSITION_BUFFER_READS", ";", "i", "++", ")", "{", "while", "(", "readBuf", ".", "has...
Searching for the next tag in a file after corrupt segment @return @throws IOException
[ "Searching", "for", "the", "next", "tag", "in", "a", "file", "after", "corrupt", "segment" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/containers/flv/FLVReader.java#L388-L405
test
Reposition the file.
Of course, here is the Java code you requested: ```java public boolean repositionFile() throws IOException { int payloadSize = 0; for (int i = 0; i < REPOSITION_BUFFER_READS; i++) { while (readBuf.hasRemaining()) { payloadSize = ((payloadSize & 0xffff) << 8) | (readBuf.get()...
oblac/jodd
jodd-joy/src/main/java/jodd/joy/JoyPaths.java
JoyPaths.start
@Override public void start() { initLogger(); final String resourceName = StringUtil.replaceChar(JoyPaths.class.getName(), '.', '/') + ".class"; URL url = ClassLoaderUtil.getResourceUrl(resourceName); if (url == null) { throw new JoyException("Failed to resolve app dir, missing: " + resourceName); } ...
java
@Override public void start() { initLogger(); final String resourceName = StringUtil.replaceChar(JoyPaths.class.getName(), '.', '/') + ".class"; URL url = ClassLoaderUtil.getResourceUrl(resourceName); if (url == null) { throw new JoyException("Failed to resolve app dir, missing: " + resourceName); } ...
[ "@", "Override", "public", "void", "start", "(", ")", "{", "initLogger", "(", ")", ";", "final", "String", "resourceName", "=", "StringUtil", ".", "replaceChar", "(", "JoyPaths", ".", "class", ".", "getName", "(", ")", ",", "'", "'", ",", "'", "'", "...
---------------------------------------------------------------- lifecycle
[ "----------------------------------------------------------------", "lifecycle" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-joy/src/main/java/jodd/joy/JoyPaths.java#L52-L81
test
Start the application.
Of course, here is the Java code you requested: ```java @Override public void start() { initLogger(); final String resourceName = StringUtil.replaceChar(JoyPaths.class.getName(), '.', '/') + ".class"; URL url = ClassLoaderUtil.getResourceUrl(resourceName); if (url == null) { throw new JoyException("Fail...
stanfy/enroscar
net/src/main/java/com/stanfy/enroscar/net/cache/CacheEntry.java
CacheEntry.writeLong
protected static void writeLong(final Writer writer, final long value) throws IOException { writer.write(new StringBuilder().append(value).append('\n').toString()); }
java
protected static void writeLong(final Writer writer, final long value) throws IOException { writer.write(new StringBuilder().append(value).append('\n').toString()); }
[ "protected", "static", "void", "writeLong", "(", "final", "Writer", "writer", ",", "final", "long", "value", ")", "throws", "IOException", "{", "writer", ".", "write", "(", "new", "StringBuilder", "(", ")", ".", "append", "(", "value", ")", ".", "append", ...
Write next line as a long. @param writer output writer @param value integer value @throws IOException if error happens
[ "Write", "next", "line", "as", "a", "long", "." ]
0e64f3c309d62e359b55ddcba10e3cc592f5e083
https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/net/src/main/java/com/stanfy/enroscar/net/cache/CacheEntry.java#L252-L254
test
Write long.
Of course, here is the Java code you requested: ```java protected static void writeLong(final Writer writer, final long value) throws IOException { writer.write(new StringBuilder().append(value).append('\n').toString()); } ``` Hope this helps!
Unidata/thredds
dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Cursor.java
Nc4Cursor.getVlenType
public TypeNotes getVlenType(DapVariable v) { DapType t = v.getBaseType(); if(t.getSort() != DapSort.SEQUENCE || ((DapSequence) t).getFields().size() != 1) throw new IllegalArgumentException(t.getFQN()); DapSequence ds = (DapSequence) t; DapVariable f0...
java
public TypeNotes getVlenType(DapVariable v) { DapType t = v.getBaseType(); if(t.getSort() != DapSort.SEQUENCE || ((DapSequence) t).getFields().size() != 1) throw new IllegalArgumentException(t.getFQN()); DapSequence ds = (DapSequence) t; DapVariable f0...
[ "public", "TypeNotes", "getVlenType", "(", "DapVariable", "v", ")", "{", "DapType", "t", "=", "v", ".", "getBaseType", "(", ")", ";", "if", "(", "t", ".", "getSort", "(", ")", "!=", "DapSort", ".", "SEQUENCE", "||", "(", "(", "DapSequence", ")", "t",...
If the basetype is sequence (=> isVlen()), then return the type of the first field of this sequence. Otherwise return null. @return the type of the first field
[ "If", "the", "basetype", "is", "sequence", "(", "=", ">", "isVlen", "()", ")", "then", "return", "the", "type", "of", "the", "first", "field", "of", "this", "sequence", ".", "Otherwise", "return", "null", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Cursor.java#L668-L679
test
Get the type notes for a single type
Of course, here is the Java code you requested: ```java public TypeNotes getVlenType(DapVariable v) { DapType t = v.getBaseType(); if(t.getSort() != DapSort.SEQUENCE || ((DapSequence) t).getFields().size() != 1) throw new IllegalArgumentException(t.getFQN()); ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/db/OrientDB.java
OrientDB.createIfNotExists
public boolean createIfNotExists(String database, ODatabaseType type, OrientDBConfig config) { if (!this.internal.exists(database, serverUser, serverPassword)) { this.internal.create(database, serverUser, serverPassword, type, config); return true; } return false; }
java
public boolean createIfNotExists(String database, ODatabaseType type, OrientDBConfig config) { if (!this.internal.exists(database, serverUser, serverPassword)) { this.internal.create(database, serverUser, serverPassword, type, config); return true; } return false; }
[ "public", "boolean", "createIfNotExists", "(", "String", "database", ",", "ODatabaseType", "type", ",", "OrientDBConfig", "config", ")", "{", "if", "(", "!", "this", ".", "internal", ".", "exists", "(", "database", ",", "serverUser", ",", "serverPassword", ")"...
Create a new database if not exists @param database database name @param type can be plocal or memory @param config custom configuration for current database @return true if the database has been created, false if already exists
[ "Create", "a", "new", "database", "if", "not", "exists" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/db/OrientDB.java#L250-L256
test
Create if not exist.
Of course, here is the Java code you requested: ```java public boolean createIfNotExists(String database, ODatabaseType type, OrientDBConfig config) { if (!this.internal.exists(database, serverUser, serverPassword)) { this.internal.create(database, serverUser, serverPassword, type, config); return true...
google/guice
extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java
ServletDefinition.doService
void doService(final ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { HttpServletRequest request = new HttpServletRequestWrapper((HttpServletRequest) servletRequest) { private boolean pathComputed; private String path; ...
java
void doService(final ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { HttpServletRequest request = new HttpServletRequestWrapper((HttpServletRequest) servletRequest) { private boolean pathComputed; private String path; ...
[ "void", "doService", "(", "final", "ServletRequest", "servletRequest", ",", "ServletResponse", "servletResponse", ")", "throws", "ServletException", ",", "IOException", "{", "HttpServletRequest", "request", "=", "new", "HttpServletRequestWrapper", "(", "(", "HttpServletRe...
Utility that delegates to the actual service method of the servlet wrapped with a contextual request (i.e. with correctly computed path info). <p>We need to suppress deprecation coz we use HttpServletRequestWrapper, which implements deprecated API for backwards compatibility.
[ "Utility", "that", "delegates", "to", "the", "actual", "service", "method", "of", "the", "servlet", "wrapped", "with", "a", "contextual", "request", "(", "i", ".", "e", ".", "with", "correctly", "computed", "path", "info", ")", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/extensions/servlet/src/com/google/inject/servlet/ServletDefinition.java#L198-L281
test
This method is called by the service to perform the actual processing of the servlet request.
Of course, here is the Java code you requested: ```java void doService(final ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { HttpServletRequest request = new HttpServletRequestWrapper((HttpServletRequest) servletRequest) { private bool...
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/metadata/EJBClientDescriptorMetaData.java
EJBClientDescriptorMetaData.addRemotingReceiverConnectionRef
public RemotingReceiverConfiguration addRemotingReceiverConnectionRef(final String outboundConnectionRef) { if (outboundConnectionRef == null || outboundConnectionRef.trim().isEmpty()) { throw new IllegalArgumentException("Cannot add a remoting receiver which references a null/empty outbound connect...
java
public RemotingReceiverConfiguration addRemotingReceiverConnectionRef(final String outboundConnectionRef) { if (outboundConnectionRef == null || outboundConnectionRef.trim().isEmpty()) { throw new IllegalArgumentException("Cannot add a remoting receiver which references a null/empty outbound connect...
[ "public", "RemotingReceiverConfiguration", "addRemotingReceiverConnectionRef", "(", "final", "String", "outboundConnectionRef", ")", "{", "if", "(", "outboundConnectionRef", "==", "null", "||", "outboundConnectionRef", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ...
Adds an outbound connection reference used by a remoting receiver in the client context represented by this {@link EJBClientDescriptorMetaData} @param outboundConnectionRef The name of the outbound connection. Cannot be null or empty string.
[ "Adds", "an", "outbound", "connection", "reference", "used", "by", "a", "remoting", "receiver", "in", "the", "client", "context", "represented", "by", "this", "{", "@link", "EJBClientDescriptorMetaData", "}" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/metadata/EJBClientDescriptorMetaData.java#L57-L64
test
Add a remoting receiver which references a connection reference.
Of course, here is the Java code you requested: ```java public RemotingReceiverConfiguration addRemotingReceiverConnectionRef(final String outboundConnectionRef) { if (outboundConnectionRef == null || outboundConnectionRef.trim().isEmpty()) { throw new IllegalArgumentException("Cannot add a remotin...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/GribNumbers.java
GribNumbers.countBits
public static int countBits(byte[] bitmap) { int bits = 0; for (byte b : bitmap) { short s = DataType.unsignedByteToShort(b); bits += Long.bitCount(s); } return bits; }
java
public static int countBits(byte[] bitmap) { int bits = 0; for (byte b : bitmap) { short s = DataType.unsignedByteToShort(b); bits += Long.bitCount(s); } return bits; }
[ "public", "static", "int", "countBits", "(", "byte", "[", "]", "bitmap", ")", "{", "int", "bits", "=", "0", ";", "for", "(", "byte", "b", ":", "bitmap", ")", "{", "short", "s", "=", "DataType", ".", "unsignedByteToShort", "(", "b", ")", ";", "bits"...
count number of bits on in bitmap
[ "count", "number", "of", "bits", "on", "in", "bitmap" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/GribNumbers.java#L287-L294
test
Count the number of bits in a given byte array
Of course, here is the Java code you requested: ```java public static int countBits(byte[] bitmap) { int bits = 0; for (byte b : bitmap) { short s = DataType.unsignedByteToShort(b); bits += Long.bitCount(s); } return bits; } ``` Hope this helps!
Unidata/thredds
dap4/d4lib/src/main/java/dap4/dap4lib/DMRPrinter.java
DMRPrinter.printNode
public void printNode(DapNode node) throws IOException { if(node == null) return; DapSort sort = node.getSort(); String dmrname = sort.getName(); switch (sort) { case DATASET:// treat like group case GROUP: if(!this.ce.referen...
java
public void printNode(DapNode node) throws IOException { if(node == null) return; DapSort sort = node.getSort(); String dmrname = sort.getName(); switch (sort) { case DATASET:// treat like group case GROUP: if(!this.ce.referen...
[ "public", "void", "printNode", "(", "DapNode", "node", ")", "throws", "IOException", "{", "if", "(", "node", "==", "null", ")", "return", ";", "DapSort", "sort", "=", "node", ".", "getSort", "(", ")", ";", "String", "dmrname", "=", "sort", ".", "getNam...
Print an arbitrary DapNode and its subnodes as if it is being sent to a client with optional constraint; inclusions are determined by the view. <p> Handling newlines is a bit tricky because they may be embedded for e.g. groups, enums, etc. So the rule is that the last newline is elided and left for the caller to print...
[ "Print", "an", "arbitrary", "DapNode", "and", "its", "subnodes", "as", "if", "it", "is", "being", "sent", "to", "a", "client", "with", "optional", "constraint", ";", "inclusions", "are", "determined", "by", "the", "view", ".", "<p", ">", "Handling", "newli...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/DMRPrinter.java#L158-L290
test
Print a node in the XML document.
Of course, here is the Java code you requested: ```java public void printNode(DapNode node) throws IOException { if(node == null) return; DapSort sort = node.getSort(); String dmrname = sort.getName(); switch (sort) { case DATASET:// treat like ...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/reflect/ExecutableUtils.java
ExecutableUtils.getExecutable
public static <T extends Executable> T getExecutable(List<T> executables, String name, Class<?>... parameterTypes) { for (T info : executables) { if (name == null || info.getName().equals(name)) { Class<?>[] types = info.getParameterTypes(); if (parameterTypes.length ...
java
public static <T extends Executable> T getExecutable(List<T> executables, String name, Class<?>... parameterTypes) { for (T info : executables) { if (name == null || info.getName().equals(name)) { Class<?>[] types = info.getParameterTypes(); if (parameterTypes.length ...
[ "public", "static", "<", "T", "extends", "Executable", ">", "T", "getExecutable", "(", "List", "<", "T", ">", "executables", ",", "String", "name", ",", "Class", "<", "?", ">", "...", "parameterTypes", ")", "{", "for", "(", "T", "info", ":", "executabl...
查找完全匹配的方法或者构造函数. @param executables - 带查找的 list @param name - 方法名称(如果查找构造函数,那么name可以是null) @param parameterTypes - 方法或者构造函数参数(完全匹配) @return 找到的方法或者构造函数,找不到返回 null.
[ "查找完全匹配的方法或者构造函数", "." ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/reflect/ExecutableUtils.java#L34-L53
test
Gets an executable from a list of executables.
Of course, here is the Java code you requested: ```java public static <T extends Executable> T getExecutable(List<T> executables, String name, Class<?>... parameterTypes) { for (T info : executables) { if (name == null || info.getName().equals(name)) { Class<?>[] types = info.getPar...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/StyleRow.java
StyleRow.setFillColor
public void setFillColor(Color color) { String hex = null; Double opacity = null; if (color != null) { hex = color.getColorHexShorthand(); opacity = new Double(color.getOpacity()); } setFillColor(hex); setFillOpacity(opacity); }
java
public void setFillColor(Color color) { String hex = null; Double opacity = null; if (color != null) { hex = color.getColorHexShorthand(); opacity = new Double(color.getOpacity()); } setFillColor(hex); setFillOpacity(opacity); }
[ "public", "void", "setFillColor", "(", "Color", "color", ")", "{", "String", "hex", "=", "null", ";", "Double", "opacity", "=", "null", ";", "if", "(", "color", "!=", "null", ")", "{", "hex", "=", "color", ".", "getColorHexShorthand", "(", ")", ";", ...
Set the color @param color color
[ "Set", "the", "color" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/StyleRow.java#L389-L398
test
Sets the fill color.
Of course, here is the Java code you requested: ```java public void setFillColor(Color color) { String hex = null; Double opacity = null; if (color != null) { hex = color.getColorHexShorthand(); opacity = new Double(color.getOpacity()); } setFillColor(hex...
streamsets/datacollector
jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcBaseRecordWriter.java
JdbcBaseRecordWriter.getSQLTypeName
static String getSQLTypeName(Field.Type type) throws OnRecordErrorException { switch (type) { case BOOLEAN: return "BOOLEAN"; case CHAR: return "CHAR"; case BYTE: return "BINARY"; case SHORT: return "SMALLINT"; case INTEGER: return "INTEGER"; ...
java
static String getSQLTypeName(Field.Type type) throws OnRecordErrorException { switch (type) { case BOOLEAN: return "BOOLEAN"; case CHAR: return "CHAR"; case BYTE: return "BINARY"; case SHORT: return "SMALLINT"; case INTEGER: return "INTEGER"; ...
[ "static", "String", "getSQLTypeName", "(", "Field", ".", "Type", "type", ")", "throws", "OnRecordErrorException", "{", "switch", "(", "type", ")", "{", "case", "BOOLEAN", ":", "return", "\"BOOLEAN\"", ";", "case", "CHAR", ":", "return", "\"CHAR\"", ";", "cas...
spec requires a string name for a data type, rather than just an enum.
[ "spec", "requires", "a", "string", "name", "for", "a", "data", "type", "rather", "than", "just", "an", "enum", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcBaseRecordWriter.java#L258-L296
test
Get the SQL type name for a single field.
Of course, here is the Java code you requested: ```java static String getSQLTypeName(Field.Type type) throws OnRecordErrorException { switch (type) { case BOOLEAN: return "BOOLEAN"; case CHAR: return "CHAR"; case BYTE: return "BINARY"; case SHORT: return "SMA...
chenlb/mmseg4j-from-googlecode
src/com/chenlb/mmseg4j/MMSeg.java
MMSeg.toChars
private static char[] toChars(StringBuilder bufSentence) { char[] chs = new char[bufSentence.length()]; bufSentence.getChars(0, bufSentence.length(), chs, 0); return chs; }
java
private static char[] toChars(StringBuilder bufSentence) { char[] chs = new char[bufSentence.length()]; bufSentence.getChars(0, bufSentence.length(), chs, 0); return chs; }
[ "private", "static", "char", "[", "]", "toChars", "(", "StringBuilder", "bufSentence", ")", "{", "char", "[", "]", "chs", "=", "new", "char", "[", "bufSentence", ".", "length", "(", ")", "]", ";", "bufSentence", ".", "getChars", "(", "0", ",", "bufSent...
从 StringBuilder 里复制出 char[]
[ "从", "StringBuilder", "里复制出", "char", "[]" ]
3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb
https://github.com/chenlb/mmseg4j-from-googlecode/blob/3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb/src/com/chenlb/mmseg4j/MMSeg.java#L319-L323
test
Converts a StringBuilder to a char array.
Of course, here is the Java code you requested: ```java private static char[] toChars(StringBuilder bufSentence) { char[] chs = new char[bufSentence.length()]; bufSentence.getChars(0, bufSentence.length(), chs, 0); return chs; } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.delay
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<T> delay(long delay, TimeUnit unit, Scheduler scheduler, boolean delayError) { ObjectHelper.requireNonNull(unit, "unit is null"); ObjectHelper.requireNonNull(scheduler, "scheduler is null"); return RxJa...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<T> delay(long delay, TimeUnit unit, Scheduler scheduler, boolean delayError) { ObjectHelper.requireNonNull(unit, "unit is null"); ObjectHelper.requireNonNull(scheduler, "scheduler is null"); return RxJa...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Observable", "<", "T", ">", "delay", "(", "long", "delay", ",", "TimeUnit", "unit", ",", "Scheduler", "scheduler", ",", "boolean", "delayError", ...
Returns an Observable that emits the items emitted by the source ObservableSource shifted forward in time by a specified delay. If {@code delayError} is true, error notifications will also be delayed. <p> <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delay.s.png" al...
[ "Returns", "an", "Observable", "that", "emits", "the", "items", "emitted", "by", "the", "source", "ObservableSource", "shifted", "forward", "in", "time", "by", "a", "specified", "delay", ".", "If", "{", "@code", "delayError", "}", "is", "true", "error", "not...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L7556-L7563
test
Delays the sequence of events in the sequence.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<T> delay(long delay, TimeUnit unit, Scheduler scheduler, boolean delayError) { ObjectHelper.requireNonNull(unit, "unit is null"); ObjectHelper.requireNonN...
boonproject/boon
boon/src/main/java/org/boon/Lists.java
Lists.deepCopy
@Universal public static <V> List<V> deepCopy( List<V> list ) { if ( list instanceof LinkedList ) { return deepCopyToList( list, new LinkedList<V>( ) ); } else if ( list instanceof CopyOnWriteArrayList ) { return deepCopyToList( list, new CopyOnWriteArrayList<V>( )); ...
java
@Universal public static <V> List<V> deepCopy( List<V> list ) { if ( list instanceof LinkedList ) { return deepCopyToList( list, new LinkedList<V>( ) ); } else if ( list instanceof CopyOnWriteArrayList ) { return deepCopyToList( list, new CopyOnWriteArrayList<V>( )); ...
[ "@", "Universal", "public", "static", "<", "V", ">", "List", "<", "V", ">", "deepCopy", "(", "List", "<", "V", ">", "list", ")", "{", "if", "(", "list", "instanceof", "LinkedList", ")", "{", "return", "deepCopyToList", "(", "list", ",", "new", "Linke...
Clones each list item into a new instance with copied fields. It is like doing a clone operation. If the passed list is a LinkedList then the returned list will be a LinkedList. If the passed list is a CopyOnWriteArrayList then the returned list will be a CopyOnWriteArrayList list. All other lists become ArrayList. ...
[ "Clones", "each", "list", "item", "into", "a", "new", "instance", "with", "copied", "fields", ".", "It", "is", "like", "doing", "a", "clone", "operation", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/Lists.java#L163-L172
test
Copy a List of objects.
Of course, here is the Java code you requested: ```java @Universal public static <V> List<V> deepCopy( List<V> list ) { if ( list instanceof LinkedList ) { return deepCopyToList( list, new LinkedList<V>( ) ); } else if ( list instanceof CopyOnWriteArrayList ) { return deepC...
Unidata/thredds
opendap/src/main/java/opendap/servers/parsers/Celex.java
Celex.yyerror
public void yyerror(String s) { Ceparse.log.error("yyerror: constraint parse error:" + s + "; char " + charno); if(yytext.length() > 0) Ceparse.log.error(" near |" + yytext + "|"); // Add extra info if(parsestate.getURL() != null) Ceparse.log.error("\turl=" + parsestate.g...
java
public void yyerror(String s) { Ceparse.log.error("yyerror: constraint parse error:" + s + "; char " + charno); if(yytext.length() > 0) Ceparse.log.error(" near |" + yytext + "|"); // Add extra info if(parsestate.getURL() != null) Ceparse.log.error("\turl=" + parsestate.g...
[ "public", "void", "yyerror", "(", "String", "s", ")", "{", "Ceparse", ".", "log", ".", "error", "(", "\"yyerror: constraint parse error:\"", "+", "s", "+", "\"; char \"", "+", "charno", ")", ";", "if", "(", "yytext", ".", "length", "(", ")", ">", "0", ...
Entry point for error reporting. Emits an error in a user-defined way. @param s The string for the error message.
[ "Entry", "point", "for", "error", "reporting", ".", "Emits", "an", "error", "in", "a", "user", "-", "defined", "way", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/parsers/Celex.java#L342-L350
test
This method is called when the yyerror occurs.
Of course, here is the Java code you requested: ```java public void yyerror(String s) { Ceparse.log.error("yyerror: constraint parse error:" + s + "; char " + charno); if(yytext.length() > 0) Ceparse.log.error(" near |" + yytext + "|"); // Add extra info if(parsestate.ge...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/xml/DomUtils.java
DomUtils.nodeNameMatch
private static boolean nodeNameMatch(Node node, String desiredName) { return (desiredName.equals(node.getNodeName()) || desiredName.equals(node.getLocalName())); }
java
private static boolean nodeNameMatch(Node node, String desiredName) { return (desiredName.equals(node.getNodeName()) || desiredName.equals(node.getLocalName())); }
[ "private", "static", "boolean", "nodeNameMatch", "(", "Node", "node", ",", "String", "desiredName", ")", "{", "return", "(", "desiredName", ".", "equals", "(", "node", ".", "getNodeName", "(", ")", ")", "||", "desiredName", ".", "equals", "(", "node", ".",...
Matches the given node's name and local name against the given desired name.
[ "Matches", "the", "given", "node", "s", "name", "and", "local", "name", "against", "the", "given", "desired", "name", "." ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/xml/DomUtils.java#L182-L184
test
Check if the node name matches the desired name.
Of course, here is the Java code you requested: ```java private static boolean nodeNameMatch(Node node, String desiredName) { return (desiredName.equals(node.getNodeName()) || desiredName.equals(node.getLocalName())); } ``` Hope this helps!
tiefaces/TieFaces
src/org/tiefaces/components/websheet/chart/ChartHelper.java
ChartHelper.setupStyle
private void setupStyle(final JFreeChart chart, final ChartData chartData) { CategoryPlot plot = (CategoryPlot) chart.getPlot(); List<ChartSeries> seriesList = chartData.getSeriesList(); BasicStroke bLine = new BasicStroke(2.0f); for (int i = 0; i < seriesList.size(); i++) { Color cColor = ColorUtil...
java
private void setupStyle(final JFreeChart chart, final ChartData chartData) { CategoryPlot plot = (CategoryPlot) chart.getPlot(); List<ChartSeries> seriesList = chartData.getSeriesList(); BasicStroke bLine = new BasicStroke(2.0f); for (int i = 0; i < seriesList.size(); i++) { Color cColor = ColorUtil...
[ "private", "void", "setupStyle", "(", "final", "JFreeChart", "chart", ",", "final", "ChartData", "chartData", ")", "{", "CategoryPlot", "plot", "=", "(", "CategoryPlot", ")", "chart", ".", "getPlot", "(", ")", ";", "List", "<", "ChartSeries", ">", "seriesLis...
finalize the style for jfreechart. The default setting is different from jfreechart and Excel. We try to minimize the difference. @param chart jfreechart. @param chartData contain information gathered from excel chart object.
[ "finalize", "the", "style", "for", "jfreechart", ".", "The", "default", "setting", "is", "different", "from", "jfreechart", "and", "Excel", ".", "We", "try", "to", "minimize", "the", "difference", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/chart/ChartHelper.java#L509-L536
test
Setup the style of the group chart.
Of course, here is the Java code you requested: ```java private void setupStyle(final JFreeChart chart, final ChartData chartData) { CategoryPlot plot = (CategoryPlot) chart.getPlot(); List<ChartSeries> seriesList = chartData.getSeriesList(); BasicStroke bLine = new BasicStroke(2.0f); for (int i = 0; i...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/concur/lock/ScalableRWLock.java
ScalableRWLock.addState
private ReadersEntry addState() { final AtomicInteger state = new AtomicInteger(SRWL_STATE_NOT_READING); final ReadersEntry newEntry = new ReadersEntry(state); entry.set(newEntry); readersStateList.add(state); readersStateArrayRef.set(null); return newEntry; }
java
private ReadersEntry addState() { final AtomicInteger state = new AtomicInteger(SRWL_STATE_NOT_READING); final ReadersEntry newEntry = new ReadersEntry(state); entry.set(newEntry); readersStateList.add(state); readersStateArrayRef.set(null); return newEntry; }
[ "private", "ReadersEntry", "addState", "(", ")", "{", "final", "AtomicInteger", "state", "=", "new", "AtomicInteger", "(", "SRWL_STATE_NOT_READING", ")", ";", "final", "ReadersEntry", "newEntry", "=", "new", "ReadersEntry", "(", "state", ")", ";", "entry", ".", ...
Creates a new ReadersEntry instance for the current thread and its associated AtomicInteger to store the state of the Reader @return Returns a reference to the newly created instance of {@code ReadersEntry}
[ "Creates", "a", "new", "ReadersEntry", "instance", "for", "the", "current", "thread", "and", "its", "associated", "AtomicInteger", "to", "store", "the", "state", "of", "the", "Reader" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/concur/lock/ScalableRWLock.java#L260-L267
test
Add a state to the list of readers.
Of course, here is the Java code you requested: ```java private ReadersEntry addState() { final AtomicInteger state = new AtomicInteger(SRWL_STATE_NOT_READING); final ReadersEntry newEntry = new ReadersEntry(state); entry.set(newEntry); readersStateList.add(state); readersStateArrayRef.set(null); ...
real-logic/aeron
aeron-client/src/main/java/io/aeron/Image.java
Image.controlledPoll
public int controlledPoll(final ControlledFragmentHandler handler, final int fragmentLimit) { if (isClosed) { return 0; } int fragmentsRead = 0; long initialPosition = subscriberPosition.get(); int initialOffset = (int)initialPosition & termLengthMask; ...
java
public int controlledPoll(final ControlledFragmentHandler handler, final int fragmentLimit) { if (isClosed) { return 0; } int fragmentsRead = 0; long initialPosition = subscriberPosition.get(); int initialOffset = (int)initialPosition & termLengthMask; ...
[ "public", "int", "controlledPoll", "(", "final", "ControlledFragmentHandler", "handler", ",", "final", "int", "fragmentLimit", ")", "{", "if", "(", "isClosed", ")", "{", "return", "0", ";", "}", "int", "fragmentsRead", "=", "0", ";", "long", "initialPosition",...
Poll for new messages in a stream. If new messages are found beyond the last consumed position then they will be delivered to the {@link ControlledFragmentHandler} up to a limited number of fragments as specified. <p> Use a {@link ControlledFragmentAssembler} to assemble messages which span multiple fragments. @param ...
[ "Poll", "for", "new", "messages", "in", "a", "stream", ".", "If", "new", "messages", "are", "found", "beyond", "the", "last", "consumed", "position", "then", "they", "will", "be", "delivered", "to", "the", "{", "@link", "ControlledFragmentHandler", "}", "up"...
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/Image.java#L313-L387
test
Poll for a sequence of fragments.
Of course, here is the Java code you requested: ```java public int controlledPoll(final ControlledFragmentHandler handler, final int fragmentLimit) { if (isClosed) { return 0; } int fragmentsRead = 0; long initialPosition = subscriberPosition.get(); int ...
oblac/jodd
jodd-core/src/main/java/jodd/util/StringUtil.java
StringUtil.startsWithOneIgnoreCase
public static int startsWithOneIgnoreCase(final String src, final String... dest) { for (int i = 0; i < dest.length; i++) { String m = dest[i]; if (m == null) { continue; } if (startsWithIgnoreCase(src, m)) { return i; } } return -1; }
java
public static int startsWithOneIgnoreCase(final String src, final String... dest) { for (int i = 0; i < dest.length; i++) { String m = dest[i]; if (m == null) { continue; } if (startsWithIgnoreCase(src, m)) { return i; } } return -1; }
[ "public", "static", "int", "startsWithOneIgnoreCase", "(", "final", "String", "src", ",", "final", "String", "...", "dest", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dest", ".", "length", ";", "i", "++", ")", "{", "String", "m", "...
Checks if string starts with at least one string from the provided array. If at least one string is matched, it returns its index. Otherwise, <code>-1</code> is returned.
[ "Checks", "if", "string", "starts", "with", "at", "least", "one", "string", "from", "the", "provided", "array", ".", "If", "at", "least", "one", "string", "is", "matched", "it", "returns", "its", "index", ".", "Otherwise", "<code", ">", "-", "1<", "/", ...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/StringUtil.java#L1720-L1731
test
Checks if src starts with one of dest ignoring case.
Of course, here is the Java code you requested: ```java public static int startsWithOneIgnoreCase(final String src, final String... dest) { for (int i = 0; i < dest.length; i++) { String m = dest[i]; if (m == null) { continue; } if (startsWithIgnoreCase(src, m)) { return i; } } return -1; ...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/Player.java
Player.fireStartMusicRequest
protected void fireStartMusicRequest(EventModel eventModel) { Optional<Playlist> playlist = PlaylistResource.getPlaylist(eventModel); Optional<Progress> progress = ProgressResource.getProgress(eventModel); Optional<TrackInfo> trackInfo = TrackInfoResource.getTrackInfo(eventModel); Option...
java
protected void fireStartMusicRequest(EventModel eventModel) { Optional<Playlist> playlist = PlaylistResource.getPlaylist(eventModel); Optional<Progress> progress = ProgressResource.getProgress(eventModel); Optional<TrackInfo> trackInfo = TrackInfoResource.getTrackInfo(eventModel); Option...
[ "protected", "void", "fireStartMusicRequest", "(", "EventModel", "eventModel", ")", "{", "Optional", "<", "Playlist", ">", "playlist", "=", "PlaylistResource", ".", "getPlaylist", "(", "eventModel", ")", ";", "Optional", "<", "Progress", ">", "progress", "=", "P...
this method will be called to create and fire the StartMusicRequest @param eventModel the cause
[ "this", "method", "will", "be", "called", "to", "create", "and", "fire", "the", "StartMusicRequest" ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/Player.java#L604-L610
test
Fire start music request event.
Of course, here is the Java code you requested: ```java protected void fireStartMusicRequest(EventModel eventModel) { Optional<Playlist> playlist = PlaylistResource.getPlaylist(eventModel); Optional<Progress> progress = ProgressResource.getProgress(eventModel); Optional<TrackInfo> trackInfo = T...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/Configurable.java
Configurable.getPropertyMetaData
public Property getPropertyMetaData(int propertyNo) { long cPtr = VideoJNI.Configurable_getPropertyMetaData__SWIG_0(swigCPtr, this, propertyNo); return (cPtr == 0) ? null : new Property(cPtr, false); }
java
public Property getPropertyMetaData(int propertyNo) { long cPtr = VideoJNI.Configurable_getPropertyMetaData__SWIG_0(swigCPtr, this, propertyNo); return (cPtr == 0) ? null : new Property(cPtr, false); }
[ "public", "Property", "getPropertyMetaData", "(", "int", "propertyNo", ")", "{", "long", "cPtr", "=", "VideoJNI", ".", "Configurable_getPropertyMetaData__SWIG_0", "(", "swigCPtr", ",", "this", ",", "propertyNo", ")", ";", "return", "(", "cPtr", "==", "0", ")", ...
Returns the name of the numbered property.<br> <br> @param propertyNo The property number in the options list.<br> <br> @return a Property value for this properties meta-data
[ "Returns", "the", "name", "of", "the", "numbered", "property", ".", "<br", ">", "<br", ">" ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Configurable.java#L140-L143
test
Returns the property meta data for the specified property.
Of course, here is the Java code you requested: ```java public Property getPropertyMetaData(int propertyNo) { long cPtr = VideoJNI.Configurable_getPropertyMetaData__SWIG_0(swigCPtr, this, propertyNo); return (cPtr == 0) ? null : new Property(cPtr, false); } ``` Hope this helps!
moparisthebest/aptIn16
apt-mirror-api/src/main/java/com/sun/mirror/util/DeclarationScanner.java
DeclarationScanner.visitClassDeclaration
public void visitClassDeclaration(ClassDeclaration d) { d.accept(pre); for (TypeParameterDeclaration tpDecl : d.getFormalTypeParameters()) { tpDecl.accept(this); } for (FieldDeclaration fieldDecl : d.getFields()) { fieldDecl.accept(this); } for (MethodDeclaration methodDecl : d.getMethod...
java
public void visitClassDeclaration(ClassDeclaration d) { d.accept(pre); for (TypeParameterDeclaration tpDecl : d.getFormalTypeParameters()) { tpDecl.accept(this); } for (FieldDeclaration fieldDecl : d.getFields()) { fieldDecl.accept(this); } for (MethodDeclaration methodDecl : d.getMethod...
[ "public", "void", "visitClassDeclaration", "(", "ClassDeclaration", "d", ")", "{", "d", ".", "accept", "(", "pre", ")", ";", "for", "(", "TypeParameterDeclaration", "tpDecl", ":", "d", ".", "getFormalTypeParameters", "(", ")", ")", "{", "tpDecl", ".", "accep...
Visits a class declaration. @param d the declaration to visit
[ "Visits", "a", "class", "declaration", "." ]
de38f7add09e69cb5ff970d1bada079a162358e7
https://github.com/moparisthebest/aptIn16/blob/de38f7add09e69cb5ff970d1bada079a162358e7/apt-mirror-api/src/main/java/com/sun/mirror/util/DeclarationScanner.java#L133-L157
test
Visits a ClassDeclaration.
Of course, here is the Java code you requested: ```java public void visitClassDeclaration(ClassDeclaration d) { d.accept(pre); for (TypeParameterDeclaration tpDecl : d.getFormalTypeParameters()) { tpDecl.accept(this); } for (FieldDeclaration fieldDecl : d.getFields()) { fieldDecl.accept(this); ...
wildfly/wildfly
naming/src/main/java/org/jboss/as/naming/NamingContext.java
NamingContext.setActiveNamingStore
public static void setActiveNamingStore(final NamingStore namingStore) { if(WildFlySecurityManager.isChecking()) { System.getSecurityManager().checkPermission(SET_ACTIVE_NAMING_STORE); } ACTIVE_NAMING_STORE = namingStore; }
java
public static void setActiveNamingStore(final NamingStore namingStore) { if(WildFlySecurityManager.isChecking()) { System.getSecurityManager().checkPermission(SET_ACTIVE_NAMING_STORE); } ACTIVE_NAMING_STORE = namingStore; }
[ "public", "static", "void", "setActiveNamingStore", "(", "final", "NamingStore", "namingStore", ")", "{", "if", "(", "WildFlySecurityManager", ".", "isChecking", "(", ")", ")", "{", "System", ".", "getSecurityManager", "(", ")", ".", "checkPermission", "(", "SET...
Set the active naming store @param namingStore The naming store
[ "Set", "the", "active", "naming", "store" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/NamingContext.java#L82-L87
test
Sets the active naming store.
Of course, here is the Java code you requested: ```java public static void setActiveNamingStore(final NamingStore namingStore) { if(WildFlySecurityManager.isChecking()) { System.getSecurityManager().checkPermission(SET_ACTIVE_NAMING_STORE); } ACTIVE_NAMING_STORE = namingStore; }...
playframework/playframework
core/play/src/main/java/play/libs/reflect/MemberUtils.java
MemberUtils.compareParameterTypes
private static int compareParameterTypes( final Executable left, final Executable right, final Class<?>[] actual) { final float leftCost = getTotalTransformationCost(actual, left); final float rightCost = getTotalTransformationCost(actual, right); return leftCost < rightCost ? -1 : rightCost < leftCos...
java
private static int compareParameterTypes( final Executable left, final Executable right, final Class<?>[] actual) { final float leftCost = getTotalTransformationCost(actual, left); final float rightCost = getTotalTransformationCost(actual, right); return leftCost < rightCost ? -1 : rightCost < leftCos...
[ "private", "static", "int", "compareParameterTypes", "(", "final", "Executable", "left", ",", "final", "Executable", "right", ",", "final", "Class", "<", "?", ">", "[", "]", "actual", ")", "{", "final", "float", "leftCost", "=", "getTotalTransformationCost", "...
Compares the relative fitness of two Executables in terms of how well they match a set of runtime parameter types, such that a list ordered by the results of the comparison would return the best match first (least). @param left the "left" Executable @param right the "right" Executable @param actual the runtime paramet...
[ "Compares", "the", "relative", "fitness", "of", "two", "Executables", "in", "terms", "of", "how", "well", "they", "match", "a", "set", "of", "runtime", "parameter", "types", "such", "that", "a", "list", "ordered", "by", "the", "results", "of", "the", "comp...
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/libs/reflect/MemberUtils.java#L122-L127
test
Compare two executable types.
Of course, here is the Java code you requested: ```java private static int compareParameterTypes( final Executable left, final Executable right, final Class<?>[] actual) { final float leftCost = getTotalTransformationCost(actual, left); final float rightCost = getTotalTransformationCost(actual, right); ...
rockagen/commons-lib
src/main/java/com/rockagen/commons/http/HttpConn.java
HttpConn.getHttpMethod
private static HttpRequestBase getHttpMethod(RequestMethod method, String uri) { HttpRequestBase hm; if (method != null) { switch (method) { case POST: hm = new HttpPost(uri); break; case GET: hm = ne...
java
private static HttpRequestBase getHttpMethod(RequestMethod method, String uri) { HttpRequestBase hm; if (method != null) { switch (method) { case POST: hm = new HttpPost(uri); break; case GET: hm = ne...
[ "private", "static", "HttpRequestBase", "getHttpMethod", "(", "RequestMethod", "method", ",", "String", "uri", ")", "{", "HttpRequestBase", "hm", ";", "if", "(", "method", "!=", "null", ")", "{", "switch", "(", "method", ")", "{", "case", "POST", ":", "hm"...
Get Http method instance by {@link com.rockagen.commons.http.RequestMethod} @param method {@link RequestMethod} @param uri the uri @return {@link HttpRequestBase}
[ "Get", "Http", "method", "instance", "by", "{", "@link", "com", ".", "rockagen", ".", "commons", ".", "http", ".", "RequestMethod", "}" ]
f37141cf40be79d130db804c39ce61690541d5f1
https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/http/HttpConn.java#L1305-L1339
test
Get the Http method.
Of course, here is the Java code you requested: ```java private static HttpRequestBase getHttpMethod(RequestMethod method, String uri) { HttpRequestBase hm; if (method != null) { switch (method) { case POST: hm = new HttpPost(uri); bre...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/grid/VertScaleSlider.java
VertScaleSlider.setSelectedIndex
private void setSelectedIndex( int idx) { if (zAxis == null) return; eventOK = false; currentIdx = idx; slider.setValue( world2slider(zAxis.getCoordValue(currentIdx))); eventOK = true; }
java
private void setSelectedIndex( int idx) { if (zAxis == null) return; eventOK = false; currentIdx = idx; slider.setValue( world2slider(zAxis.getCoordValue(currentIdx))); eventOK = true; }
[ "private", "void", "setSelectedIndex", "(", "int", "idx", ")", "{", "if", "(", "zAxis", "==", "null", ")", "return", ";", "eventOK", "=", "false", ";", "currentIdx", "=", "idx", ";", "slider", ".", "setValue", "(", "world2slider", "(", "zAxis", ".", "g...
set current value - no event
[ "set", "current", "value", "-", "no", "event" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/grid/VertScaleSlider.java#L180-L187
test
Sets the selected index.
Of course, here is the Java code you requested: ```java private void setSelectedIndex( int idx) { if (zAxis == null) return; eventOK = false; currentIdx = idx; slider.setValue( world2slider(zAxis.getCoordValue(currentIdx))); eventOK = true; } ``` Hope this helps!
agentsoz/jill
jill/src/main/java/io/github/agentsoz/jill/Program.java
Program.shutdownIntentionSelectionThreads
static void shutdownIntentionSelectionThreads() { for (int i = 0; i < Main.npools; i++) { Main.intentionSelectors[i].shutdown(); } }
java
static void shutdownIntentionSelectionThreads() { for (int i = 0; i < Main.npools; i++) { Main.intentionSelectors[i].shutdown(); } }
[ "static", "void", "shutdownIntentionSelectionThreads", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "Main", ".", "npools", ";", "i", "++", ")", "{", "Main", ".", "intentionSelectors", "[", "i", "]", ".", "shutdown", "(", ")", ";", ...
Stops the intention selection threads.
[ "Stops", "the", "intention", "selection", "threads", "." ]
13126fc78350465b477386132465f84cad719426
https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/Program.java#L96-L100
test
shutdown intention selection threads
Of course, here is the Java code you requested: ```java static void shutdownIntentionSelectionThreads() { for (int i = 0; i < Main.npools; i++) { Main.intentionSelectors[i].shutdown(); } } ``` Hope this helps!
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/lucene/function/LuceneSearchFunction.java
LuceneSearchFunction.execute
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void execute(FunctionContext functionContext) { Cache cache = CacheFactory.getAnyInstance(); try { //Function must be executed on REgion if(!(functionContext instanceof RegionFunctionContext)) { throw new FunctionException("Exec...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void execute(FunctionContext functionContext) { Cache cache = CacheFactory.getAnyInstance(); try { //Function must be executed on REgion if(!(functionContext instanceof RegionFunctionContext)) { throw new FunctionException("Exec...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "@", "Override", "public", "void", "execute", "(", "FunctionContext", "functionContext", ")", "{", "Cache", "cache", "=", "CacheFactory", ".", "getAnyInstance", "(", ")", ";", "...
Execute the search on Region
[ "Execute", "the", "search", "on", "Region" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/lucene/function/LuceneSearchFunction.java#L40-L121
test
Execute on a region.
Of course, here is the Java code you requested: ```java @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void execute(FunctionContext functionContext) { Cache cache = CacheFactory.getAnyInstance(); try { //Function must be executed on REgion if(!(functionContext instanceof RegionFunc...
streamsets/datacollector
kafka_multisource-protolib/src/main/java/com/streamsets/pipeline/stage/origin/multikafka/MultiKafkaSource.java
MultiKafkaSource.getKafkaProperties
private Properties getKafkaProperties(Stage.Context context) { Properties props = new Properties(); props.putAll(conf.kafkaOptions); props.setProperty("bootstrap.servers", conf.brokerURI); props.setProperty("group.id", conf.consumerGroup); props.setProperty("max.poll.records", String.valueOf(batchS...
java
private Properties getKafkaProperties(Stage.Context context) { Properties props = new Properties(); props.putAll(conf.kafkaOptions); props.setProperty("bootstrap.servers", conf.brokerURI); props.setProperty("group.id", conf.consumerGroup); props.setProperty("max.poll.records", String.valueOf(batchS...
[ "private", "Properties", "getKafkaProperties", "(", "Stage", ".", "Context", "context", ")", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "props", ".", "putAll", "(", "conf", ".", "kafkaOptions", ")", ";", "props", ".", "setProperty",...
no trespassing...
[ "no", "trespassing", "..." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/kafka_multisource-protolib/src/main/java/com/streamsets/pipeline/stage/origin/multikafka/MultiKafkaSource.java#L317-L334
test
Get Kafka properties
Of course, here is the Java code you requested: ```java private Properties getKafkaProperties(Stage.Context context) { Properties props = new Properties(); props.putAll(conf.kafkaOptions); props.setProperty("bootstrap.servers", conf.brokerURI); props.setProperty("group.id", conf.consumerGroup); pr...
Unidata/thredds
tds/src/main/java/thredds/core/DatasetManager.java
DatasetManager.openCoverageDataset
public CoverageCollection openCoverageDataset(HttpServletRequest req, HttpServletResponse res, String reqPath) throws IOException { if (reqPath == null) return null; if (reqPath.startsWith("/")) reqPath = reqPath.substring(1); // see if its under resource control if (!resourceControlOk(req...
java
public CoverageCollection openCoverageDataset(HttpServletRequest req, HttpServletResponse res, String reqPath) throws IOException { if (reqPath == null) return null; if (reqPath.startsWith("/")) reqPath = reqPath.substring(1); // see if its under resource control if (!resourceControlOk(req...
[ "public", "CoverageCollection", "openCoverageDataset", "(", "HttpServletRequest", "req", ",", "HttpServletResponse", "res", ",", "String", "reqPath", ")", "throws", "IOException", "{", "if", "(", "reqPath", "==", "null", ")", "return", "null", ";", "if", "(", "r...
return null means request has been handled, and calling routine should exit without further processing
[ "return", "null", "means", "request", "has", "been", "handled", "and", "calling", "routine", "should", "exit", "without", "further", "processing" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/core/DatasetManager.java#L292-L344
test
Open a CoverageDataset
Of course, here is the Java code you requested: ```java public CoverageCollection openCoverageDataset(HttpServletRequest req, HttpServletResponse res, String reqPath) throws IOException { if (reqPath == null) return null; if (reqPath.startsWith("/")) reqPath = reqPath.substring(1); // see if ...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasIzamax
public static int cublasIzamax(int n, Pointer x, int incx) { int result = cublasIzamaxNative(n, x, incx); checkResultBLAS(); return result; }
java
public static int cublasIzamax(int n, Pointer x, int incx) { int result = cublasIzamaxNative(n, x, incx); checkResultBLAS(); return result; }
[ "public", "static", "int", "cublasIzamax", "(", "int", "n", ",", "Pointer", "x", ",", "int", "incx", ")", "{", "int", "result", "=", "cublasIzamaxNative", "(", "n", ",", "x", ",", "incx", ")", ";", "checkResultBLAS", "(", ")", ";", "return", "result", ...
<pre> int cublasIzamax (int n, const double *x, int incx) finds the smallest index of the element having maximum absolute value in double-complex vector x; that is, the result is the first i, i = 0 to n - 1 that maximizes abs(real(x[1+i*incx]))+abs(imag(x[1 + i * incx])). Input ----- n number of elements in inpu...
[ "<pre", ">", "int", "cublasIzamax", "(", "int", "n", "const", "double", "*", "x", "int", "incx", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L2786-L2791
test
Cublas iminor.
Of course, here is the Java code you requested: ```java public static int cublasIzamax(int n, Pointer x, int incx) { int result = cublasIzamaxNative(n, x, incx); checkResultBLAS(); return result; } ``` Hope this helps!
wildfly/wildfly
webservices/server-integration/src/main/java/org/jboss/as/webservices/util/WebMetaDataHelper.java
WebMetaDataHelper.getServletMappings
public static List<ServletMappingMetaData> getServletMappings(final JBossWebMetaData jbossWebMD) { List<ServletMappingMetaData> servletMappingsMD = jbossWebMD.getServletMappings(); if (servletMappingsMD == null) { servletMappingsMD = new LinkedList<ServletMappingMetaData>(); jbo...
java
public static List<ServletMappingMetaData> getServletMappings(final JBossWebMetaData jbossWebMD) { List<ServletMappingMetaData> servletMappingsMD = jbossWebMD.getServletMappings(); if (servletMappingsMD == null) { servletMappingsMD = new LinkedList<ServletMappingMetaData>(); jbo...
[ "public", "static", "List", "<", "ServletMappingMetaData", ">", "getServletMappings", "(", "final", "JBossWebMetaData", "jbossWebMD", ")", "{", "List", "<", "ServletMappingMetaData", ">", "servletMappingsMD", "=", "jbossWebMD", ".", "getServletMappings", "(", ")", ";"...
Gets servlet mappings meta data from jboss web meta data. If not found it creates new servlet mappings meta data and associates them with jboss web meta data. @param jbossWebMD jboss web meta data @return servlet mappings meta data
[ "Gets", "servlet", "mappings", "meta", "data", "from", "jboss", "web", "meta", "data", ".", "If", "not", "found", "it", "creates", "new", "servlet", "mappings", "meta", "data", "and", "associates", "them", "with", "jboss", "web", "meta", "data", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/util/WebMetaDataHelper.java#L147-L156
test
Get the servlet mappings.
Of course, here is the Java code you requested: ```java public static List<ServletMappingMetaData> getServletMappings(final JBossWebMetaData jbossWebMD) { List<ServletMappingMetaData> servletMappingsMD = jbossWebMD.getServletMappings(); if (servletMappingsMD == null) { servletMappingsMD = ...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/resource/support/change/ResourceWatcher.java
ResourceWatcher.onException
protected void onException(final Exception e) { // not using ERROR log intentionally, since this error is not that important LOG.info("Could not check for resource changes because: {}", e.getMessage()); LOG.debug("[FAIL] detecting resource change ", e); }
java
protected void onException(final Exception e) { // not using ERROR log intentionally, since this error is not that important LOG.info("Could not check for resource changes because: {}", e.getMessage()); LOG.debug("[FAIL] detecting resource change ", e); }
[ "protected", "void", "onException", "(", "final", "Exception", "e", ")", "{", "// not using ERROR log intentionally, since this error is not that important", "LOG", ".", "info", "(", "\"Could not check for resource changes because: {}\"", ",", "e", ".", "getMessage", "(", ")"...
Invoked when exception occurs.
[ "Invoked", "when", "exception", "occurs", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/support/change/ResourceWatcher.java#L214-L218
test
Called when an exception occurs while checking for resource changes.
Of course, here is the Java code you requested: ```java protected void onException(final Exception e) { // not using ERROR log intentionally, since this error is not that important LOG.info("Could not check for resource changes because: {}", e.getMessage()); LOG.debug("[FAIL] detecting resource change ", e...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/events/Event.java
Event.addDescriptor
public Event addDescriptor(String descriptor) { List<String> newDescriptors = new ArrayList<>(); newDescriptors.addAll(descriptors); newDescriptors.add(descriptor); return new Event(getType(), getSource(), newDescriptors); }
java
public Event addDescriptor(String descriptor) { List<String> newDescriptors = new ArrayList<>(); newDescriptors.addAll(descriptors); newDescriptors.add(descriptor); return new Event(getType(), getSource(), newDescriptors); }
[ "public", "Event", "addDescriptor", "(", "String", "descriptor", ")", "{", "List", "<", "String", ">", "newDescriptors", "=", "new", "ArrayList", "<>", "(", ")", ";", "newDescriptors", ".", "addAll", "(", "descriptors", ")", ";", "newDescriptors", ".", "add"...
sets the Descriptors (but not the Event-Type). @param descriptor a String describing the Event. @return the resulting Event (which is the same instance)
[ "sets", "the", "Descriptors", "(", "but", "not", "the", "Event", "-", "Type", ")", "." ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/events/Event.java#L190-L195
test
Add a descriptor to the event.
Of course, here is the Java code you requested: ```java public Event addDescriptor(String descriptor) { List<String> newDescriptors = new ArrayList<>(); newDescriptors.addAll(descriptors); newDescriptors.add(descriptor); return new Event(getType(), getSource(), newDescriptors); } ``...
Unidata/thredds
bufr/src/main/java/ucar/nc2/ft/point/bufr/StandardFields.java
StandardFields.extract
public static StandardFieldsFromMessage extract(Message m) throws IOException { StandardFieldsFromMessage result = new StandardFieldsFromMessage(); extract(m.ids.getCenterId(), m.getRootDataDescriptor(), result); return result; }
java
public static StandardFieldsFromMessage extract(Message m) throws IOException { StandardFieldsFromMessage result = new StandardFieldsFromMessage(); extract(m.ids.getCenterId(), m.getRootDataDescriptor(), result); return result; }
[ "public", "static", "StandardFieldsFromMessage", "extract", "(", "Message", "m", ")", "throws", "IOException", "{", "StandardFieldsFromMessage", "result", "=", "new", "StandardFieldsFromMessage", "(", ")", ";", "extract", "(", "m", ".", "ids", ".", "getCenterId", ...
///////////////////////////////////////////////////////////////////////////////////////
[ "///////////////////////////////////////////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/bufr/src/main/java/ucar/nc2/ft/point/bufr/StandardFields.java#L136-L140
test
Extract the StandardFieldsFromMessage from the given message.
Of course, here is the Java code you requested: ```java public static StandardFieldsFromMessage extract(Message m) throws IOException { StandardFieldsFromMessage result = new StandardFieldsFromMessage(); extract(m.ids.getCenterId(), m.getRootDataDescriptor(), result); return result; } ``` Hope this help...
real-logic/aeron
aeron-agent/src/main/java/io/aeron/agent/EventConfiguration.java
EventConfiguration.getEnabledDriverEventCodes
static Set<DriverEventCode> getEnabledDriverEventCodes(final String enabledLoggerEventCodes) { if (null == enabledLoggerEventCodes || "".equals(enabledLoggerEventCodes)) { return EnumSet.noneOf(DriverEventCode.class); } final Set<DriverEventCode> eventCodeSet = new HashS...
java
static Set<DriverEventCode> getEnabledDriverEventCodes(final String enabledLoggerEventCodes) { if (null == enabledLoggerEventCodes || "".equals(enabledLoggerEventCodes)) { return EnumSet.noneOf(DriverEventCode.class); } final Set<DriverEventCode> eventCodeSet = new HashS...
[ "static", "Set", "<", "DriverEventCode", ">", "getEnabledDriverEventCodes", "(", "final", "String", "enabledLoggerEventCodes", ")", "{", "if", "(", "null", "==", "enabledLoggerEventCodes", "||", "\"\"", ".", "equals", "(", "enabledLoggerEventCodes", ")", ")", "{", ...
Get the {@link Set} of {@link DriverEventCode}s that are enabled for the logger. @param enabledLoggerEventCodes that can be "all", "admin", or a comma separated list of Event Code ids or names. @return the {@link Set} of {@link DriverEventCode}s that are enabled for the logger.
[ "Get", "the", "{", "@link", "Set", "}", "of", "{", "@link", "DriverEventCode", "}", "s", "that", "are", "enabled", "for", "the", "logger", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-agent/src/main/java/io/aeron/agent/EventConfiguration.java#L202-L259
test
Get the set of DriverEventCode from the string.
Of course, here is the Java code you requested: ```java static Set<DriverEventCode> getEnabledDriverEventCodes(final String enabledLoggerEventCodes) { if (null == enabledLoggerEventCodes || "".equals(enabledLoggerEventCodes)) { return EnumSet.noneOf(DriverEventCode.class); } ...
stanfy/enroscar
net/src/main/java/com/stanfy/enroscar/net/operation/BaseRequestBuilder.java
BaseRequestBuilder.addHeader
protected BaseRequestBuilder<MT> addHeader(final String name, final String value) { result.addHeader(name, value); return this; }
java
protected BaseRequestBuilder<MT> addHeader(final String name, final String value) { result.addHeader(name, value); return this; }
[ "protected", "BaseRequestBuilder", "<", "MT", ">", "addHeader", "(", "final", "String", "name", ",", "final", "String", "value", ")", "{", "result", ".", "addHeader", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
Add header to request description. @param name header name @param value header value @return this for chaining
[ "Add", "header", "to", "request", "description", "." ]
0e64f3c309d62e359b55ddcba10e3cc592f5e083
https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/net/src/main/java/com/stanfy/enroscar/net/operation/BaseRequestBuilder.java#L302-L305
test
Add a header to the request.
Of course, here is the Java code you requested: ```java protected BaseRequestBuilder<MT> addHeader(final String name, final String value) { result.addHeader(name, value); return this; } ``` Hope this helps!
playframework/playframework
core/play/src/main/java/play/mvc/Results.java
Results.badRequest
public static Result badRequest(Path content, String filename) { return badRequest(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
java
public static Result badRequest(Path content, String filename) { return badRequest(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
[ "public", "static", "Result", "badRequest", "(", "Path", "content", ",", "String", "filename", ")", "{", "return", "badRequest", "(", "content", ",", "filename", ",", "StaticFileMimeTypes", ".", "fileMimeTypes", "(", ")", ")", ";", "}" ]
Generates a 400 Bad Request result. @param content The path to send. @param filename The name to send the file as. @return the result
[ "Generates", "a", "400", "Bad", "Request", "result", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L1218-L1220
test
Returns a Result indicating that the content of the file is not a valid file.
Of course, here is the Java code you requested: ```java public static Result badRequest(Path content, String filename) { return badRequest(content, filename, StaticFileMimeTypes.fileMimeTypes()); } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/util/XArrays.java
XArrays.rotate
public static <T> T[] rotate(T[] a, int distance) { int len = a.length; T[] copy = newArray(a.getClass().getComponentType(), len); for (int i = 0; i < len; i++) { copy[i] = a[index(i - distance, len)]; } return copy; }
java
public static <T> T[] rotate(T[] a, int distance) { int len = a.length; T[] copy = newArray(a.getClass().getComponentType(), len); for (int i = 0; i < len; i++) { copy[i] = a[index(i - distance, len)]; } return copy; }
[ "public", "static", "<", "T", ">", "T", "[", "]", "rotate", "(", "T", "[", "]", "a", ",", "int", "distance", ")", "{", "int", "len", "=", "a", ".", "length", ";", "T", "[", "]", "copy", "=", "newArray", "(", "a", ".", "getClass", "(", ")", ...
Returns a new array containing the same elements as the given one, but rotated by the given distance. The element at index {@code i} in the returned array corresponds to the element in the original array at index {@code (i - distance)} mod {@code a.length}, for all values of {@code i} between {@code 0} and {@code a.len...
[ "Returns", "a", "new", "array", "containing", "the", "same", "elements", "as", "the", "given", "one", "but", "rotated", "by", "the", "given", "distance", ".", "The", "element", "at", "index", "{", "@code", "i", "}", "in", "the", "returned", "array", "cor...
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/XArrays.java#L1166-L1174
test
Rotate the elements of an array by the specified distance.
Of course, here is the Java code you requested: ```java public static <T> T[] rotate(T[] a, int distance) { int len = a.length; T[] copy = newArray(a.getClass().getComponentType(), len); for (int i = 0; i < len; i++) { copy[i] = a[index(i - distance, len)]; } return copy; } ``` Hope this helps!
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib1/Grib1RecordScanner.java
Grib1RecordScanner.main
public static void main(String[] args) throws IOException { int count = 0; String file = (args.length > 0) ? args[0] : "Q:/cdmUnitTest/formats/grib1/ECMWF.hybrid.grib1"; RandomAccessFile raf = new RandomAccessFile(file, "r"); System.out.printf("Read %s%n", raf.getLocation()); Grib1RecordScanner...
java
public static void main(String[] args) throws IOException { int count = 0; String file = (args.length > 0) ? args[0] : "Q:/cdmUnitTest/formats/grib1/ECMWF.hybrid.grib1"; RandomAccessFile raf = new RandomAccessFile(file, "r"); System.out.printf("Read %s%n", raf.getLocation()); Grib1RecordScanner...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "IOException", "{", "int", "count", "=", "0", ";", "String", "file", "=", "(", "args", ".", "length", ">", "0", ")", "?", "args", "[", "0", "]", ":", "\"Q:/cdmUnitT...
Count the number of records in a grib1 file.
[ "Count", "the", "number", "of", "records", "in", "a", "grib1", "file", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib1/Grib1RecordScanner.java#L290-L302
test
Main method to read a file in GRIB 1 format and create a Grib1RecordScanner.
Of course, here is the Java code you requested: ```java public static void main(String[] args) throws IOException { int count = 0; String file = (args.length > 0) ? args[0] : "Q:/cdmUnitTest/formats/grib1/ECMWF.hybrid.grib1"; RandomAccessFile raf = new RandomAccessFile(file, "r"); System.out.printf...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/core/userdetails/UserDetailsResourceFactoryBean.java
UserDetailsResourceFactoryBean.fromResource
public static UserDetailsResourceFactoryBean fromResource(Resource propertiesResource) { UserDetailsResourceFactoryBean result = new UserDetailsResourceFactoryBean(); result.setResource(propertiesResource); return result; }
java
public static UserDetailsResourceFactoryBean fromResource(Resource propertiesResource) { UserDetailsResourceFactoryBean result = new UserDetailsResourceFactoryBean(); result.setResource(propertiesResource); return result; }
[ "public", "static", "UserDetailsResourceFactoryBean", "fromResource", "(", "Resource", "propertiesResource", ")", "{", "UserDetailsResourceFactoryBean", "result", "=", "new", "UserDetailsResourceFactoryBean", "(", ")", ";", "result", ".", "setResource", "(", "propertiesReso...
Create a UserDetailsResourceFactoryBean with a Resource that is a Properties file in the format defined in {@link UserDetailsResourceFactoryBean}. @param propertiesResource the Resource that is a properties file that contains the users @return the UserDetailsResourceFactoryBean
[ "Create", "a", "UserDetailsResourceFactoryBean", "with", "a", "Resource", "that", "is", "a", "Properties", "file", "in", "the", "format", "defined", "in", "{", "@link", "UserDetailsResourceFactoryBean", "}", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/core/userdetails/UserDetailsResourceFactoryBean.java#L126-L130
test
Creates a UserDetailsResourceFactoryBean from a properties resource.
Of course, here is the Java code you requested: ```java public static UserDetailsResourceFactoryBean fromResource(Resource propertiesResource) { UserDetailsResourceFactoryBean result = new UserDetailsResourceFactoryBean(); result.setResource(propertiesResource); return result; } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/ZoomOutAction2.java
ZoomOutAction2.setZoomManager
public void setZoomManager(ZoomManager manager) { if ( zoomManager != null ) { zoomManager.removeZoomListener( this ); } zoomManager = manager; if ( zoomManager != null ) { zoomManager.addZoomListener( this ); } }
java
public void setZoomManager(ZoomManager manager) { if ( zoomManager != null ) { zoomManager.removeZoomListener( this ); } zoomManager = manager; if ( zoomManager != null ) { zoomManager.addZoomListener( this ); } }
[ "public", "void", "setZoomManager", "(", "ZoomManager", "manager", ")", "{", "if", "(", "zoomManager", "!=", "null", ")", "{", "zoomManager", ".", "removeZoomListener", "(", "this", ")", ";", "}", "zoomManager", "=", "manager", ";", "if", "(", "zoomManager",...
Replaces existing zoomManager with the new one. Implementation is null-safe. @param newManager new zoom manager
[ "Replaces", "existing", "zoomManager", "with", "the", "new", "one", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/ZoomOutAction2.java#L54-L66
test
Set the zoom manager.
Of course, here is the Java code you requested: ```java public void setZoomManager(ZoomManager manager) { if ( zoomManager != null ) { zoomManager.removeZoomListener( this ); } zoomManager = manager; if ( zoomManager != null ) { zoomManager.addZoomListener( th...
FitLayout/api
src/main/java/org/fit/layout/impl/DefaultContentRect.java
DefaultContentRect.setBorders
public void setBorders(int top, int right, int bottom, int left) { setTopBorder(top); setRightBorder(right); setBottomBorder(bottom); setLeftBorder(left); }
java
public void setBorders(int top, int right, int bottom, int left) { setTopBorder(top); setRightBorder(right); setBottomBorder(bottom); setLeftBorder(left); }
[ "public", "void", "setBorders", "(", "int", "top", ",", "int", "right", ",", "int", "bottom", ",", "int", "left", ")", "{", "setTopBorder", "(", "top", ")", ";", "setRightBorder", "(", "right", ")", ";", "setBottomBorder", "(", "bottom", ")", ";", "set...
Sets all the border values. @param top @param right @param bottom @param left
[ "Sets", "all", "the", "border", "values", "." ]
fcfa67ce2a7485fbd722576413191fff5d68bae8
https://github.com/FitLayout/api/blob/fcfa67ce2a7485fbd722576413191fff5d68bae8/src/main/java/org/fit/layout/impl/DefaultContentRect.java#L257-L263
test
Sets the border values of the CRAs of the CRAs of the CRAs.
Of course, here is the Java code you requested: ```java public void setBorders(int top, int right, int bottom, int left) { setTopBorder(top); setRightBorder(right); setBottomBorder(bottom); setLeftBorder(left); } ``` Hope this helps!
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/dom/Node.java
Node.initChildElementNodes
protected void initChildElementNodes() { if (childElementNodes == null) { childElementNodes = new Element[childElementNodesCount]; int childCount = getChildNodesCount(); for (int i = 0; i < childCount; i++) { Node child = getChild(i); if (child.siblingElementIndex >= 0) { childElementNodes[chil...
java
protected void initChildElementNodes() { if (childElementNodes == null) { childElementNodes = new Element[childElementNodesCount]; int childCount = getChildNodesCount(); for (int i = 0; i < childCount; i++) { Node child = getChild(i); if (child.siblingElementIndex >= 0) { childElementNodes[chil...
[ "protected", "void", "initChildElementNodes", "(", ")", "{", "if", "(", "childElementNodes", "==", "null", ")", "{", "childElementNodes", "=", "new", "Element", "[", "childElementNodesCount", "]", ";", "int", "childCount", "=", "getChildNodesCount", "(", ")", ";...
Initializes list of child elements.
[ "Initializes", "list", "of", "child", "elements", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/Node.java#L841-L853
test
Initializes the child element nodes array.
Of course, here is the Java code you requested: ```java protected void initChildElementNodes() { if (childElementNodes == null) { childElementNodes = new Element[childElementNodesCount]; int childCount = getChildNodesCount(); for (int i = 0; i < childCount; i++) { Node child = getChild(i); if (chil...
js-lib-com/tiny-container
src/main/java/js/container/InstanceFieldsInjectionProcessor.java
InstanceFieldsInjectionProcessor.postProcessInstance
@Override public void postProcessInstance(ManagedClassSPI managedClass, Object instance) { if (instance == null) { // null instance is silently ignored since container ensure not null instance argument return; } for (Field dependency : managedClass.getDependencies()) { if (dependency.isSynthetic(...
java
@Override public void postProcessInstance(ManagedClassSPI managedClass, Object instance) { if (instance == null) { // null instance is silently ignored since container ensure not null instance argument return; } for (Field dependency : managedClass.getDependencies()) { if (dependency.isSynthetic(...
[ "@", "Override", "public", "void", "postProcessInstance", "(", "ManagedClassSPI", "managedClass", ",", "Object", "instance", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "// null instance is silently ignored since container ensure not null instance argument\r", ...
Inject dependencies described by given managed class into related managed instance. For every dependency field retrieve its value using {@link DependencyProcessor#getDependencyValue(ManagedClassSPI, Class)} and inject it reflexively. @param managedClass managed class, @param instance instance of given managed class. @...
[ "Inject", "dependencies", "described", "by", "given", "managed", "class", "into", "related", "managed", "instance", ".", "For", "every", "dependency", "field", "retrieve", "its", "value", "using", "{", "@link", "DependencyProcessor#getDependencyValue", "(", "ManagedCl...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/InstanceFieldsInjectionProcessor.java#L29-L43
test
Override this method to add additional fields to the instance.
Of course, here is the Java code you requested: ```java @Override public void postProcessInstance(ManagedClassSPI managedClass, Object instance) { if (instance == null) { // null instance is silently ignored since container ensure not null instance argument return; } for (Field dependency : managedC...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/swing/surface/Surface.java
Surface.createBinaryImage
private BufferedImage createBinaryImage(int w, int h, int pixelBits) { int bytesPerRow = w * pixelBits / 8; if ((w * pixelBits % 8) != 0) { bytesPerRow++; } byte[] imageData = new byte[h * bytesPerRow]; IndexColorModel cm = null; switch (pixelBi...
java
private BufferedImage createBinaryImage(int w, int h, int pixelBits) { int bytesPerRow = w * pixelBits / 8; if ((w * pixelBits % 8) != 0) { bytesPerRow++; } byte[] imageData = new byte[h * bytesPerRow]; IndexColorModel cm = null; switch (pixelBi...
[ "private", "BufferedImage", "createBinaryImage", "(", "int", "w", ",", "int", "h", ",", "int", "pixelBits", ")", "{", "int", "bytesPerRow", "=", "w", "*", "pixelBits", "/", "8", ";", "if", "(", "(", "w", "*", "pixelBits", "%", "8", ")", "!=", "0", ...
Creates a custom grey-scale binary image format. @param w The image width. @param h The image height. @param pixelBits The number of grey-scale bits to use. Must be 1, 2 or 4. @return A buffered image of the specifed size and type.
[ "Creates", "a", "custom", "grey", "-", "scale", "binary", "image", "format", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/swing/surface/Surface.java#L509-L551
test
Create a binary image of the specified size.
Of course, here is the Java code you requested: ```java private BufferedImage createBinaryImage(int w, int h, int pixelBits) { int bytesPerRow = w * pixelBits / 8; if ((w * pixelBits % 8) != 0) { bytesPerRow++; } byte[] imageData = new byte[h * bytesPerRow]; ...
spring-projects/spring-security
core/src/main/java/org/springframework/security/core/userdetails/jdbc/JdbcDaoImpl.java
JdbcDaoImpl.createUserDetails
protected UserDetails createUserDetails(String username, UserDetails userFromUserQuery, List<GrantedAuthority> combinedAuthorities) { String returnUsername = userFromUserQuery.getUsername(); if (!this.usernameBasedPrimaryKey) { returnUsername = username; } return new User(returnUsername, userFromUserQue...
java
protected UserDetails createUserDetails(String username, UserDetails userFromUserQuery, List<GrantedAuthority> combinedAuthorities) { String returnUsername = userFromUserQuery.getUsername(); if (!this.usernameBasedPrimaryKey) { returnUsername = username; } return new User(returnUsername, userFromUserQue...
[ "protected", "UserDetails", "createUserDetails", "(", "String", "username", ",", "UserDetails", "userFromUserQuery", ",", "List", "<", "GrantedAuthority", ">", "combinedAuthorities", ")", "{", "String", "returnUsername", "=", "userFromUserQuery", ".", "getUsername", "("...
Can be overridden to customize the creation of the final UserDetailsObject which is returned by the <tt>loadUserByUsername</tt> method. @param username the name originally passed to loadUserByUsername @param userFromUserQuery the object returned from the execution of the @param combinedAuthorities the combined array o...
[ "Can", "be", "overridden", "to", "customize", "the", "creation", "of", "the", "final", "UserDetailsObject", "which", "is", "returned", "by", "the", "<tt", ">", "loadUserByUsername<", "/", "tt", ">", "method", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/core/userdetails/jdbc/JdbcDaoImpl.java#L289-L300
test
Create a UserDetails object from the UserQuery.
Of course, here is the Java code you requested: ```java protected UserDetails createUserDetails(String username, UserDetails userFromUserQuery, List<GrantedAuthority> combinedAuthorities) { String returnUsername = userFromUserQuery.getUsername(); if (!this.usernameBasedPrimaryKey) { returnUsername = usernam...
jcodec/jcodec
javase/src/main/java/org/jcodec/api/awt/AWTFrameGrab.java
AWTFrameGrab.getFrame
public static BufferedImage getFrame(SeekableByteChannel file, int frameNumber) throws JCodecException, IOException { return ((AWTFrameGrab) createAWTFrameGrab(file).seekToFramePrecise(frameNumber)).getFrame(); }
java
public static BufferedImage getFrame(SeekableByteChannel file, int frameNumber) throws JCodecException, IOException { return ((AWTFrameGrab) createAWTFrameGrab(file).seekToFramePrecise(frameNumber)).getFrame(); }
[ "public", "static", "BufferedImage", "getFrame", "(", "SeekableByteChannel", "file", ",", "int", "frameNumber", ")", "throws", "JCodecException", ",", "IOException", "{", "return", "(", "(", "AWTFrameGrab", ")", "createAWTFrameGrab", "(", "file", ")", ".", "seekTo...
Get frame at a specified frame number as AWT image @param file @param second @return @throws IOException @throws JCodecException
[ "Get", "frame", "at", "a", "specified", "frame", "number", "as", "AWT", "image" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/javase/src/main/java/org/jcodec/api/awt/AWTFrameGrab.java#L123-L125
test
Get a buffered image from a file.
Of course, here is the Java code you requested: ```java public static BufferedImage getFrame(SeekableByteChannel file, int frameNumber) throws JCodecException, IOException { return ((AWTFrameGrab) createAWTFrameGrab(file).seekToFramePrecise(frameNumber)).getFrame(); } ``` Hope this helps!
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/taxonomy/TaxonomyPrinter.java
TaxonomyPrinter.processTaxomomy
protected static <T extends ElkEntity> void processTaxomomy( final Taxonomy<T> taxonomy, final Appendable writer) throws IOException { final ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); // Declarations. final List<T> members = new ArrayList<T>( taxonomy.getNodes().size() * 2);...
java
protected static <T extends ElkEntity> void processTaxomomy( final Taxonomy<T> taxonomy, final Appendable writer) throws IOException { final ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); // Declarations. final List<T> members = new ArrayList<T>( taxonomy.getNodes().size() * 2);...
[ "protected", "static", "<", "T", "extends", "ElkEntity", ">", "void", "processTaxomomy", "(", "final", "Taxonomy", "<", "T", ">", "taxonomy", ",", "final", "Appendable", "writer", ")", "throws", "IOException", "{", "final", "ElkObject", ".", "Factory", "factor...
Process a taxonomy and write a normalized serialization. @param taxonomy @param writer @throws IOException
[ "Process", "a", "taxonomy", "and", "write", "a", "normalized", "serialization", "." ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/taxonomy/TaxonomyPrinter.java#L193-L249
test
Process the Taxonomy object.
Of course, here is the Java code you requested: ```java protected static <T extends ElkEntity> void processTaxomomy( final Taxonomy<T> taxonomy, final Appendable writer) throws IOException { final ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); // Declarations. final List<T> members...
RestComm/jain-slee
container/fault-tolerant-ra/impl/src/main/java/org/mobicents/slee/resource/cluster/FaultTolerantResourceAdaptorContextImpl.java
FaultTolerantResourceAdaptorContextImpl.getLocalAddress
public MemberAddress getLocalAddress() { Address localAddress = sleeContainer.getCluster().getLocalAddress(); return localAddress != null ? new MemberAddressImpl(localAddress) : null; }
java
public MemberAddress getLocalAddress() { Address localAddress = sleeContainer.getCluster().getLocalAddress(); return localAddress != null ? new MemberAddressImpl(localAddress) : null; }
[ "public", "MemberAddress", "getLocalAddress", "(", ")", "{", "Address", "localAddress", "=", "sleeContainer", ".", "getCluster", "(", ")", ".", "getLocalAddress", "(", ")", ";", "return", "localAddress", "!=", "null", "?", "new", "MemberAddressImpl", "(", "local...
/* (non-Javadoc) @see org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptorContext #getLocalAddress()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/fault-tolerant-ra/impl/src/main/java/org/mobicents/slee/resource/cluster/FaultTolerantResourceAdaptorContextImpl.java#L156-L160
test
Returns the local address of the cluster.
Of course, here is the Java code you requested: ```java public MemberAddress getLocalAddress() { Address localAddress = sleeContainer.getCluster().getLocalAddress(); return localAddress != null ? new MemberAddressImpl(localAddress) : null; } ``` Hope this helps!
playframework/playframework
core/play/src/main/java/play/mvc/Results.java
Results.movedPermanently
public static Result movedPermanently(Call call) { return new Result(MOVED_PERMANENTLY, Collections.singletonMap(LOCATION, call.path())); }
java
public static Result movedPermanently(Call call) { return new Result(MOVED_PERMANENTLY, Collections.singletonMap(LOCATION, call.path())); }
[ "public", "static", "Result", "movedPermanently", "(", "Call", "call", ")", "{", "return", "new", "Result", "(", "MOVED_PERMANENTLY", ",", "Collections", ".", "singletonMap", "(", "LOCATION", ",", "call", ".", "path", "(", ")", ")", ")", ";", "}" ]
Generates a 301 Moved Permanently result. @param call Call defining the url to redirect (typically comes from reverse router). @return the result
[ "Generates", "a", "301", "Moved", "Permanently", "result", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L4488-L4490
test
A result indicating that a call is permanently moved.
Of course, here is the Java code you requested: ```java public static Result movedPermanently(Call call) { return new Result(MOVED_PERMANENTLY, Collections.singletonMap(LOCATION, call.path())); } ``` Hope this helps!
yunify/qingstor-sdk-java
src/main/java/com/qingstor/sdk/upload/UploadManager.java
UploadManager.putFile
public void putFile(File file, final String objectKey, String fileName, long length) throws QSException { PutObjectInput input = new PutObjectInput(); input.setContentLength(length); input.setBodyInputFile(file); // Set content disposition to the object. i...
java
public void putFile(File file, final String objectKey, String fileName, long length) throws QSException { PutObjectInput input = new PutObjectInput(); input.setContentLength(length); input.setBodyInputFile(file); // Set content disposition to the object. i...
[ "public", "void", "putFile", "(", "File", "file", ",", "final", "String", "objectKey", ",", "String", "fileName", ",", "long", "length", ")", "throws", "QSException", "{", "PutObjectInput", "input", "=", "new", "PutObjectInput", "(", ")", ";", "input", ".", ...
Upload a file with a simple put object upload as a sync request. <br> If a file's size is less than {@link UploadManager#partSize}, there will call this method. @param file file @param objectKey key of the object in the bucket @param fileName file name of response(content-disposition) when downloaded @param length leng...
[ "Upload", "a", "file", "with", "a", "simple", "put", "object", "upload", "as", "a", "sync", "request", ".", "<br", ">", "If", "a", "file", "s", "size", "is", "less", "than", "{" ]
b44a228a99e60e4d6e5a450b7c05972552ab9962
https://github.com/yunify/qingstor-sdk-java/blob/b44a228a99e60e4d6e5a450b7c05972552ab9962/src/main/java/com/qingstor/sdk/upload/UploadManager.java#L320-L357
test
Put a file to a object.
Of course, here is the Java code you requested: ```java public void putFile(File file, final String objectKey, String fileName, long length) throws QSException { PutObjectInput input = new PutObjectInput(); input.setContentLength(length); input.setBodyInputFile(file); ...
jkuhnert/ognl
src/main/java/ognl/OgnlRuntime.java
OgnlRuntime.setClassCacheInspector
public static void setClassCacheInspector(ClassCacheInspector inspector) { _cacheInspector = inspector; _propertyDescriptorCache.setClassInspector(_cacheInspector); _constructorCache.setClassInspector(_cacheInspector); _staticMethodCache.setClassInspector(_cacheInspector); _...
java
public static void setClassCacheInspector(ClassCacheInspector inspector) { _cacheInspector = inspector; _propertyDescriptorCache.setClassInspector(_cacheInspector); _constructorCache.setClassInspector(_cacheInspector); _staticMethodCache.setClassInspector(_cacheInspector); _...
[ "public", "static", "void", "setClassCacheInspector", "(", "ClassCacheInspector", "inspector", ")", "{", "_cacheInspector", "=", "inspector", ";", "_propertyDescriptorCache", ".", "setClassInspector", "(", "_cacheInspector", ")", ";", "_constructorCache", ".", "setClassIn...
Registers the specified {@link ClassCacheInspector} with all class reflection based internal caches. This may have a significant performance impact so be careful using this in production scenarios. @param inspector The inspector instance that will be registered with all internal cache instances.
[ "Registers", "the", "specified", "{", "@link", "ClassCacheInspector", "}", "with", "all", "class", "reflection", "based", "internal", "caches", ".", "This", "may", "have", "a", "significant", "performance", "impact", "so", "be", "careful", "using", "this", "in",...
53d51a30c8c299b750dede779d05cb84beee73c3
https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlRuntime.java#L2844-L2856
test
Sets the class cache inspector.
Of course, here is the Java code you requested: ```java public static void setClassCacheInspector(ClassCacheInspector inspector) { _cacheInspector = inspector; _propertyDescriptorCache.setClassInspector(_cacheInspector); _constructorCache.setClassInspector(_cacheInspector); _static...
jcodec/jcodec
src/main/java/org/jcodec/codecs/vpx/VPXBooleanDecoder.java
VPXBooleanDecoder.readTree3
public int readTree3(int[] tree, int prob0, int prob1) { int i = 0; if ((i = tree[i + readBit(prob0)]) > 0) { while ((i = tree[i + readBit(prob1)]) > 0) ; } return -i; /* negate the return value */ }
java
public int readTree3(int[] tree, int prob0, int prob1) { int i = 0; if ((i = tree[i + readBit(prob0)]) > 0) { while ((i = tree[i + readBit(prob1)]) > 0) ; } return -i; /* negate the return value */ }
[ "public", "int", "readTree3", "(", "int", "[", "]", "tree", ",", "int", "prob0", ",", "int", "prob1", ")", "{", "int", "i", "=", "0", ";", "if", "(", "(", "i", "=", "tree", "[", "i", "+", "readBit", "(", "prob0", ")", "]", ")", ">", "0", ")...
There is a method in the class (or one of its parents) having the same name with the method named [readTree] but is less generic
[ "There", "is", "a", "method", "in", "the", "class", "(", "or", "one", "of", "its", "parents", ")", "having", "the", "same", "name", "with", "the", "method", "named", "[", "readTree", "]", "but", "is", "less", "generic" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/vpx/VPXBooleanDecoder.java#L163-L169
test
readTree3 - Reads 3 bits from the input tree.
Of course, here is the Java code you requested: ```java public int readTree3(int[] tree, int prob0, int prob1) { int i = 0; if ((i = tree[i + readBit(prob0)]) > 0) { while ((i = tree[i + readBit(prob1)]) > 0) ; } return -i; /* negate the return value */ ...
oblac/jodd
jodd-proxetta/src/main/java/jodd/proxetta/asm/InvokeReplacerMethodAdapter.java
InvokeReplacerMethodAdapter.changeReturnType
protected static String changeReturnType(final String desc, final String type) { int ndx = desc.indexOf(')'); return desc.substring(0, ndx + 1) + type; }
java
protected static String changeReturnType(final String desc, final String type) { int ndx = desc.indexOf(')'); return desc.substring(0, ndx + 1) + type; }
[ "protected", "static", "String", "changeReturnType", "(", "final", "String", "desc", ",", "final", "String", "type", ")", "{", "int", "ndx", "=", "desc", ".", "indexOf", "(", "'", "'", ")", ";", "return", "desc", ".", "substring", "(", "0", ",", "ndx",...
Changes return type.
[ "Changes", "return", "type", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/asm/InvokeReplacerMethodAdapter.java#L365-L368
test
Change return type.
Of course, here is the Java code you requested: ```java protected static String changeReturnType(final String desc, final String type) { int ndx = desc.indexOf(')'); return desc.substring(0, ndx + 1) + type; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java
GridCoordSys.isZPositive
@Override public boolean isZPositive() { if (vertZaxis == null) return false; if (vertZaxis.getPositive() != null) { return vertZaxis.getPositive().equalsIgnoreCase(ucar.nc2.constants.CF.POSITIVE_UP); } if (vertZaxis.getAxisType() == AxisType.Height) return true; return vertZaxis.getA...
java
@Override public boolean isZPositive() { if (vertZaxis == null) return false; if (vertZaxis.getPositive() != null) { return vertZaxis.getPositive().equalsIgnoreCase(ucar.nc2.constants.CF.POSITIVE_UP); } if (vertZaxis.getAxisType() == AxisType.Height) return true; return vertZaxis.getA...
[ "@", "Override", "public", "boolean", "isZPositive", "(", ")", "{", "if", "(", "vertZaxis", "==", "null", ")", "return", "false", ";", "if", "(", "vertZaxis", ".", "getPositive", "(", ")", "!=", "null", ")", "{", "return", "vertZaxis", ".", "getPositive"...
true if increasing z coordinate values means "up" in altitude
[ "true", "if", "increasing", "z", "coordinate", "values", "means", "up", "in", "altitude" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java#L738-L746
test
Returns true if the z - axis is positive.
Of course, here is the Java code you requested: ```java @Override public boolean isZPositive() { if (vertZaxis == null) return false; if (vertZaxis.getPositive() != null) { return vertZaxis.getPositive().equalsIgnoreCase(ucar.nc2.constants.CF.POSITIVE_UP); } if (vertZaxis.getAxisType() ==...
ReactiveX/RxJava
src/main/java/io/reactivex/Completable.java
Completable.fromCallable
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable fromCallable(final Callable<?> callable) { ObjectHelper.requireNonNull(callable, "callable is null"); return RxJavaPlugins.onAssembly(new CompletableFromCallable(callable)); }
java
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable fromCallable(final Callable<?> callable) { ObjectHelper.requireNonNull(callable, "callable is null"); return RxJavaPlugins.onAssembly(new CompletableFromCallable(callable)); }
[ "@", "CheckReturnValue", "@", "NonNull", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "static", "Completable", "fromCallable", "(", "final", "Callable", "<", "?", ">", "callable", ")", "{", "ObjectHelper", ".", "requireNonNull", ...
Returns a Completable which when subscribed, executes the callable function, ignores its normal result and emits onError or onComplete only. <p> <img width="640" height="286" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromCallable.png" alt=""> <dl> <dt><b>Scheduler:</b></dt> <dd>{...
[ "Returns", "a", "Completable", "which", "when", "subscribed", "executes", "the", "callable", "function", "ignores", "its", "normal", "result", "and", "emits", "onError", "or", "onComplete", "only", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L449-L455
test
Creates an Completable from a Callable.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable fromCallable(final Callable<?> callable) { ObjectHelper.requireNonNull(callable, "callable is null"); return RxJavaPlugins.onAssembly(new Com...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/PlayerController.java
PlayerController.stopPlaying
public void stopPlaying() { Optional<Identification> ownIdentification = IdentificationManagerM.getInstance() .getIdentification(this); Optional<Identification> playerIdentification = IdentificationManagerM.getInstance() .getIdentification(player); if (!ownIdentif...
java
public void stopPlaying() { Optional<Identification> ownIdentification = IdentificationManagerM.getInstance() .getIdentification(this); Optional<Identification> playerIdentification = IdentificationManagerM.getInstance() .getIdentification(player); if (!ownIdentif...
[ "public", "void", "stopPlaying", "(", ")", "{", "Optional", "<", "Identification", ">", "ownIdentification", "=", "IdentificationManagerM", ".", "getInstance", "(", ")", ".", "getIdentification", "(", "this", ")", ";", "Optional", "<", "Identification", ">", "pl...
stops the playing of the music
[ "stops", "the", "playing", "of", "the", "music" ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/PlayerController.java#L97-L108
test
Stop playing the music
Of course, here is the Java code you requested: ```java public void stopPlaying() { Optional<Identification> ownIdentification = IdentificationManagerM.getInstance() .getIdentification(this); Optional<Identification> playerIdentification = IdentificationManagerM.getInstance() ...
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/parser/AbstractNodeParser.java
AbstractNodeParser.parse
public void parse(Element element) { model = newModel(); model.setName(element.getAttribute(ATTR_NAME)); model.setDisplayName(element.getAttribute(ATTR_DISPLAYNAME)); model.setLayout(element.getAttribute(ATTR_LAYOUT)); model.setPreInterceptors(element.getAttribute(ATTR_PREINTERCEPTORS)); model.setPostInterc...
java
public void parse(Element element) { model = newModel(); model.setName(element.getAttribute(ATTR_NAME)); model.setDisplayName(element.getAttribute(ATTR_DISPLAYNAME)); model.setLayout(element.getAttribute(ATTR_LAYOUT)); model.setPreInterceptors(element.getAttribute(ATTR_PREINTERCEPTORS)); model.setPostInterc...
[ "public", "void", "parse", "(", "Element", "element", ")", "{", "model", "=", "newModel", "(", ")", ";", "model", ".", "setName", "(", "element", ".", "getAttribute", "(", "ATTR_NAME", ")", ")", ";", "model", ".", "setDisplayName", "(", "element", ".", ...
实现NodeParser接口的parse函数 由子类产生各自的模型对象,设置常用的名称属性,并且解析子节点transition,构造TransitionModel模型对象
[ "实现NodeParser接口的parse函数", "由子类产生各自的模型对象,设置常用的名称属性,并且解析子节点transition,构造TransitionModel模型对象" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/parser/AbstractNodeParser.java#L40-L62
test
Parses the XML element and creates the model.
Of course, here is the Java code you requested: ```java public void parse(Element element) { model = newModel(); model.setName(element.getAttribute(ATTR_NAME)); model.setDisplayName(element.getAttribute(ATTR_DISPLAYNAME)); model.setLayout(element.getAttribute(ATTR_LAYOUT)); model.setPreInterceptors(element.g...
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormFieldUtil.java
SQLFormFieldUtil.getFormDefinitionId
public Long getFormDefinitionId(Long electronicFormIdParam) { if(electronicFormIdParam == null) { return null; } PreparedStatement preparedStatement = null; ResultSet resultSet; try { ISyntax syntax = SyntaxFactory.getInstance().getSyntaxFor( this.getSQLTypeFromConnection(), ISyntax.Proced...
java
public Long getFormDefinitionId(Long electronicFormIdParam) { if(electronicFormIdParam == null) { return null; } PreparedStatement preparedStatement = null; ResultSet resultSet; try { ISyntax syntax = SyntaxFactory.getInstance().getSyntaxFor( this.getSQLTypeFromConnection(), ISyntax.Proced...
[ "public", "Long", "getFormDefinitionId", "(", "Long", "electronicFormIdParam", ")", "{", "if", "(", "electronicFormIdParam", "==", "null", ")", "{", "return", "null", ";", "}", "PreparedStatement", "preparedStatement", "=", "null", ";", "ResultSet", "resultSet", "...
Retrieves the Form Definition Id for the Electronic Form with id {@code electronicFormIdParam}. @param electronicFormIdParam The Electronic Form to fetch fields for. @return The Form Definition for Electronic Form {@code electronicFormIdParam}.
[ "Retrieves", "the", "Form", "Definition", "Id", "for", "the", "Electronic", "Form", "with", "id", "{", "@code", "electronicFormIdParam", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormFieldUtil.java#L251-L284
test
Get the form definition id for the given electronic form id parameter.
Of course, here is the Java code you requested: ```java public Long getFormDefinitionId(Long electronicFormIdParam) { if(electronicFormIdParam == null) { return null; } PreparedStatement preparedStatement = null; ResultSet resultSet; try { ISyntax syntax = SyntaxFactory.getInstance().getSyntaxFor( ...
PeterisP/morphology
src/main/java/lv/semti/morphology/analyzer/MarkupConverter.java
MarkupConverter.charsToPrologList
public static String charsToPrologList(String chars) { StringBuilder sb = new StringBuilder(chars.length()*2+1); charsToPrologList(chars, sb); return sb.toString(); }
java
public static String charsToPrologList(String chars) { StringBuilder sb = new StringBuilder(chars.length()*2+1); charsToPrologList(chars, sb); return sb.toString(); }
[ "public", "static", "String", "charsToPrologList", "(", "String", "chars", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "chars", ".", "length", "(", ")", "*", "2", "+", "1", ")", ";", "charsToPrologList", "(", "chars", ",", "sb", ")...
Converts Kamols-style markup to Prolog list.
[ "Converts", "Kamols", "-", "style", "markup", "to", "Prolog", "list", "." ]
a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783
https://github.com/PeterisP/morphology/blob/a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783/src/main/java/lv/semti/morphology/analyzer/MarkupConverter.java#L803-L807
test
Converts a sequence of characters to a sequence of Prolog objects.
Of course, here is the Java code you requested: ```java public static String charsToPrologList(String chars) { StringBuilder sb = new StringBuilder(chars.length()*2+1); charsToPrologList(chars, sb); return sb.toString(); } ``` Hope this helps!
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/interceptor/EchoInterceptor.java
EchoInterceptor.intercept
@Override public Object intercept(final ActionRequest actionRequest) throws Exception { printBefore(actionRequest); long startTime = System.currentTimeMillis(); Object result = null; try { result = actionRequest.invoke(); } catch (Exception ex) { result = "<exception>"; throw ex; } catch (Throwabl...
java
@Override public Object intercept(final ActionRequest actionRequest) throws Exception { printBefore(actionRequest); long startTime = System.currentTimeMillis(); Object result = null; try { result = actionRequest.invoke(); } catch (Exception ex) { result = "<exception>"; throw ex; } catch (Throwabl...
[ "@", "Override", "public", "Object", "intercept", "(", "final", "ActionRequest", "actionRequest", ")", "throws", "Exception", "{", "printBefore", "(", "actionRequest", ")", ";", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Object...
Measure action invocation time.
[ "Measure", "action", "invocation", "time", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/interceptor/EchoInterceptor.java#L53-L71
test
Intercepts the specified action request.
Of course, here is the Java code you requested: ```java @Override public Object intercept(final ActionRequest actionRequest) throws Exception { printBefore(actionRequest); long startTime = System.currentTimeMillis(); Object result = null; try { result = actionRequest.invoke(); } catch (Exception ex) { ...
akquinet/chameRIA
chameria-webview-factory/src/main/java/de/akquinet/chameria/webview/WebViewFactory.java
WebViewFactory.setURL
@Property(name="url") public synchronized void setURL(final String url) { this.m_url = url; if (m_browser != null) { QApplication.invokeLater(new Runnable() { public void run() { m_browser.open(url); } }); } }
java
@Property(name="url") public synchronized void setURL(final String url) { this.m_url = url; if (m_browser != null) { QApplication.invokeLater(new Runnable() { public void run() { m_browser.open(url); } }); } }
[ "@", "Property", "(", "name", "=", "\"url\"", ")", "public", "synchronized", "void", "setURL", "(", "final", "String", "url", ")", "{", "this", ".", "m_url", "=", "url", ";", "if", "(", "m_browser", "!=", "null", ")", "{", "QApplication", ".", "invokeL...
Configuration Property: set the initial URL. This property is <b>mandatory</b>. If the browser is already created, this web view loads this new url. @param url the url
[ "Configuration", "Property", ":", "set", "the", "initial", "URL", ".", "This", "property", "is", "<b", ">", "mandatory<", "/", "b", ">", ".", "If", "the", "browser", "is", "already", "created", "this", "web", "view", "loads", "this", "new", "url", "." ]
a5c154e0d0f70f24381db93d57b70364e6c2db0b
https://github.com/akquinet/chameRIA/blob/a5c154e0d0f70f24381db93d57b70364e6c2db0b/chameria-webview-factory/src/main/java/de/akquinet/chameria/webview/WebViewFactory.java#L287-L297
test
Sets the URL of the page.
Of course, here is the Java code you requested: ```java @Property(name="url") public synchronized void setURL(final String url) { this.m_url = url; if (m_browser != null) { QApplication.invokeLater(new Runnable() { public void run() { m_browser.open(u...