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
playframework/playframework
core/play/src/main/java/play/mvc/Results.java
Results.preconditionRequired
public static Result preconditionRequired(File content, FileMimeTypes fileMimeTypes) { return status(PRECONDITION_REQUIRED, content, fileMimeTypes); }
java
public static Result preconditionRequired(File content, FileMimeTypes fileMimeTypes) { return status(PRECONDITION_REQUIRED, content, fileMimeTypes); }
[ "public", "static", "Result", "preconditionRequired", "(", "File", "content", ",", "FileMimeTypes", "fileMimeTypes", ")", "{", "return", "status", "(", "PRECONDITION_REQUIRED", ",", "content", ",", "fileMimeTypes", ")", ";", "}" ]
Generates a 428 Precondition Required result. @param content The file to send. @param fileMimeTypes Used for file type mapping. @return the result
[ "Generates", "a", "428", "Precondition", "Required", "result", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L3125-L3127
test
Check if precondition is required.
Of course, here is the Java code you requested: ```java public static Result preconditionRequired(File content, FileMimeTypes fileMimeTypes) { return status(PRECONDITION_REQUIRED, content, fileMimeTypes); } ``` Hope this helps!
yunify/qingstor-sdk-java
src/main/java/com/qingstor/sdk/upload/UploadManager.java
UploadManager.putFileMulti
public void putFileMulti(File file, final String objectKey, String fileName, String eTag, final long length) throws QSException { if (partSize < 4 * 1024 * 1024) { throw new QSException("Every part of the file can not smaller than 4 MB."); } if (recorder == null || recorder.get(obj...
java
public void putFileMulti(File file, final String objectKey, String fileName, String eTag, final long length) throws QSException { if (partSize < 4 * 1024 * 1024) { throw new QSException("Every part of the file can not smaller than 4 MB."); } if (recorder == null || recorder.get(obj...
[ "public", "void", "putFileMulti", "(", "File", "file", ",", "final", "String", "objectKey", ",", "String", "fileName", ",", "String", "eTag", ",", "final", "long", "length", ")", "throws", "QSException", "{", "if", "(", "partSize", "<", "4", "*", "1024", ...
Upload a file with a multi upload as a sync request. @param file file @param objectKey key of the object in the bucket @param fileName file name of response(content-disposition) when downloaded @param eTag MD5 info @param length length of the file. @throws QSException exception
[ "Upload", "a", "file", "with", "a", "multi", "upload", "as", "a", "sync", "request", "." ]
b44a228a99e60e4d6e5a450b7c05972552ab9962
https://github.com/yunify/qingstor-sdk-java/blob/b44a228a99e60e4d6e5a450b7c05972552ab9962/src/main/java/com/qingstor/sdk/upload/UploadManager.java#L122-L233
test
Upload a multi part of a file.
Of course, here is the Java code you requested: ```java public void putFileMulti(File file, final String objectKey, String fileName, String eTag, final long length) throws QSException { if (partSize < 4 * 1024 * 1024) { throw new QSException("Every part of the file can not smaller than 4 MB."); ...
WASdev/ci.common
src/main/java/net/wasdev/wlp/common/plugins/util/InstallFeatureUtil.java
InstallFeatureUtil.isReplacementJar
private static boolean isReplacementJar(File file1, File file2) { if (file1 == null) { return true; } else if (file2 == null) { return false; } else { String version1 = extractVersion(file1.getName()); String version2 = extractVersion(file2.getName...
java
private static boolean isReplacementJar(File file1, File file2) { if (file1 == null) { return true; } else if (file2 == null) { return false; } else { String version1 = extractVersion(file1.getName()); String version2 = extractVersion(file2.getName...
[ "private", "static", "boolean", "isReplacementJar", "(", "File", "file1", ",", "File", "file2", ")", "{", "if", "(", "file1", "==", "null", ")", "{", "return", "true", ";", "}", "else", "if", "(", "file2", "==", "null", ")", "{", "return", "false", "...
Returns whether file2 can replace file1 as the install map jar. @param file1 @param file2 @return true if file2 is a replacement jar for file1 false otherwise
[ "Returns", "whether", "file2", "can", "replace", "file1", "as", "the", "install", "map", "jar", "." ]
24fc917383e9ff60ea6a42972c86577fe0f4591e
https://github.com/WASdev/ci.common/blob/24fc917383e9ff60ea6a42972c86577fe0f4591e/src/main/java/net/wasdev/wlp/common/plugins/util/InstallFeatureUtil.java#L884-L894
test
Checks if the jar is a replacement jar.
Of course, here is the Java code you requested: ```java private static boolean isReplacementJar(File file1, File file2) { if (file1 == null) { return true; } else if (file2 == null) { return false; } else { String version1 = extractVersion(file1.getName()); ...
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/IIOPJndiBindingProcessor.java
IIOPJndiBindingProcessor.bindService
private void bindService(final ServiceTarget serviceTarget, final ServiceName contextServiceName, final Module module) { final ServiceName orbServiceName = contextServiceName.append("ORB"); final BinderService orbService = new BinderService("ORB"); serviceTarget.addService(orbServiceName, orbSe...
java
private void bindService(final ServiceTarget serviceTarget, final ServiceName contextServiceName, final Module module) { final ServiceName orbServiceName = contextServiceName.append("ORB"); final BinderService orbService = new BinderService("ORB"); serviceTarget.addService(orbServiceName, orbSe...
[ "private", "void", "bindService", "(", "final", "ServiceTarget", "serviceTarget", ",", "final", "ServiceName", "contextServiceName", ",", "final", "Module", "module", ")", "{", "final", "ServiceName", "orbServiceName", "=", "contextServiceName", ".", "append", "(", ...
Binds java:comp/ORB @param serviceTarget The service target @param contextServiceName The service name of the context to bind to
[ "Binds", "java", ":", "comp", "/", "ORB" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/IIOPJndiBindingProcessor.java#L95-L113
test
Binds the CORBA - SEQUENCE RECORD service to the given service target.
Of course, here is the Java code you requested: ```java private void bindService(final ServiceTarget serviceTarget, final ServiceName contextServiceName, final Module module) { final ServiceName orbServiceName = contextServiceName.append("ORB"); final BinderService orbService = new BinderService("ORB"...
RestComm/jain-slee
container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/SbbEntityImpl.java
SbbEntityImpl.getSbbLocalObject
public SbbLocalObjectImpl getSbbLocalObject() { if (doTraceLogs) log.trace("getSbbLocalObject()"); // The concrete class generated in ConcreteLocalObjectGenerator final Class<?> sbbLocalClass = getSbbComponent().getSbbLocalInterfaceConcreteClass(); if (sbbLocalClass != null) { Object[] objs = { this }...
java
public SbbLocalObjectImpl getSbbLocalObject() { if (doTraceLogs) log.trace("getSbbLocalObject()"); // The concrete class generated in ConcreteLocalObjectGenerator final Class<?> sbbLocalClass = getSbbComponent().getSbbLocalInterfaceConcreteClass(); if (sbbLocalClass != null) { Object[] objs = { this }...
[ "public", "SbbLocalObjectImpl", "getSbbLocalObject", "(", ")", "{", "if", "(", "doTraceLogs", ")", "log", ".", "trace", "(", "\"getSbbLocalObject()\"", ")", ";", "// The concrete class generated in ConcreteLocalObjectGenerator", "final", "Class", "<", "?", ">", "sbbLoca...
TODO improve with sbb local object storage @return
[ "TODO", "improve", "with", "sbb", "local", "object", "storage" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/SbbEntityImpl.java#L676-L704
test
Gets the SbbLocalObject object.
Of course, here is the Java code you requested: ```java public SbbLocalObjectImpl getSbbLocalObject() { if (doTraceLogs) log.trace("getSbbLocalObject()"); // The concrete class generated in ConcreteLocalObjectGenerator final Class<?> sbbLocalClass = getSbbComponent().getSbbLocalInterfaceConcreteClass(); ...
deeplearning4j/nd4j
nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java
BigDecimalMath.err2prec
static public int err2prec(BigDecimal x, BigDecimal xerr) { return err2prec(xerr.divide(x, MathContext.DECIMAL64).doubleValue()); }
java
static public int err2prec(BigDecimal x, BigDecimal xerr) { return err2prec(xerr.divide(x, MathContext.DECIMAL64).doubleValue()); }
[ "static", "public", "int", "err2prec", "(", "BigDecimal", "x", ",", "BigDecimal", "xerr", ")", "{", "return", "err2prec", "(", "xerr", ".", "divide", "(", "x", ",", "MathContext", ".", "DECIMAL64", ")", ".", "doubleValue", "(", ")", ")", ";", "}" ]
Convert an absolute error to a precision. @param x The value of the variable @param xerr The absolute error in the variable @return The number of valid digits in x. The value is rounded down, and on the pessimistic side for that reason.
[ "Convert", "an", "absolute", "error", "to", "a", "precision", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java#L2318-L2322
test
Get the precision of a number of precision values from a number of precision values.
Of course, here is the Java code you requested: ```java static public int err2prec(BigDecimal x, BigDecimal xerr) { return err2prec(xerr.divide(x, MathContext.DECIMAL64).doubleValue()); } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/collection/Iterators.java
Iterators.toSet
public static <E> Set<E> toSet(Iterator<? extends E> iterator) { Set<E> set = new LinkedHashSet<E>(); while (iterator.hasNext()) { set.add(iterator.next()); } return set; }
java
public static <E> Set<E> toSet(Iterator<? extends E> iterator) { Set<E> set = new LinkedHashSet<E>(); while (iterator.hasNext()) { set.add(iterator.next()); } return set; }
[ "public", "static", "<", "E", ">", "Set", "<", "E", ">", "toSet", "(", "Iterator", "<", "?", "extends", "E", ">", "iterator", ")", "{", "Set", "<", "E", ">", "set", "=", "new", "LinkedHashSet", "<", "E", ">", "(", ")", ";", "while", "(", "itera...
Returns a {@code Set} containing all the given {@code Iterator}'s elements. The returned {@code Set} has the same iteration order as the given {@code Iterator}. This method consumes entirely the input {@code Iterator}. @param <E> the type of the returned {@code Set}'s elements. @param iterator the {@code Iterator} to ...
[ "Returns", "a", "{", "@code", "Set", "}", "containing", "all", "the", "given", "{", "@code", "Iterator", "}", "s", "elements", ".", "The", "returned", "{", "@code", "Set", "}", "has", "the", "same", "iteration", "order", "as", "the", "given", "{", "@co...
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/collection/Iterators.java#L228-L235
test
Converts an iterator to a Set.
Of course, here is the Java code you requested: ```java public static <E> Set<E> toSet(Iterator<? extends E> iterator) { Set<E> set = new LinkedHashSet<E>(); while (iterator.hasNext()) { set.add(iterator.next()); } return set; } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.keyStore
public static void keyStore(File pathToJks, String password) { Validate.notNull(pathToJks, "Path to JKS on the file system cannot be null"); applyKeyStore(pathToJks, password); }
java
public static void keyStore(File pathToJks, String password) { Validate.notNull(pathToJks, "Path to JKS on the file system cannot be null"); applyKeyStore(pathToJks, password); }
[ "public", "static", "void", "keyStore", "(", "File", "pathToJks", ",", "String", "password", ")", "{", "Validate", ".", "notNull", "(", "pathToJks", ",", "\"Path to JKS on the file system cannot be null\"", ")", ";", "applyKeyStore", "(", "pathToJks", ",", "password...
Use a keystore located on the file-system. See {@link #keyStore(String, String)} for more details. * <p> Note that this is just a shortcut for: </p> <pre> RestAssured.config = RestAssured.config().sslConfig(sslConfig().keyStore(pathToJks, password)); </pre> @param pathToJks The path to JKS file on the file-system @par...
[ "Use", "a", "keystore", "located", "on", "the", "file", "-", "system", ".", "See", "{", "@link", "#keyStore", "(", "String", "String", ")", "}", "for", "more", "details", ".", "*", "<p", ">", "Note", "that", "this", "is", "just", "a", "shortcut", "fo...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L1667-L1670
test
Apply a keystore to the file system.
Of course, here is the Java code you requested: ```java public static void keyStore(File pathToJks, String password) { Validate.notNull(pathToJks, "Path to JKS on the file system cannot be null"); applyKeyStore(pathToJks, password); } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/transform/twist/TwistOps_F64.java
TwistOps_F64.twist
public static TwistCoordinate_F64 twist( Se3_F64 motion , TwistCoordinate_F64 twist ) { if( twist == null ) twist = new TwistCoordinate_F64(); if(MatrixFeatures_DDRM.isIdentity(motion.R, GrlConstants.TEST_F64)) { twist.w.set(0,0,0); twist.v.set(motion.T); } else { Rodrigues_F64 rod = new Rodrigues_F6...
java
public static TwistCoordinate_F64 twist( Se3_F64 motion , TwistCoordinate_F64 twist ) { if( twist == null ) twist = new TwistCoordinate_F64(); if(MatrixFeatures_DDRM.isIdentity(motion.R, GrlConstants.TEST_F64)) { twist.w.set(0,0,0); twist.v.set(motion.T); } else { Rodrigues_F64 rod = new Rodrigues_F6...
[ "public", "static", "TwistCoordinate_F64", "twist", "(", "Se3_F64", "motion", ",", "TwistCoordinate_F64", "twist", ")", "{", "if", "(", "twist", "==", "null", ")", "twist", "=", "new", "TwistCoordinate_F64", "(", ")", ";", "if", "(", "MatrixFeatures_DDRM", "."...
Converts a rigid body motion into a twist coordinate. The value of theta used to generate the motion is assumed to be one. @param motion (Input) The SE(3) transformation @param twist (Output) Storage for twist. @return magnitude of the motion
[ "Converts", "a", "rigid", "body", "motion", "into", "a", "twist", "coordinate", ".", "The", "value", "of", "theta", "used", "to", "generate", "the", "motion", "is", "assumed", "to", "be", "one", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/transform/twist/TwistOps_F64.java#L156-L199
test
Twist coordinate.
Of course, here is the Java code you requested: ```java public static TwistCoordinate_F64 twist( Se3_F64 motion , TwistCoordinate_F64 twist ) { if( twist == null ) twist = new TwistCoordinate_F64(); if(MatrixFeatures_DDRM.isIdentity(motion.R, GrlConstants.TEST_F64)) { twist.w.set(0,0,0); twist.v.set(moti...
RestComm/jain-slee
container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/stats/EventRouterStatisticsImpl.java
EventRouterStatisticsImpl.getActivitiesMapped
public int getActivitiesMapped() { int result = 0; for (int i = 0; i < getExecutors().length; i++) { result += getActivitiesMapped(i); } return result; }
java
public int getActivitiesMapped() { int result = 0; for (int i = 0; i < getExecutors().length; i++) { result += getActivitiesMapped(i); } return result; }
[ "public", "int", "getActivitiesMapped", "(", ")", "{", "int", "result", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getExecutors", "(", ")", ".", "length", ";", "i", "++", ")", "{", "result", "+=", "getActivitiesMapped", "(", "...
/* (non-Javadoc) @see org.mobicents.slee.core.eventrouter.stats.EventRouterStatisticsMBean#getActivitiesMapped()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/stats/EventRouterStatisticsImpl.java#L46-L52
test
Gets the number of activities mapped.
Of course, here is the Java code you requested: ```java public int getActivitiesMapped() { int result = 0; for (int i = 0; i < getExecutors().length; i++) { result += getActivitiesMapped(i); } return result; } ``` Hope this helps!
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/Parser.java
Parser.adup
@Override public void adup(char[] buff, int offset, int length) throws SAXException { if (theNewElement != null && theAttributeName != null) { theNewElement.setAttribute(theAttributeName, null, theAttributeName); theAttributeName = null; } }
java
@Override public void adup(char[] buff, int offset, int length) throws SAXException { if (theNewElement != null && theAttributeName != null) { theNewElement.setAttribute(theAttributeName, null, theAttributeName); theAttributeName = null; } }
[ "@", "Override", "public", "void", "adup", "(", "char", "[", "]", "buff", ",", "int", "offset", ",", "int", "length", ")", "throws", "SAXException", "{", "if", "(", "theNewElement", "!=", "null", "&&", "theAttributeName", "!=", "null", ")", "{", "theNewE...
needs to support chars past U+FFFF
[ "needs", "to", "support", "chars", "past", "U", "+", "FFFF" ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/Parser.java#L522-L528
test
This method is called to adup the content of a CML SECTYPE.
Of course, here is the Java code you requested: ```java @Override public void adup(char[] buff, int offset, int length) throws SAXException { if (theNewElement != null && theAttributeName != null) { theNewElement.setAttribute(theAttributeName, null, theAttributeName); theAttributeNa...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft/FeatureDatasetFactoryManager.java
FeatureDatasetFactoryManager.registerFactory
static public boolean registerFactory(FeatureType datatype, String className) { try { Class c = Class.forName(className); registerFactory(datatype, c); return true; } catch (ClassNotFoundException e) { // ok - these are optional return false; } }
java
static public boolean registerFactory(FeatureType datatype, String className) { try { Class c = Class.forName(className); registerFactory(datatype, c); return true; } catch (ClassNotFoundException e) { // ok - these are optional return false; } }
[ "static", "public", "boolean", "registerFactory", "(", "FeatureType", "datatype", ",", "String", "className", ")", "{", "try", "{", "Class", "c", "=", "Class", ".", "forName", "(", "className", ")", ";", "registerFactory", "(", "datatype", ",", "c", ")", "...
Register a class that implements a FeatureDatasetFactory. @param datatype scientific data type @param className name of class that implements FeatureDatasetFactory. @return true if successfully loaded
[ "Register", "a", "class", "that", "implements", "a", "FeatureDatasetFactory", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/FeatureDatasetFactoryManager.java#L79-L89
test
Register a factory for a class.
Of course, here is the Java code you requested: ```java static public boolean registerFactory(FeatureType datatype, String className) { try { Class c = Class.forName(className); registerFactory(datatype, c); return true; } catch (ClassNotFoundException e) { // ok - these are opt...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/CommandLineParser.java
CommandLineParser.checkArgumentFormat
private void checkArgumentFormat(CommandLineOption optionInfo, CharSequence matchedArg) { // Check if this option enforces a format for its argument. if (optionInfo.argumentFormatRegexp != null) { Pattern pattern = Pattern.compile(optionInfo.argumentFormatRegexp); Mat...
java
private void checkArgumentFormat(CommandLineOption optionInfo, CharSequence matchedArg) { // Check if this option enforces a format for its argument. if (optionInfo.argumentFormatRegexp != null) { Pattern pattern = Pattern.compile(optionInfo.argumentFormatRegexp); Mat...
[ "private", "void", "checkArgumentFormat", "(", "CommandLineOption", "optionInfo", ",", "CharSequence", "matchedArg", ")", "{", "// Check if this option enforces a format for its argument.", "if", "(", "optionInfo", ".", "argumentFormatRegexp", "!=", "null", ")", "{", "Patte...
Checks the format of an argument to an option against its specified regular expression format if one has been set. Any errors are added to the list of parsing errors. @param optionInfo The command line option information for the option which is havings its argument checked. @param matchedArg The string argument to the...
[ "Checks", "the", "format", "of", "an", "argument", "to", "an", "option", "against", "its", "specified", "regular", "expression", "format", "if", "one", "has", "been", "set", ".", "Any", "errors", "are", "added", "to", "the", "list", "of", "parsing", "error...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/CommandLineParser.java#L697-L713
test
Check if the argument format is valid.
Of course, here is the Java code you requested: ```java private void checkArgumentFormat(CommandLineOption optionInfo, CharSequence matchedArg) { // Check if this option enforces a format for its argument. if (optionInfo.argumentFormatRegexp != null) { Pattern pattern = Pattern....
rupertlssmith/lojix
lojix/power_model/src/main/com/thesett/aima/attribute/time/ByteBufferUtils.java
ByteBufferUtils.putPaddedInt32AsString
public static ByteBuffer putPaddedInt32AsString(ByteBuffer buffer, int value, int length) { // Ensure there is sufficient space in the buffer to hold the result. int charsRequired = BitHackUtils.getCharacterCountInt32(value); length = (charsRequired < length) ? length : charsRequired; ...
java
public static ByteBuffer putPaddedInt32AsString(ByteBuffer buffer, int value, int length) { // Ensure there is sufficient space in the buffer to hold the result. int charsRequired = BitHackUtils.getCharacterCountInt32(value); length = (charsRequired < length) ? length : charsRequired; ...
[ "public", "static", "ByteBuffer", "putPaddedInt32AsString", "(", "ByteBuffer", "buffer", ",", "int", "value", ",", "int", "length", ")", "{", "// Ensure there is sufficient space in the buffer to hold the result.", "int", "charsRequired", "=", "BitHackUtils", ".", "getChara...
Writes the specified integer value as an ASCII string into the specified byte buffer. If the integer value is shorted than the specified length, the number will be padded with leading zeros, so that it fills the required length. If there is insufficient space in the buffer to write the value into, then the buffer size ...
[ "Writes", "the", "specified", "integer", "value", "as", "an", "ASCII", "string", "into", "the", "specified", "byte", "buffer", ".", "If", "the", "integer", "value", "is", "shorted", "than", "the", "specified", "length", "the", "number", "will", "be", "padded...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/power_model/src/main/com/thesett/aima/attribute/time/ByteBufferUtils.java#L52-L97
test
This method writes a padded int32 value into the buffer.
Of course, here is the Java code you requested: ```java public static ByteBuffer putPaddedInt32AsString(ByteBuffer buffer, int value, int length) { // Ensure there is sufficient space in the buffer to hold the result. int charsRequired = BitHackUtils.getCharacterCountInt32(value); length = ...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java
BaseComplexNDArray.addi
@Override public IComplexNDArray addi(INDArray other, INDArray result) { IComplexNDArray cOther = (IComplexNDArray) other; IComplexNDArray cResult = (IComplexNDArray) result; if (cOther.isScalar()) { return cResult.addi(cOther.getComplex(0), result); } if (isScal...
java
@Override public IComplexNDArray addi(INDArray other, INDArray result) { IComplexNDArray cOther = (IComplexNDArray) other; IComplexNDArray cResult = (IComplexNDArray) result; if (cOther.isScalar()) { return cResult.addi(cOther.getComplex(0), result); } if (isScal...
[ "@", "Override", "public", "IComplexNDArray", "addi", "(", "INDArray", "other", ",", "INDArray", "result", ")", "{", "IComplexNDArray", "cOther", "=", "(", "IComplexNDArray", ")", "other", ";", "IComplexNDArray", "cResult", "=", "(", "IComplexNDArray", ")", "res...
in place addition of two matrices @param other the second ndarray to add @param result the result ndarray @return the result of the addition
[ "in", "place", "addition", "of", "two", "matrices" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java#L2764-L2793
test
Add i method for the CIS
Of course, here is the Java code you requested: ```java @Override public IComplexNDArray addi(INDArray other, INDArray result) { IComplexNDArray cOther = (IComplexNDArray) other; IComplexNDArray cResult = (IComplexNDArray) result; if (cOther.isScalar()) { return cResult.addi(cO...
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/BasicComponentCreateService.java
BasicComponentCreateService.getValue
public synchronized Component getValue() throws IllegalStateException, IllegalArgumentException { Component component = this.component; if (component == null) { throw EeLogger.ROOT_LOGGER.serviceNotStarted(); } return component; }
java
public synchronized Component getValue() throws IllegalStateException, IllegalArgumentException { Component component = this.component; if (component == null) { throw EeLogger.ROOT_LOGGER.serviceNotStarted(); } return component; }
[ "public", "synchronized", "Component", "getValue", "(", ")", "throws", "IllegalStateException", ",", "IllegalArgumentException", "{", "Component", "component", "=", "this", ".", "component", ";", "if", "(", "component", "==", "null", ")", "{", "throw", "EeLogger",...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/BasicComponentCreateService.java#L108-L114
test
Gets the value of the CRA.
Of course, here is the Java code you requested: ```java public synchronized Component getValue() throws IllegalStateException, IllegalArgumentException { Component component = this.component; if (component == null) { throw EeLogger.ROOT_LOGGER.serviceNotStarted(); } return c...
oblac/jodd
jodd-decora/src/main/java/jodd/decora/parser/DecoraParser.java
DecoraParser.writeRegion
protected void writeRegion(final Writer out, final char[] pageContent, final DecoraTag decoraTag, final DecoraTag[] decoraTags) throws IOException { int regionStart = decoraTag.getRegionStart(); int regionLen = decoraTag.getRegionLength(); int regionEnd = regionStart + regionLen; for (DecoraTag innerDecoraTag ...
java
protected void writeRegion(final Writer out, final char[] pageContent, final DecoraTag decoraTag, final DecoraTag[] decoraTags) throws IOException { int regionStart = decoraTag.getRegionStart(); int regionLen = decoraTag.getRegionLength(); int regionEnd = regionStart + regionLen; for (DecoraTag innerDecoraTag ...
[ "protected", "void", "writeRegion", "(", "final", "Writer", "out", ",", "final", "char", "[", "]", "pageContent", ",", "final", "DecoraTag", "decoraTag", ",", "final", "DecoraTag", "[", "]", "decoraTags", ")", "throws", "IOException", "{", "int", "regionStart"...
Writes region to output, but extracts all inner regions.
[ "Writes", "region", "to", "output", "but", "extracts", "all", "inner", "regions", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-decora/src/main/java/jodd/decora/parser/DecoraParser.java#L110-L134
test
Writes the region of the content of the DecoraTag.
Of course, here is the Java code you requested: ```java protected void writeRegion(final Writer out, final char[] pageContent, final DecoraTag decoraTag, final DecoraTag[] decoraTags) throws IOException { int regionStart = decoraTag.getRegionStart(); int regionLen = decoraTag.getRegionLength(); int regionEnd = r...
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/matrix/SquareMatrix.java
SquareMatrix._set
private void _set (final Matrix m) { this.m_nRows = this.m_nCols = Math.min (m.m_nRows, m.m_nCols); this.m_aValues = m.m_aValues; }
java
private void _set (final Matrix m) { this.m_nRows = this.m_nCols = Math.min (m.m_nRows, m.m_nCols); this.m_aValues = m.m_aValues; }
[ "private", "void", "_set", "(", "final", "Matrix", "m", ")", "{", "this", ".", "m_nRows", "=", "this", ".", "m_nCols", "=", "Math", ".", "min", "(", "m", ".", "m_nRows", ",", "m", ".", "m_nCols", ")", ";", "this", ".", "m_aValues", "=", "m", ".",...
Set this square matrix from another matrix. Note that this matrix will reference the values of the argument matrix. If the values are not square, only the upper left square is used. @param m the 2-d array of values
[ "Set", "this", "square", "matrix", "from", "another", "matrix", ".", "Note", "that", "this", "matrix", "will", "reference", "the", "values", "of", "the", "argument", "matrix", ".", "If", "the", "values", "are", "not", "square", "only", "the", "upper", "lef...
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/matrix/SquareMatrix.java#L73-L77
test
Sets the values of this matrix to the given matrix.
Of course, here is the Java code you requested: ```java private void _set (final Matrix m) { this.m_nRows = this.m_nCols = Math.min (m.m_nRows, m.m_nCols); this.m_aValues = m.m_aValues; } ``` Hope this helps!
spring-projects/spring-session
spring-session-core/src/main/java/org/springframework/session/web/http/DefaultCookieSerializer.java
DefaultCookieSerializer.base64Decode
private String base64Decode(String base64Value) { try { byte[] decodedCookieBytes = Base64.getDecoder().decode(base64Value); return new String(decodedCookieBytes); } catch (Exception ex) { logger.debug("Unable to Base64 decode value: " + base64Value); return null; } }
java
private String base64Decode(String base64Value) { try { byte[] decodedCookieBytes = Base64.getDecoder().decode(base64Value); return new String(decodedCookieBytes); } catch (Exception ex) { logger.debug("Unable to Base64 decode value: " + base64Value); return null; } }
[ "private", "String", "base64Decode", "(", "String", "base64Value", ")", "{", "try", "{", "byte", "[", "]", "decodedCookieBytes", "=", "Base64", ".", "getDecoder", "(", ")", ".", "decode", "(", "base64Value", ")", ";", "return", "new", "String", "(", "decod...
Decode the value using Base64. @param base64Value the Base64 String to decode @return the Base64 decoded value @since 1.2.2
[ "Decode", "the", "value", "using", "Base64", "." ]
397d4e5ca11954072187ac701ab0379505029f7d
https://github.com/spring-projects/spring-session/blob/397d4e5ca11954072187ac701ab0379505029f7d/spring-session-core/src/main/java/org/springframework/session/web/http/DefaultCookieSerializer.java#L173-L182
test
Decode the base64 value.
Of course, here is the Java code you requested: ```java private String base64Decode(String base64Value) { try { byte[] decodedCookieBytes = Base64.getDecoder().decode(base64Value); return new String(decodedCookieBytes); } catch (Exception ex) { logger.debug("Unable to Base64 decode value: " + base64Valu...
oblac/jodd
jodd-proxetta/src/main/java/jodd/pathref/Pathref.java
Pathref.createProxyObject
protected C createProxyObject(Class<C> target) { target = ProxettaUtil.resolveTargetClass(target); Class proxyClass = cache.get(target); if (proxyClass == null) { proxyClass = proxetta.defineProxy(target); cache.put(target, proxyClass); } C proxy; try { proxy = (C) ClassUtil.newInstance(proxyC...
java
protected C createProxyObject(Class<C> target) { target = ProxettaUtil.resolveTargetClass(target); Class proxyClass = cache.get(target); if (proxyClass == null) { proxyClass = proxetta.defineProxy(target); cache.put(target, proxyClass); } C proxy; try { proxy = (C) ClassUtil.newInstance(proxyC...
[ "protected", "C", "createProxyObject", "(", "Class", "<", "C", ">", "target", ")", "{", "target", "=", "ProxettaUtil", ".", "resolveTargetClass", "(", "target", ")", ";", "Class", "proxyClass", "=", "cache", ".", "get", "(", "target", ")", ";", "if", "("...
Creates proxy object.
[ "Creates", "proxy", "object", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/pathref/Pathref.java#L82-L102
test
Creates a proxy object for the specified target class.
Of course, here is the Java code you requested: ```java protected C createProxyObject(Class<C> target) { target = ProxettaUtil.resolveTargetClass(target); Class proxyClass = cache.get(target); if (proxyClass == null) { proxyClass = proxetta.defineProxy(target); cache.put(target, proxyClass); } C pr...
abmargb/jamppa
src/main/java/org/jivesoftware/smack/XMPPConnection.java
XMPPConnection.useCompression
private boolean useCompression() { // If stream compression was offered by the server and we want to use // compression then send compression request to the server if (authenticated) { throw new IllegalStateException( "Compression should be negotiated before authe...
java
private boolean useCompression() { // If stream compression was offered by the server and we want to use // compression then send compression request to the server if (authenticated) { throw new IllegalStateException( "Compression should be negotiated before authe...
[ "private", "boolean", "useCompression", "(", ")", "{", "// If stream compression was offered by the server and we want to use", "// compression then send compression request to the server", "if", "(", "authenticated", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Compr...
Starts using stream compression that will compress network traffic. Traffic can be reduced up to 90%. Therefore, stream compression is ideal when using a slow speed network connection. However, the server and the client will need to use more CPU time in order to un/compress network data so under high load the server pe...
[ "Starts", "using", "stream", "compression", "that", "will", "compress", "network", "traffic", ".", "Traffic", "can", "be", "reduced", "up", "to", "90%", ".", "Therefore", "stream", "compression", "is", "ideal", "when", "using", "a", "slow", "speed", "network",...
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/XMPPConnection.java#L1008-L1029
test
Check if compression is being used.
Of course, here is the Java code you requested: ```java private boolean useCompression() { // If stream compression was offered by the server and we want to use // compression then send compression request to the server if (authenticated) { throw new IllegalStateException( ...
spring-projects/spring-security
openid/src/main/java/org/springframework/security/openid/OpenIDAuthenticationFilter.java
OpenIDAuthenticationFilter.afterPropertiesSet
@Override public void afterPropertiesSet() { super.afterPropertiesSet(); if (consumer == null) { try { consumer = new OpenID4JavaConsumer(); } catch (ConsumerException e) { throw new IllegalArgumentException("Failed to initialize OpenID", e); } } if (returnToUrlParameters.isEmpty() &&...
java
@Override public void afterPropertiesSet() { super.afterPropertiesSet(); if (consumer == null) { try { consumer = new OpenID4JavaConsumer(); } catch (ConsumerException e) { throw new IllegalArgumentException("Failed to initialize OpenID", e); } } if (returnToUrlParameters.isEmpty() &&...
[ "@", "Override", "public", "void", "afterPropertiesSet", "(", ")", "{", "super", ".", "afterPropertiesSet", "(", ")", ";", "if", "(", "consumer", "==", "null", ")", "{", "try", "{", "consumer", "=", "new", "OpenID4JavaConsumer", "(", ")", ";", "}", "catc...
========================================================================================================
[ "========================================================================================================" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/openid/src/main/java/org/springframework/security/openid/OpenIDAuthenticationFilter.java#L92-L112
test
Override afterPropertiesSet to initialize the OpenID consumer.
Of course, here is the Java code you requested: ```java @Override public void afterPropertiesSet() { super.afterPropertiesSet(); if (consumer == null) { try { consumer = new OpenID4JavaConsumer(); } catch (ConsumerException e) { throw new IllegalArgumentException("Failed to initialize OpenID", e...
Unidata/thredds
tds/src/main/java/thredds/server/wfs/WFSExceptionWriter.java
WFSExceptionWriter.write
public void write(HttpServletResponse hsr) throws IOException{ PrintWriter xmlResponse = hsr.getWriter(); xmlResponse.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); xmlResponse.append("<ows:ExceptionReport xml:lang=\"en-US\" xsi:schemaLocation=\"http://www.opengis.net/ows/1.1" + " http://schema...
java
public void write(HttpServletResponse hsr) throws IOException{ PrintWriter xmlResponse = hsr.getWriter(); xmlResponse.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); xmlResponse.append("<ows:ExceptionReport xml:lang=\"en-US\" xsi:schemaLocation=\"http://www.opengis.net/ows/1.1" + " http://schema...
[ "public", "void", "write", "(", "HttpServletResponse", "hsr", ")", "throws", "IOException", "{", "PrintWriter", "xmlResponse", "=", "hsr", ".", "getWriter", "(", ")", ";", "xmlResponse", ".", "append", "(", "\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\"", ")"...
Given the information on construction, writes the necessary exception information. @param hsr the Servlet Response to write to @throws IOException
[ "Given", "the", "information", "on", "construction", "writes", "the", "necessary", "exception", "information", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/wfs/WFSExceptionWriter.java#L25-L38
test
Write the exception information to the HttpServletResponse.
Of course, here is the Java code you requested: ```java public void write(HttpServletResponse hsr) throws IOException{ PrintWriter xmlResponse = hsr.getWriter(); xmlResponse.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); xmlResponse.append("<ows:ExceptionReport xml:lang=\"en-US\" xsi:schemaLocation...
oblac/jodd
jodd-core/src/main/java/jodd/system/HostInfo.java
HostInfo.nosep
protected String nosep(final String in) { if (in.endsWith(File.separator)) { return in.substring(0, in.length() - 1); } return in; }
java
protected String nosep(final String in) { if (in.endsWith(File.separator)) { return in.substring(0, in.length() - 1); } return in; }
[ "protected", "String", "nosep", "(", "final", "String", "in", ")", "{", "if", "(", "in", ".", "endsWith", "(", "File", ".", "separator", ")", ")", "{", "return", "in", ".", "substring", "(", "0", ",", "in", ".", "length", "(", ")", "-", "1", ")",...
---------------------------------------------------------------- util
[ "----------------------------------------------------------------", "util" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/system/HostInfo.java#L75-L80
test
Remove file separator from input string.
Of course, here is the Java code you requested: ```java protected String nosep(final String in) { if (in.endsWith(File.separator)) { return in.substring(0, in.length() - 1); } return in; } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/internal/http/AuthConfig.java
AuthConfig.certificate
public void certificate(Object keyStorePath, String keyStorePassword, String keyStoreType, KeyStore keyStore, Object trustStorePath, String trustStorePassword, String trustStoreType, KeyStore trustStore, int port, X509HostnameVerifier hostnameVerifier, SSLSocketFa...
java
public void certificate(Object keyStorePath, String keyStorePassword, String keyStoreType, KeyStore keyStore, Object trustStorePath, String trustStorePassword, String trustStoreType, KeyStore trustStore, int port, X509HostnameVerifier hostnameVerifier, SSLSocketFa...
[ "public", "void", "certificate", "(", "Object", "keyStorePath", ",", "String", "keyStorePassword", ",", "String", "keyStoreType", ",", "KeyStore", "keyStore", ",", "Object", "trustStorePath", ",", "String", "trustStorePassword", ",", "String", "trustStoreType", ",", ...
Sets a certificate to be used for SSL authentication. See {@link Class#getResource(String)} for how to get a URL from a resource on the classpath. @param keyStorePath URL to a JKS keystore where the certificate is stored. @param keyStorePassword password to decrypt the keystore @param keyStoreT...
[ "Sets", "a", "certificate", "to", "be", "used", "for", "SSL", "authentication", ".", "See", "{", "@link", "Class#getResource", "(", "String", ")", "}", "for", "how", "to", "get", "a", "URL", "from", "a", "resource", "on", "the", "classpath", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/internal/http/AuthConfig.java#L138-L158
test
Certificate method.
Of course, here is the Java code you requested: ```java public void certificate(Object keyStorePath, String keyStorePassword, String keyStoreType, KeyStore keyStore, Object trustStorePath, String trustStorePassword, String trustStoreType, KeyStore trustStore, int...
playframework/playframework
core/play/src/main/java/play/mvc/Results.java
Results.badRequest
public static Result badRequest(Path content, boolean inline) { return badRequest(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
java
public static Result badRequest(Path content, boolean inline) { return badRequest(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
[ "public", "static", "Result", "badRequest", "(", "Path", "content", ",", "boolean", "inline", ")", "{", "return", "badRequest", "(", "content", ",", "inline", ",", "StaticFileMimeTypes", ".", "fileMimeTypes", "(", ")", ")", ";", "}" ]
Generates a 400 Bad Request result. @param content The path to send. @param inline Whether the file should be sent inline, or as an attachment. @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#L1195-L1197
test
Returns a Result indicating that the content is not a valid file.
Of course, here is the Java code you requested: ```java public static Result badRequest(Path content, boolean inline) { return badRequest(content, inline, StaticFileMimeTypes.fileMimeTypes()); } ``` Hope this helps!
RestComm/jain-slee
container/profiles/src/main/java/org/mobicents/slee/container/deployment/profile/ClassGeneratorUtils.java
ClassGeneratorUtils.createInterfaceLinks
public static void createInterfaceLinks(CtClass concreteClass, String[] interfaceNames) { if(interfaceNames != null && interfaceNames.length > 0) { try { for(String interfaceName : interfaceNames) { boolean found = false; for(CtClass existingInterfaces : concret...
java
public static void createInterfaceLinks(CtClass concreteClass, String[] interfaceNames) { if(interfaceNames != null && interfaceNames.length > 0) { try { for(String interfaceName : interfaceNames) { boolean found = false; for(CtClass existingInterfaces : concret...
[ "public", "static", "void", "createInterfaceLinks", "(", "CtClass", "concreteClass", ",", "String", "[", "]", "interfaceNames", ")", "{", "if", "(", "interfaceNames", "!=", "null", "&&", "interfaceNames", ".", "length", ">", "0", ")", "{", "try", "{", "for",...
Create the links with possible interfaces @param concreteClass @param interfaces
[ "Create", "the", "links", "with", "possible", "interfaces" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/deployment/profile/ClassGeneratorUtils.java#L133-L156
test
Create the interface links for the given concrete class.
Of course, here is the Java code you requested: ```java public static void createInterfaceLinks(CtClass concreteClass, String[] interfaceNames) { if(interfaceNames != null && interfaceNames.length > 0) { try { for(String interfaceName : interfaceNames) { boolean found = ...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.post
public static Response post(String path, Map<String, ?> pathParams) { return given().post(path, pathParams); }
java
public static Response post(String path, Map<String, ?> pathParams) { return given().post(path, pathParams); }
[ "public", "static", "Response", "post", "(", "String", "path", ",", "Map", "<", "String", ",", "?", ">", "pathParams", ")", "{", "return", "given", "(", ")", ".", "post", "(", "path", ",", "pathParams", ")", ";", "}" ]
Perform a POST request to a <code>path</code>. Normally the path doesn't have to be fully-qualified e.g. you don't need to specify the path as <tt>http://localhost:8080/path</tt>. In this case it's enough to use <tt>/path</tt>. @param path The path to send the request to. @param pathParams The path parameters. @...
[ "Perform", "a", "POST", "request", "to", "a", "<code", ">", "path<", "/", "code", ">", ".", "Normally", "the", "path", "doesn", "t", "have", "to", "be", "fully", "-", "qualified", "e", ".", "g", ".", "you", "don", "t", "need", "to", "specify", "the...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L765-L767
test
A POST request with path and path parameters.
Of course, here is the Java code you requested: ```java public static Response post(String path, Map<String, ?> pathParams) { return given().post(path, pathParams); } ``` Hope this helps!
rupertlssmith/lojix
base/common/src/main/com/thesett/common/reflect/DirectMemento.java
DirectMemento.put
public void put(Class cls, String attr, Object val) { /*log.fine("public void put(Class cls, String attr, Object val): called");*/ /*log.fine("class name is " + cls.getName());*/ /*log.fine("attribute is " + attr);*/ /*log.fine("value to set is " + val);*/ HashMap map; ...
java
public void put(Class cls, String attr, Object val) { /*log.fine("public void put(Class cls, String attr, Object val): called");*/ /*log.fine("class name is " + cls.getName());*/ /*log.fine("attribute is " + attr);*/ /*log.fine("value to set is " + val);*/ HashMap map; ...
[ "public", "void", "put", "(", "Class", "cls", ",", "String", "attr", ",", "Object", "val", ")", "{", "/*log.fine(\"public void put(Class cls, String attr, Object val): called\");*/", "/*log.fine(\"class name is \" + cls.getName());*/", "/*log.fine(\"attribute is \" + attr);*/", "/*...
Places the specified value into the memento based on the field's declaring class and name. @param cls The class in which the field is declared. @param attr The name of the attribute. @param val The value to store into this memento.
[ "Places", "the", "specified", "value", "into", "the", "memento", "based", "on", "the", "field", "s", "declaring", "class", "and", "name", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/reflect/DirectMemento.java#L270-L296
test
Put a value into the cache.
Of course, here is the Java code you requested: ```java public void put(Class cls, String attr, Object val) { /*log.fine("public void put(Class cls, String attr, Object val): called");*/ /*log.fine("class name is " + cls.getName());*/ /*log.fine("attribute is " + attr);*/ /*log.fine...
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/drafts/Draft_6455.java
Draft_6455.getPayloadFromByteBufferList
private ByteBuffer getPayloadFromByteBufferList() throws LimitExceededException { long totalSize = 0; ByteBuffer resultingByteBuffer; synchronized (byteBufferList) { for (ByteBuffer buffer : byteBufferList) { totalSize += buffer.limit(); } checkBufferLimit(); resultingByteBuffer = ByteBuffer.alloc...
java
private ByteBuffer getPayloadFromByteBufferList() throws LimitExceededException { long totalSize = 0; ByteBuffer resultingByteBuffer; synchronized (byteBufferList) { for (ByteBuffer buffer : byteBufferList) { totalSize += buffer.limit(); } checkBufferLimit(); resultingByteBuffer = ByteBuffer.alloc...
[ "private", "ByteBuffer", "getPayloadFromByteBufferList", "(", ")", "throws", "LimitExceededException", "{", "long", "totalSize", "=", "0", ";", "ByteBuffer", "resultingByteBuffer", ";", "synchronized", "(", "byteBufferList", ")", "{", "for", "(", "ByteBuffer", "buffer...
Method to generate a full bytebuffer out of all the fragmented frame payload @return a bytebuffer containing all the data @throws LimitExceededException will be thrown when the totalSize is bigger then Integer.MAX_VALUE due to not being able to allocate more
[ "Method", "to", "generate", "a", "full", "bytebuffer", "out", "of", "all", "the", "fragmented", "frame", "payload" ]
73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9
https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/drafts/Draft_6455.java#L1011-L1026
test
Get the payload from the byte buffer list.
Of course, here is the Java code you requested: ```java private ByteBuffer getPayloadFromByteBufferList() throws LimitExceededException { long totalSize = 0; ByteBuffer resultingByteBuffer; synchronized (byteBufferList) { for (ByteBuffer buffer : byteBufferList) { totalSize += buffer.limit(); } chec...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/addon/AddOn.java
AddOn.initAddOn
@Override public void initAddOn(org.intellimate.izou.system.Context context) { this.context = new Context(context); }
java
@Override public void initAddOn(org.intellimate.izou.system.Context context) { this.context = new Context(context); }
[ "@", "Override", "public", "void", "initAddOn", "(", "org", ".", "intellimate", ".", "izou", ".", "system", ".", "Context", "context", ")", "{", "this", ".", "context", "=", "new", "Context", "(", "context", ")", ";", "}" ]
Internal initiation of addOn - fake constructor, comes before prepare @param context the context to initialize with
[ "Internal", "initiation", "of", "addOn", "-", "fake", "constructor", "comes", "before", "prepare" ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/addon/AddOn.java#L166-L169
test
Initialize the context.
Of course, here is the Java code you requested: ```java @Override public void initAddOn(org.intellimate.izou.system.Context context) { this.context = new Context(context); } ``` Hope this helps!
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java
src/main/java/org/teachingkidsprogramming/recipes/completed/section05recursion/RecursiveSquare.java
RecursiveSquare.makeASquare
private static void makeASquare(double length) { // If the current length is greater than 10 --#10.2 if (length > 10) { // Run the recipe moveToTheSquareStart with the current length --#4.3 moveToTheSquareStart(length); // // Do the following 4 times --#7.1 for (int ...
java
private static void makeASquare(double length) { // If the current length is greater than 10 --#10.2 if (length > 10) { // Run the recipe moveToTheSquareStart with the current length --#4.3 moveToTheSquareStart(length); // // Do the following 4 times --#7.1 for (int ...
[ "private", "static", "void", "makeASquare", "(", "double", "length", ")", "{", "// If the current length is greater than 10 --#10.2", "if", "(", "length", ">", "10", ")", "{", "// Run the recipe moveToTheSquareStart with the current length --#4.3", "moveToTheSquareStart", ...
Create the makeASquare recipe --#11.1
[ "Create", "the", "makeASquare", "recipe", "--", "#11", ".", "1" ]
516fee15e537ecdb3f4dcbe3695c5cfde7e930da
https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingkidsprogramming/recipes/completed/section05recursion/RecursiveSquare.java#L22-L52
test
Make the ASquare sequence of the current length.
Of course, here is the Java code you requested: ```java private static void makeASquare(double length) { // If the current length is greater than 10 --#10.2 if (length > 10) { // Run the recipe moveToTheSquareStart with the current length --#4.3 moveToTheSquareStart(length); // ...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/FlowStepRuleClient.java
FlowStepRuleClient.moveFlowStepEntryRuleUp
public FlowStepRule moveFlowStepEntryRuleUp(FlowStepRule flowStepRuleParam) { if(flowStepRuleParam != null && this.serviceTicket != null) { flowStepRuleParam.setServiceTicket(this.serviceTicket); } return new FlowStepRule(this.postJson( flowStepRuleParam,...
java
public FlowStepRule moveFlowStepEntryRuleUp(FlowStepRule flowStepRuleParam) { if(flowStepRuleParam != null && this.serviceTicket != null) { flowStepRuleParam.setServiceTicket(this.serviceTicket); } return new FlowStepRule(this.postJson( flowStepRuleParam,...
[ "public", "FlowStepRule", "moveFlowStepEntryRuleUp", "(", "FlowStepRule", "flowStepRuleParam", ")", "{", "if", "(", "flowStepRuleParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", "null", ")", "{", "flowStepRuleParam", ".", "setServiceTicket", "(", "thi...
Moves an entry rule order one up from the current location. @param flowStepRuleParam The Rule to move up. @return The result after the move.
[ "Moves", "an", "entry", "rule", "order", "one", "up", "from", "the", "current", "location", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/FlowStepRuleClient.java#L312-L321
test
Move a FlowStepRule up.
Of course, here is the Java code you requested: ```java public FlowStepRule moveFlowStepEntryRuleUp(FlowStepRule flowStepRuleParam) { if(flowStepRuleParam != null && this.serviceTicket != null) { flowStepRuleParam.setServiceTicket(this.serviceTicket); } return new FlowS...
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/util/cache/CacheUtil.java
CacheUtil.initXMemcachedClient
private MemcachedClient initXMemcachedClient() { if(this.memcachedClient != null && !this.memcachedClient.isShutdown()) { return this.memcachedClient; } try{ this.memcachedClient = new XMemcachedClient( this.cacheHost,this.cachePort); return this.memcachedClient; } //Unable to create client...
java
private MemcachedClient initXMemcachedClient() { if(this.memcachedClient != null && !this.memcachedClient.isShutdown()) { return this.memcachedClient; } try{ this.memcachedClient = new XMemcachedClient( this.cacheHost,this.cachePort); return this.memcachedClient; } //Unable to create client...
[ "private", "MemcachedClient", "initXMemcachedClient", "(", ")", "{", "if", "(", "this", ".", "memcachedClient", "!=", "null", "&&", "!", "this", ".", "memcachedClient", ".", "isShutdown", "(", ")", ")", "{", "return", "this", ".", "memcachedClient", ";", "}"...
Creates an instance of MemcachedClient. @return MemcachedClient
[ "Creates", "an", "instance", "of", "MemcachedClient", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/cache/CacheUtil.java#L499-L518
test
Initializes the memcached client.
Of course, here is the Java code you requested: ```java private MemcachedClient initXMemcachedClient() { if(this.memcachedClient != null && !this.memcachedClient.isShutdown()) { return this.memcachedClient; } try{ this.memcachedClient = new XMemcachedClient( this.cacheHost,this.cachePort); ret...
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/nlp/Token.java
Token.getIsVariable
public boolean getIsVariable() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_isVariable == null) jcasType.jcas.throwFeatMissing("isVariable", "edu.cmu.lti.oaqa.type.nlp.Token"); return jcasType.ll_cas.ll_getBooleanValue(addr, ((Token_Type)jcasType).casFeatCode_isVariable);}
java
public boolean getIsVariable() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_isVariable == null) jcasType.jcas.throwFeatMissing("isVariable", "edu.cmu.lti.oaqa.type.nlp.Token"); return jcasType.ll_cas.ll_getBooleanValue(addr, ((Token_Type)jcasType).casFeatCode_isVariable);}
[ "public", "boolean", "getIsVariable", "(", ")", "{", "if", "(", "Token_Type", ".", "featOkTst", "&&", "(", "(", "Token_Type", ")", "jcasType", ")", ".", "casFeat_isVariable", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"isVari...
getter for isVariable - gets True iff the token expresses some unknown entity, typically the focus of a question: --- Example: "[Who] shot JR?", "What [city] was JR born in?" @generated @return value of the feature
[ "getter", "for", "isVariable", "-", "gets", "True", "iff", "the", "token", "expresses", "some", "unknown", "entity", "typically", "the", "focus", "of", "a", "question", ":", "---", "Example", ":", "[", "Who", "]", "shot", "JR?", "What", "[", "city", "]",...
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/nlp/Token.java#L218-L221
test
getter for isVariable - gets see MeL
Of course, here is the Java code you requested: ```java public boolean getIsVariable() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_isVariable == null) jcasType.jcas.throwFeatMissing("isVariable", "edu.cmu.lti.oaqa.type.nlp.Token"); return jcasType.ll_cas.ll_getBooleanValue(addr, ((Token_...
rest-assured/rest-assured
xml-path/src/main/java/io/restassured/path/xml/XmlPath.java
XmlPath.getUUID
public UUID getUUID(String path) { Object object = get(path); return convertObjectTo(object, UUID.class); }
java
public UUID getUUID(String path) { Object object = get(path); return convertObjectTo(object, UUID.class); }
[ "public", "UUID", "getUUID", "(", "String", "path", ")", "{", "Object", "object", "=", "get", "(", "path", ")", ";", "return", "convertObjectTo", "(", "object", ",", "UUID", ".", "class", ")", ";", "}" ]
Get the result of an XML path expression as a UUID. For syntax details please refer to <a href="http://www.groovy-lang.org/processing-xml.html#_manipulating_xml">this</a> url. @param path The XML path. @return The object matching the XML path. A {@link java.lang.ClassCastException} will be thrown if the object cannot ...
[ "Get", "the", "result", "of", "an", "XML", "path", "expression", "as", "a", "UUID", ".", "For", "syntax", "details", "please", "refer", "to", "<a", "href", "=", "http", ":", "//", "www", ".", "groovy", "-", "lang", ".", "org", "/", "processing", "-",...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/xml-path/src/main/java/io/restassured/path/xml/XmlPath.java#L583-L586
test
Gets the UUID from the resource.
Of course, here is the Java code you requested: ```java public UUID getUUID(String path) { Object object = get(path); return convertObjectTo(object, UUID.class); } ``` Hope this helps!
Unidata/thredds
dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventHandler.java
SaxEventHandler.fatalError
@Override public void fatalError(SAXParseException e) throws SAXException { throw new SAXParseException( String.format("Sax fatal error: %s; %s%n", e, report(this.locator)), this.locator); }
java
@Override public void fatalError(SAXParseException e) throws SAXException { throw new SAXParseException( String.format("Sax fatal error: %s; %s%n", e, report(this.locator)), this.locator); }
[ "@", "Override", "public", "void", "fatalError", "(", "SAXParseException", "e", ")", "throws", "SAXException", "{", "throw", "new", "SAXParseException", "(", "String", ".", "format", "(", "\"Sax fatal error: %s; %s%n\"", ",", "e", ",", "report", "(", "this", "."...
Error handling Events
[ "Error", "handling", "Events" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventHandler.java#L236-L243
test
Called by SAXParser when a fatal error occurs.
Of course, here is the Java code you requested: ```java @Override public void fatalError(SAXParseException e) throws SAXException { throw new SAXParseException( String.format("Sax fatal error: %s; %s%n", e, report(this.locator)), this.locator); } ``` Hop...
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/cfg/Configuration.java
Configuration.buildSnakerEngine
public SnakerEngine buildSnakerEngine() throws SnakerException { if(log.isInfoEnabled()) { log.info("SnakerEngine start......"); } parser(); /** * 由服务上下文返回流程引擎 */ SnakerEngine configEngine = ServiceContext.getEngine(); if(configEngine == null) { throw new SnakerException("配置无法发现SnakerEngine的实现类"...
java
public SnakerEngine buildSnakerEngine() throws SnakerException { if(log.isInfoEnabled()) { log.info("SnakerEngine start......"); } parser(); /** * 由服务上下文返回流程引擎 */ SnakerEngine configEngine = ServiceContext.getEngine(); if(configEngine == null) { throw new SnakerException("配置无法发现SnakerEngine的实现类"...
[ "public", "SnakerEngine", "buildSnakerEngine", "(", ")", "throws", "SnakerException", "{", "if", "(", "log", ".", "isInfoEnabled", "(", ")", ")", "{", "log", ".", "info", "(", "\"SnakerEngine start......\"", ")", ";", "}", "parser", "(", ")", ";", "/**\n\t\t...
构造SnakerEngine对象,用于api集成 通过SpringHelper调用 @return SnakerEngine @throws SnakerException
[ "构造SnakerEngine对象,用于api集成", "通过SpringHelper调用" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/cfg/Configuration.java#L94-L110
test
Build the SnakerEngine
Of course, here is the Java code you requested: ```java public SnakerEngine buildSnakerEngine() throws SnakerException { if(log.isInfoEnabled()) { log.info("SnakerEngine start......"); } parser(); /** * 由服务上下文返回流程引擎 */ SnakerEngine configEngine = ServiceContext.getEngine(); if(configEngine == null...
kiegroup/droolsjbpm-tools
drools-eclipse/org.kie.eclipse.navigator/src/main/java/org/kie/eclipse/navigator/view/KieNavigatorView.java
KieNavigatorView.toggleDefaultPage
void toggleDefaultPage() { if (treeViewer.getTree().getItemCount() < 1) { book.showPage(noServersPage); } else { book.showPage(mainPage); } }
java
void toggleDefaultPage() { if (treeViewer.getTree().getItemCount() < 1) { book.showPage(noServersPage); } else { book.showPage(mainPage); } }
[ "void", "toggleDefaultPage", "(", ")", "{", "if", "(", "treeViewer", ".", "getTree", "(", ")", ".", "getItemCount", "(", ")", "<", "1", ")", "{", "book", ".", "showPage", "(", "noServersPage", ")", ";", "}", "else", "{", "book", ".", "showPage", "(",...
Switch between the servers and default/empty page.
[ "Switch", "between", "the", "servers", "and", "default", "/", "empty", "page", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse.navigator/src/main/java/org/kie/eclipse/navigator/view/KieNavigatorView.java#L223-L229
test
Toggle the default page.
Of course, here is the Java code you requested: ```java void toggleDefaultPage() { if (treeViewer.getTree().getItemCount() < 1) { book.showPage(noServersPage); } else { book.showPage(mainPage); } } ``` Hope this helps!
rackerlabs/blueflood
blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DPreaggregatedMetricsRW.java
DPreaggregatedMetricsRW.insertMetrics
@VisibleForTesting @Override public void insertMetrics(Collection<IMetric> metrics, Granularity granularity) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext( CassandraModel.getPreaggregatedColumnFamilyName(granularity)); ...
java
@VisibleForTesting @Override public void insertMetrics(Collection<IMetric> metrics, Granularity granularity) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext( CassandraModel.getPreaggregatedColumnFamilyName(granularity)); ...
[ "@", "VisibleForTesting", "@", "Override", "public", "void", "insertMetrics", "(", "Collection", "<", "IMetric", ">", "metrics", ",", "Granularity", "granularity", ")", "throws", "IOException", "{", "Timer", ".", "Context", "ctx", "=", "Instrumentation", ".", "g...
Inserts a collection of rolled up metrics to the metrics_preaggregated_{granularity} column family. Only our tests should call this method. Services should call either insertMetrics(Collection metrics) or insertRollups() @param metrics @throws IOException
[ "Inserts", "a", "collection", "of", "rolled", "up", "metrics", "to", "the", "metrics_preaggregated_", "{", "granularity", "}", "column", "family", ".", "Only", "our", "tests", "should", "call", "this", "method", ".", "Services", "should", "call", "either", "in...
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DPreaggregatedMetricsRW.java#L106-L124
test
Insert the given metrics into the database.
Of course, here is the Java code you requested: ```java @VisibleForTesting @Override public void insertMetrics(Collection<IMetric> metrics, Granularity granularity) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext( CassandraMod...
orientechnologies/orientdb
distributed-v2/src/main/java/com/orientechnologies/orient/distributed/impl/ODistributedStorage.java
ODistributedStorage.executeOnlyLocally
protected boolean executeOnlyLocally(final String localNodeName, final ODistributedConfiguration dbCfg, final OCommandExecutor exec, final Collection<String> involvedClusters, final Collection<String> nodes) { boolean executeLocally = false; if (exec.isIdempotent()) { final int availableNodes = node...
java
protected boolean executeOnlyLocally(final String localNodeName, final ODistributedConfiguration dbCfg, final OCommandExecutor exec, final Collection<String> involvedClusters, final Collection<String> nodes) { boolean executeLocally = false; if (exec.isIdempotent()) { final int availableNodes = node...
[ "protected", "boolean", "executeOnlyLocally", "(", "final", "String", "localNodeName", ",", "final", "ODistributedConfiguration", "dbCfg", ",", "final", "OCommandExecutor", "exec", ",", "final", "Collection", "<", "String", ">", "involvedClusters", ",", "final", "Coll...
Only idempotent commands that don't involve any other node can be executed locally.
[ "Only", "idempotent", "commands", "that", "don", "t", "involve", "any", "other", "node", "can", "be", "executed", "locally", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/distributed-v2/src/main/java/com/orientechnologies/orient/distributed/impl/ODistributedStorage.java#L473-L623
test
This method is called only by the local environment.
Of course, here is the Java code you requested: ```java protected boolean executeOnlyLocally(final String localNodeName, final ODistributedConfiguration dbCfg, final OCommandExecutor exec, final Collection<String> involvedClusters, final Collection<String> nodes) { boolean executeLocally = false; if (exe...
apache/parquet-mr
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
ParquetFileReader.readNextRowGroup
public PageReadStore readNextRowGroup() throws IOException { if (currentBlock == blocks.size()) { return null; } BlockMetaData block = blocks.get(currentBlock); if (block.getRowCount() == 0) { throw new RuntimeException("Illegal row group of 0 rows"); } this.currentRowGroup = new Col...
java
public PageReadStore readNextRowGroup() throws IOException { if (currentBlock == blocks.size()) { return null; } BlockMetaData block = blocks.get(currentBlock); if (block.getRowCount() == 0) { throw new RuntimeException("Illegal row group of 0 rows"); } this.currentRowGroup = new Col...
[ "public", "PageReadStore", "readNextRowGroup", "(", ")", "throws", "IOException", "{", "if", "(", "currentBlock", "==", "blocks", ".", "size", "(", ")", ")", "{", "return", "null", ";", "}", "BlockMetaData", "block", "=", "blocks", ".", "get", "(", "curren...
Reads all the columns requested from the row group at the current file position. @throws IOException if an error occurs while reading @return the PageReadStore which can provide PageReaders for each column.
[ "Reads", "all", "the", "columns", "requested", "from", "the", "row", "group", "at", "the", "current", "file", "position", "." ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java#L817-L860
test
Read the next row group.
Of course, here is the Java code you requested: ```java public PageReadStore readNextRowGroup() throws IOException { if (currentBlock == blocks.size()) { return null; } BlockMetaData block = blocks.get(currentBlock); if (block.getRowCount() == 0) { throw new RuntimeException("Illegal row gr...
oblac/jodd
jodd-core/src/main/java/jodd/io/NetUtil.java
NetUtil.downloadBytes
public static byte[] downloadBytes(final String url) throws IOException { try (InputStream inputStream = new URL(url).openStream()) { return StreamUtil.readBytes(inputStream); } }
java
public static byte[] downloadBytes(final String url) throws IOException { try (InputStream inputStream = new URL(url).openStream()) { return StreamUtil.readBytes(inputStream); } }
[ "public", "static", "byte", "[", "]", "downloadBytes", "(", "final", "String", "url", ")", "throws", "IOException", "{", "try", "(", "InputStream", "inputStream", "=", "new", "URL", "(", "url", ")", ".", "openStream", "(", ")", ")", "{", "return", "Strea...
Downloads resource as byte array.
[ "Downloads", "resource", "as", "byte", "array", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/NetUtil.java#L155-L159
test
Download bytes from URL.
Of course, here is the Java code you requested: ```java public static byte[] downloadBytes(final String url) throws IOException { try (InputStream inputStream = new URL(url).openStream()) { return StreamUtil.readBytes(inputStream); } } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/ErrorDispatcher.java
ErrorDispatcher.jspError
public void jspError(String errCode, String ... args) throws JasperException { dispatch(null, errCode, args, null); }
java
public void jspError(String errCode, String ... args) throws JasperException { dispatch(null, errCode, args, null); }
[ "public", "void", "jspError", "(", "String", "errCode", ",", "String", "...", "args", ")", "throws", "JasperException", "{", "dispatch", "(", "null", ",", "errCode", ",", "args", ",", "null", ")", ";", "}" ]
/* Dispatches the given JSP parse error to the configured error handler. The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message. @param errCode Error code @param args Arguments for parametric replacement
[ "/", "*", "Dispatches", "the", "given", "JSP", "parse", "error", "to", "the", "configured", "error", "handler", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/ErrorDispatcher.java#L170-L173
test
This method is called by the jspError method.
Of course, here is the Java code you requested: ```java public void jspError(String errCode, String ... args) throws JasperException { dispatch(null, errCode, args, null); } ``` Hope this helps!
wildfly/wildfly
undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentInfoService.java
UndertowDeploymentInfoService.handleJACCAuthorization
private void handleJACCAuthorization(final DeploymentInfo deploymentInfo) { // TODO make the authorization manager implementation configurable in Undertow or jboss-web.xml ApplicationPolicy applicationPolicy = SecurityConfiguration.getApplicationPolicy(this.securityDomain); if (applicationPolicy...
java
private void handleJACCAuthorization(final DeploymentInfo deploymentInfo) { // TODO make the authorization manager implementation configurable in Undertow or jboss-web.xml ApplicationPolicy applicationPolicy = SecurityConfiguration.getApplicationPolicy(this.securityDomain); if (applicationPolicy...
[ "private", "void", "handleJACCAuthorization", "(", "final", "DeploymentInfo", "deploymentInfo", ")", "{", "// TODO make the authorization manager implementation configurable in Undertow or jboss-web.xml", "ApplicationPolicy", "applicationPolicy", "=", "SecurityConfiguration", ".", "get...
<p> Sets the {@link JACCAuthorizationManager} in the specified {@link DeploymentInfo} if the webapp security domain has defined a JACC authorization module. </p> @param deploymentInfo the {@link DeploymentInfo} instance.
[ "<p", ">", "Sets", "the", "{", "@link", "JACCAuthorizationManager", "}", "in", "the", "specified", "{", "@link", "DeploymentInfo", "}", "if", "the", "webapp", "security", "domain", "has", "defined", "a", "JACC", "authorization", "module", ".", "<", "/", "p",...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentInfoService.java#L488-L502
test
Handle the JACC authorization.
Of course, here is the Java code you requested: ```java private void handleJACCAuthorization(final DeploymentInfo deploymentInfo) { // TODO make the authorization manager implementation configurable in Undertow or jboss-web.xml ApplicationPolicy applicationPolicy = SecurityConfiguration.getApplicationP...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/CellControlsUtility.java
CellControlsUtility.getObjectPropertyValue
public static String getObjectPropertyValue(final Object obj, final String propertyName, final boolean ignoreNonExisting) { try { Method method = obj.getClass() .getMethod("get" + Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1)); return (String) method.invo...
java
public static String getObjectPropertyValue(final Object obj, final String propertyName, final boolean ignoreNonExisting) { try { Method method = obj.getClass() .getMethod("get" + Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1)); return (String) method.invo...
[ "public", "static", "String", "getObjectPropertyValue", "(", "final", "Object", "obj", ",", "final", "String", "propertyName", ",", "final", "boolean", "ignoreNonExisting", ")", "{", "try", "{", "Method", "method", "=", "obj", ".", "getClass", "(", ")", ".", ...
get object property value. @param obj object. @param propertyName property name. @param ignoreNonExisting true ignore no existing. @return perperty value.
[ "get", "object", "property", "value", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/CellControlsUtility.java#L349-L368
test
Gets the value of the specified property from the specified object.
Of course, here is the Java code you requested: ```java public static String getObjectPropertyValue(final Object obj, final String propertyName, final boolean ignoreNonExisting) { try { Method method = obj.getClass() .getMethod("get" + Character.toUpperCase(propertyName.charAt(0)) + pr...
rest-assured/rest-assured
modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/internal/StandaloneMockMvcFactory.java
StandaloneMockMvcFactory.of
public static MockMvcFactory of(Object[] controllerOrMockMvcConfigurers) { List<Object> controllers = new ArrayList<Object>(); List<MockMvcConfigurer> configurers = new ArrayList<MockMvcConfigurer>(); for (Object object : controllerOrMockMvcConfigurers) { if (object instanceof MockMv...
java
public static MockMvcFactory of(Object[] controllerOrMockMvcConfigurers) { List<Object> controllers = new ArrayList<Object>(); List<MockMvcConfigurer> configurers = new ArrayList<MockMvcConfigurer>(); for (Object object : controllerOrMockMvcConfigurers) { if (object instanceof MockMv...
[ "public", "static", "MockMvcFactory", "of", "(", "Object", "[", "]", "controllerOrMockMvcConfigurers", ")", "{", "List", "<", "Object", ">", "controllers", "=", "new", "ArrayList", "<", "Object", ">", "(", ")", ";", "List", "<", "MockMvcConfigurer", ">", "co...
Create a new {@link MockMvcFactory} with the supplied controllers or mock mvc configureres @param controllerOrMockMvcConfigurers Array of controllers or configurerrs @return A new {@link MockMvcFactory}
[ "Create", "a", "new", "{", "@link", "MockMvcFactory", "}", "with", "the", "supplied", "controllers", "or", "mock", "mvc", "configureres" ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/internal/StandaloneMockMvcFactory.java#L34-L51
test
Create a new instance of the class based on the specified controllers and configurers.
Of course, here is the Java code you requested: ```java public static MockMvcFactory of(Object[] controllerOrMockMvcConfigurers) { List<Object> controllers = new ArrayList<Object>(); List<MockMvcConfigurer> configurers = new ArrayList<MockMvcConfigurer>(); for (Object object : controllerOrMockM...
lessthanoptimal/GeoRegression
main/src/georegression/metric/Intersection3D_I32.java
Intersection3D_I32.contained
public static boolean contained( Box3D_I32 box , Point3D_I32 point ) { return( box.p0.x <= point.x && point.x < box.p1.x && box.p0.y <= point.y && point.y < box.p1.y && box.p0.z <= point.z && point.z < box.p1.z ); }
java
public static boolean contained( Box3D_I32 box , Point3D_I32 point ) { return( box.p0.x <= point.x && point.x < box.p1.x && box.p0.y <= point.y && point.y < box.p1.y && box.p0.z <= point.z && point.z < box.p1.z ); }
[ "public", "static", "boolean", "contained", "(", "Box3D_I32", "box", ",", "Point3D_I32", "point", ")", "{", "return", "(", "box", ".", "p0", ".", "x", "<=", "point", ".", "x", "&&", "point", ".", "x", "<", "box", ".", "p1", ".", "x", "&&", "box", ...
Returns true if the point is contained inside the box. The point is considered to be inside the box if the following test passes for each dimension. box.p0.x &le; point.x {@code <} box.p1.x + box.lengthX @param box Box @param point Point which is tested to see if it is inside the box @return true for inside and false...
[ "Returns", "true", "if", "the", "point", "is", "contained", "inside", "the", "box", ".", "The", "point", "is", "considered", "to", "be", "inside", "the", "box", "if", "the", "following", "test", "passes", "for", "each", "dimension", ".", "box", ".", "p0"...
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/Intersection3D_I32.java#L36-L41
test
Returns true if the box is contained in the point.
Of course, here is the Java code you requested: ```java public static boolean contained( Box3D_I32 box , Point3D_I32 point ) { return( box.p0.x <= point.x && point.x < box.p1.x && box.p0.y <= point.y && point.y < box.p1.y && box.p0.z <= point.z && point.z < box.p1.z ); } ``` Hope this helps!
stanfy/enroscar
io/src/main/java/com/stanfy/enroscar/io/PoolableBufferedInputStream.java
PoolableBufferedInputStream.read
@Override public synchronized int read() throws IOException { // Use local refs since buf and in may be invalidated by an // unsynchronized close() byte[] localBuf = buf; final InputStream localIn = in; if (localBuf == null || localIn == null) { throw new IOException("Stream is closed"); } ...
java
@Override public synchronized int read() throws IOException { // Use local refs since buf and in may be invalidated by an // unsynchronized close() byte[] localBuf = buf; final InputStream localIn = in; if (localBuf == null || localIn == null) { throw new IOException("Stream is closed"); } ...
[ "@", "Override", "public", "synchronized", "int", "read", "(", ")", "throws", "IOException", "{", "// Use local refs since buf and in may be invalidated by an\r", "// unsynchronized close()\r", "byte", "[", "]", "localBuf", "=", "buf", ";", "final", "InputStream", "localI...
Reads a single byte from this stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of the source string has been reached. If the internal buffer does not contain any available bytes then it is filled from the source stream and the first byte is returned. @return the byte read or -1 if ...
[ "Reads", "a", "single", "byte", "from", "this", "stream", "and", "returns", "it", "as", "an", "integer", "in", "the", "range", "from", "0", "to", "255", ".", "Returns", "-", "1", "if", "the", "end", "of", "the", "source", "string", "has", "been", "re...
0e64f3c309d62e359b55ddcba10e3cc592f5e083
https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/io/src/main/java/com/stanfy/enroscar/io/PoolableBufferedInputStream.java#L175-L199
test
Reads a single octet from the stream.
Of course, here is the Java code you requested: ```java @Override public synchronized int read() throws IOException { // Use local refs since buf and in may be invalidated by an // unsynchronized close() byte[] localBuf = buf; final InputStream localIn = in; if (localBuf == null || localIn ...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/OutputStreamAppender.java
OutputStreamAppender.start
public void start() { int errors = 0; if (this.encoder == null) { addStatus(new ErrorStatus("No encoder set for the appender named \"" + name + "\".", this)); errors++; } if (this.outputStream == null) { addStatus(new ErrorStatus( "No output stream set for the appe...
java
public void start() { int errors = 0; if (this.encoder == null) { addStatus(new ErrorStatus("No encoder set for the appender named \"" + name + "\".", this)); errors++; } if (this.outputStream == null) { addStatus(new ErrorStatus( "No output stream set for the appe...
[ "public", "void", "start", "(", ")", "{", "int", "errors", "=", "0", ";", "if", "(", "this", ".", "encoder", "==", "null", ")", "{", "addStatus", "(", "new", "ErrorStatus", "(", "\"No encoder set for the appender named \\\"\"", "+", "name", "+", "\"\\\".\"",...
Checks that requires parameters are set and if everything is in order, activates this appender.
[ "Checks", "that", "requires", "parameters", "are", "set", "and", "if", "everything", "is", "in", "order", "activates", "this", "appender", "." ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/OutputStreamAppender.java#L72-L89
test
Start the appenders.
Of course, here is the Java code you requested: ```java public void start() { int errors = 0; if (this.encoder == null) { addStatus(new ErrorStatus("No encoder set for the appender named \"" + name + "\".", this)); errors++; } if (this.outputStream == null) { addStatus(new ...
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/FilemakerWritingExample.java
FilemakerWritingExample.createProduct
protected static ProductType createProduct() { ProductType product = FACTORY.createProductType(); product.setNAME("OpenEstate-IO"); product.setVERSION("1.4"); product.setBUILD("123"); return product; }
java
protected static ProductType createProduct() { ProductType product = FACTORY.createProductType(); product.setNAME("OpenEstate-IO"); product.setVERSION("1.4"); product.setBUILD("123"); return product; }
[ "protected", "static", "ProductType", "createProduct", "(", ")", "{", "ProductType", "product", "=", "FACTORY", ".", "createProductType", "(", ")", ";", "product", ".", "setNAME", "(", "\"OpenEstate-IO\"", ")", ";", "product", ".", "setVERSION", "(", "\"1.4\"", ...
Create a {@link ProductType} with some example data. @return created example object
[ "Create", "a", "{", "@link", "ProductType", "}", "with", "some", "example", "data", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/FilemakerWritingExample.java#L158-L164
test
Create a new product type.
Of course, here is the Java code you requested: ```java protected static ProductType createProduct() { ProductType product = FACTORY.createProductType(); product.setNAME("OpenEstate-IO"); product.setVERSION("1.4"); product.setBUILD("123"); return product; } ``` Hope this he...
real-logic/aeron
aeron-archive/src/main/java/io/aeron/archive/client/ArchiveProxy.java
ArchiveProxy.replay
public boolean replay( final long recordingId, final long position, final long length, final String replayChannel, final int replayStreamId, final long correlationId, final long controlSessionId) { replayRequestEncoder .wrapAndApplyHeader(b...
java
public boolean replay( final long recordingId, final long position, final long length, final String replayChannel, final int replayStreamId, final long correlationId, final long controlSessionId) { replayRequestEncoder .wrapAndApplyHeader(b...
[ "public", "boolean", "replay", "(", "final", "long", "recordingId", ",", "final", "long", "position", ",", "final", "long", "length", ",", "final", "String", "replayChannel", ",", "final", "int", "replayStreamId", ",", "final", "long", "correlationId", ",", "f...
Replay a recording from a given position. @param recordingId to be replayed. @param position from which the replay should be started. @param length of the stream to be replayed. Use {@link Long#MAX_VALUE} to follow a live stream. @param replayChannel to which the replay should be sent. @param...
[ "Replay", "a", "recording", "from", "a", "given", "position", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-archive/src/main/java/io/aeron/archive/client/ArchiveProxy.java#L290-L310
test
Replay a single record.
Of course, here is the Java code you requested: ```java public boolean replay( final long recordingId, final long position, final long length, final String replayChannel, final int replayStreamId, final long correlationId, final long controlSessionId) { ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/util/EscapeStrings.java
EscapeStrings.backslashEscapeCDMString
static public String backslashEscapeCDMString(String s, String toescape) { if(toescape == null || toescape.length() == 0) return s; if(s == null || s.length() == 0) return s; StringBuilder buf = new StringBuilder(); for(int i=0;i<s.length();i++) { int c = s.charAt(i); if(toes...
java
static public String backslashEscapeCDMString(String s, String toescape) { if(toescape == null || toescape.length() == 0) return s; if(s == null || s.length() == 0) return s; StringBuilder buf = new StringBuilder(); for(int i=0;i<s.length();i++) { int c = s.charAt(i); if(toes...
[ "static", "public", "String", "backslashEscapeCDMString", "(", "String", "s", ",", "String", "toescape", ")", "{", "if", "(", "toescape", "==", "null", "||", "toescape", ".", "length", "(", ")", "==", "0", ")", "return", "s", ";", "if", "(", "s", "==",...
Given a CDM string, insert backslashes before <toescape> characters.
[ "Given", "a", "CDM", "string", "insert", "backslashes", "before", "<toescape", ">", "characters", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/EscapeStrings.java#L548-L561
test
Escape a CDM string.
Of course, here is the Java code you requested: ```java static public String backslashEscapeCDMString(String s, String toescape) { if(toescape == null || toescape.length() == 0) return s; if(s == null || s.length() == 0) return s; StringBuilder buf = new StringBuilder(); for(int i=0;i<s.len...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.concatMapSingleDelayError
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapSingleDelayError(Function<? super T, ? extends SingleSource<? extends R>> mapper, boolean tillTheEnd) { return concatMapSingleDelayError(mapper, tillTheEnd, 2); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapSingleDelayError(Function<? super T, ? extends SingleSource<? extends R>> mapper, boolean tillTheEnd) { return concatMapSingleDelayError(mapper, tillTheEnd, 2); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Observable", "<", "R", ">", "concatMapSingleDelayError", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "SingleSource...
Maps the upstream items into {@link SingleSource}s and subscribes to them one after the other succeeds or fails, emits their success values and optionally delays all errors till both this {@code Observable} and all inner {@code SingleSource}s terminate. <p> <img width="640" height="305" src="https://raw.github.com/wiki...
[ "Maps", "the", "upstream", "items", "into", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L7121-L7125
test
Concatenates a single - source SingleSource to an Observable.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapSingleDelayError(Function<? super T, ? extends SingleSource<? extends R>> mapper, boolean tillTheEnd) { return concatMapSingleDelayError(mapper, til...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/Type.java
Type.getArgumentsAndReturnSizes
public static int getArgumentsAndReturnSizes(final String methodDescriptor) { int argumentsSize = 1; // Skip the first character, which is always a '('. int currentOffset = 1; int currentChar = methodDescriptor.charAt(currentOffset); // Parse the argument types and compute their size, one at a each ...
java
public static int getArgumentsAndReturnSizes(final String methodDescriptor) { int argumentsSize = 1; // Skip the first character, which is always a '('. int currentOffset = 1; int currentChar = methodDescriptor.charAt(currentOffset); // Parse the argument types and compute their size, one at a each ...
[ "public", "static", "int", "getArgumentsAndReturnSizes", "(", "final", "String", "methodDescriptor", ")", "{", "int", "argumentsSize", "=", "1", ";", "// Skip the first character, which is always a '('.", "int", "currentOffset", "=", "1", ";", "int", "currentChar", "=",...
Computes the size of the arguments and of the return value of a method. @param methodDescriptor a method descriptor. @return the size of the arguments of the method (plus one for the implicit this argument), argumentsSize, and the size of its return value, returnSize, packed into a single int i = {@code (argumentsSize...
[ "Computes", "the", "size", "of", "the", "arguments", "and", "of", "the", "return", "value", "of", "a", "method", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Type.java#L724-L753
test
Get the number of arguments and return sizes from the method descriptor.
Of course, here is the Java code you requested: ```java public static int getArgumentsAndReturnSizes(final String methodDescriptor) { int argumentsSize = 1; // Skip the first character, which is always a '('. int currentOffset = 1; int currentChar = methodDescriptor.charAt(currentOffset); // Parse ...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java
GeoPackageManagerImpl.isTemporary
private boolean isTemporary(String database) { return database.endsWith(context.getString(R.string.geopackage_db_rollback_journal_suffix)) || database.endsWith(context.getString(R.string.geopackage_db_write_ahead_log_suffix)) || database.endsWith(context.getString(R.string.geopac...
java
private boolean isTemporary(String database) { return database.endsWith(context.getString(R.string.geopackage_db_rollback_journal_suffix)) || database.endsWith(context.getString(R.string.geopackage_db_write_ahead_log_suffix)) || database.endsWith(context.getString(R.string.geopac...
[ "private", "boolean", "isTemporary", "(", "String", "database", ")", "{", "return", "database", ".", "endsWith", "(", "context", ".", "getString", "(", "R", ".", "string", ".", "geopackage_db_rollback_journal_suffix", ")", ")", "||", "database", ".", "endsWith",...
Check if the database is temporary (rollback journal) @param database @return
[ "Check", "if", "the", "database", "is", "temporary", "(", "rollback", "journal", ")" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java#L1477-L1481
test
Checks if the database is temporary.
Of course, here is the Java code you requested: ```java private boolean isTemporary(String database) { return database.endsWith(context.getString(R.string.geopackage_db_rollback_journal_suffix)) || database.endsWith(context.getString(R.string.geopackage_db_write_ahead_log_suffix)) ...
kocakosm/pitaya
src/org/kocakosm/pitaya/io/XFiles.java
XFiles.cp
public static void cp(File src, OutputStream dst) throws IOException { InputStream in = newInputStream(src); try { ByteStreams.copy(in, dst); } finally { IO.close(in); } }
java
public static void cp(File src, OutputStream dst) throws IOException { InputStream in = newInputStream(src); try { ByteStreams.copy(in, dst); } finally { IO.close(in); } }
[ "public", "static", "void", "cp", "(", "File", "src", ",", "OutputStream", "dst", ")", "throws", "IOException", "{", "InputStream", "in", "=", "newInputStream", "(", "src", ")", ";", "try", "{", "ByteStreams", ".", "copy", "(", "in", ",", "dst", ")", "...
Copies the contents of the given input {@code File} to the given {@code OutputStream}. Named after the Unix command of the same name. @param src the file to copy from. @param dst the stream to write to. @throws NullPointerException if one of the arguments is {@code null}. @throws IOException if {@code src} does not e...
[ "Copies", "the", "contents", "of", "the", "given", "input", "{", "@code", "File", "}", "to", "the", "given", "{", "@code", "OutputStream", "}", ".", "Named", "after", "the", "Unix", "command", "of", "the", "same", "name", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/XFiles.java#L127-L135
test
Copy a file to an output stream.
Of course, here is the Java code you requested: ```java public static void cp(File src, OutputStream dst) throws IOException { InputStream in = newInputStream(src); try { ByteStreams.copy(in, dst); } finally { IO.close(in); } } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel3.java
BaseLevel3.trmm
@Override public void trmm(char Order, char Side, char Uplo, char TransA, char Diag, IComplexNumber alpha, IComplexNDArray A, IComplexNDArray B, IComplexNDArray C) { // FIXME: int cast if (A.data().dataType() == DataBuffer.Type.DOUBLE) ztrmm(Order, Side, Uplo, TransA...
java
@Override public void trmm(char Order, char Side, char Uplo, char TransA, char Diag, IComplexNumber alpha, IComplexNDArray A, IComplexNDArray B, IComplexNDArray C) { // FIXME: int cast if (A.data().dataType() == DataBuffer.Type.DOUBLE) ztrmm(Order, Side, Uplo, TransA...
[ "@", "Override", "public", "void", "trmm", "(", "char", "Order", ",", "char", "Side", ",", "char", "Uplo", ",", "char", "TransA", ",", "char", "Diag", ",", "IComplexNumber", "alpha", ",", "IComplexNDArray", "A", ",", "IComplexNDArray", "B", ",", "IComplexN...
syr2k performs a rank-2k update of an n-by-n symmetric matrix c, that is, one of the following operations: c := alpha*a*b' + alpha*b*a' + beta*c for trans = 'N'or'n' c := alpha*a'*b + alpha*b'*a + beta*c for trans = 'T'or't', where c is an n-by-n symmetric matrix; a and b are n-by-k matrices, if trans = 'N'or'n', a a...
[ "syr2k", "performs", "a", "rank", "-", "2k", "update", "of", "an", "n", "-", "by", "-", "n", "symmetric", "matrix", "c", "that", "is", "one", "of", "the", "following", "operations", ":", "c", ":", "=", "alpha", "*", "a", "*", "b", "+", "alpha", "...
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel3.java#L483-L493
test
TRMM method.
Of course, here is the Java code you requested: ```java @Override public void trmm(char Order, char Side, char Uplo, char TransA, char Diag, IComplexNumber alpha, IComplexNDArray A, IComplexNDArray B, IComplexNDArray C) { // FIXME: int cast if (A.data().dataType() == DataBuffer...
jboss/jboss-common-core
src/main/java/org/jboss/util/property/PropertyManager.java
PropertyManager.addPropertyListeners
public static void addPropertyListeners(final PropertyListener[] listeners) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPropertiesAccess(); props.addPropertyListeners(listeners); }
java
public static void addPropertyListeners(final PropertyListener[] listeners) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPropertiesAccess(); props.addPropertyListeners(listeners); }
[ "public", "static", "void", "addPropertyListeners", "(", "final", "PropertyListener", "[", "]", "listeners", ")", "{", "SecurityManager", "sm", "=", "System", ".", "getSecurityManager", "(", ")", ";", "if", "(", "sm", "!=", "null", ")", "sm", ".", "checkProp...
Add an array of property listeners. @param listeners Array of property listeners to add.
[ "Add", "an", "array", "of", "property", "listeners", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/property/PropertyManager.java#L134-L140
test
Add a list of PropertyListeners to the Properties object.
Of course, here is the Java code you requested: ```java public static void addPropertyListeners(final PropertyListener[] listeners) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPropertiesAccess(); props.addPropertyListeners(listeners); } ``` Hope this he...
oblac/jodd
jodd-core/src/main/java/jodd/time/TimeUtil.java
TimeUtil.toCalendar
public static Calendar toCalendar(final LocalDateTime localDateTime) { return GregorianCalendar.from(ZonedDateTime.of(localDateTime, ZoneId.systemDefault())); }
java
public static Calendar toCalendar(final LocalDateTime localDateTime) { return GregorianCalendar.from(ZonedDateTime.of(localDateTime, ZoneId.systemDefault())); }
[ "public", "static", "Calendar", "toCalendar", "(", "final", "LocalDateTime", "localDateTime", ")", "{", "return", "GregorianCalendar", ".", "from", "(", "ZonedDateTime", ".", "of", "(", "localDateTime", ",", "ZoneId", ".", "systemDefault", "(", ")", ")", ")", ...
Converts local date time to Calendar.
[ "Converts", "local", "date", "time", "to", "Calendar", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/time/TimeUtil.java#L64-L66
test
To calendar.
Of course, here is the Java code you requested: ```java public static Calendar toCalendar(final LocalDateTime localDateTime) { return GregorianCalendar.from(ZonedDateTime.of(localDateTime, ZoneId.systemDefault())); } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/TagHandlerPool.java
TagHandlerPool.release
public synchronized void release() { for (int i=current; i>=0; i--) { if (handlers[i] instanceof Tag) { ((Tag)handlers[i]).release(); } if (resourceInjector != null) { resourceInjector.preDestroy(handlers[i]); } } }
java
public synchronized void release() { for (int i=current; i>=0; i--) { if (handlers[i] instanceof Tag) { ((Tag)handlers[i]).release(); } if (resourceInjector != null) { resourceInjector.preDestroy(handlers[i]); } } }
[ "public", "synchronized", "void", "release", "(", ")", "{", "for", "(", "int", "i", "=", "current", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "handlers", "[", "i", "]", "instanceof", "Tag", ")", "{", "(", "(", "Tag", ")", "handl...
Calls the release() method of all available tag handlers in this tag handler pool.
[ "Calls", "the", "release", "()", "method", "of", "all", "available", "tag", "handlers", "in", "this", "tag", "handler", "pool", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/TagHandlerPool.java#L207-L216
test
Release all resources.
Of course, here is the Java code you requested: ```java public synchronized void release() { for (int i=current; i>=0; i--) { if (handlers[i] instanceof Tag) { ((Tag)handlers[i]).release(); } if (resourceInjector != null) { resourceInjector.preDestro...
rupertlssmith/lojix
debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingColorFactory.java
SwingColorFactory.createFader
public Fader<Color> createFader(Color startColor, Color endColor) { return new FaderImpl(startColor, endColor); }
java
public Fader<Color> createFader(Color startColor, Color endColor) { return new FaderImpl(startColor, endColor); }
[ "public", "Fader", "<", "Color", ">", "createFader", "(", "Color", "startColor", ",", "Color", "endColor", ")", "{", "return", "new", "FaderImpl", "(", "startColor", ",", "endColor", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingColorFactory.java#L54-L57
test
Create a Fader object.
Of course, here is the Java code you requested: ```java public Fader<Color> createFader(Color startColor, Color endColor) { return new FaderImpl(startColor, endColor); } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/geometry/GeometryMath_F64.java
GeometryMath_F64.rotate
public static void rotate( double c , double s, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution ) { double x = pt.x; double y = pt.y; solution.x = c * x - s * y; solution.y = s * x + c * y; }
java
public static void rotate( double c , double s, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution ) { double x = pt.x; double y = pt.y; solution.x = c * x - s * y; solution.y = s * x + c * y; }
[ "public", "static", "void", "rotate", "(", "double", "c", ",", "double", "s", ",", "GeoTuple2D_F64", "pt", ",", "GeoTuple2D_F64", "solution", ")", "{", "double", "x", "=", "pt", ".", "x", ";", "double", "y", "=", "pt", ".", "y", ";", "solution", ".",...
Rotates a 2D point by the specified angle. @param c Cosine of theta @param s Sine of theta @param pt @param solution where the solution is written to. Can be the same point as 'pt'.
[ "Rotates", "a", "2D", "point", "by", "the", "specified", "angle", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/GeometryMath_F64.java#L308-L315
test
Rotate the point in the solution by the rotation
Of course, here is the Java code you requested: ```java public static void rotate( double c , double s, GeoTuple2D_F64 pt, GeoTuple2D_F64 solution ) { double x = pt.x; double y = pt.y; solution.x = c * x - s * y; solution.y = s * x + c * y; } ``` Hope this helps!
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/matrix/InvertibleMatrix.java
InvertibleMatrix.norm
public float norm () { float sum = 0; for (int r = 0; r < m_nRows; ++r) { for (int c = 0; c < m_nCols; ++c) { final float v = m_aValues[r][c]; sum += v * v; } } return (float) Math.sqrt (sum); }
java
public float norm () { float sum = 0; for (int r = 0; r < m_nRows; ++r) { for (int c = 0; c < m_nCols; ++c) { final float v = m_aValues[r][c]; sum += v * v; } } return (float) Math.sqrt (sum); }
[ "public", "float", "norm", "(", ")", "{", "float", "sum", "=", "0", ";", "for", "(", "int", "r", "=", "0", ";", "r", "<", "m_nRows", ";", "++", "r", ")", "{", "for", "(", "int", "c", "=", "0", ";", "c", "<", "m_nCols", ";", "++", "c", ")"...
Compute the Euclidean norm of this matrix. @return the norm
[ "Compute", "the", "Euclidean", "norm", "of", "this", "matrix", "." ]
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/matrix/InvertibleMatrix.java#L100-L114
test
Returns the norm of the matrix.
Of course, here is the Java code you requested: ```java public float norm () { float sum = 0; for (int r = 0; r < m_nRows; ++r) { for (int c = 0; c < m_nCols; ++c) { final float v = m_aValues[r][c]; sum += v * v; } } return (float) Math.sqrt (sum); } ``` Hop...
RestComm/jain-slee
container/profiles/src/main/java/org/mobicents/slee/container/management/jmx/ProfileProvisioningMBeanImpl.java
ProfileProvisioningMBeanImpl.createAndRegisterProfileMBean
private AbstractProfileMBeanImpl createAndRegisterProfileMBean(String profileName, ProfileTableImpl profileTable) throws ManagementException { if (logger.isDebugEnabled()) { logger.debug("createAndRegisterProfileMBean( profileTable = "+profileTable+" , profileName = "+profileName+" )"); } try { ...
java
private AbstractProfileMBeanImpl createAndRegisterProfileMBean(String profileName, ProfileTableImpl profileTable) throws ManagementException { if (logger.isDebugEnabled()) { logger.debug("createAndRegisterProfileMBean( profileTable = "+profileTable+" , profileName = "+profileName+" )"); } try { ...
[ "private", "AbstractProfileMBeanImpl", "createAndRegisterProfileMBean", "(", "String", "profileName", ",", "ProfileTableImpl", "profileTable", ")", "throws", "ManagementException", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "de...
Creates and registers a profile mbean for the specified object. @param profileObject @return @throws ManagementException
[ "Creates", "and", "registers", "a", "profile", "mbean", "for", "the", "specified", "object", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/management/jmx/ProfileProvisioningMBeanImpl.java#L189-L215
test
Creates and registers the profile MBean.
Of course, here is the Java code you requested: ```java private AbstractProfileMBeanImpl createAndRegisterProfileMBean(String profileName, ProfileTableImpl profileTable) throws ManagementException { if (logger.isDebugEnabled()) { logger.debug("createAndRegisterProfileMBean( profileTable = "+profileTable+" ,...
playframework/playframework
core/play/src/main/java/play/mvc/Controller.java
Controller.TODO
public static Result TODO(Request request) { return status(NOT_IMPLEMENTED, views.html.defaultpages.todo.render(request.asScala())); }
java
public static Result TODO(Request request) { return status(NOT_IMPLEMENTED, views.html.defaultpages.todo.render(request.asScala())); }
[ "public", "static", "Result", "TODO", "(", "Request", "request", ")", "{", "return", "status", "(", "NOT_IMPLEMENTED", ",", "views", ".", "html", ".", "defaultpages", ".", "todo", ".", "render", "(", "request", ".", "asScala", "(", ")", ")", ")", ";", ...
Generates a 501 NOT_IMPLEMENTED simple result.
[ "Generates", "a", "501", "NOT_IMPLEMENTED", "simple", "result", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Controller.java#L26-L28
test
Render a todo page.
Of course, here is the Java code you requested: ```java public static Result TODO(Request request) { return status(NOT_IMPLEMENTED, views.html.defaultpages.todo.render(request.asScala())); } ``` Hope this helps!
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/ComboValue.java
ComboValue.mustInsert
private static boolean mustInsert(int nextIdx, long[] valueTimeStamps, long tsAtInsertPoint) { return (nextIdx < valueTimeStamps.length) && (valueTimeStamps[nextIdx] <= tsAtInsertPoint); }
java
private static boolean mustInsert(int nextIdx, long[] valueTimeStamps, long tsAtInsertPoint) { return (nextIdx < valueTimeStamps.length) && (valueTimeStamps[nextIdx] <= tsAtInsertPoint); }
[ "private", "static", "boolean", "mustInsert", "(", "int", "nextIdx", ",", "long", "[", "]", "valueTimeStamps", ",", "long", "tsAtInsertPoint", ")", "{", "return", "(", "nextIdx", "<", "valueTimeStamps", ".", "length", ")", "&&", "(", "valueTimeStamps", "[", ...
Return true if the current ts must be inserted instead of being mapped to the tsAtInsertPoint
[ "Return", "true", "if", "the", "current", "ts", "must", "be", "inserted", "instead", "of", "being", "mapped", "to", "the", "tsAtInsertPoint" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/ComboValue.java#L134-L138
test
mustInsert returns true if the index of the next value in the array is less than the timestamp at the insert point.
Of course, here is the Java code you requested: ```java private static boolean mustInsert(int nextIdx, long[] valueTimeStamps, long tsAtInsertPoint) { return (nextIdx < valueTimeStamps.length) && (valueTimeStamps[nextIdx] <= tsAtInsertPoint); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/vertical/HybridSigmaPressure.java
HybridSigmaPressure.getCoordinateArray
public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { Array psArray = readArray(psVar, timeIndex); if (null == aArray) { aArray = aVar.read(); bArray = bVar.read(); //p0 = (p0Var == null) ? 1.0 : p0Var.readScalarDouble(); p...
java
public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { Array psArray = readArray(psVar, timeIndex); if (null == aArray) { aArray = aVar.read(); bArray = bVar.read(); //p0 = (p0Var == null) ? 1.0 : p0Var.readScalarDouble(); p...
[ "public", "ArrayDouble", ".", "D3", "getCoordinateArray", "(", "int", "timeIndex", ")", "throws", "IOException", ",", "InvalidRangeException", "{", "Array", "psArray", "=", "readArray", "(", "psVar", ",", "timeIndex", ")", ";", "if", "(", "null", "==", "aArray...
Get the 3D vertical coordinate array for this time step. @param timeIndex the time index. Ignored if !isTimeDependent(). @return vertical coordinate array @throws IOException problem reading data @throws InvalidRangeException _more_
[ "Get", "the", "3D", "vertical", "coordinate", "array", "for", "this", "time", "step", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/vertical/HybridSigmaPressure.java#L121-L169
test
Gets the coordinate array of the two data structures.
Of course, here is the Java code you requested: ```java public ArrayDouble.D3 getCoordinateArray(int timeIndex) throws IOException, InvalidRangeException { Array psArray = readArray(psVar, timeIndex); if (null == aArray) { aArray = aVar.read(); bArray = bVar.read(); //p0 = (...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java
ElementEditor.getNSPrefix
public static String getNSPrefix(String name) { Assert.isNotNull(name); int p = name.lastIndexOf(':'); if (p <= 0) return null; return name.substring(0, p); }
java
public static String getNSPrefix(String name) { Assert.isNotNull(name); int p = name.lastIndexOf(':'); if (p <= 0) return null; return name.substring(0, p); }
[ "public", "static", "String", "getNSPrefix", "(", "String", "name", ")", "{", "Assert", ".", "isNotNull", "(", "name", ")", ";", "int", "p", "=", "name", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "p", "<=", "0", ")", "return", "null",...
Returns the namespace prefix part of the given name, or <code>null</code> if its name has no prefix. The name must not be <code>null</code>. <table> <caption>Example</caption> <tr> <th>name</th> <th>namespace prefix</th> <tr> <td>D:foo</td> <td>D</td> <tr> <td>foo</td> <td>null</td> <tr> <td>D:</td> <td>D</td> <tr> <td...
[ "Returns", "the", "namespace", "prefix", "part", "of", "the", "given", "name", "or", "<code", ">", "null<", "/", "code", ">", "if", "its", "name", "has", "no", "prefix", ".", "The", "name", "must", "not", "be", "<code", ">", "null<", "/", "code", ">"...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java#L1200-L1206
test
Get the namespace prefix from a name.
Of course, here is the Java code you requested: ```java public static String getNSPrefix(String name) { Assert.isNotNull(name); int p = name.lastIndexOf(':'); if (p <= 0) return null; return name.substring(0, p); } ``` Hope this helps!
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/FeaturePaintCache.java
FeaturePaintCache.setPaint
public void setPaint(long styleId, FeatureDrawType type, Paint paint) { FeaturePaint featurePaint = getFeaturePaint(styleId); if (featurePaint == null) { featurePaint = new FeaturePaint(); paintCache.put(styleId, featurePaint); } featurePaint.setPaint(type, paint)...
java
public void setPaint(long styleId, FeatureDrawType type, Paint paint) { FeaturePaint featurePaint = getFeaturePaint(styleId); if (featurePaint == null) { featurePaint = new FeaturePaint(); paintCache.put(styleId, featurePaint); } featurePaint.setPaint(type, paint)...
[ "public", "void", "setPaint", "(", "long", "styleId", ",", "FeatureDrawType", "type", ",", "Paint", "paint", ")", "{", "FeaturePaint", "featurePaint", "=", "getFeaturePaint", "(", "styleId", ")", ";", "if", "(", "featurePaint", "==", "null", ")", "{", "featu...
Set the paint for the style id and draw type @param styleId style row id @param type feature draw type @param paint paint
[ "Set", "the", "paint", "for", "the", "style", "id", "and", "draw", "type" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/FeaturePaintCache.java#L125-L132
test
Set the Paint object for the specified style.
Of course, here is the Java code you requested: ```java public void setPaint(long styleId, FeatureDrawType type, Paint paint) { FeaturePaint featurePaint = getFeaturePaint(styleId); if (featurePaint == null) { featurePaint = new FeaturePaint(); paintCache.put(styleId, featurePai...
deeplearning4j/nd4j
nd4j-parameter-server-parent/nd4j-parameter-server/src/main/java/org/nd4j/parameterserver/updater/TimeDelayedParameterUpdater.java
TimeDelayedParameterUpdater.shouldReplicate
@Override public boolean shouldReplicate() { long now = System.currentTimeMillis(); long diff = Math.abs(now - lastSynced); return diff > syncTime; }
java
@Override public boolean shouldReplicate() { long now = System.currentTimeMillis(); long diff = Math.abs(now - lastSynced); return diff > syncTime; }
[ "@", "Override", "public", "boolean", "shouldReplicate", "(", ")", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "diff", "=", "Math", ".", "abs", "(", "now", "-", "lastSynced", ")", ";", "return", "diff", ">", "syn...
Returns true if the updater has accumulated enough ndarrays to replicate to the workers @return true if replication should happen,false otherwise
[ "Returns", "true", "if", "the", "updater", "has", "accumulated", "enough", "ndarrays", "to", "replicate", "to", "the", "workers" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-parameter-server-parent/nd4j-parameter-server/src/main/java/org/nd4j/parameterserver/updater/TimeDelayedParameterUpdater.java#L64-L69
test
Returns true if the cache should be replicated.
Of course, here is the Java code you requested: ```java @Override public boolean shouldReplicate() { long now = System.currentTimeMillis(); long diff = Math.abs(now - lastSynced); return diff > syncTime; } ``` Hope this helps!
oblac/jodd
jodd-http/src/main/java/jodd/http/HttpBrowser.java
HttpBrowser.readCookies
protected void readCookies(final HttpResponse httpResponse) { Cookie[] newCookies = httpResponse.cookies(); for (Cookie cookie : newCookies) { cookies.add(cookie.getName(), cookie); } }
java
protected void readCookies(final HttpResponse httpResponse) { Cookie[] newCookies = httpResponse.cookies(); for (Cookie cookie : newCookies) { cookies.add(cookie.getName(), cookie); } }
[ "protected", "void", "readCookies", "(", "final", "HttpResponse", "httpResponse", ")", "{", "Cookie", "[", "]", "newCookies", "=", "httpResponse", ".", "cookies", "(", ")", ";", "for", "(", "Cookie", "cookie", ":", "newCookies", ")", "{", "cookies", ".", "...
Reads cookies from response and adds to cookies list.
[ "Reads", "cookies", "from", "response", "and", "adds", "to", "cookies", "list", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpBrowser.java#L276-L282
test
Read cookies from the given HTTP response.
Of course, here is the Java code you requested: ```java protected void readCookies(final HttpResponse httpResponse) { Cookie[] newCookies = httpResponse.cookies(); for (Cookie cookie : newCookies) { cookies.add(cookie.getName(), cookie); } } ``` Hope this helps!
PistoiaHELM/HELMNotationParser
src/main/java/org/helm/notation2/parser/notation/connection/ConnectionNotation.java
ConnectionNotation.toHELM2
public String toHELM2() { if (isAnnotationTrue()) { return sourceId.getId() + "," + targetId.getId() + "," + sourceUnit + ":" + rGroupSource + "-" + targetUnit + ":" + rGroupTarget + "\"" + annotation + "\""; } else { return sourceId.getId() + "," + targetId.getId() + "," + sourceUnit...
java
public String toHELM2() { if (isAnnotationTrue()) { return sourceId.getId() + "," + targetId.getId() + "," + sourceUnit + ":" + rGroupSource + "-" + targetUnit + ":" + rGroupTarget + "\"" + annotation + "\""; } else { return sourceId.getId() + "," + targetId.getId() + "," + sourceUnit...
[ "public", "String", "toHELM2", "(", ")", "{", "if", "(", "isAnnotationTrue", "(", ")", ")", "{", "return", "sourceId", ".", "getId", "(", ")", "+", "\",\"", "+", "targetId", ".", "getId", "(", ")", "+", "\",\"", "+", "sourceUnit", "+", "\":\"", "+", ...
method to get a valid HELM2 of the connection notation @return valid HELM2
[ "method", "to", "get", "a", "valid", "HELM2", "of", "the", "connection", "notation" ]
685d7ab7886e9b5cc15fb904025fe6eee703f8f6
https://github.com/PistoiaHELM/HELMNotationParser/blob/685d7ab7886e9b5cc15fb904025fe6eee703f8f6/src/main/java/org/helm/notation2/parser/notation/connection/ConnectionNotation.java#L267-L275
test
Converts the phrase to HELM2
Of course, here is the Java code you requested: ```java public String toHELM2() { if (isAnnotationTrue()) { return sourceId.getId() + "," + targetId.getId() + "," + sourceUnit + ":" + rGroupSource + "-" + targetUnit + ":" + rGroupTarget + "\"" + annotation + "\""; } else { return sou...
oblac/jodd
jodd-mail/src/main/java/jodd/mail/EmailAttachment.java
EmailAttachment.toByteArray
public byte[] toByteArray() { final FastByteArrayOutputStream out; if (size != -1) { out = new FastByteArrayOutputStream(size); } else { out = new FastByteArrayOutputStream(); } writeToStream(out); return out.toByteArray(); }
java
public byte[] toByteArray() { final FastByteArrayOutputStream out; if (size != -1) { out = new FastByteArrayOutputStream(size); } else { out = new FastByteArrayOutputStream(); } writeToStream(out); return out.toByteArray(); }
[ "public", "byte", "[", "]", "toByteArray", "(", ")", "{", "final", "FastByteArrayOutputStream", "out", ";", "if", "(", "size", "!=", "-", "1", ")", "{", "out", "=", "new", "FastByteArrayOutputStream", "(", "size", ")", ";", "}", "else", "{", "out", "="...
Returns byte content of the attachment. @return byte array with content of the attachment.
[ "Returns", "byte", "content", "of", "the", "attachment", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/EmailAttachment.java#L257-L266
test
Returns the contents of this object as a byte array.
Of course, here is the Java code you requested: ```java public byte[] toByteArray() { final FastByteArrayOutputStream out; if (size != -1) { out = new FastByteArrayOutputStream(size); } else { out = new FastByteArrayOutputStream(); } writeToStream(out); return out.toByteArray(); } ``` Hope this hel...
Unidata/thredds
httpservices/src/main/java/ucar/httpservices/Escape.java
Escape.backslashEncode
public static String backslashEncode(String s) { StringBuilder buf = new StringBuilder(); for(int i = 0; i < s.length(); i++) { int c = buf.charAt(i); if(_MustBackslashEscape.indexOf(c) >= 0) buf.append(_BACKSLASHEscape); buf.append((char) c); ...
java
public static String backslashEncode(String s) { StringBuilder buf = new StringBuilder(); for(int i = 0; i < s.length(); i++) { int c = buf.charAt(i); if(_MustBackslashEscape.indexOf(c) >= 0) buf.append(_BACKSLASHEscape); buf.append((char) c); ...
[ "public", "static", "String", "backslashEncode", "(", "String", "s", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "++", ")", ...
Define the DEFINITIVE URL BACKSLASH escape function. @param s The string to escape. @return The escaped expression.
[ "Define", "the", "DEFINITIVE", "URL", "BACKSLASH", "escape", "function", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/httpservices/src/main/java/ucar/httpservices/Escape.java#L363-L373
test
backslashEncode Method.
Of course, here is the Java code you requested: ```java public static String backslashEncode(String s) { StringBuilder buf = new StringBuilder(); for(int i = 0; i < s.length(); i++) { int c = buf.charAt(i); if(_MustBackslashEscape.indexOf(c) >= 0) buf.append(...
Unidata/thredds
cdm/src/main/java/ucar/nc2/units/SimpleUnit.java
SimpleUnit.isCompatible
public boolean isCompatible(String unitString) { Unit uuWant; try { UnitFormat format = UnitFormatManager.instance(); uuWant = format.parse(unitString); } catch (Exception e) { if (debugParse) System.out.println("Parse " + unitString + " got Exception1 " + e); return false; } ...
java
public boolean isCompatible(String unitString) { Unit uuWant; try { UnitFormat format = UnitFormatManager.instance(); uuWant = format.parse(unitString); } catch (Exception e) { if (debugParse) System.out.println("Parse " + unitString + " got Exception1 " + e); return false; } ...
[ "public", "boolean", "isCompatible", "(", "String", "unitString", ")", "{", "Unit", "uuWant", ";", "try", "{", "UnitFormat", "format", "=", "UnitFormatManager", ".", "instance", "(", ")", ";", "uuWant", "=", "format", ".", "parse", "(", "unitString", ")", ...
Return true if unitString1 is compatible to unitString2, meaning one can be converted to the other. If either unit string is illegal, return false. @param unitString check if this is compatible with unitString @return true if compatible
[ "Return", "true", "if", "unitString1", "is", "compatible", "to", "unitString2", "meaning", "one", "can", "be", "converted", "to", "the", "other", ".", "If", "either", "unit", "string", "is", "illegal", "return", "false", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/units/SimpleUnit.java#L263-L274
test
Checks if the given unit string is compatible with this object.
Of course, here is the Java code you requested: ```java public boolean isCompatible(String unitString) { Unit uuWant; try { UnitFormat format = UnitFormatManager.instance(); uuWant = format.parse(unitString); } catch (Exception e) { if (debugParse) System.out.println("Parse " + unitString...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/index/OIndexChangesWrapper.java
OIndexChangesWrapper.next
@Override public OIdentifiable next() { if (source.isRebuilding()) throwRebuildException(); final OIdentifiable next = delegate.next(); if (source.getRebuildVersion() != indexRebuildVersion) throwRebuildException(); return next; }
java
@Override public OIdentifiable next() { if (source.isRebuilding()) throwRebuildException(); final OIdentifiable next = delegate.next(); if (source.getRebuildVersion() != indexRebuildVersion) throwRebuildException(); return next; }
[ "@", "Override", "public", "OIdentifiable", "next", "(", ")", "{", "if", "(", "source", ".", "isRebuilding", "(", ")", ")", "throwRebuildException", "(", ")", ";", "final", "OIdentifiable", "next", "=", "delegate", ".", "next", "(", ")", ";", "if", "(", ...
{@inheritDoc}
[ "{" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/index/OIndexChangesWrapper.java#L149-L160
test
Returns the next CID .
Of course, here is the Java code you requested: ```java @Override public OIdentifiable next() { if (source.isRebuilding()) throwRebuildException(); final OIdentifiable next = delegate.next(); if (source.getRebuildVersion() != indexRebuildVersion) throwRebuildException(); return next; ...
playframework/playframework
core/play/src/main/java/play/mvc/Results.java
Results.notAcceptable
public static Result notAcceptable(Path content, String filename) { return notAcceptable(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
java
public static Result notAcceptable(Path content, String filename) { return notAcceptable(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
[ "public", "static", "Result", "notAcceptable", "(", "Path", "content", ",", "String", "filename", ")", "{", "return", "notAcceptable", "(", "content", ",", "filename", ",", "StaticFileMimeTypes", ".", "fileMimeTypes", "(", ")", ")", ";", "}" ]
Generates a 406 Not Acceptable result. @param content The path to send. @param filename The name to send the file as. @return the result
[ "Generates", "a", "406", "Not", "Acceptable", "result", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L2668-L2670
test
Returns a Result indicating that the content is not acceptable for the given filename.
Of course, here is the Java code you requested: ```java public static Result notAcceptable(Path content, String filename) { return notAcceptable(content, filename, StaticFileMimeTypes.fileMimeTypes()); } ``` Hope this helps!
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/rules/DummyRuleVisitor.java
DummyRuleVisitor.defaultVisit
protected <P> O defaultVisit(Rule<P> rule, P premise, ContextPremises premises, ClassInferenceProducer producer) { if (LOGGER_.isTraceEnabled()) { LOGGER_.trace("ignore {} by {} in {}", premise, rule, premises); } return null; }
java
protected <P> O defaultVisit(Rule<P> rule, P premise, ContextPremises premises, ClassInferenceProducer producer) { if (LOGGER_.isTraceEnabled()) { LOGGER_.trace("ignore {} by {} in {}", premise, rule, premises); } return null; }
[ "protected", "<", "P", ">", "O", "defaultVisit", "(", "Rule", "<", "P", ">", "rule", ",", "P", "premise", ",", "ContextPremises", "premises", ",", "ClassInferenceProducer", "producer", ")", "{", "if", "(", "LOGGER_", ".", "isTraceEnabled", "(", ")", ")", ...
The default implementation of all methods @param rule @param premise @param premises @param producer @return
[ "The", "default", "implementation", "of", "all", "methods" ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/rules/DummyRuleVisitor.java#L96-L102
test
Visit a Rule.
Of course, here is the Java code you requested: ```java protected <P> O defaultVisit(Rule<P> rule, P premise, ContextPremises premises, ClassInferenceProducer producer) { if (LOGGER_.isTraceEnabled()) { LOGGER_.trace("ignore {} by {} in {}", premise, rule, premises); } return null; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/ncml/Aggregation.java
Aggregation.makeDatasets
protected void makeDatasets(CancelTask cancelTask) throws IOException { // heres where the results will go datasets = new ArrayList<>(); for (MFile cd : datasetManager.getFilesSorted()) { datasets.add( makeDataset(cd)); } // sort using Aggregation.Dataset as Comparator. // Sor...
java
protected void makeDatasets(CancelTask cancelTask) throws IOException { // heres where the results will go datasets = new ArrayList<>(); for (MFile cd : datasetManager.getFilesSorted()) { datasets.add( makeDataset(cd)); } // sort using Aggregation.Dataset as Comparator. // Sor...
[ "protected", "void", "makeDatasets", "(", "CancelTask", "cancelTask", ")", "throws", "IOException", "{", "// heres where the results will go\r", "datasets", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "MFile", "cd", ":", "datasetManager", ".", "getFi...
Make the list of Datasets, from explicit and scans. @param cancelTask user can cancel @throws IOException on i/o error
[ "Make", "the", "list", "of", "Datasets", "from", "explicit", "and", "scans", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ncml/Aggregation.java#L407-L487
test
Create the datasets for the files sorted by date and by date.
Of course, here is the Java code you requested: ```java protected void makeDatasets(CancelTask cancelTask) throws IOException { // heres where the results will go datasets = new ArrayList<>(); for (MFile cd : datasetManager.getFilesSorted()) { datasets.add( makeDataset(cd)); } // ...
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/ComponentDescription.java
ComponentDescription.getClassInterceptor
public InterceptorDescription getClassInterceptor(String interceptorClassName) { for (InterceptorDescription interceptor : classInterceptors) { if (interceptor.getInterceptorClassName().equals(interceptorClassName)) { return interceptor; } } return null; ...
java
public InterceptorDescription getClassInterceptor(String interceptorClassName) { for (InterceptorDescription interceptor : classInterceptors) { if (interceptor.getInterceptorClassName().equals(interceptorClassName)) { return interceptor; } } return null; ...
[ "public", "InterceptorDescription", "getClassInterceptor", "(", "String", "interceptorClassName", ")", "{", "for", "(", "InterceptorDescription", "interceptor", ":", "classInterceptors", ")", "{", "if", "(", "interceptor", ".", "getInterceptorClassName", "(", ")", ".", ...
Returns the {@link InterceptorDescription} for the passed <code>interceptorClassName</code>, if such a class interceptor exists for this component description. Else returns null. @param interceptorClassName The fully qualified interceptor class name @return
[ "Returns", "the", "{", "@link", "InterceptorDescription", "}", "for", "the", "passed", "<code", ">", "interceptorClassName<", "/", "code", ">", "if", "such", "a", "class", "interceptor", "exists", "for", "this", "component", "description", ".", "Else", "returns"...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ComponentDescription.java#L337-L344
test
Gets the interceptor description for the specified class name.
Of course, here is the Java code you requested: ```java public InterceptorDescription getClassInterceptor(String interceptorClassName) { for (InterceptorDescription interceptor : classInterceptors) { if (interceptor.getInterceptorClassName().equals(interceptorClassName)) { return in...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java
Nidsheader.readInString
public static String readInString(ByteBuffer datainput) throws IOException { StringBuffer stringbuffer = new StringBuffer(); int i = datainput.getInt(); for(int j = 0; j < i; j++) { char c = (char)(datainput.get() & 0xff); stringbuffer.appe...
java
public static String readInString(ByteBuffer datainput) throws IOException { StringBuffer stringbuffer = new StringBuffer(); int i = datainput.getInt(); for(int j = 0; j < i; j++) { char c = (char)(datainput.get() & 0xff); stringbuffer.appe...
[ "public", "static", "String", "readInString", "(", "ByteBuffer", "datainput", ")", "throws", "IOException", "{", "StringBuffer", "stringbuffer", "=", "new", "StringBuffer", "(", ")", ";", "int", "i", "=", "datainput", ".", "getInt", "(", ")", ";", "for", "("...
for level3 176 product @param datainput @return string
[ "for", "level3", "176", "product" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java#L1905-L1923
test
Reads a string from a ByteBuffer.
Of course, here is the Java code you requested: ```java public static String readInString(ByteBuffer datainput) throws IOException { StringBuffer stringbuffer = new StringBuffer(); int i = datainput.getInt(); for(int j = 0; j < i; j++) { char c = (char...
jboss/jboss-common-core
src/main/java/org/jboss/util/property/FieldBoundPropertyListener.java
FieldBoundPropertyListener.propertyBound
public void propertyBound(final PropertyMap map) { // only set the field if the map contains the property already if (map.containsProperty(propertyName)) { setFieldValue(map.getProperty(propertyName)); } }
java
public void propertyBound(final PropertyMap map) { // only set the field if the map contains the property already if (map.containsProperty(propertyName)) { setFieldValue(map.getProperty(propertyName)); } }
[ "public", "void", "propertyBound", "(", "final", "PropertyMap", "map", ")", "{", "// only set the field if the map contains the property already", "if", "(", "map", ".", "containsProperty", "(", "propertyName", ")", ")", "{", "setFieldValue", "(", "map", ".", "getProp...
Notifies that this listener was bound to a property. @param map PropertyMap which contains property bound to.
[ "Notifies", "that", "this", "listener", "was", "bound", "to", "a", "property", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/property/FieldBoundPropertyListener.java#L166-L171
test
Set the value of the property bound to the value of the property.
Of course, here is the Java code you requested: ```java public void propertyBound(final PropertyMap map) { // only set the field if the map contains the property already if (map.containsProperty(propertyName)) { setFieldValue(map.getProperty(propertyName)); } } ``` Hope this helps!
vdmeer/execs
src/main/java/de/vandermeer/execs/options/ExecS_CliParser.java
ExecS_CliParser.addOption
public ExecS_CliParser addOption(ApplicationOption<?> option){ if(option!=null && option.getCliOption()!=null){ this._addOption(option.getCliOption()); } return this; }
java
public ExecS_CliParser addOption(ApplicationOption<?> option){ if(option!=null && option.getCliOption()!=null){ this._addOption(option.getCliOption()); } return this; }
[ "public", "ExecS_CliParser", "addOption", "(", "ApplicationOption", "<", "?", ">", "option", ")", "{", "if", "(", "option", "!=", "null", "&&", "option", ".", "getCliOption", "(", ")", "!=", "null", ")", "{", "this", ".", "_addOption", "(", "option", "."...
Adds a CLI option to the parser. @param option new CLI option, ignored if the option is null or getOption() on the option is null @throws IllegalArgumentException if the option uses short/long options already in use @return self to allow for chaining
[ "Adds", "a", "CLI", "option", "to", "the", "parser", "." ]
ac73170bfd449de1f460248d56ece57ff3b0c761
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/options/ExecS_CliParser.java#L61-L66
test
Adds an application option to the command line.
Of course, here is the Java code you requested: ```java public ExecS_CliParser addOption(ApplicationOption<?> option){ if(option!=null && option.getCliOption()!=null){ this._addOption(option.getCliOption()); } return this; } ``` Hope this helps!
liveontologies/elk-reasoner
elk-util-parent/elk-util-io/src/main/java/org/semanticweb/elk/io/IOUtils.java
IOUtils.getResourceNamesFromJAR
public static List<String> getResourceNamesFromJAR(String path, String extension, Class<?> clazz) throws IOException { CodeSource src = clazz.getProtectionDomain().getCodeSource(); List<String> testResources = new ArrayList<String>(); ZipInputStream zip = null; if (src != null) { URL jar = src.getLocatio...
java
public static List<String> getResourceNamesFromJAR(String path, String extension, Class<?> clazz) throws IOException { CodeSource src = clazz.getProtectionDomain().getCodeSource(); List<String> testResources = new ArrayList<String>(); ZipInputStream zip = null; if (src != null) { URL jar = src.getLocatio...
[ "public", "static", "List", "<", "String", ">", "getResourceNamesFromJAR", "(", "String", "path", ",", "String", "extension", ",", "Class", "<", "?", ">", "clazz", ")", "throws", "IOException", "{", "CodeSource", "src", "=", "clazz", ".", "getProtectionDomain"...
Retrieves a set of resource names from a JAR file (the code source for the given Java class) @param path @param extension @param clazz @return the list of resource names from a JAR file @throws IOException
[ "Retrieves", "a", "set", "of", "resource", "names", "from", "a", "JAR", "file", "(", "the", "code", "source", "for", "the", "given", "Java", "class", ")" ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-util-parent/elk-util-io/src/main/java/org/semanticweb/elk/io/IOUtils.java#L161-L191
test
Get the list of resource names from a jar file.
Of course, here is the Java code you requested: ```java public static List<String> getResourceNamesFromJAR(String path, String extension, Class<?> clazz) throws IOException { CodeSource src = clazz.getProtectionDomain().getCodeSource(); List<String> testResources = new ArrayList<String>(); ZipInputStream zip ...
rupertlssmith/lojix
lojix/search/src/main/com/thesett/aima/search/examples/eightpuzzle/EightPuzzleState.java
EightPuzzleState.prettyPrint
public String prettyPrint() { String result = ""; for (int j = 0; j < 3; j++) { result += new String(board[j]) + "\n"; } result = result.replace('E', ' '); return result; }
java
public String prettyPrint() { String result = ""; for (int j = 0; j < 3; j++) { result += new String(board[j]) + "\n"; } result = result.replace('E', ' '); return result; }
[ "public", "String", "prettyPrint", "(", ")", "{", "String", "result", "=", "\"\"", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "3", ";", "j", "++", ")", "{", "result", "+=", "new", "String", "(", "board", "[", "j", "]", ")", "+", "\...
Pretty prints the board as 3 lines of characters with a space for the empty square. @return A pretty printed string representation of this board position.
[ "Pretty", "prints", "the", "board", "as", "3", "lines", "of", "characters", "with", "a", "space", "for", "the", "empty", "square", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/examples/eightpuzzle/EightPuzzleState.java#L439-L451
test
Pretty print the result of a CIS file.
Of course, here is the Java code you requested: ```java public String prettyPrint() { String result = ""; for (int j = 0; j < 3; j++) { result += new String(board[j]) + "\n"; } result = result.replace('E', ' '); return result; } ``` Hope this help...
oblac/jodd
jodd-mail/src/main/java/jodd/mail/EmailFilter.java
EmailFilter.flags
public EmailFilter flags(final Flags flags, final boolean value) { final SearchTerm flagTerm = new FlagTerm(flags, value); concat(flagTerm); return this; }
java
public EmailFilter flags(final Flags flags, final boolean value) { final SearchTerm flagTerm = new FlagTerm(flags, value); concat(flagTerm); return this; }
[ "public", "EmailFilter", "flags", "(", "final", "Flags", "flags", ",", "final", "boolean", "value", ")", "{", "final", "SearchTerm", "flagTerm", "=", "new", "FlagTerm", "(", "flags", ",", "value", ")", ";", "concat", "(", "flagTerm", ")", ";", "return", ...
Defines filter for many flags at once. @param flags The {@link Flags} to filter on. @param value The {@link Flag} setting to check for. @return this
[ "Defines", "filter", "for", "many", "flags", "at", "once", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/EmailFilter.java#L172-L176
test
Add a flag to the filter.
Of course, here is the Java code you requested: ```java public EmailFilter flags(final Flags flags, final boolean value) { final SearchTerm flagTerm = new FlagTerm(flags, value); concat(flagTerm); return this; } ``` Hope this helps!
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/gempak/GempakSurfaceFileReader.java
GempakSurfaceFileReader.printOb
public void printOb(int row, int col) { int stnIndex = (getFileSubType().equals(CLIMATE)) ? row : col; List<GempakStation> stations = getStations(); if (stations.isEmpty() || stnIndex > stations.size()) { System.out.println("\nNo data available"); return; } ...
java
public void printOb(int row, int col) { int stnIndex = (getFileSubType().equals(CLIMATE)) ? row : col; List<GempakStation> stations = getStations(); if (stations.isEmpty() || stnIndex > stations.size()) { System.out.println("\nNo data available"); return; } ...
[ "public", "void", "printOb", "(", "int", "row", ",", "int", "col", ")", "{", "int", "stnIndex", "=", "(", "getFileSubType", "(", ")", ".", "equals", "(", "CLIMATE", ")", ")", "?", "row", ":", "col", ";", "List", "<", "GempakStation", ">", "stations",...
Print the list of dates in the file @param row ob row @param col ob column
[ "Print", "the", "list", "of", "dates", "in", "the", "file" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakSurfaceFileReader.java#L168-L211
test
Print the Obs information for a single row and column of the file.
Of course, here is the Java code you requested: ```java public void printOb(int row, int col) { int stnIndex = (getFileSubType().equals(CLIMATE)) ? row : col; List<GempakStation> stations = getStations(); if (stations.isEmpty() || stnIndex > stations.size()) { System.out...
eiichiro/bootleg
src/main/java/org/eiichiro/bootleg/AbstractRequest.java
AbstractRequest.builtin
protected Object builtin(Type type) { Class<?> rawType = Types.getRawType(type); if (rawType.equals(WebContext.class)) { return context; } else if (rawType.equals(HttpServletRequest.class)) { return context.request(); } else if (rawType.equals(HttpServletResponse.class)) { return context.response();...
java
protected Object builtin(Type type) { Class<?> rawType = Types.getRawType(type); if (rawType.equals(WebContext.class)) { return context; } else if (rawType.equals(HttpServletRequest.class)) { return context.request(); } else if (rawType.equals(HttpServletResponse.class)) { return context.response();...
[ "protected", "Object", "builtin", "(", "Type", "type", ")", "{", "Class", "<", "?", ">", "rawType", "=", "Types", ".", "getRawType", "(", "type", ")", ";", "if", "(", "rawType", ".", "equals", "(", "WebContext", ".", "class", ")", ")", "{", "return",...
Returns the value of built-in type. @param type The parameter type. @return The value of built-in type.
[ "Returns", "the", "value", "of", "built", "-", "in", "type", "." ]
b98a108500597cb6185056be2eef7de5ba1963d2
https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/AbstractRequest.java#L169-L186
test
Returns the builtin object for the given type.
Of course, here is the Java code you requested: ```java protected Object builtin(Type type) { Class<?> rawType = Types.getRawType(type); if (rawType.equals(WebContext.class)) { return context; } else if (rawType.equals(HttpServletRequest.class)) { return context.request(); } else if (rawType.equals(Ht...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/SaverImpl.java
SaverImpl.toEntity
@Override public FullEntity<?> toEntity(final Object pojo) { if (pojo instanceof FullEntity<?>) { return (FullEntity<?>)pojo; } else { @SuppressWarnings("unchecked") final EntityMetadata<Object> meta = (EntityMetadata<Object>)ofy.factory().getMetadata(pojo.getClass()); return meta.save(pojo, new...
java
@Override public FullEntity<?> toEntity(final Object pojo) { if (pojo instanceof FullEntity<?>) { return (FullEntity<?>)pojo; } else { @SuppressWarnings("unchecked") final EntityMetadata<Object> meta = (EntityMetadata<Object>)ofy.factory().getMetadata(pojo.getClass()); return meta.save(pojo, new...
[ "@", "Override", "public", "FullEntity", "<", "?", ">", "toEntity", "(", "final", "Object", "pojo", ")", "{", "if", "(", "pojo", "instanceof", "FullEntity", "<", "?", ">", ")", "{", "return", "(", "FullEntity", "<", "?", ">", ")", "pojo", ";", "}", ...
/* (non-Javadoc) @see com.googlecode.objectify.cmd.Saver#toEntity(java.lang.Object)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/SaverImpl.java#L66-L75
test
Converts a POJO to a FullEntity.
Of course, here is the Java code you requested: ```java @Override public FullEntity<?> toEntity(final Object pojo) { if (pojo instanceof FullEntity<?>) { return (FullEntity<?>)pojo; } else { @SuppressWarnings("unchecked") final EntityMetadata<Object> meta = (EntityMetadata<Object>)ofy.factory().get...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java
GempakGridReader.findGrid
public GempakGridRecord findGrid(String parm) { List<GridRecord> gridList = gridIndex.getGridRecords(); if (gridList == null) { return null; } for (GridRecord grid : gridList) { GempakGridRecord gh = (GempakGridRecord) grid; if (gh.param.trim().equals(parm)) { return gh; ...
java
public GempakGridRecord findGrid(String parm) { List<GridRecord> gridList = gridIndex.getGridRecords(); if (gridList == null) { return null; } for (GridRecord grid : gridList) { GempakGridRecord gh = (GempakGridRecord) grid; if (gh.param.trim().equals(parm)) { return gh; ...
[ "public", "GempakGridRecord", "findGrid", "(", "String", "parm", ")", "{", "List", "<", "GridRecord", ">", "gridList", "=", "gridIndex", ".", "getGridRecords", "(", ")", ";", "if", "(", "gridList", "==", "null", ")", "{", "return", "null", ";", "}", "for...
Find the first grid with this name @param parm name of grid @return the grid header or null
[ "Find", "the", "first", "grid", "with", "this", "name" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java#L350-L362
test
Find a grid by parameter name
Of course, here is the Java code you requested: ```java public GempakGridRecord findGrid(String parm) { List<GridRecord> gridList = gridIndex.getGridRecords(); if (gridList == null) { return null; } for (GridRecord grid : gridList) { GempakGridRecord gh = (GempakGridRecord) grid; if (...
Unidata/thredds
opendap/src/main/java/opendap/servers/parsers/Celex.java
Celex.yylex
public int yylex() throws ParseException { int token; int c; token = 0; yytext.setLength(0); /* invariant: p always points to current char */ try { token = -1; while(token < 0) { if((c = read()) <= 0) break; ...
java
public int yylex() throws ParseException { int token; int c; token = 0; yytext.setLength(0); /* invariant: p always points to current char */ try { token = -1; while(token < 0) { if((c = read()) <= 0) break; ...
[ "public", "int", "yylex", "(", ")", "throws", "ParseException", "{", "int", "token", ";", "int", "c", ";", "token", "=", "0", ";", "yytext", ".", "setLength", "(", "0", ")", ";", "/* invariant: p always points to current char */", "try", "{", "token", "=", ...
/* This is part of the Lexer interface
[ "/", "*", "This", "is", "part", "of", "the", "Lexer", "interface" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/parsers/Celex.java#L145-L284
test
yylex - > yylex
Of course, here is the Java code you requested: ```java public int yylex() throws ParseException { int token; int c; token = 0; yytext.setLength(0); /* invariant: p always points to current char */ try { token = -1; while(token < ...
basis-technology-corp/tcl-regex-java
src/main/java/com/basistech/tclre/Compiler.java
Compiler.makesearch
private void makesearch(Nfa nfa) { Arc a; Arc b; State pre = nfa.pre; State s; State s2; State slist; /* no loops are needed if it's anchored */ for (a = pre.outs; a != null; a = a.outchain) { assert a.type == PLAIN; if (a.co != nfa.bo...
java
private void makesearch(Nfa nfa) { Arc a; Arc b; State pre = nfa.pre; State s; State s2; State slist; /* no loops are needed if it's anchored */ for (a = pre.outs; a != null; a = a.outchain) { assert a.type == PLAIN; if (a.co != nfa.bo...
[ "private", "void", "makesearch", "(", "Nfa", "nfa", ")", "{", "Arc", "a", ";", "Arc", "b", ";", "State", "pre", "=", "nfa", ".", "pre", ";", "State", "s", ";", "State", "s2", ";", "State", "slist", ";", "/* no loops are needed if it's anchored */", "for"...
makesearch - turn an NFA into a search NFA (implicit prepend of .*?) NFA must have been optimize()d already.
[ "makesearch", "-", "turn", "an", "NFA", "into", "a", "search", "NFA", "(", "implicit", "prepend", "of", ".", "*", "?", ")", "NFA", "must", "have", "been", "optimize", "()", "d", "already", "." ]
de0d5eaccf9a61b694cb8793f234cc229c395b43
https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Compiler.java#L299-L366
test
makeearch is the first time we make a new arc.
Of course, here is the Java code you requested: ```java private void makesearch(Nfa nfa) { Arc a; Arc b; State pre = nfa.pre; State s; State s2; State slist; /* no loops are needed if it's anchored */ for (a = pre.outs; a != null; a = a.outchain) { ...
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/dom/Node.java
Node.getTextContent
public String getTextContent() { StringBuilder sb = new StringBuilder(getChildNodesCount() + 1); appendTextContent(sb); return sb.toString(); }
java
public String getTextContent() { StringBuilder sb = new StringBuilder(getChildNodesCount() + 1); appendTextContent(sb); return sb.toString(); }
[ "public", "String", "getTextContent", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "getChildNodesCount", "(", ")", "+", "1", ")", ";", "appendTextContent", "(", "sb", ")", ";", "return", "sb", ".", "toString", "(", ")", ";", "}...
Returns the text content of this node and its descendants. @see #appendTextContent(Appendable)
[ "Returns", "the", "text", "content", "of", "this", "node", "and", "its", "descendants", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/Node.java#L1049-L1053
test
Get the text content of the node.
Of course, here is the Java code you requested: ```java public String getTextContent() { StringBuilder sb = new StringBuilder(getChildNodesCount() + 1); appendTextContent(sb); return sb.toString(); } ``` Hope this helps!
alipay/sofa-bolt
src/main/java/com/alipay/remoting/util/RemotingUtil.java
RemotingUtil.parseRemotePort
public static int parseRemotePort(final Channel channel) { if (null == channel) { return -1; } final InetSocketAddress remote = (InetSocketAddress) channel.remoteAddress(); if (remote != null) { return remote.getPort(); } return -1; }
java
public static int parseRemotePort(final Channel channel) { if (null == channel) { return -1; } final InetSocketAddress remote = (InetSocketAddress) channel.remoteAddress(); if (remote != null) { return remote.getPort(); } return -1; }
[ "public", "static", "int", "parseRemotePort", "(", "final", "Channel", "channel", ")", "{", "if", "(", "null", "==", "channel", ")", "{", "return", "-", "1", ";", "}", "final", "InetSocketAddress", "remote", "=", "(", "InetSocketAddress", ")", "channel", "...
Parse the remote host port of the channel. @param channel @return int
[ "Parse", "the", "remote", "host", "port", "of", "the", "channel", "." ]
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/util/RemotingUtil.java#L120-L129
test
Parse the remote port from the channel.
Of course, here is the Java code you requested: ```java public static int parseRemotePort(final Channel channel) { if (null == channel) { return -1; } final InetSocketAddress remote = (InetSocketAddress) channel.remoteAddress(); if (remote != null) { return remot...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/config/EncoderConfig.java
EncoderConfig.defaultContentCharset
public EncoderConfig defaultContentCharset(Charset charset) { String charsetAsString = notNull(charset, Charset.class).toString(); return new EncoderConfig(charsetAsString, defaultQueryParameterCharset, shouldAppendDefaultContentCharsetToContentTypeIfUndefined, contentEncoders, contentTypeToDefaultChars...
java
public EncoderConfig defaultContentCharset(Charset charset) { String charsetAsString = notNull(charset, Charset.class).toString(); return new EncoderConfig(charsetAsString, defaultQueryParameterCharset, shouldAppendDefaultContentCharsetToContentTypeIfUndefined, contentEncoders, contentTypeToDefaultChars...
[ "public", "EncoderConfig", "defaultContentCharset", "(", "Charset", "charset", ")", "{", "String", "charsetAsString", "=", "notNull", "(", "charset", ",", "Charset", ".", "class", ")", ".", "toString", "(", ")", ";", "return", "new", "EncoderConfig", "(", "cha...
Specify the default charset for the body/content in the request specification @param charset The charset to use. @return A new instance of {@link EncoderConfig}
[ "Specify", "the", "default", "charset", "for", "the", "body", "/", "content", "in", "the", "request", "specification" ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/config/EncoderConfig.java#L190-L193
test
Default content charset.
Of course, here is the Java code you requested: ```java public EncoderConfig defaultContentCharset(Charset charset) { String charsetAsString = notNull(charset, Charset.class).toString(); return new EncoderConfig(charsetAsString, defaultQueryParameterCharset, shouldAppendDefaultContentCharsetToContentTy...
orientechnologies/orientdb
object/src/main/java/com/orientechnologies/orient/object/db/OrientDBObject.java
OrientDBObject.open
public ODatabaseObject open(String name, String user, String password) { return new OObjectDatabaseTx((ODatabaseDocumentInternal) orientDB.open(name, user, password)); }
java
public ODatabaseObject open(String name, String user, String password) { return new OObjectDatabaseTx((ODatabaseDocumentInternal) orientDB.open(name, user, password)); }
[ "public", "ODatabaseObject", "open", "(", "String", "name", ",", "String", "user", ",", "String", "password", ")", "{", "return", "new", "OObjectDatabaseTx", "(", "(", "ODatabaseDocumentInternal", ")", "orientDB", ".", "open", "(", "name", ",", "user", ",", ...
Open a database specified by name using the username and password if needed @param name of the database to open @param user the username allowed to open the database @param password related to the specified username @return the opened database
[ "Open", "a", "database", "specified", "by", "name", "using", "the", "username", "and", "password", "if", "needed" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/object/src/main/java/com/orientechnologies/orient/object/db/OrientDBObject.java#L160-L162
test
Open a new database object.
Of course, here is the Java code you requested: ```java public ODatabaseObject open(String name, String user, String password) { return new OObjectDatabaseTx((ODatabaseDocumentInternal) orientDB.open(name, user, password)); } ``` Hope this helps!
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/ferry/JNILibrary.java
JNILibrary.deleteTemporaryFiles
private static void deleteTemporaryFiles() { final File dir = getTmpDir(); final FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(HUMBLE_TEMP_EXTENSION); } }; final File markers[] = dir.listFiles(filter); for (File...
java
private static void deleteTemporaryFiles() { final File dir = getTmpDir(); final FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(HUMBLE_TEMP_EXTENSION); } }; final File markers[] = dir.listFiles(filter); for (File...
[ "private", "static", "void", "deleteTemporaryFiles", "(", ")", "{", "final", "File", "dir", "=", "getTmpDir", "(", ")", ";", "final", "FilenameFilter", "filter", "=", "new", "FilenameFilter", "(", ")", "{", "public", "boolean", "accept", "(", "File", "dir", ...
Finds all ".humble" temp files in the temp directory and nukes them.
[ "Finds", "all", ".", "humble", "temp", "files", "in", "the", "temp", "directory", "and", "nukes", "them", "." ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/JNILibrary.java#L332-L348
test
Delete temporary files.
Of course, here is the Java code you requested: ```java private static void deleteTemporaryFiles() { final File dir = getTmpDir(); final FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(HUMBLE_TEMP_EXTENSION); } }; fi...
RestComm/jain-slee
container/events/src/main/java/org/mobicents/slee/container/event/LazyStoredEventContext.java
LazyStoredEventContext.getEventContextHandle
public EventContextHandle getEventContextHandle() { if (handle == null) { handle = new EventContextHandleImpl(factory.getSleeContainer().getUuidGenerator().createUUID()); factory.getDataSource().addEventContext(handle, this); } return handle; }
java
public EventContextHandle getEventContextHandle() { if (handle == null) { handle = new EventContextHandleImpl(factory.getSleeContainer().getUuidGenerator().createUUID()); factory.getDataSource().addEventContext(handle, this); } return handle; }
[ "public", "EventContextHandle", "getEventContextHandle", "(", ")", "{", "if", "(", "handle", "==", "null", ")", "{", "handle", "=", "new", "EventContextHandleImpl", "(", "factory", ".", "getSleeContainer", "(", ")", ".", "getUuidGenerator", "(", ")", ".", "cre...
/* (non-Javadoc) @see org.mobicents.slee.container.event.EventContext#getEventContextHandle()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/events/src/main/java/org/mobicents/slee/container/event/LazyStoredEventContext.java#L49-L55
test
Gets the handle of the EventContext.
Of course, here is the Java code you requested: ```java public EventContextHandle getEventContextHandle() { if (handle == null) { handle = new EventContextHandleImpl(factory.getSleeContainer().getUuidGenerator().createUUID()); factory.getDataSource().addEventContext(handle, this); } return handle; } ``` ...
playframework/playframework
web/play-java-forms/src/main/java/play/data/Form.java
Form.bind
public Form<T> bind(Lang lang, TypedMap attrs, JsonNode data, String... allowedFields) { return bind( lang, attrs, play.libs.Scala.asJava( play.api.data.FormUtils.fromJson( "", play.api.libs.json.Json.parse(play.libs.Json.stringify(data)))), allowedFields)...
java
public Form<T> bind(Lang lang, TypedMap attrs, JsonNode data, String... allowedFields) { return bind( lang, attrs, play.libs.Scala.asJava( play.api.data.FormUtils.fromJson( "", play.api.libs.json.Json.parse(play.libs.Json.stringify(data)))), allowedFields)...
[ "public", "Form", "<", "T", ">", "bind", "(", "Lang", "lang", ",", "TypedMap", "attrs", ",", "JsonNode", "data", ",", "String", "...", "allowedFields", ")", "{", "return", "bind", "(", "lang", ",", "attrs", ",", "play", ".", "libs", ".", "Scala", "."...
Binds Json data to this form - that is, handles form submission. @param lang used for validators and formatters during binding and is part of {@link ValidationPayload}. Later also used for formatting when retrieving a field (via {@link #field(String)} or {@link #apply(String)}) and for translations in {@link #errorsAs...
[ "Binds", "Json", "data", "to", "this", "form", "-", "that", "is", "handles", "form", "submission", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/web/play-java-forms/src/main/java/play/data/Form.java#L785-L793
test
Bind a form to a CRUD record.
Of course, here is the Java code you requested: ```java public Form<T> bind(Lang lang, TypedMap attrs, JsonNode data, String... allowedFields) { return bind( lang, attrs, play.libs.Scala.asJava( play.api.data.FormUtils.fromJson( "", play.api.libs.json.Json.parse(...