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
alipay/sofa-bolt
src/main/java/com/alipay/remoting/rpc/RpcClient.java
RpcClient.enableConnHeartbeat
public void enableConnHeartbeat(String addr) { Url url = this.addressParser.parse(addr); this.enableConnHeartbeat(url); }
java
public void enableConnHeartbeat(String addr) { Url url = this.addressParser.parse(addr); this.enableConnHeartbeat(url); }
[ "public", "void", "enableConnHeartbeat", "(", "String", "addr", ")", "{", "Url", "url", "=", "this", ".", "addressParser", ".", "parse", "(", "addr", ")", ";", "this", ".", "enableConnHeartbeat", "(", "url", ")", ";", "}" ]
Enable heart beat for a certain connection. If this address not connected, then do nothing. <p> Notice: this method takes no effect on a stand alone connection. @param addr
[ "Enable", "heart", "beat", "for", "a", "certain", "connection", ".", "If", "this", "address", "not", "connected", "then", "do", "nothing", ".", "<p", ">", "Notice", ":", "this", "method", "takes", "no", "effect", "on", "a", "stand", "alone", "connection", ...
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcClient.java#L832-L835
test
Enable a connection heartbeat for a given address.
Of course, here is the Java code you requested: ```java public void enableConnHeartbeat(String addr) { Url url = this.addressParser.parse(addr); this.enableConnHeartbeat(url); } ``` Hope this helps!
ieb/sparsemapcontent
core/src/main/java/org/sakaiproject/nakamura/lite/storage/spi/types/Types.java
Types.loadFromStream
public static void loadFromStream(String key, Map<String, Object> output, InputStream binaryStream, String type) throws IOException { DataInputStream dis = new DataInputStream(binaryStream); String ckey = dis.readUTF(); if (!key.equals(ckey)) { throw new IOException("Body...
java
public static void loadFromStream(String key, Map<String, Object> output, InputStream binaryStream, String type) throws IOException { DataInputStream dis = new DataInputStream(binaryStream); String ckey = dis.readUTF(); if (!key.equals(ckey)) { throw new IOException("Body...
[ "public", "static", "void", "loadFromStream", "(", "String", "key", ",", "Map", "<", "String", ",", "Object", ">", "output", ",", "InputStream", "binaryStream", ",", "String", "type", ")", "throws", "IOException", "{", "DataInputStream", "dis", "=", "new", "...
Load a Map from binary stream @param output @param binaryStream @throws IOException
[ "Load", "a", "Map", "from", "binary", "stream" ]
0570fdf868adbbf7734790cbc09fe66480e5f2dc
https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/core/src/main/java/org/sakaiproject/nakamura/lite/storage/spi/types/Types.java#L117-L139
test
Load a single record from the given stream.
Of course, here is the Java code you requested: ```java public static void loadFromStream(String key, Map<String, Object> output, InputStream binaryStream, String type) throws IOException { DataInputStream dis = new DataInputStream(binaryStream); String ckey = dis.readUTF(); if (!ke...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java
ClassWriter.getCommonSuperClass
protected String getCommonSuperClass(final String type1, final String type2) { ClassLoader classLoader = getClassLoader(); Class<?> class1; try { class1 = Class.forName(type1.replace('/', '.'), false, classLoader); } catch (ClassNotFoundException e) { throw new TypeNotPresentException(type1,...
java
protected String getCommonSuperClass(final String type1, final String type2) { ClassLoader classLoader = getClassLoader(); Class<?> class1; try { class1 = Class.forName(type1.replace('/', '.'), false, classLoader); } catch (ClassNotFoundException e) { throw new TypeNotPresentException(type1,...
[ "protected", "String", "getCommonSuperClass", "(", "final", "String", "type1", ",", "final", "String", "type2", ")", "{", "ClassLoader", "classLoader", "=", "getClassLoader", "(", ")", ";", "Class", "<", "?", ">", "class1", ";", "try", "{", "class1", "=", ...
Returns the common super type of the two given types. The default implementation of this method <i>loads</i> the two given classes and uses the java.lang.Class methods to find the common super class. It can be overridden to compute this common super type in other ways, in particular without actually loading any class, ...
[ "Returns", "the", "common", "super", "type", "of", "the", "two", "given", "types", ".", "The", "default", "implementation", "of", "this", "method", "<i", ">", "loads<", "/", "i", ">", "the", "two", "given", "classes", "and", "uses", "the", "java", ".", ...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java#L945-L973
test
Get the common super class name.
Of course, here is the Java code you requested: ```java protected String getCommonSuperClass(final String type1, final String type2) { ClassLoader classLoader = getClassLoader(); Class<?> class1; try { class1 = Class.forName(type1.replace('/', '.'), false, classLoader); } catch (ClassNotFoundExce...
ReactiveX/RxJava
src/main/java/io/reactivex/Notification.java
Notification.createOnNext
@NonNull public static <T> Notification<T> createOnNext(@NonNull T value) { ObjectHelper.requireNonNull(value, "value is null"); return new Notification<T>(value); }
java
@NonNull public static <T> Notification<T> createOnNext(@NonNull T value) { ObjectHelper.requireNonNull(value, "value is null"); return new Notification<T>(value); }
[ "@", "NonNull", "public", "static", "<", "T", ">", "Notification", "<", "T", ">", "createOnNext", "(", "@", "NonNull", "T", "value", ")", "{", "ObjectHelper", ".", "requireNonNull", "(", "value", ",", "\"value is null\"", ")", ";", "return", "new", "Notifi...
Constructs an onNext notification containing the given value. @param <T> the value type @param value the value to carry around in the notification, not null @return the new Notification instance @throws NullPointerException if value is null
[ "Constructs", "an", "onNext", "notification", "containing", "the", "given", "value", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Notification.java#L128-L132
test
Creates a new notification on next.
Of course, here is the Java code you requested: ```java @NonNull public static <T> Notification<T> createOnNext(@NonNull T value) { ObjectHelper.requireNonNull(value, "value is null"); return new Notification<T>(value); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java
TrovitUtils.parseBooleanValue
public static Boolean parseBooleanValue(String value) { value = StringUtils.lowerCase(StringUtils.trimToEmpty(value), Locale.ENGLISH); switch (value) { case "true": case "yes": case "si": case "1": return Boolean.TRUE; case "fa...
java
public static Boolean parseBooleanValue(String value) { value = StringUtils.lowerCase(StringUtils.trimToEmpty(value), Locale.ENGLISH); switch (value) { case "true": case "yes": case "si": case "1": return Boolean.TRUE; case "fa...
[ "public", "static", "Boolean", "parseBooleanValue", "(", "String", "value", ")", "{", "value", "=", "StringUtils", ".", "lowerCase", "(", "StringUtils", ".", "trimToEmpty", "(", "value", ")", ",", "Locale", ".", "ENGLISH", ")", ";", "switch", "(", "value", ...
Read a {@link Boolean} value from XML. @param value XML string @return parsed value or null, if the value is invalid
[ "Read", "a", "{", "@link", "Boolean", "}", "value", "from", "XML", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java#L239-L256
test
Parse a boolean value.
Of course, here is the Java code you requested: ```java public static Boolean parseBooleanValue(String value) { value = StringUtils.lowerCase(StringUtils.trimToEmpty(value), Locale.ENGLISH); switch (value) { case "true": case "yes": case "si": case "1": ...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/GeometryMath_F64.java
GeometryMath_F64.toTuple3D
public static void toTuple3D(DMatrixRMaj in, GeoTuple3D_F64 out) { out.x = (double)in.get(0); out.y = (double)in.get(1); out.z = (double)in.get(2); }
java
public static void toTuple3D(DMatrixRMaj in, GeoTuple3D_F64 out) { out.x = (double)in.get(0); out.y = (double)in.get(1); out.z = (double)in.get(2); }
[ "public", "static", "void", "toTuple3D", "(", "DMatrixRMaj", "in", ",", "GeoTuple3D_F64", "out", ")", "{", "out", ".", "x", "=", "(", "double", ")", "in", ".", "get", "(", "0", ")", ";", "out", ".", "y", "=", "(", "double", ")", "in", ".", "get",...
Converts a DMatrixRMaj into GeoTuple3D_F64 @param in Input matrix @param out Output vector.
[ "Converts", "a", "DMatrixRMaj", "into", "GeoTuple3D_F64" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/GeometryMath_F64.java#L902-L907
test
Converts a 3D matrix into a GeoTuple_F64.
Of course, here is the Java code you requested: ```java public static void toTuple3D(DMatrixRMaj in, GeoTuple3D_F64 out) { out.x = (double)in.get(0); out.y = (double)in.get(1); out.z = (double)in.get(2); } ``` Hope this helps!
boonproject/boon
boon/src/main/java/org/boon/messages/MessageSpecification.java
MessageSpecification.keysToValues
private Object[] keysToValues( List<String> argKeys ) { List<String> values = new ArrayList<>(); for ( String key : argKeys ) { values.add( getMessage( key ) ); } return values.toArray(); }
java
private Object[] keysToValues( List<String> argKeys ) { List<String> values = new ArrayList<>(); for ( String key : argKeys ) { values.add( getMessage( key ) ); } return values.toArray(); }
[ "private", "Object", "[", "]", "keysToValues", "(", "List", "<", "String", ">", "argKeys", ")", "{", "List", "<", "String", ">", "values", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "String", "key", ":", "argKeys", ")", "{", "values", ...
Convert the keys to values.
[ "Convert", "the", "keys", "to", "values", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/messages/MessageSpecification.java#L191-L197
test
Get a list of values for a list of keys.
Of course, here is the Java code you requested: ```java private Object[] keysToValues( List<String> argKeys ) { List<String> values = new ArrayList<>(); for ( String key : argKeys ) { values.add( getMessage( key ) ); } return values.toArray(); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
NetcdfDataset.openDataset
static public NetcdfDataset openDataset(String location, boolean enhance, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException { DatasetUrl durl = DatasetUrl.findDatasetUrl(location); return openDataset(durl, enhance ? defaultEnhanceMode : null, buffer_size, cancelTask, spi...
java
static public NetcdfDataset openDataset(String location, boolean enhance, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException { DatasetUrl durl = DatasetUrl.findDatasetUrl(location); return openDataset(durl, enhance ? defaultEnhanceMode : null, buffer_size, cancelTask, spi...
[ "static", "public", "NetcdfDataset", "openDataset", "(", "String", "location", ",", "boolean", "enhance", ",", "int", "buffer_size", ",", "ucar", ".", "nc2", ".", "util", ".", "CancelTask", "cancelTask", ",", "Object", "spiObject", ")", "throws", "IOException", ...
Factory method for opening a dataset through the netCDF API, and identifying its coordinate variables. @param location location of file @param enhance if true, use defaultEnhanceMode, else no enhancements @param buffer_size RandomAccessFile buffer size, if <= 0, use default size @param cancelTask allow task to...
[ "Factory", "method", "for", "opening", "a", "dataset", "through", "the", "netCDF", "API", "and", "identifying", "its", "coordinate", "variables", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java#L358-L361
test
Opens a NetcdfDataset from a location.
Of course, here is the Java code you requested: ```java static public NetcdfDataset openDataset(String location, boolean enhance, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException { DatasetUrl durl = DatasetUrl.findDatasetUrl(location); return openDataset(durl, enhance ...
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java
ODistributedConfiguration.getAllConfiguredServers
public Set<String> getAllConfiguredServers() { final Set<String> servers = new HashSet<String>(); for (String p : getClusterNames()) { final List<String> serverList = getClusterConfiguration(p).field(SERVERS); if (serverList != null) { for (String s : serverList) if (!s.equals(NE...
java
public Set<String> getAllConfiguredServers() { final Set<String> servers = new HashSet<String>(); for (String p : getClusterNames()) { final List<String> serverList = getClusterConfiguration(p).field(SERVERS); if (serverList != null) { for (String s : serverList) if (!s.equals(NE...
[ "public", "Set", "<", "String", ">", "getAllConfiguredServers", "(", ")", "{", "final", "Set", "<", "String", ">", "servers", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "for", "(", "String", "p", ":", "getClusterNames", "(", ")", ")", ...
Returns the complete list of servers found in configuration.
[ "Returns", "the", "complete", "list", "of", "servers", "found", "in", "configuration", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java#L399-L412
test
Get all configured servers.
Of course, here is the Java code you requested: ```java public Set<String> getAllConfiguredServers() { final Set<String> servers = new HashSet<String>(); for (String p : getClusterNames()) { final List<String> serverList = getClusterConfiguration(p).field(SERVERS); if (serverList != null) { ...
playframework/playframework
core/play/src/main/java/play/i18n/MessagesApi.java
MessagesApi.get
public String get(play.api.i18n.Lang lang, String key, Object... args) { Seq<Object> scalaArgs = convertArgsToScalaBuffer(args); return messages.apply(key, scalaArgs, lang); }
java
public String get(play.api.i18n.Lang lang, String key, Object... args) { Seq<Object> scalaArgs = convertArgsToScalaBuffer(args); return messages.apply(key, scalaArgs, lang); }
[ "public", "String", "get", "(", "play", ".", "api", ".", "i18n", ".", "Lang", "lang", ",", "String", "key", ",", "Object", "...", "args", ")", "{", "Seq", "<", "Object", ">", "scalaArgs", "=", "convertArgsToScalaBuffer", "(", "args", ")", ";", "return"...
Translates a message. <p>Uses `java.text.MessageFormat` internally to format the message. @param lang the message lang @param key the message key @param args the message arguments @return the formatted message or a default rendering if the key wasn't defined
[ "Translates", "a", "message", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/i18n/MessagesApi.java#L79-L82
test
Get a message from the cache.
Of course, here is the Java code you requested: ```java public String get(play.api.i18n.Lang lang, String key, Object... args) { Seq<Object> scalaArgs = convertArgsToScalaBuffer(args); return messages.apply(key, scalaArgs, lang); } ``` Hope this helps!
RestComm/jain-slee
container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/SbbEntityImpl.java
SbbEntityImpl.invokeEventHandler
public void invokeEventHandler(EventContext sleeEvent, ActivityContext ac, EventContext eventContextImpl) throws Exception { // get event handler method final SbbComponent sbbComponent = getSbbComponent(); final EventHandlerMethod eventHandlerMethod = sbbComponent .getEventHandlerMethods().get(sleeEven...
java
public void invokeEventHandler(EventContext sleeEvent, ActivityContext ac, EventContext eventContextImpl) throws Exception { // get event handler method final SbbComponent sbbComponent = getSbbComponent(); final EventHandlerMethod eventHandlerMethod = sbbComponent .getEventHandlerMethods().get(sleeEven...
[ "public", "void", "invokeEventHandler", "(", "EventContext", "sleeEvent", ",", "ActivityContext", "ac", ",", "EventContext", "eventContextImpl", ")", "throws", "Exception", "{", "// get event handler method", "final", "SbbComponent", "sbbComponent", "=", "getSbbComponent", ...
/* (non-Javadoc) @see org.mobicents.slee.runtime.sbbentity.SbbEntity#invokeEventHandler(org.mobicents.slee.core.event.SleeEvent, org.mobicents.slee.runtime.activity.ActivityContext, org.mobicents.slee.core.event.EventContext)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/SbbEntityImpl.java#L435-L528
test
Invoke the event handler method
Of course, here is the Java code you requested: ```java public void invokeEventHandler(EventContext sleeEvent, ActivityContext ac, EventContext eventContextImpl) throws Exception { // get event handler method final SbbComponent sbbComponent = getSbbComponent(); final EventHandlerMethod eventHandlerMethod ...
Unidata/thredds
cdm/src/main/java/ucar/ma2/MAVector.java
MAVector.dot
public double dot(MAVector v) { if (nelems != v.getNelems()) throw new IllegalArgumentException("MAVector.dot "+nelems+" != "+ v.getNelems()); double sum = 0.0; for (int k=0; k<nelems; k++) sum += getDouble(k) * v.getDouble(k); return sum; }
java
public double dot(MAVector v) { if (nelems != v.getNelems()) throw new IllegalArgumentException("MAVector.dot "+nelems+" != "+ v.getNelems()); double sum = 0.0; for (int k=0; k<nelems; k++) sum += getDouble(k) * v.getDouble(k); return sum; }
[ "public", "double", "dot", "(", "MAVector", "v", ")", "{", "if", "(", "nelems", "!=", "v", ".", "getNelems", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"MAVector.dot \"", "+", "nelems", "+", "\" != \"", "+", "v", ".", "getNelems", ...
Dot product of 2 vectors @param v dot product with this vector @return double result: dot product @exception IllegalArgumentException if nelems != v.getNelems().
[ "Dot", "product", "of", "2", "vectors" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/MAVector.java#L86-L96
test
Dot product of this vector and another vector.
Of course, here is the Java code you requested: ```java public double dot(MAVector v) { if (nelems != v.getNelems()) throw new IllegalArgumentException("MAVector.dot "+nelems+" != "+ v.getNelems()); double sum = 0.0; for (int k=0; k<nelems; k++) sum += getDouble(k) * v.getDouble(k); retu...
streamsets/datacollector
kinesis-lib/src/main/java/com/streamsets/pipeline/stage/origin/kinesis/StreamSetsRecordProcessor.java
StreamSetsRecordProcessor.processRecords
@Override public void processRecords(ProcessRecordsInput processRecordsInput) { LOG.debug("RecordProcessor processRecords called"); try { IRecordProcessorCheckpointer checkpointer = processRecordsInput.getCheckpointer(); startBatch(); Optional<Record> lastProcessedRecord = Optional.empty();...
java
@Override public void processRecords(ProcessRecordsInput processRecordsInput) { LOG.debug("RecordProcessor processRecords called"); try { IRecordProcessorCheckpointer checkpointer = processRecordsInput.getCheckpointer(); startBatch(); Optional<Record> lastProcessedRecord = Optional.empty();...
[ "@", "Override", "public", "void", "processRecords", "(", "ProcessRecordsInput", "processRecordsInput", ")", "{", "LOG", ".", "debug", "(", "\"RecordProcessor processRecords called\"", ")", ";", "try", "{", "IRecordProcessorCheckpointer", "checkpointer", "=", "processReco...
{@inheritDoc}
[ "{" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/kinesis-lib/src/main/java/com/streamsets/pipeline/stage/origin/kinesis/StreamSetsRecordProcessor.java#L101-L151
test
Process records.
Of course, here is the Java code you requested: ```java @Override public void processRecords(ProcessRecordsInput processRecordsInput) { LOG.debug("RecordProcessor processRecords called"); try { IRecordProcessorCheckpointer checkpointer = processRecordsInput.getCheckpointer(); startBatch(); ...
jboss/jboss-common-core
src/main/java/org/jboss/net/protocol/file/FileURLLister.java
FileURLLister.listFiles
private void listFiles(final URL baseUrl, final URLFilter filter, boolean scanNonDottedSubDirs, ArrayList<URL> resultList) throws IOException { // List the files at the current dir level, using the provided filter final File baseDir = new File(baseUrl.getPath()); String[] filenames = ba...
java
private void listFiles(final URL baseUrl, final URLFilter filter, boolean scanNonDottedSubDirs, ArrayList<URL> resultList) throws IOException { // List the files at the current dir level, using the provided filter final File baseDir = new File(baseUrl.getPath()); String[] filenames = ba...
[ "private", "void", "listFiles", "(", "final", "URL", "baseUrl", ",", "final", "URLFilter", "filter", ",", "boolean", "scanNonDottedSubDirs", ",", "ArrayList", "<", "URL", ">", "resultList", ")", "throws", "IOException", "{", "// List the files at the current dir level...
Starting from baseUrl, that should point to a directory, populate the resultList with the contents that pass the filter (in the form of URLs) and possibly recurse into subdris not containing a '.' in their name.
[ "Starting", "from", "baseUrl", "that", "should", "point", "to", "a", "directory", "populate", "the", "resultList", "with", "the", "contents", "that", "pass", "the", "filter", "(", "in", "the", "form", "of", "URLs", ")", "and", "possibly", "recurse", "into", ...
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/net/protocol/file/FileURLLister.java#L85-L145
test
List all the files at the current directory level using the provided URLFilter.
Of course, here is the Java code you requested: ```java private void listFiles(final URL baseUrl, final URLFilter filter, boolean scanNonDottedSubDirs, ArrayList<URL> resultList) throws IOException { // List the files at the current dir level, using the provided filter final File baseDir = n...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.fromArray
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull public static <T> Observable<T> fromArray(T... items) { ObjectHelper.requireNonNull(items, "items is null"); if (items.length == 0) { return empty(); } else if (items.length == 1) { re...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull public static <T> Observable<T> fromArray(T... items) { ObjectHelper.requireNonNull(items, "items is null"); if (items.length == 0) { return empty(); } else if (items.length == 1) { re...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "@", "NonNull", "public", "static", "<", "T", ">", "Observable", "<", "T", ">", "fromArray", "(", "T", "...", "items", ")", "{", "ObjectHelper", ".", "requireNonNull...
Converts an Array into an ObservableSource that emits the items in the Array. <p> <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/from.png" alt=""> <dl> <dt><b>Scheduler:</b></dt> <dd>{@code fromArray} does not operate by default on a particular {@link Scheduler}.</dd...
[ "Converts", "an", "Array", "into", "an", "ObservableSource", "that", "emits", "the", "items", "in", "the", "Array", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "315", "src", "=", "https", ":", "//", "raw", ".", "github", ".", "com", "...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L1761-L1773
test
Creates an observable from an array of items.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull public static <T> Observable<T> fromArray(T... items) { ObjectHelper.requireNonNull(items, "items is null"); if (items.length == 0) { return empty(); ...
apache/parquet-mr
parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java
ParquetMetadataConverter.filterFileMetaDataByStart
static FileMetaData filterFileMetaDataByStart(FileMetaData metaData, OffsetMetadataFilter filter) { List<RowGroup> rowGroups = metaData.getRow_groups(); List<RowGroup> newRowGroups = new ArrayList<RowGroup>(); for (RowGroup rowGroup : rowGroups) { long startIndex = getOffset(rowGroup.getColumns().get(...
java
static FileMetaData filterFileMetaDataByStart(FileMetaData metaData, OffsetMetadataFilter filter) { List<RowGroup> rowGroups = metaData.getRow_groups(); List<RowGroup> newRowGroups = new ArrayList<RowGroup>(); for (RowGroup rowGroup : rowGroups) { long startIndex = getOffset(rowGroup.getColumns().get(...
[ "static", "FileMetaData", "filterFileMetaDataByStart", "(", "FileMetaData", "metaData", ",", "OffsetMetadataFilter", "filter", ")", "{", "List", "<", "RowGroup", ">", "rowGroups", "=", "metaData", ".", "getRow_groups", "(", ")", ";", "List", "<", "RowGroup", ">", ...
Visible for testing
[ "Visible", "for", "testing" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java#L1110-L1121
test
Filter the file metadata by the start of the file
Of course, here is the Java code you requested: ```java static FileMetaData filterFileMetaDataByStart(FileMetaData metaData, OffsetMetadataFilter filter) { List<RowGroup> rowGroups = metaData.getRow_groups(); List<RowGroup> newRowGroups = new ArrayList<RowGroup>(); for (RowGroup rowGroup : rowGroups) { ...
cologneintelligence/FitGoodies
fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/typehandler/StringBuilderTypeHandler.java
StringBuilderTypeHandler.unsafeEquals
@Override public final boolean unsafeEquals(final StringBuilder a, Object b) { return a.toString().trim().equals(b.toString().trim()); }
java
@Override public final boolean unsafeEquals(final StringBuilder a, Object b) { return a.toString().trim().equals(b.toString().trim()); }
[ "@", "Override", "public", "final", "boolean", "unsafeEquals", "(", "final", "StringBuilder", "a", ",", "Object", "b", ")", "{", "return", "a", ".", "toString", "(", ")", ".", "trim", "(", ")", ".", "equals", "(", "b", ".", "toString", "(", ")", ".",...
Checks whether two StringBuilder {@code a} and {@code b} are equal. <p> This method removes whitespaces around both strings first. @param a first StringBuilder @param b second StringBuilder @return true if they are equal or both are null, false otherwise
[ "Checks", "whether", "two", "StringBuilder", "{", "@code", "a", "}", "and", "{", "@code", "b", "}", "are", "equal", ".", "<p", ">", "This", "method", "removes", "whitespaces", "around", "both", "strings", "first", "." ]
834e42d1f41b4b9226060b1e83a80cc69ea88c7b
https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/typehandler/StringBuilderTypeHandler.java#L58-L61
test
Returns true if the StringBuilder s elements are equal.
Of course, here is the Java code you requested: ```java @Override public final boolean unsafeEquals(final StringBuilder a, Object b) { return a.toString().trim().equals(b.toString().trim()); } ``` Hope this helps!
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.allEntrySet
public FilterableSet<Entry<K,V>> allEntrySet() { if (setOfAllEntries == null) { setOfAllEntries = new AbstractFilterableSet<Entry<K,V>>() { @Override public Iterator<Entry<K,V>> iterator() { return new TransactionalBidiTreeMapIterator<En...
java
public FilterableSet<Entry<K,V>> allEntrySet() { if (setOfAllEntries == null) { setOfAllEntries = new AbstractFilterableSet<Entry<K,V>>() { @Override public Iterator<Entry<K,V>> iterator() { return new TransactionalBidiTreeMapIterator<En...
[ "public", "FilterableSet", "<", "Entry", "<", "K", ",", "V", ">", ">", "allEntrySet", "(", ")", "{", "if", "(", "setOfAllEntries", "==", "null", ")", "{", "setOfAllEntries", "=", "new", "AbstractFilterableSet", "<", "Entry", "<", "K", ",", "V", ">", ">...
It is very rare that this method would be required. You probably want to use entrySet instead. This method returns all Entry's in this Map no matter what its transactional status. Returns a set view of the mappings contained in this map. Each element in the returned set is a Map.Entry. The set is backed by the map, so...
[ "It", "is", "very", "rare", "that", "this", "method", "would", "be", "required", ".", "You", "probably", "want", "to", "use", "entrySet", "instead", ".", "This", "method", "returns", "all", "Entry", "s", "in", "this", "Map", "no", "matter", "what", "its"...
1b638be51997eafac4d368c14f62a16624a08d3e
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2425-L2472
test
Returns a set of all entries in this BidiTreeMap.
Of course, here is the Java code you requested: ```java public FilterableSet<Entry<K,V>> allEntrySet() { if (setOfAllEntries == null) { setOfAllEntries = new AbstractFilterableSet<Entry<K,V>>() { @Override public Iterator<Entry<K,V>> iterator() { ...
Axway/iron
iron-core/src/main/java/io/axway/iron/core/internal/definition/DataTypeManager.java
DataTypeManager.getTypeConverter
@SuppressWarnings("unchecked") public <T> TypeConverter<T> getTypeConverter(Class<T> clazz) { TypeConverter<T> converter = (TypeConverter<T>) TYPE_CONVERTERS.get(clazz); if (converter == null) { converter = value -> (T) value; } return converter; }
java
@SuppressWarnings("unchecked") public <T> TypeConverter<T> getTypeConverter(Class<T> clazz) { TypeConverter<T> converter = (TypeConverter<T>) TYPE_CONVERTERS.get(clazz); if (converter == null) { converter = value -> (T) value; } return converter; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "TypeConverter", "<", "T", ">", "getTypeConverter", "(", "Class", "<", "T", ">", "clazz", ")", "{", "TypeConverter", "<", "T", ">", "converter", "=", "(", "TypeConverter", "<", ...
TODO very ugly fix
[ "TODO", "very", "ugly", "fix" ]
387ec6d43d2353f857d510dd29f93a06a8db9069
https://github.com/Axway/iron/blob/387ec6d43d2353f857d510dd29f93a06a8db9069/iron-core/src/main/java/io/axway/iron/core/internal/definition/DataTypeManager.java#L129-L137
test
Gets the type converter.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public <T> TypeConverter<T> getTypeConverter(Class<T> clazz) { TypeConverter<T> converter = (TypeConverter<T>) TYPE_CONVERTERS.get(clazz); if (converter == null) { converter = value -> (T) value; ...
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java
OrientEdge.getVertex
@Override public OrientVertex getVertex(final Direction direction) { final OrientBaseGraph graph = setCurrentGraphInThreadLocal(); if (direction.equals(Direction.OUT)) return graph.getVertex(getOutVertex()); else if (direction.equals(Direction.IN)) return graph.getVertex(getInVertex()); e...
java
@Override public OrientVertex getVertex(final Direction direction) { final OrientBaseGraph graph = setCurrentGraphInThreadLocal(); if (direction.equals(Direction.OUT)) return graph.getVertex(getOutVertex()); else if (direction.equals(Direction.IN)) return graph.getVertex(getInVertex()); e...
[ "@", "Override", "public", "OrientVertex", "getVertex", "(", "final", "Direction", "direction", ")", "{", "final", "OrientBaseGraph", "graph", "=", "setCurrentGraphInThreadLocal", "(", ")", ";", "if", "(", "direction", ".", "equals", "(", "Direction", ".", "OUT"...
Returns the connected incoming or outgoing vertex. @param direction Direction between IN or OUT
[ "Returns", "the", "connected", "incoming", "or", "outgoing", "vertex", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java#L158-L168
test
Get the vertex in the specified direction.
Of course, here is the Java code you requested: ```java @Override public OrientVertex getVertex(final Direction direction) { final OrientBaseGraph graph = setCurrentGraphInThreadLocal(); if (direction.equals(Direction.OUT)) return graph.getVertex(getOutVertex()); else if (direction.equals(Directio...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/geoloc/RubberbandRectangleHandles.java
RubberbandRectangleHandles.move
public void move(int deltax, int deltay) { lastPt.x = stretchedPt.x; lastPt.y = stretchedPt.y; Graphics2D g = (Graphics2D) component.getGraphics(); if(g != null) { try { g.setXORMode(component.getBackground()); if(firstStretch == true) firstStretch = false; ...
java
public void move(int deltax, int deltay) { lastPt.x = stretchedPt.x; lastPt.y = stretchedPt.y; Graphics2D g = (Graphics2D) component.getGraphics(); if(g != null) { try { g.setXORMode(component.getBackground()); if(firstStretch == true) firstStretch = false; ...
[ "public", "void", "move", "(", "int", "deltax", ",", "int", "deltay", ")", "{", "lastPt", ".", "x", "=", "stretchedPt", ".", "x", ";", "lastPt", ".", "y", "=", "stretchedPt", ".", "y", ";", "Graphics2D", "g", "=", "(", "Graphics2D", ")", "component",...
Erase the last rectangle and shift the rectangle and redraw deltax, deltay: position from original position
[ "Erase", "the", "last", "rectangle", "and", "shift", "the", "rectangle", "and", "redraw", "deltax", "deltay", ":", "position", "from", "original", "position" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/geoloc/RubberbandRectangleHandles.java#L32-L55
test
Move the component to the next position.
Of course, here is the Java code you requested: ```java public void move(int deltax, int deltay) { lastPt.x = stretchedPt.x; lastPt.y = stretchedPt.y; Graphics2D g = (Graphics2D) component.getGraphics(); if(g != null) { try { g.setXORMode(component.getBackground()); if(fir...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/state/BaseState.java
BaseState.removePropertyChangeListener
public void removePropertyChangeListener(String p, PropertyChangeListener l) { if (listeners == null) { return; } synchronized (listeners) { listeners.remove(l); } }
java
public void removePropertyChangeListener(String p, PropertyChangeListener l) { if (listeners == null) { return; } synchronized (listeners) { listeners.remove(l); } }
[ "public", "void", "removePropertyChangeListener", "(", "String", "p", ",", "PropertyChangeListener", "l", ")", "{", "if", "(", "listeners", "==", "null", ")", "{", "return", ";", "}", "synchronized", "(", "listeners", ")", "{", "listeners", ".", "remove", "(...
Removes the specified property change listener from the list of active listeners. @param p Ignored. In future will be used to name the specific property to remove the listener for. @param l The property change listener to remove.
[ "Removes", "the", "specified", "property", "change", "listener", "from", "the", "list", "of", "active", "listeners", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/state/BaseState.java#L127-L138
test
Removes a PropertyChangeListener from the list of listeners.
Of course, here is the Java code you requested: ```java public void removePropertyChangeListener(String p, PropertyChangeListener l) { if (listeners == null) { return; } synchronized (listeners) { listeners.remove(l); } } ``` Hope this h...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis2D.java
CoordinateAxis2D.makeYEdgesRotated
static public ArrayDouble.D2 makeYEdgesRotated(ArrayDouble.D2 midy) { int[] shape = midy.getShape(); int ny = shape[0]; int nx = shape[1]; ArrayDouble.D2 edgey = new ArrayDouble.D2(ny + 2, nx + 1); // compute the interior rows for (int y = 0; y < ny; y++) { for (int x = 1; x < nx;...
java
static public ArrayDouble.D2 makeYEdgesRotated(ArrayDouble.D2 midy) { int[] shape = midy.getShape(); int ny = shape[0]; int nx = shape[1]; ArrayDouble.D2 edgey = new ArrayDouble.D2(ny + 2, nx + 1); // compute the interior rows for (int y = 0; y < ny; y++) { for (int x = 1; x < nx;...
[ "static", "public", "ArrayDouble", ".", "D2", "makeYEdgesRotated", "(", "ArrayDouble", ".", "D2", "midy", ")", "{", "int", "[", "]", "shape", "=", "midy", ".", "getShape", "(", ")", ";", "int", "ny", "=", "shape", "[", "0", "]", ";", "int", "nx", "...
Experimental: for WRF rotated (NMM "E") Grids @param midy y coordinates of midpoints @return y coordinates of edges with shape (ny+2, nx+1)
[ "Experimental", ":", "for", "WRF", "rotated", "(", "NMM", "E", ")", "Grids" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis2D.java#L271-L306
test
Make the edges of midy in the same direction.
Of course, here is the Java code you requested: ```java static public ArrayDouble.D2 makeYEdgesRotated(ArrayDouble.D2 midy) { int[] shape = midy.getShape(); int ny = shape[0]; int nx = shape[1]; ArrayDouble.D2 edgey = new ArrayDouble.D2(ny + 2, nx + 1); // compute the interior rows for ...
braintree/braintree_android
PayPalOneTouch/src/main/java/com/paypal/android/sdk/onetouch/core/PayPalOneTouchCore.java
PayPalOneTouchCore.getClientMetadataId
@MainThread public static String getClientMetadataId(Context context, String pairingId) { return PayPalDataCollector.getClientMetadataId(context, pairingId); }
java
@MainThread public static String getClientMetadataId(Context context, String pairingId) { return PayPalDataCollector.getClientMetadataId(context, pairingId); }
[ "@", "MainThread", "public", "static", "String", "getClientMetadataId", "(", "Context", "context", ",", "String", "pairingId", ")", "{", "return", "PayPalDataCollector", ".", "getClientMetadataId", "(", "context", ",", "pairingId", ")", ";", "}" ]
Gets a Client Metadata ID at the time of payment activity. Once a user initiates a PayPal payment from their device, PayPal uses the Client Metadata ID to verify that the payment is originating from a valid, user-consented device and application. This helps reduce fraud and decrease declines. This method MUST be called...
[ "Gets", "a", "Client", "Metadata", "ID", "at", "the", "time", "of", "payment", "activity", ".", "Once", "a", "user", "initiates", "a", "PayPal", "payment", "from", "their", "device", "PayPal", "uses", "the", "Client", "Metadata", "ID", "to", "verify", "tha...
07b32e6fad73f9fb8432971b0e79fc8c94b11873
https://github.com/braintree/braintree_android/blob/07b32e6fad73f9fb8432971b0e79fc8c94b11873/PayPalOneTouch/src/main/java/com/paypal/android/sdk/onetouch/core/PayPalOneTouchCore.java#L135-L138
test
Get the client metadata id for a given pairing ID.
Of course, here is the Java code you requested: ```java @MainThread public static String getClientMetadataId(Context context, String pairingId) { return PayPalDataCollector.getClientMetadataId(context, pairingId); } ``` Hope this helps!
hawkular/hawkular-metrics
core/metrics-core-service/src/main/java/org/hawkular/metrics/core/util/GCGraceSecondsManager.java
GCGraceSecondsManager.maybeUpdateGCGraceSeconds
public void maybeUpdateGCGraceSeconds() { logger.info("Checking tables in " + keyspace + " to see if gc_grace_seconds needs to be updated"); Stopwatch stopwatch = Stopwatch.createStarted(); Map<String, String> replication = session.getCluster().getMetadata().getKeyspace(keyspace).getReplication(...
java
public void maybeUpdateGCGraceSeconds() { logger.info("Checking tables in " + keyspace + " to see if gc_grace_seconds needs to be updated"); Stopwatch stopwatch = Stopwatch.createStarted(); Map<String, String> replication = session.getCluster().getMetadata().getKeyspace(keyspace).getReplication(...
[ "public", "void", "maybeUpdateGCGraceSeconds", "(", ")", "{", "logger", ".", "info", "(", "\"Checking tables in \"", "+", "keyspace", "+", "\" to see if gc_grace_seconds needs to be updated\"", ")", ";", "Stopwatch", "stopwatch", "=", "Stopwatch", ".", "createStarted", ...
Asynchronously performs gc_grace_seconds updates if necessary. This method should <strong>not</strong> be called until schema updates have finished.
[ "Asynchronously", "performs", "gc_grace_seconds", "updates", "if", "necessary", ".", "This", "method", "should", "<strong", ">", "not<", "/", "strong", ">", "be", "called", "until", "schema", "updates", "have", "finished", "." ]
6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c
https://github.com/hawkular/hawkular-metrics/blob/6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c/core/metrics-core-service/src/main/java/org/hawkular/metrics/core/util/GCGraceSecondsManager.java#L87-L118
test
Check if the table in the keyspace has the gc_grace_seconds property. If it has the value of gc_grace_seconds then update the value of the gc_grace_seconds property.
Of course, here is the Java code you requested: ```java public void maybeUpdateGCGraceSeconds() { logger.info("Checking tables in " + keyspace + " to see if gc_grace_seconds needs to be updated"); Stopwatch stopwatch = Stopwatch.createStarted(); Map<String, String> replication = session.getClus...
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/properties/ObjectPropertyTaxonomyComputationFactory.java
ObjectPropertyTaxonomyComputationFactory.instertIntoTaxonomy
private void instertIntoTaxonomy(final IndexedObjectProperty property) { /* * @formatter:off * * Transitive reduction and taxonomy computation * if sub-properties of a sub-property contain this property, * they are equivalent * if a property is a strict sub-property of another strict sub-prop...
java
private void instertIntoTaxonomy(final IndexedObjectProperty property) { /* * @formatter:off * * Transitive reduction and taxonomy computation * if sub-properties of a sub-property contain this property, * they are equivalent * if a property is a strict sub-property of another strict sub-prop...
[ "private", "void", "instertIntoTaxonomy", "(", "final", "IndexedObjectProperty", "property", ")", "{", "/* \n\t\t * @formatter:off\n\t\t * \n\t\t * Transitive reduction and taxonomy computation\n\t\t * \tif sub-properties of a sub-property contain this property,\n\t\t * \t\tthey are equivalent\n\t...
Adds the specified object property into the taxonomy if it is not in it yet and sets its direct sub-properties if not set yet. @param property The property that should be inserted into taxonomy.
[ "Adds", "the", "specified", "object", "property", "into", "the", "taxonomy", "if", "it", "is", "not", "in", "it", "yet", "and", "sets", "its", "direct", "sub", "-", "properties", "if", "not", "set", "yet", "." ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/properties/ObjectPropertyTaxonomyComputationFactory.java#L112-L190
test
Inerts the property into the taxonomy.
Of course, here is the Java code you requested: ```java private void instertIntoTaxonomy(final IndexedObjectProperty property) { /* * @formatter:off * * Transitive reduction and taxonomy computation * if sub-properties of a sub-property contain this property, * they are equivalent * if a pro...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasDsyr
public static void cublasDsyr(char uplo, int n, double alpha, Pointer x, int incx, Pointer A, int lda) { cublasDsyrNative(uplo, n, alpha, x, incx, A, lda); checkResultBLAS(); }
java
public static void cublasDsyr(char uplo, int n, double alpha, Pointer x, int incx, Pointer A, int lda) { cublasDsyrNative(uplo, n, alpha, x, incx, A, lda); checkResultBLAS(); }
[ "public", "static", "void", "cublasDsyr", "(", "char", "uplo", ",", "int", "n", ",", "double", "alpha", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "A", ",", "int", "lda", ")", "{", "cublasDsyrNative", "(", "uplo", ",", "n", ",", "alpha"...
<pre> void cublasDsyr (char uplo, int n, double alpha, const double *x, int incx, double *A, int lda) performs the symmetric rank 1 operation A = alpha * x * transpose(x) + A, where alpha is a double precision scalar, x is an n element double precision vector and A is an n x n symmetric matrix consisting of double p...
[ "<pre", ">", "void", "cublasDsyr", "(", "char", "uplo", "int", "n", "double", "alpha", "const", "double", "*", "x", "int", "incx", "double", "*", "A", "int", "lda", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L7715-L7719
test
Cublas Dsyr for symmetric matrix.
Of course, here is the Java code you requested: ```java public static void cublasDsyr(char uplo, int n, double alpha, Pointer x, int incx, Pointer A, int lda) { cublasDsyrNative(uplo, n, alpha, x, incx, A, lda); checkResultBLAS(); } ``` Hope this helps!
apache/parquet-mr
parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java
ParquetRecordReaderWrapper.getSplit
protected ParquetInputSplit getSplit( final InputSplit oldSplit, final JobConf conf ) throws IOException { if (oldSplit instanceof FileSplit) { FileSplit fileSplit = (FileSplit) oldSplit; final long splitStart = fileSplit.getStart(); final long splitLength = fileSplit.getLength()...
java
protected ParquetInputSplit getSplit( final InputSplit oldSplit, final JobConf conf ) throws IOException { if (oldSplit instanceof FileSplit) { FileSplit fileSplit = (FileSplit) oldSplit; final long splitStart = fileSplit.getStart(); final long splitLength = fileSplit.getLength()...
[ "protected", "ParquetInputSplit", "getSplit", "(", "final", "InputSplit", "oldSplit", ",", "final", "JobConf", "conf", ")", "throws", "IOException", "{", "if", "(", "oldSplit", "instanceof", "FileSplit", ")", "{", "FileSplit", "fileSplit", "=", "(", "FileSplit", ...
gets a ParquetInputSplit corresponding to a split given by Hive @param oldSplit The split given by Hive @param conf The JobConf of the Hive job @return a ParquetInputSplit corresponding to the oldSplit @throws IOException if the config cannot be enhanced or if the footer cannot be read from the file
[ "gets", "a", "ParquetInputSplit", "corresponding", "to", "a", "split", "given", "by", "Hive" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java#L197-L227
test
Get a split from a file.
Of course, here is the Java code you requested: ```java protected ParquetInputSplit getSplit( final InputSplit oldSplit, final JobConf conf ) throws IOException { if (oldSplit instanceof FileSplit) { FileSplit fileSplit = (FileSplit) oldSplit; final long splitStart = fileSplit.getStar...
ReactiveX/RxJava
src/main/java/io/reactivex/Maybe.java
Maybe.retry
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Maybe<T> retry(long count) { return retry(count, Functions.alwaysTrue()); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Maybe<T> retry(long count) { return retry(count, Functions.alwaysTrue()); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Maybe", "<", "T", ">", "retry", "(", "long", "count", ")", "{", "return", "retry", "(", "count", ",", "Functions", ".", "alwaysTrue", "(", ")",...
Returns a Maybe that mirrors the source Maybe, resubscribing to it if it calls {@code onError} up to a specified number of retries. <p> <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/retry.png" alt=""> <p> If the source Maybe calls {@link MaybeObserver#onError}, this...
[ "Returns", "a", "Maybe", "that", "mirrors", "the", "source", "Maybe", "resubscribing", "to", "it", "if", "it", "calls", "{", "@code", "onError", "}", "up", "to", "a", "specified", "number", "of", "retries", ".", "<p", ">", "<img", "width", "=", "640", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L4038-L4042
test
Retry a sequence of tokens.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Maybe<T> retry(long count) { return retry(count, Functions.alwaysTrue()); } ``` Hope this helps!
WASdev/ci.common
src/main/java/net/wasdev/wlp/common/plugins/util/InstallFeatureUtil.java
InstallFeatureUtil.extractVersion
private static String extractVersion(String fileName) { int startIndex = INSTALL_MAP_PREFIX.length() + 1; // skip the underscore after the prefix int endIndex = fileName.lastIndexOf(INSTALL_MAP_SUFFIX); if (startIndex < endIndex) { return fileName.substring(startIndex, endIndex); ...
java
private static String extractVersion(String fileName) { int startIndex = INSTALL_MAP_PREFIX.length() + 1; // skip the underscore after the prefix int endIndex = fileName.lastIndexOf(INSTALL_MAP_SUFFIX); if (startIndex < endIndex) { return fileName.substring(startIndex, endIndex); ...
[ "private", "static", "String", "extractVersion", "(", "String", "fileName", ")", "{", "int", "startIndex", "=", "INSTALL_MAP_PREFIX", ".", "length", "(", ")", "+", "1", ";", "// skip the underscore after the prefix", "int", "endIndex", "=", "fileName", ".", "lastI...
Returns the extracted version from fileName @param fileName @return the version extracted from fileName
[ "Returns", "the", "extracted", "version", "from", "fileName" ]
24fc917383e9ff60ea6a42972c86577fe0f4591e
https://github.com/WASdev/ci.common/blob/24fc917383e9ff60ea6a42972c86577fe0f4591e/src/main/java/net/wasdev/wlp/common/plugins/util/InstallFeatureUtil.java#L902-L910
test
Extract the version from a file name.
Of course, here is the Java code you requested: ```java private static String extractVersion(String fileName) { int startIndex = INSTALL_MAP_PREFIX.length() + 1; // skip the underscore after the prefix int endIndex = fileName.lastIndexOf(INSTALL_MAP_SUFFIX); if (startIndex < endIndex) { ...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/executioner/OpExecutionerUtil.java
OpExecutionerUtil.get1DTensorStats
public static Tensor1DStats get1DTensorStats(INDArray array, int... dimension) { long tensorLength = array.size(dimension[0]); //As per tensorssAlongDimension: long numTensors = array.tensorssAlongDimension(dimension); //First tensor always starts with the first element in the NDArray,...
java
public static Tensor1DStats get1DTensorStats(INDArray array, int... dimension) { long tensorLength = array.size(dimension[0]); //As per tensorssAlongDimension: long numTensors = array.tensorssAlongDimension(dimension); //First tensor always starts with the first element in the NDArray,...
[ "public", "static", "Tensor1DStats", "get1DTensorStats", "(", "INDArray", "array", ",", "int", "...", "dimension", ")", "{", "long", "tensorLength", "=", "array", ".", "size", "(", "dimension", "[", "0", "]", ")", ";", "//As per tensorssAlongDimension:", "long",...
Tensor1DStats, used to efficiently iterate through tensors on a matrix (2d NDArray) for element-wise ops For example, the offset of each 1d tensor can be calculated using only a single tensorAlongDimension method call, hence is potentially faster than approaches requiring multiple tensorAlongDimension calls.<br> Note t...
[ "Tensor1DStats", "used", "to", "efficiently", "iterate", "through", "tensors", "on", "a", "matrix", "(", "2d", "NDArray", ")", "for", "element", "-", "wise", "ops", "For", "example", "the", "offset", "of", "each", "1d", "tensor", "can", "be", "calculated", ...
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/executioner/OpExecutionerUtil.java#L326-L348
test
Get the 1D tensor statistics for the given dimension
Of course, here is the Java code you requested: ```java public static Tensor1DStats get1DTensorStats(INDArray array, int... dimension) { long tensorLength = array.size(dimension[0]); //As per tensorssAlongDimension: long numTensors = array.tensorssAlongDimension(dimension); //First te...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/util/SwingUtils.java
SwingUtils.getUIDefaultsOfClass
public static UIDefaults getUIDefaultsOfClass(String className) { UIDefaults retVal = new UIDefaults(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); List<?> listKeys = Collections.list(defaults.keys()); for (Object key : listKeys) { if (key instanceof String && ((String) ke...
java
public static UIDefaults getUIDefaultsOfClass(String className) { UIDefaults retVal = new UIDefaults(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); List<?> listKeys = Collections.list(defaults.keys()); for (Object key : listKeys) { if (key instanceof String && ((String) ke...
[ "public", "static", "UIDefaults", "getUIDefaultsOfClass", "(", "String", "className", ")", "{", "UIDefaults", "retVal", "=", "new", "UIDefaults", "(", ")", ";", "UIDefaults", "defaults", "=", "UIManager", ".", "getLookAndFeelDefaults", "(", ")", ";", "List", "<"...
Convenience method for retrieving a subset of the UIDefaults pertaining to a particular class. @param className fully qualified name of the class of interest @return the UIDefaults of the class named
[ "Convenience", "method", "for", "retrieving", "a", "subset", "of", "the", "UIDefaults", "pertaining", "to", "a", "particular", "class", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/util/SwingUtils.java#L325-L340
test
Get the UIDefaults of a class
Of course, here is the Java code you requested: ```java public static UIDefaults getUIDefaultsOfClass(String className) { UIDefaults retVal = new UIDefaults(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); List<?> listKeys = Collections.list(defaults.keys()); for (Object key : listK...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3iosp.java
N3iosp.readRecordDataSubset
private ucar.ma2.Array readRecordDataSubset(ucar.nc2.Structure s, Section section) throws java.io.IOException { Range recordRange = section.getRange(0); int nrecords = recordRange.length(); // create the ArrayStructureMA StructureMembers members = s.makeStructureMembers(); for (StructureMembers.Mem...
java
private ucar.ma2.Array readRecordDataSubset(ucar.nc2.Structure s, Section section) throws java.io.IOException { Range recordRange = section.getRange(0); int nrecords = recordRange.length(); // create the ArrayStructureMA StructureMembers members = s.makeStructureMembers(); for (StructureMembers.Mem...
[ "private", "ucar", ".", "ma2", ".", "Array", "readRecordDataSubset", "(", "ucar", ".", "nc2", ".", "Structure", "s", ",", "Section", "section", ")", "throws", "java", ".", "io", ".", "IOException", "{", "Range", "recordRange", "=", "section", ".", "getRang...
Read data from record structure, that has been subsetted. Read one record at at time, put requested variable into ArrayStructureMA. @param s the record structure @param section the record range to read @return an ArrayStructure, with all the data read in. @throws IOException on error
[ "Read", "data", "from", "record", "structure", "that", "has", "been", "subsetted", ".", "Read", "one", "record", "at", "at", "time", "put", "requested", "variable", "into", "ArrayStructureMA", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3iosp.java#L523-L572
test
Read the data subset of a N3 section.
Of course, here is the Java code you requested: ```java private ucar.ma2.Array readRecordDataSubset(ucar.nc2.Structure s, Section section) throws java.io.IOException { Range recordRange = section.getRange(0); int nrecords = recordRange.length(); // create the ArrayStructureMA StructureMembers members ...
oblac/jodd
jodd-db/src/main/java/jodd/db/oom/sqlgen/chunks/SqlChunk.java
SqlChunk.defineParameter
protected void defineParameter(final StringBuilder query, String name, final Object value, final DbEntityColumnDescriptor dec) { if (name == null) { name = templateData.getNextParameterName(); } query.append(':').append(name); templateData.addParameter(name, value, dec); }
java
protected void defineParameter(final StringBuilder query, String name, final Object value, final DbEntityColumnDescriptor dec) { if (name == null) { name = templateData.getNextParameterName(); } query.append(':').append(name); templateData.addParameter(name, value, dec); }
[ "protected", "void", "defineParameter", "(", "final", "StringBuilder", "query", ",", "String", "name", ",", "final", "Object", "value", ",", "final", "DbEntityColumnDescriptor", "dec", ")", "{", "if", "(", "name", "==", "null", ")", "{", "name", "=", "templa...
Defines parameter with name and its value.
[ "Defines", "parameter", "with", "name", "and", "its", "value", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/sqlgen/chunks/SqlChunk.java#L226-L232
test
Define a parameter.
Of course, here is the Java code you requested: ```java protected void defineParameter(final StringBuilder query, String name, final Object value, final DbEntityColumnDescriptor dec) { if (name == null) { name = templateData.getNextParameterName(); } query.append(':').append(name); templateData.addParameter...
jboss/jboss-common-core
src/main/java/org/jboss/util/property/PropertyContainer.java
PropertyContainer.bindMethod
protected void bindMethod(final String name, final String propertyName) { if (name == null || name.equals("")) throw new IllegalArgumentException("name"); if (propertyName == null || propertyName.equals("")) throw new IllegalArgumentException("propertyName"); addPropertyListener // ...
java
protected void bindMethod(final String name, final String propertyName) { if (name == null || name.equals("")) throw new IllegalArgumentException("name"); if (propertyName == null || propertyName.equals("")) throw new IllegalArgumentException("propertyName"); addPropertyListener // ...
[ "protected", "void", "bindMethod", "(", "final", "String", "name", ",", "final", "String", "propertyName", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "equals", "(", "\"\"", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"na...
Creates a {@link MethodBoundPropertyListener} for the method and property name and adds it the underlying property group. @param name The method name to bind values to. @param propertyName The property name to bind to. @throws IllegalArgumentException Method of property name is null or empty.
[ "Creates", "a", "{", "@link", "MethodBoundPropertyListener", "}", "for", "the", "method", "and", "property", "name", "and", "adds", "it", "the", "underlying", "property", "group", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/property/PropertyContainer.java#L106-L114
test
Binds a method to a property.
Of course, here is the Java code you requested: ```java protected void bindMethod(final String name, final String propertyName) { if (name == null || name.equals("")) throw new IllegalArgumentException("name"); if (propertyName == null || propertyName.equals("")) throw new IllegalArgument...
wildfly/wildfly
legacy/jacorb/src/main/java/org/jboss/as/jacorb/JacORBSubsystemParser.java
JacORBSubsystemParser.writeORBConfig
private void writeORBConfig(XMLExtendedStreamWriter writer, ModelNode node) throws XMLStreamException { boolean writeORB = this.isWritable(node, JacORBSubsystemDefinitions.ORB_ATTRIBUTES); boolean writeORBConnection = this.isWritable(node, JacORBSubsystemDefinitions.ORB_CONN_ATTRIBUTES); boolea...
java
private void writeORBConfig(XMLExtendedStreamWriter writer, ModelNode node) throws XMLStreamException { boolean writeORB = this.isWritable(node, JacORBSubsystemDefinitions.ORB_ATTRIBUTES); boolean writeORBConnection = this.isWritable(node, JacORBSubsystemDefinitions.ORB_CONN_ATTRIBUTES); boolea...
[ "private", "void", "writeORBConfig", "(", "XMLExtendedStreamWriter", "writer", ",", "ModelNode", "node", ")", "throws", "XMLStreamException", "{", "boolean", "writeORB", "=", "this", ".", "isWritable", "(", "node", ",", "JacORBSubsystemDefinitions", ".", "ORB_ATTRIBUT...
<p> Writes the {@code orb} section of the JacORB subsystem configuration using the contents of the provided {@code ModelNode}. </p> @param writer the {@code XMLExtendedStreamWriter} used to write the configuration XML. @param node the {@code ModelNode} that might contain ORB configuration properties. @throws XMLStre...
[ "<p", ">", "Writes", "the", "{", "@code", "orb", "}", "section", "of", "the", "JacORB", "subsystem", "configuration", "using", "the", "contents", "of", "the", "provided", "{", "@code", "ModelNode", "}", ".", "<", "/", "p", ">" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/legacy/jacorb/src/main/java/org/jboss/as/jacorb/JacORBSubsystemParser.java#L818-L845
test
Write the ORB configuration.
Of course, here is the Java code you requested: ```java private void writeORBConfig(XMLExtendedStreamWriter writer, ModelNode node) throws XMLStreamException { boolean writeORB = this.isWritable(node, JacORBSubsystemDefinitions.ORB_ATTRIBUTES); boolean writeORBConnection = this.isWritable(node, JacORB...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java
BaseLevel2.sbmv
@Override public void sbmv(char order, char Uplo, double alpha, INDArray A, INDArray X, double beta, INDArray Y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, A, X, Y); // FIXME: int cast if (X...
java
@Override public void sbmv(char order, char Uplo, double alpha, INDArray A, INDArray X, double beta, INDArray Y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, A, X, Y); // FIXME: int cast if (X...
[ "@", "Override", "public", "void", "sbmv", "(", "char", "order", ",", "char", "Uplo", ",", "double", "alpha", ",", "INDArray", "A", ",", "INDArray", "X", ",", "double", "beta", ",", "INDArray", "Y", ")", "{", "if", "(", "Nd4j", ".", "getExecutioner", ...
sbmv computes a matrix-vector product using a symmetric band matrix: y := alpha*a*x + beta*y. Here a is an n-by-n symmetric band matrix with k superdiagonals, x and y are n-element vectors, alpha and beta are scalars. @param order @param Uplo @param alpha @param A @param X @param beta @param Y
[ "sbmv", "computes", "a", "matrix", "-", "vector", "product", "using", "a", "symmetric", "band", "matrix", ":", "y", ":", "=", "alpha", "*", "a", "*", "x", "+", "beta", "*", "y", ".", "Here", "a", "is", "an", "n", "-", "by", "-", "n", "symmetric",...
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java#L362-L380
test
SBBV method for double vector vector
Of course, here is the Java code you requested: ```java @Override public void sbmv(char order, char Uplo, double alpha, INDArray A, INDArray X, double beta, INDArray Y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(fa...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/DataSet.java
DataSet.merge
public static DataSet merge(List<DataSet> data) { if (data.isEmpty()) throw new IllegalArgumentException("Unable to merge empty dataset"); int nonEmpty = 0; boolean anyFeaturesPreset = false; boolean anyLabelsPreset = false; boolean first = true; for(DataSet ...
java
public static DataSet merge(List<DataSet> data) { if (data.isEmpty()) throw new IllegalArgumentException("Unable to merge empty dataset"); int nonEmpty = 0; boolean anyFeaturesPreset = false; boolean anyLabelsPreset = false; boolean first = true; for(DataSet ...
[ "public", "static", "DataSet", "merge", "(", "List", "<", "DataSet", ">", "data", ")", "{", "if", "(", "data", ".", "isEmpty", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Unable to merge empty dataset\"", ")", ";", "int", "nonEmpty", "...
Merge the list of datasets in to one list. All the rows are merged in to one dataset @param data the data to merge @return a single dataset
[ "Merge", "the", "list", "of", "datasets", "in", "to", "one", "list", ".", "All", "the", "rows", "are", "merged", "in", "to", "one", "dataset" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/DataSet.java#L145-L228
test
Merge a list of data sets into a single DataSet.
Of course, here is the Java code you requested: ```java public static DataSet merge(List<DataSet> data) { if (data.isEmpty()) throw new IllegalArgumentException("Unable to merge empty dataset"); int nonEmpty = 0; boolean anyFeaturesPreset = false; boolean anyLabelsPreset = ...
spring-projects/spring-security
oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/ReactiveRemoteJWKSource.java
ReactiveRemoteJWKSource.getJWKSet
private Mono<JWKSet> getJWKSet() { return this.webClient.get() .uri(this.jwkSetURL) .retrieve() .bodyToMono(String.class) .map(this::parse) .doOnNext(jwkSet -> this.cachedJWKSet.set(Mono.just(jwkSet))) .cache(); }
java
private Mono<JWKSet> getJWKSet() { return this.webClient.get() .uri(this.jwkSetURL) .retrieve() .bodyToMono(String.class) .map(this::parse) .doOnNext(jwkSet -> this.cachedJWKSet.set(Mono.just(jwkSet))) .cache(); }
[ "private", "Mono", "<", "JWKSet", ">", "getJWKSet", "(", ")", "{", "return", "this", ".", "webClient", ".", "get", "(", ")", ".", "uri", "(", "this", ".", "jwkSetURL", ")", ".", "retrieve", "(", ")", ".", "bodyToMono", "(", "String", ".", "class", ...
Updates the cached JWK set from the configured URL. @return The updated JWK set. @throws RemoteKeySourceException If JWK retrieval failed.
[ "Updates", "the", "cached", "JWK", "set", "from", "the", "configured", "URL", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/ReactiveRemoteJWKSource.java#L98-L106
test
Gets the RAWKSet.
Of course, here is the Java code you requested: ```java private Mono<JWKSet> getJWKSet() { return this.webClient.get() .uri(this.jwkSetURL) .retrieve() .bodyToMono(String.class) .map(this::parse) .doOnNext(jwkSet -> this.cachedJWKSet.set(Mono.just(jwkSet))) .cache(); } ``` Hope this helps!
js-lib-com/tiny-container
src/main/java/js/container/ManagedClass.java
ManagedClass.initializeStaticFields
private void initializeStaticFields() throws ConfigException { if (config == null) { return; } for (Config config : config.findChildren("static-field")) { String fieldName = config.getAttribute("name"); if (fieldName == null) { throw new ConfigException("Missing <name> attribute from static fi...
java
private void initializeStaticFields() throws ConfigException { if (config == null) { return; } for (Config config : config.findChildren("static-field")) { String fieldName = config.getAttribute("name"); if (fieldName == null) { throw new ConfigException("Missing <name> attribute from static fi...
[ "private", "void", "initializeStaticFields", "(", ")", "throws", "ConfigException", "{", "if", "(", "config", "==", "null", ")", "{", "return", ";", "}", "for", "(", "Config", "config", ":", "config", ".", "findChildren", "(", "\"static-field\"", ")", ")", ...
Initialize implementation class static, not final, fields. Static initializer reads name / value pairs from <code>static-field</code> configuration element, see sample below. String value is converted to instance field type using {@link Converter#asObject(String, Class)} utility. This means that configured value should...
[ "Initialize", "implementation", "class", "static", "not", "final", "fields", ".", "Static", "initializer", "reads", "name", "/", "value", "pairs", "from", "<code", ">", "static", "-", "field<", "/", "code", ">", "configuration", "element", "see", "sample", "be...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/ManagedClass.java#L1009-L1035
test
Initializes the static fields of the managed class.
Of course, here is the Java code you requested: ```java private void initializeStaticFields() throws ConfigException { if (config == null) { return; } for (Config config : config.findChildren("static-field")) { String fieldName = config.getAttribute("name"); if (fieldName == null) { throw new...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLogoutPageGeneratingFilter.java
DefaultLogoutPageGeneratingFilter.setResolveHiddenInputs
public void setResolveHiddenInputs( Function<HttpServletRequest, Map<String, String>> resolveHiddenInputs) { Assert.notNull(resolveHiddenInputs, "resolveHiddenInputs cannot be null"); this.resolveHiddenInputs = resolveHiddenInputs; }
java
public void setResolveHiddenInputs( Function<HttpServletRequest, Map<String, String>> resolveHiddenInputs) { Assert.notNull(resolveHiddenInputs, "resolveHiddenInputs cannot be null"); this.resolveHiddenInputs = resolveHiddenInputs; }
[ "public", "void", "setResolveHiddenInputs", "(", "Function", "<", "HttpServletRequest", ",", "Map", "<", "String", ",", "String", ">", ">", "resolveHiddenInputs", ")", "{", "Assert", ".", "notNull", "(", "resolveHiddenInputs", ",", "\"resolveHiddenInputs cannot be nul...
Sets a Function used to resolve a Map of the hidden inputs where the key is the name of the input and the value is the value of the input. Typically this is used to resolve the CSRF token. @param resolveHiddenInputs the function to resolve the inputs
[ "Sets", "a", "Function", "used", "to", "resolve", "a", "Map", "of", "the", "hidden", "inputs", "where", "the", "key", "is", "the", "name", "of", "the", "input", "and", "the", "value", "is", "the", "value", "of", "the", "input", ".", "Typically", "this"...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/ui/DefaultLogoutPageGeneratingFilter.java#L90-L94
test
Sets the function that will be called when the hidden inputs should be resolved.
Of course, here is the Java code you requested: ```java public void setResolveHiddenInputs( Function<HttpServletRequest, Map<String, String>> resolveHiddenInputs) { Assert.notNull(resolveHiddenInputs, "resolveHiddenInputs cannot be null"); this.resolveHiddenInputs = resolveHiddenInputs; } ``` Hope this helps!
nutzam/ssdb4j
src/main/java/org/nutz/ssdb4j/SSDBs.java
SSDBs.simple
public static final SSDB simple(String host, int port, int timeout) { return new SimpleClient(host, port, timeout); }
java
public static final SSDB simple(String host, int port, int timeout) { return new SimpleClient(host, port, timeout); }
[ "public", "static", "final", "SSDB", "simple", "(", "String", "host", ",", "int", "port", ",", "int", "timeout", ")", "{", "return", "new", "SimpleClient", "(", "host", ",", "port", ",", "timeout", ")", ";", "}" ]
指定配置生成一个单连接的客户端 @param host 主机名 @param port 端口 @param timeout 超时设置
[ "指定配置生成一个单连接的客户端" ]
9d907857b9bbf5d068c72e5fc7590df24db63862
https://github.com/nutzam/ssdb4j/blob/9d907857b9bbf5d068c72e5fc7590df24db63862/src/main/java/org/nutz/ssdb4j/SSDBs.java#L52-L54
test
Create a simple SSDB connection.
Of course, here is the Java code you requested: ```java public static final SSDB simple(String host, int port, int timeout) { return new SimpleClient(host, port, timeout); } ``` Hope this helps!
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/ManagedReferenceLifecycleMethodInterceptor.java
ManagedReferenceLifecycleMethodInterceptor.processInvocation
public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { final Method ...
java
public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { final Method ...
[ "public", "Object", "processInvocation", "(", "final", "InterceptorContext", "context", ")", "throws", "Exception", "{", "final", "ManagedReference", "reference", "=", "(", "ManagedReference", ")", "context", ".", "getPrivateData", "(", "ComponentInstance", ".", "clas...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ManagedReferenceLifecycleMethodInterceptor.java#L73-L106
test
Process the invocation of the component.
Of course, here is the Java code you requested: ```java public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = referen...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java
GridCoordSys.isGlobalLon
@Override public boolean isGlobalLon() { if (!isLatLon) return false; if (!(horizXaxis instanceof CoordinateAxis1D)) return false; CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis; double first = lon.getCoordEdge(0); double last = lon.getCoordEdge((int) lon.getSize()); double min = ...
java
@Override public boolean isGlobalLon() { if (!isLatLon) return false; if (!(horizXaxis instanceof CoordinateAxis1D)) return false; CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis; double first = lon.getCoordEdge(0); double last = lon.getCoordEdge((int) lon.getSize()); double min = ...
[ "@", "Override", "public", "boolean", "isGlobalLon", "(", ")", "{", "if", "(", "!", "isLatLon", ")", "return", "false", ";", "if", "(", "!", "(", "horizXaxis", "instanceof", "CoordinateAxis1D", ")", ")", "return", "false", ";", "CoordinateAxis1D", "lon", "...
Is this a global coverage over longitude ? @return true if isLatLon and longitude wraps
[ "Is", "this", "a", "global", "coverage", "over", "longitude", "?" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java#L723-L733
test
Returns true if the Horiz X axis is a global longitude coordinate axis.
Of course, here is the Java code you requested: ```java @Override public boolean isGlobalLon() { if (!isLatLon) return false; if (!(horizXaxis instanceof CoordinateAxis1D)) return false; CoordinateAxis1D lon = (CoordinateAxis1D) horizXaxis; double first = lon.getCoordEdge(0); double last = ...
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.firePacketInterceptors
protected void firePacketInterceptors(Packet packet) { if (packet != null) { for (InterceptorWrapper interceptorWrapper : interceptors.values()) { interceptorWrapper.notifyListener(packet); } } }
java
protected void firePacketInterceptors(Packet packet) { if (packet != null) { for (InterceptorWrapper interceptorWrapper : interceptors.values()) { interceptorWrapper.notifyListener(packet); } } }
[ "protected", "void", "firePacketInterceptors", "(", "Packet", "packet", ")", "{", "if", "(", "packet", "!=", "null", ")", "{", "for", "(", "InterceptorWrapper", "interceptorWrapper", ":", "interceptors", ".", "values", "(", ")", ")", "{", "interceptorWrapper", ...
Process interceptors. Interceptors may modify the packet that is about to be sent. Since the thread that requested to send the packet will invoke all interceptors, it is important that interceptors perform their work as soon as possible so that the thread does not remain blocked for a long period. @param packet the pa...
[ "Process", "interceptors", ".", "Interceptors", "may", "modify", "the", "packet", "that", "is", "about", "to", "be", "sent", ".", "Since", "the", "thread", "that", "requested", "to", "send", "the", "packet", "will", "invoke", "all", "interceptors", "it", "is...
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L791-L797
test
Fire the interceptors for a packet.
Of course, here is the Java code you requested: ```java protected void firePacketInterceptors(Packet packet) { if (packet != null) { for (InterceptorWrapper interceptorWrapper : interceptors.values()) { interceptorWrapper.notifyListener(packet); } } } ``` Ho...
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/Index.java
Index.searchRaw
protected byte[] searchRaw(@Nullable Query query, @Nullable RequestOptions requestOptions) throws AlgoliaException { if (query == null) { query = new Query(); } try { String paramsString = query.build(); if (paramsString.length() > 0) { JSONOb...
java
protected byte[] searchRaw(@Nullable Query query, @Nullable RequestOptions requestOptions) throws AlgoliaException { if (query == null) { query = new Query(); } try { String paramsString = query.build(); if (paramsString.length() > 0) { JSONOb...
[ "protected", "byte", "[", "]", "searchRaw", "(", "@", "Nullable", "Query", "query", ",", "@", "Nullable", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "if", "(", "query", "==", "null", ")", "{", "query", "=", "new", "Query", ...
Searches inside the index. @param requestOptions Request-specific options. @return a byte array containing search results @throws AlgoliaException
[ "Searches", "inside", "the", "index", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L1373-L1390
test
Search raw data.
Of course, here is the Java code you requested: ```java protected byte[] searchRaw(@Nullable Query query, @Nullable RequestOptions requestOptions) throws AlgoliaException { if (query == null) { query = new Query(); } try { String paramsString = query.build(); ...
wildfly/wildfly
jaxrs/src/main/java/org/jboss/as/jaxrs/deployment/ResteasyDeploymentData.java
ResteasyDeploymentData.merge
public void merge(final List<ResteasyDeploymentData> deploymentData) throws DeploymentUnitProcessingException { for (ResteasyDeploymentData data : deploymentData) { scannedApplicationClasses.addAll(data.getScannedApplicationClasses()); if (scanResources) { scannedResource...
java
public void merge(final List<ResteasyDeploymentData> deploymentData) throws DeploymentUnitProcessingException { for (ResteasyDeploymentData data : deploymentData) { scannedApplicationClasses.addAll(data.getScannedApplicationClasses()); if (scanResources) { scannedResource...
[ "public", "void", "merge", "(", "final", "List", "<", "ResteasyDeploymentData", ">", "deploymentData", ")", "throws", "DeploymentUnitProcessingException", "{", "for", "(", "ResteasyDeploymentData", "data", ":", "deploymentData", ")", "{", "scannedApplicationClasses", "....
Merges a list of additional JAX-RS deployment data with this lot of deployment data. @param deploymentData
[ "Merges", "a", "list", "of", "additional", "JAX", "-", "RS", "deployment", "data", "with", "this", "lot", "of", "deployment", "data", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jaxrs/src/main/java/org/jboss/as/jaxrs/deployment/ResteasyDeploymentData.java#L53-L64
test
Merge the deployment data into this one.
Of course, here is the Java code you requested: ```java public void merge(final List<ResteasyDeploymentData> deploymentData) throws DeploymentUnitProcessingException { for (ResteasyDeploymentData data : deploymentData) { scannedApplicationClasses.addAll(data.getScannedApplicationClasses()); ...
lessthanoptimal/GeoRegression
main/src/georegression/struct/shapes/Polygon2D_F64.java
Polygon2D_F64.getLine
public LineSegment2D_F64 getLine( int index , LineSegment2D_F64 storage ) { if( storage == null ) storage = new LineSegment2D_F64(); int j = (index+1)%vertexes.size; storage.a.set(get(index)); storage.b.set(get(j)); return storage; }
java
public LineSegment2D_F64 getLine( int index , LineSegment2D_F64 storage ) { if( storage == null ) storage = new LineSegment2D_F64(); int j = (index+1)%vertexes.size; storage.a.set(get(index)); storage.b.set(get(j)); return storage; }
[ "public", "LineSegment2D_F64", "getLine", "(", "int", "index", ",", "LineSegment2D_F64", "storage", ")", "{", "if", "(", "storage", "==", "null", ")", "storage", "=", "new", "LineSegment2D_F64", "(", ")", ";", "int", "j", "=", "(", "index", "+", "1", ")"...
Returns the line/edge defined by vertex index and index+1. @param index Index of the line @return A new instance of the line segment.
[ "Returns", "the", "line", "/", "edge", "defined", "by", "vertex", "index", "and", "index", "+", "1", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/struct/shapes/Polygon2D_F64.java#L175-L185
test
Gets the line at the specified index in the image.
Of course, here is the Java code you requested: ```java public LineSegment2D_F64 getLine( int index , LineSegment2D_F64 storage ) { if( storage == null ) storage = new LineSegment2D_F64(); int j = (index+1)%vertexes.size; storage.a.set(get(index)); storage.b.set(get(j)); return storage; } ``` Hope th...
streamsets/datacollector
jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcMetastoreUtil.java
JdbcMetastoreUtil.resolveScaleOrPrecisionExpression
private static int resolveScaleOrPrecisionExpression( String type, Field field, String attributeName, String fieldPath ) throws JdbcStageCheckedException { String stringValue = field.getAttribute(attributeName); try { return Integer.parseInt(stringValue); } catch (NumberForm...
java
private static int resolveScaleOrPrecisionExpression( String type, Field field, String attributeName, String fieldPath ) throws JdbcStageCheckedException { String stringValue = field.getAttribute(attributeName); try { return Integer.parseInt(stringValue); } catch (NumberForm...
[ "private", "static", "int", "resolveScaleOrPrecisionExpression", "(", "String", "type", ",", "Field", "field", ",", "String", "attributeName", ",", "String", "fieldPath", ")", "throws", "JdbcStageCheckedException", "{", "String", "stringValue", "=", "field", ".", "g...
Evaluate precision or scale in context of record and given field path.
[ "Evaluate", "precision", "or", "scale", "in", "context", "of", "record", "and", "given", "field", "path", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/JdbcMetastoreUtil.java#L35-L48
test
Resolve a scale or precision expression.
Of course, here is the Java code you requested: ```java private static int resolveScaleOrPrecisionExpression( String type, Field field, String attributeName, String fieldPath ) throws JdbcStageCheckedException { String stringValue = field.getAttribute(attributeName); try { retu...
oblac/jodd
jodd-decora/src/main/java/jodd/decora/DecoraServletFilter.java
DecoraServletFilter.init
@Override public void init(final FilterConfig filterConfig) throws ServletException { // final String decoraManagerClass = filterConfig.getInitParameter(PARAM_DECORA_MANAGER); if (decoraManagerClass != null) { try { final Class decoraManagerType = ClassLoaderUtil.loadClass(decoraManagerClass); deco...
java
@Override public void init(final FilterConfig filterConfig) throws ServletException { // final String decoraManagerClass = filterConfig.getInitParameter(PARAM_DECORA_MANAGER); if (decoraManagerClass != null) { try { final Class decoraManagerType = ClassLoaderUtil.loadClass(decoraManagerClass); deco...
[ "@", "Override", "public", "void", "init", "(", "final", "FilterConfig", "filterConfig", ")", "throws", "ServletException", "{", "//", "final", "String", "decoraManagerClass", "=", "filterConfig", ".", "getInitParameter", "(", "PARAM_DECORA_MANAGER", ")", ";", "if",...
Initializes Decora filter. Loads manager and parser from init parameters.
[ "Initializes", "Decora", "filter", ".", "Loads", "manager", "and", "parser", "from", "init", "parameters", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-decora/src/main/java/jodd/decora/DecoraServletFilter.java#L85-L127
test
Initialize the DecoraManager and DecoraParser.
Of course, here is the Java code you requested: ```java @Override public void init(final FilterConfig filterConfig) throws ServletException { // final String decoraManagerClass = filterConfig.getInitParameter(PARAM_DECORA_MANAGER); if (decoraManagerClass != null) { try { final Class decoraManagerType ...
spring-projects/spring-security
samples/xml/contacts/src/main/java/sample/contact/AdminPermissionController.java
AdminPermissionController.displayAdminPage
@RequestMapping(value = "/secure/adminPermission.htm", method = RequestMethod.GET) public ModelAndView displayAdminPage(@RequestParam("contactId") int contactId) { Contact contact = contactManager.getById(Long.valueOf(contactId)); Acl acl = aclService.readAclById(new ObjectIdentityImpl(contact)); Map<String, Ob...
java
@RequestMapping(value = "/secure/adminPermission.htm", method = RequestMethod.GET) public ModelAndView displayAdminPage(@RequestParam("contactId") int contactId) { Contact contact = contactManager.getById(Long.valueOf(contactId)); Acl acl = aclService.readAclById(new ObjectIdentityImpl(contact)); Map<String, Ob...
[ "@", "RequestMapping", "(", "value", "=", "\"/secure/adminPermission.htm\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "ModelAndView", "displayAdminPage", "(", "@", "RequestParam", "(", "\"contactId\"", ")", "int", "contactId", ")", "{", "Con...
Displays the permission admin page for a particular contact.
[ "Displays", "the", "permission", "admin", "page", "for", "a", "particular", "contact", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/samples/xml/contacts/src/main/java/sample/contact/AdminPermissionController.java#L69-L79
test
Display admin page.
Of course, here is the Java code you requested: ```java @RequestMapping(value = "/secure/adminPermission.htm", method = RequestMethod.GET) public ModelAndView displayAdminPage(@RequestParam("contactId") int contactId) { Contact contact = contactManager.getById(Long.valueOf(contactId)); Acl acl = aclService.readAc...
jboss/jboss-common-core
src/main/java/org/jboss/util/xml/catalog/Resolver.java
Resolver.queryResolver
protected Resolver queryResolver(String resolver, String command, String arg1, String arg2) { String RFC2483 = resolver + "?command=" + command + "&format=tr9401&uri=" + arg1 + "&uri2=" + arg2; try { URL url = new URL(RFC2483); URLConnection urlCon = url.openConnecti...
java
protected Resolver queryResolver(String resolver, String command, String arg1, String arg2) { String RFC2483 = resolver + "?command=" + command + "&format=tr9401&uri=" + arg1 + "&uri2=" + arg2; try { URL url = new URL(RFC2483); URLConnection urlCon = url.openConnecti...
[ "protected", "Resolver", "queryResolver", "(", "String", "resolver", ",", "String", "command", ",", "String", "arg1", ",", "String", "arg2", ")", "{", "String", "RFC2483", "=", "resolver", "+", "\"?command=\"", "+", "command", "+", "\"&format=tr9401&uri=\"", "+"...
Query an external RFC2483 resolver. @param resolver The URL of the RFC2483 resolver. @param command The command to send the resolver. @param arg1 The first argument to the resolver. @param arg2 The second argument to the resolver, usually null. @return The Resolver constructed.
[ "Query", "an", "external", "RFC2483", "resolver", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Resolver.java#L362-L404
test
Query resolver.
Of course, here is the Java code you requested: ```java protected Resolver queryResolver(String resolver, String command, String arg1, String arg2) { String RFC2483 = resolver + "?command=" + command + "&format=tr9401&uri=" + arg1 + "&uri2=" + arg2; try { URL url = new UR...
oblac/jodd
jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java
ServletUtil.isAbsoluteUrl
public static boolean isAbsoluteUrl(final String url) { if (url == null) { // a null URL is not absolute return false; } int colonPos; // fast simple check first if ((colonPos = url.indexOf(':')) == -1) { return false; } // if we DO have a colon, ma...
java
public static boolean isAbsoluteUrl(final String url) { if (url == null) { // a null URL is not absolute return false; } int colonPos; // fast simple check first if ((colonPos = url.indexOf(':')) == -1) { return false; } // if we DO have a colon, ma...
[ "public", "static", "boolean", "isAbsoluteUrl", "(", "final", "String", "url", ")", "{", "if", "(", "url", "==", "null", ")", "{", "// a null URL is not absolute", "return", "false", ";", "}", "int", "colonPos", ";", "// fast simple check first", "if", "(", "(...
Returns <code>true</code> if current URL is absolute, <code>false</code> otherwise.
[ "Returns", "<code", ">", "true<", "/", "code", ">", "if", "current", "URL", "is", "absolute", "<code", ">", "false<", "/", "code", ">", "otherwise", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java#L501-L518
test
Checks if the given URL is an absolute URL.
Of course, here is the Java code you requested: ```java public static boolean isAbsoluteUrl(final String url) { if (url == null) { // a null URL is not absolute return false; } int colonPos; // fast simple check first if ((colonPos = url.indexOf(':')) == -1) { ...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java
LogoutConfigurer.createLogoutFilter
private LogoutFilter createLogoutFilter(H http) throws Exception { logoutHandlers.add(contextLogoutHandler); LogoutHandler[] handlers = logoutHandlers .toArray(new LogoutHandler[logoutHandlers.size()]); LogoutFilter result = new LogoutFilter(getLogoutSuccessHandler(), handlers); result.setLogoutRequestMatch...
java
private LogoutFilter createLogoutFilter(H http) throws Exception { logoutHandlers.add(contextLogoutHandler); LogoutHandler[] handlers = logoutHandlers .toArray(new LogoutHandler[logoutHandlers.size()]); LogoutFilter result = new LogoutFilter(getLogoutSuccessHandler(), handlers); result.setLogoutRequestMatch...
[ "private", "LogoutFilter", "createLogoutFilter", "(", "H", "http", ")", "throws", "Exception", "{", "logoutHandlers", ".", "add", "(", "contextLogoutHandler", ")", ";", "LogoutHandler", "[", "]", "handlers", "=", "logoutHandlers", ".", "toArray", "(", "new", "Lo...
Creates the {@link LogoutFilter} using the {@link LogoutHandler} instances, the {@link #logoutSuccessHandler(LogoutSuccessHandler)} and the {@link #logoutUrl(String)}. @param http the builder to use @return the {@link LogoutFilter} to use. @throws Exception
[ "Creates", "the", "{", "@link", "LogoutFilter", "}", "using", "the", "{", "@link", "LogoutHandler", "}", "instances", "the", "{", "@link", "#logoutSuccessHandler", "(", "LogoutSuccessHandler", ")", "}", "and", "the", "{", "@link", "#logoutUrl", "(", "String", ...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java#L330-L338
test
Create a LogoutFilter.
Of course, here is the Java code you requested: ```java private LogoutFilter createLogoutFilter(H http) throws Exception { logoutHandlers.add(contextLogoutHandler); LogoutHandler[] handlers = logoutHandlers .toArray(new LogoutHandler[logoutHandlers.size()]); LogoutFilter result = new LogoutFilter(getLogoutSu...
ombre42/jrobotremoteserver
examples/AnnotationLibrary/src/main/java/com/example/MyRemoteLibrary.java
MyRemoteLibrary.main
public static void main(String[] args) throws Exception { RemoteServer.configureLogging(); RemoteServer server = new RemoteServer(); server.addLibrary(MyRemoteLibrary.class, 8270); server.start(); }
java
public static void main(String[] args) throws Exception { RemoteServer.configureLogging(); RemoteServer server = new RemoteServer(); server.addLibrary(MyRemoteLibrary.class, 8270); server.start(); }
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "RemoteServer", ".", "configureLogging", "(", ")", ";", "RemoteServer", "server", "=", "new", "RemoteServer", "(", ")", ";", "server", ".", "addLibrary", ...
/* Starts jrobotremoteserver with an example library and returns. The application will shutdown when all of the web server's threads exit.
[ "/", "*", "Starts", "jrobotremoteserver", "with", "an", "example", "library", "and", "returns", ".", "The", "application", "will", "shutdown", "when", "all", "of", "the", "web", "server", "s", "threads", "exit", "." ]
688ab33a6bd04951d9dee7f5ec23c6f1cc709c10
https://github.com/ombre42/jrobotremoteserver/blob/688ab33a6bd04951d9dee7f5ec23c6f1cc709c10/examples/AnnotationLibrary/src/main/java/com/example/MyRemoteLibrary.java#L27-L32
test
Main method for the application.
Of course, here is the Java code you requested: ```java public static void main(String[] args) throws Exception { RemoteServer.configureLogging(); RemoteServer server = new RemoteServer(); server.addLibrary(MyRemoteLibrary.class, 8270); server.start(); } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/coverage2/CoverageRenderer.java
CoverageRenderer.getXYvalueStr
public String getXYvalueStr(ProjectionPoint loc) { if ((lastGrid == null) || (geodata == null)) return ""; // convert to dataProjection, where x and y are orthogonal if (!sameProjection) { LatLonPoint llpt = drawProjection.projToLatLon(loc); loc = dataProjection.latLonToProj(llpt); } ...
java
public String getXYvalueStr(ProjectionPoint loc) { if ((lastGrid == null) || (geodata == null)) return ""; // convert to dataProjection, where x and y are orthogonal if (!sameProjection) { LatLonPoint llpt = drawProjection.projToLatLon(loc); loc = dataProjection.latLonToProj(llpt); } ...
[ "public", "String", "getXYvalueStr", "(", "ProjectionPoint", "loc", ")", "{", "if", "(", "(", "lastGrid", "==", "null", ")", "||", "(", "geodata", "==", "null", ")", ")", "return", "\"\"", ";", "// convert to dataProjection, where x and y are orthogonal", "if", ...
/* Get the data value at this projection (x,y) point. @param loc : point in display projection coordinates (plan view) @return String representation of value
[ "/", "*", "Get", "the", "data", "value", "at", "this", "projection", "(", "x", "y", ")", "point", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/coverage2/CoverageRenderer.java#L186-L214
test
Get the X Y value of the specified location in the last grid.
Of course, here is the Java code you requested: ```java public String getXYvalueStr(ProjectionPoint loc) { if ((lastGrid == null) || (geodata == null)) return ""; // convert to dataProjection, where x and y are orthogonal if (!sameProjection) { LatLonPoint llpt = drawProjection.projToLatLon(lo...
Unidata/thredds
cdm/src/main/java/ucar/nc2/geotiff/GeoTiffWriter2.java
GeoTiffWriter2.getSwathLatLonInformation
private double[] getSwathLatLonInformation(Array lat, Array lon) { // Calculate the increment of latitude and longitude of original swath data // Calculate the size of the boundingBox // element0: Longitude increment // element1: Latitude increment // element2: minLat // element3: maxLat // ...
java
private double[] getSwathLatLonInformation(Array lat, Array lon) { // Calculate the increment of latitude and longitude of original swath data // Calculate the size of the boundingBox // element0: Longitude increment // element1: Latitude increment // element2: minLat // element3: maxLat // ...
[ "private", "double", "[", "]", "getSwathLatLonInformation", "(", "Array", "lat", ",", "Array", "lon", ")", "{", "// Calculate the increment of latitude and longitude of original swath data", "// Calculate the size of the boundingBox", "// element0: Longitude increment", "// element1:...
get lat lon information from the swath @param lat 2D lat array @param lon 2D lon array @return double array for geotiff
[ "get", "lat", "lon", "information", "from", "the", "swath" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/geotiff/GeoTiffWriter2.java#L606-L689
test
This method returns the swath lat and lon information.
Of course, here is the Java code you requested: ```java private double[] getSwathLatLonInformation(Array lat, Array lon) { // Calculate the increment of latitude and longitude of original swath data // Calculate the size of the boundingBox // element0: Longitude increment // element1: Latitude incremen...
spring-projects/spring-security
acl/src/main/java/org/springframework/security/acls/afterinvocation/AclEntryAfterInvocationProvider.java
AclEntryAfterInvocationProvider.decide
public Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> config, Object returnedObject) throws AccessDeniedException { if (returnedObject == null) { // AclManager interface contract prohibits nulls // As they have permission to null/nothing, grant access logger.de...
java
public Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> config, Object returnedObject) throws AccessDeniedException { if (returnedObject == null) { // AclManager interface contract prohibits nulls // As they have permission to null/nothing, grant access logger.de...
[ "public", "Object", "decide", "(", "Authentication", "authentication", ",", "Object", "object", ",", "Collection", "<", "ConfigAttribute", ">", "config", ",", "Object", "returnedObject", ")", "throws", "AccessDeniedException", "{", "if", "(", "returnedObject", "==",...
========================================================================================================
[ "========================================================================================================" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/acl/src/main/java/org/springframework/security/acls/afterinvocation/AclEntryAfterInvocationProvider.java#L90-L127
test
Decide whether the given object has permission to the given domain object.
Of course, here is the Java code you requested: ```java public Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> config, Object returnedObject) throws AccessDeniedException { if (returnedObject == null) { // AclManager interface contract prohibits nulls // As they h...
wildfly/wildfly
weld/subsystem/src/main/java/org/jboss/as/weld/deployment/processors/ExternalBeanArchiveProcessor.java
ExternalBeanArchiveProcessor.findExportedResources
private Map<URL, URL> findExportedResources(Module dependencyModule) { Set<URL> beanXmls = findExportedResource(dependencyModule, META_INF_BEANS_XML); if (beanXmls.isEmpty()) { return Collections.emptyMap(); } Set<URL> indexes = findExportedResource(dependencyModule, META_INF...
java
private Map<URL, URL> findExportedResources(Module dependencyModule) { Set<URL> beanXmls = findExportedResource(dependencyModule, META_INF_BEANS_XML); if (beanXmls.isEmpty()) { return Collections.emptyMap(); } Set<URL> indexes = findExportedResource(dependencyModule, META_INF...
[ "private", "Map", "<", "URL", ",", "URL", ">", "findExportedResources", "(", "Module", "dependencyModule", ")", "{", "Set", "<", "URL", ">", "beanXmls", "=", "findExportedResource", "(", "dependencyModule", ",", "META_INF_BEANS_XML", ")", ";", "if", "(", "bean...
The entry key is bean.xml URL, value is (optional) jandex index URL. @param dependencyModule @return the map of exported resources
[ "The", "entry", "key", "is", "bean", ".", "xml", "URL", "value", "is", "(", "optional", ")", "jandex", "index", "URL", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/weld/subsystem/src/main/java/org/jboss/as/weld/deployment/processors/ExternalBeanArchiveProcessor.java#L308-L327
test
Find exported resources.
Of course, here is the Java code you requested: ```java private Map<URL, URL> findExportedResources(Module dependencyModule) { Set<URL> beanXmls = findExportedResource(dependencyModule, META_INF_BEANS_XML); if (beanXmls.isEmpty()) { return Collections.emptyMap(); } Set<URL> ...
wildfly/wildfly
jpa/subsystem/src/main/java/org/jboss/as/jpa/service/JPAService.java
JPAService.createManagementStatisticsResource
public static Resource createManagementStatisticsResource( final ManagementAdaptor managementAdaptor, final String scopedPersistenceUnitName, final DeploymentUnit deploymentUnit) { synchronized (existingResourceDescriptionResolver) { final EntityManagerFactoryLoo...
java
public static Resource createManagementStatisticsResource( final ManagementAdaptor managementAdaptor, final String scopedPersistenceUnitName, final DeploymentUnit deploymentUnit) { synchronized (existingResourceDescriptionResolver) { final EntityManagerFactoryLoo...
[ "public", "static", "Resource", "createManagementStatisticsResource", "(", "final", "ManagementAdaptor", "managementAdaptor", ",", "final", "String", "scopedPersistenceUnitName", ",", "final", "DeploymentUnit", "deploymentUnit", ")", "{", "synchronized", "(", "existingResourc...
Create single instance of management statistics resource per managementAdaptor version. ManagementAccess The persistence provider and jipijapa adapters will be in the same classloader, either a static module or included directly in the application. Those are the two supported use cases for management of deployment p...
[ "Create", "single", "instance", "of", "management", "statistics", "resource", "per", "managementAdaptor", "version", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/subsystem/src/main/java/org/jboss/as/jpa/service/JPAService.java#L132-L179
test
Creates a resource that is used to store the management statistics.
Of course, here is the Java code you requested: ```java public static Resource createManagementStatisticsResource( final ManagementAdaptor managementAdaptor, final String scopedPersistenceUnitName, final DeploymentUnit deploymentUnit) { synchronized (existingResourceDescrip...
Unidata/thredds
dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java
HttpDSP.getCapabilities
public String getCapabilities(String url) throws IOException { // Save the original url String saveurl = this.xuri.getOriginal(); parseURL(url); String fdsurl = buildURL(this.xuri.assemble(XURI.URLALL), DSRSUFFIX, null, null); try { // Make the req...
java
public String getCapabilities(String url) throws IOException { // Save the original url String saveurl = this.xuri.getOriginal(); parseURL(url); String fdsurl = buildURL(this.xuri.assemble(XURI.URLALL), DSRSUFFIX, null, null); try { // Make the req...
[ "public", "String", "getCapabilities", "(", "String", "url", ")", "throws", "IOException", "{", "// Save the original url", "String", "saveurl", "=", "this", ".", "xuri", ".", "getOriginal", "(", ")", ";", "parseURL", "(", "url", ")", ";", "String", "fdsurl", ...
Provide a method for getting the capabilities document. @param url for accessing the document @throws DapException
[ "Provide", "a", "method", "for", "getting", "the", "capabilities", "document", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java#L295-L314
test
Get the content of a CIS SECTYPE from a URL.
Of course, here is the Java code you requested: ```java public String getCapabilities(String url) throws IOException { // Save the original url String saveurl = this.xuri.getOriginal(); parseURL(url); String fdsurl = buildURL(this.xuri.assemble(XURI.URLALL), DSRSUFFI...
eiichiro/bootleg
src/main/java/org/eiichiro/bootleg/BootlegFilter.java
BootlegFilter.configuration
protected Configuration configuration(FilterConfig config) throws ServletException { ServletContext context = config.getServletContext(); String clazz = context.getInitParameter(CONFIGURATION); Configuration configuration = null; if (clazz != null) { try { configuration = (Configuration) Class.forName...
java
protected Configuration configuration(FilterConfig config) throws ServletException { ServletContext context = config.getServletContext(); String clazz = context.getInitParameter(CONFIGURATION); Configuration configuration = null; if (clazz != null) { try { configuration = (Configuration) Class.forName...
[ "protected", "Configuration", "configuration", "(", "FilterConfig", "config", ")", "throws", "ServletException", "{", "ServletContext", "context", "=", "config", ".", "getServletContext", "(", ")", ";", "String", "clazz", "=", "context", ".", "getInitParameter", "("...
Constructs the {@code Configuration}. This method attempts to get custom configuration class from {@code ServletContext} init parameter and instantiate and initialize it. If the custom configuration class has not been specified as the {@code ServletContext} init parameter, this method returns <code>null</code>. @param...
[ "Constructs", "the", "{", "@code", "Configuration", "}", ".", "This", "method", "attempts", "to", "get", "custom", "configuration", "class", "from", "{", "@code", "ServletContext", "}", "init", "parameter", "and", "instantiate", "and", "initialize", "it", ".", ...
b98a108500597cb6185056be2eef7de5ba1963d2
https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/BootlegFilter.java#L136-L153
test
Loads the configuration from the servlet context.
Of course, here is the Java code you requested: ```java protected Configuration configuration(FilterConfig config) throws ServletException { ServletContext context = config.getServletContext(); String clazz = context.getInitParameter(CONFIGURATION); Configuration configuration = null; if (clazz != null) { ...
phax/ph-genericode
src/main/java/com/helger/genericode/excel/ExcelReadOptions.java
ExcelReadOptions.addColumn
@Nonnull public ExcelReadOptions <USE_TYPE> addColumn (@Nonnegative final int nIndex, @Nonnull @Nonempty final String sColumnID, @Nonnull final USE_TYPE eUseType, @Nonnull @N...
java
@Nonnull public ExcelReadOptions <USE_TYPE> addColumn (@Nonnegative final int nIndex, @Nonnull @Nonempty final String sColumnID, @Nonnull final USE_TYPE eUseType, @Nonnull @N...
[ "@", "Nonnull", "public", "ExcelReadOptions", "<", "USE_TYPE", ">", "addColumn", "(", "@", "Nonnegative", "final", "int", "nIndex", ",", "@", "Nonnull", "@", "Nonempty", "final", "String", "sColumnID", ",", "@", "Nonnull", "final", "USE_TYPE", "eUseType", ",",...
Add a single column definition. @param nIndex The 0-based index of the column in Excel. @param sColumnID The ID of the column in Genericode. @param eUseType Optional or required? @param sDataType The XSD data type to be used in Genericode. Use "string" if you're unsure. @param bKeyColumn <code>true</code> if this is a...
[ "Add", "a", "single", "column", "definition", "." ]
76ef5bb0744af42bd3decd41c2bf0829c87ae71d
https://github.com/phax/ph-genericode/blob/76ef5bb0744af42bd3decd41c2bf0829c87ae71d/src/main/java/com/helger/genericode/excel/ExcelReadOptions.java#L133-L147
test
Add a new column to the read options.
Of course, here is the Java code you requested: ```java @Nonnull public ExcelReadOptions <USE_TYPE> addColumn (@Nonnegative final int nIndex, @Nonnull @Nonempty final String sColumnID, @Nonnull final USE_TYPE eUseType, ...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.skipLast
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipLast(int count) { if (count < 0) { throw new IndexOutOfBoundsException("count >= 0 required but it was " + count); } if (count == 0) { ...
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipLast(int count) { if (count < 0) { throw new IndexOutOfBoundsException("count >= 0 required but it was " + count); } if (count == 0) { ...
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "T", ">", "skipLast", "(", "int", "count", ")", "{", "if", ...
Returns a Flowable that drops a specified number of items from the end of the sequence emitted by the source Publisher. <p> <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipLast.png" alt=""> <p> This Subscriber accumulates a queue long enough to store the first {@c...
[ "Returns", "a", "Flowable", "that", "drops", "a", "specified", "number", "of", "items", "from", "the", "end", "of", "the", "sequence", "emitted", "by", "the", "source", "Publisher", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "305", "src"...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L14178-L14189
test
Skip the last count items from the stream.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipLast(int count) { if (count < 0) { throw new IndexOutOfBoundsException("count >= 0 required but it ...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiff.java
CoverageDataTiff.drawTileData
@Override public byte[] drawTileData(GriddedTile griddedTile, Double[] values, int tileWidth, int tileHeight) { CoverageDataTiffImage image = drawTile(griddedTile, values, tileWidth, tileHeight); byte[] bytes = image.getImageBytes(); return byte...
java
@Override public byte[] drawTileData(GriddedTile griddedTile, Double[] values, int tileWidth, int tileHeight) { CoverageDataTiffImage image = drawTile(griddedTile, values, tileWidth, tileHeight); byte[] bytes = image.getImageBytes(); return byte...
[ "@", "Override", "public", "byte", "[", "]", "drawTileData", "(", "GriddedTile", "griddedTile", ",", "Double", "[", "]", "values", ",", "int", "tileWidth", ",", "int", "tileHeight", ")", "{", "CoverageDataTiffImage", "image", "=", "drawTile", "(", "griddedTile...
{@inheritDoc}
[ "{" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiff.java#L309-L316
test
Draw a coverage data tile.
Of course, here is the Java code you requested: ```java @Override public byte[] drawTileData(GriddedTile griddedTile, Double[] values, int tileWidth, int tileHeight) { CoverageDataTiffImage image = drawTile(griddedTile, values, tileWidth, tileHeight); ...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/firewall/RequestWrapper.java
RequestWrapper.strip
private String strip(String path) { if (path == null) { return null; } int scIndex = path.indexOf(';'); if (scIndex < 0) { int doubleSlashIndex = path.indexOf("//"); if (doubleSlashIndex < 0) { // Most likely case, no parameters in any segment and no '//', so no // stripping required retu...
java
private String strip(String path) { if (path == null) { return null; } int scIndex = path.indexOf(';'); if (scIndex < 0) { int doubleSlashIndex = path.indexOf("//"); if (doubleSlashIndex < 0) { // Most likely case, no parameters in any segment and no '//', so no // stripping required retu...
[ "private", "String", "strip", "(", "String", "path", ")", "{", "if", "(", "path", "==", "null", ")", "{", "return", "null", ";", "}", "int", "scIndex", "=", "path", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "scIndex", "<", "0", ")", "...
Removes path parameters from each path segment in the supplied path and truncates sequences of multiple '/' characters to a single '/'. @param path either the {@code servletPath} and {@code pathInfo} from the original request @return the supplied value, with path parameters removed and sequences of multiple '/' chara...
[ "Removes", "path", "parameters", "from", "each", "path", "segment", "in", "the", "supplied", "path", "and", "truncates", "sequences", "of", "multiple", "/", "characters", "to", "a", "single", "/", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/firewall/RequestWrapper.java#L71-L110
test
Strip off the path parameters and trailing slashes.
Of course, here is the Java code you requested: ```java private String strip(String path) { if (path == null) { return null; } int scIndex = path.indexOf(';'); if (scIndex < 0) { int doubleSlashIndex = path.indexOf("//"); if (doubleSlashIndex < 0) { // Most likely case, no parameters in any segm...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/Encoder.java
Encoder.make
public static Encoder make(Coder src) { long cPtr = VideoJNI.Encoder_make__SWIG_1(Coder.getCPtr(src), src); return (cPtr == 0) ? null : new Encoder(cPtr, false); }
java
public static Encoder make(Coder src) { long cPtr = VideoJNI.Encoder_make__SWIG_1(Coder.getCPtr(src), src); return (cPtr == 0) ? null : new Encoder(cPtr, false); }
[ "public", "static", "Encoder", "make", "(", "Coder", "src", ")", "{", "long", "cPtr", "=", "VideoJNI", ".", "Encoder_make__SWIG_1", "(", "Coder", ".", "getCPtr", "(", "src", ")", ",", "src", ")", ";", "return", "(", "cPtr", "==", "0", ")", "?", "null...
Creates a Encoder from a given Encoder<br> @return a Encoder<br> @throws InvalidArgument if src is null
[ "Creates", "a", "Encoder", "from", "a", "given", "Encoder<br", ">" ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Encoder.java#L141-L144
test
Create a new encoder from a given Coder.
Of course, here is the Java code you requested: ```java public static Encoder make(Coder src) { long cPtr = VideoJNI.Encoder_make__SWIG_1(Coder.getCPtr(src), src); return (cPtr == 0) ? null : new Encoder(cPtr, false); } ``` Hope this helps!
wildfly/wildfly
clustering/common/src/main/java/org/jboss/as/clustering/controller/transform/SimpleOperationTransformer.java
SimpleOperationTransformer.transformOperation
@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) { return new TransformedOperation(this.operationTransformer.transformOperation(operation), this.resultTransformer); }
java
@Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) { return new TransformedOperation(this.operationTransformer.transformOperation(operation), this.resultTransformer); }
[ "@", "Override", "public", "TransformedOperation", "transformOperation", "(", "TransformationContext", "context", ",", "PathAddress", "address", ",", "ModelNode", "operation", ")", "{", "return", "new", "TransformedOperation", "(", "this", ".", "operationTransformer", "...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/clustering/common/src/main/java/org/jboss/as/clustering/controller/transform/SimpleOperationTransformer.java#L50-L53
test
Transform an operation.
Of course, here is the Java code you requested: ```java @Override public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) { return new TransformedOperation(this.operationTransformer.transformOperation(operation), this.resultTransformer); }...
boonproject/boon
boon/src/main/java/org/boon/cache/FastConcurrentReadLruLfuFifoCache.java
FastConcurrentReadLruLfuFifoCache.get
public VALUE get( KEY key ) { CacheEntry<KEY, VALUE> cacheEntry = map.get( key ); if ( cacheEntry != null ) { cacheEntry.readCount.incrementAndGet(); return cacheEntry.value; } else { return null; } }
java
public VALUE get( KEY key ) { CacheEntry<KEY, VALUE> cacheEntry = map.get( key ); if ( cacheEntry != null ) { cacheEntry.readCount.incrementAndGet(); return cacheEntry.value; } else { return null; } }
[ "public", "VALUE", "get", "(", "KEY", "key", ")", "{", "CacheEntry", "<", "KEY", ",", "VALUE", ">", "cacheEntry", "=", "map", ".", "get", "(", "key", ")", ";", "if", "(", "cacheEntry", "!=", "null", ")", "{", "cacheEntry", ".", "readCount", ".", "i...
Get the value from the cache. It does not touch the lock so reads are fast. This does not touch the order list so it is fast. @param key the key @return value
[ "Get", "the", "value", "from", "the", "cache", ".", "It", "does", "not", "touch", "the", "lock", "so", "reads", "are", "fast", ".", "This", "does", "not", "touch", "the", "order", "list", "so", "it", "is", "fast", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/cache/FastConcurrentReadLruLfuFifoCache.java#L151-L160
test
Gets the value of the specified key.
Of course, here is the Java code you requested: ```java public VALUE get( KEY key ) { CacheEntry<KEY, VALUE> cacheEntry = map.get( key ); if ( cacheEntry != null ) { cacheEntry.readCount.incrementAndGet(); return cacheEntry.value; } else { return null; ...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasSspr
public static void cublasSspr(char uplo, int n, float alpha, Pointer x, int incx, Pointer AP) { cublasSsprNative(uplo, n, alpha, x, incx, AP); checkResultBLAS(); }
java
public static void cublasSspr(char uplo, int n, float alpha, Pointer x, int incx, Pointer AP) { cublasSsprNative(uplo, n, alpha, x, incx, AP); checkResultBLAS(); }
[ "public", "static", "void", "cublasSspr", "(", "char", "uplo", ",", "int", "n", ",", "float", "alpha", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "AP", ")", "{", "cublasSsprNative", "(", "uplo", ",", "n", ",", "alpha", ",", "x", ",", ...
<pre> void cublasSspr (char uplo, int n, float alpha, const float *x, int incx, float *AP) performs the symmetric rank 1 operation A = alpha * x * transpose(x) + A, where alpha is a single precision scalar and x is an n element single precision vector. A is a symmetric n x n matrix consisting of single precision ele...
[ "<pre", ">", "void", "cublasSspr", "(", "char", "uplo", "int", "n", "float", "alpha", "const", "float", "*", "x", "int", "incx", "float", "*", "AP", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L3276-L3280
test
Cublas Sspr for symmetric matrix.
Of course, here is the Java code you requested: ```java public static void cublasSspr(char uplo, int n, float alpha, Pointer x, int incx, Pointer AP) { cublasSsprNative(uplo, n, alpha, x, incx, AP); checkResultBLAS(); } ``` Hope this helps!
js-lib-com/tiny-container
src/main/java/js/http/encoder/QueryParametersParser.java
QueryParametersParser.isObject
private static boolean isObject(Type[] formalParameters) { if (formalParameters.length != 1) { return false; } final Type type = formalParameters[0]; if (!(type instanceof Class)) { return false; } if (Types.isPrimitive(type)) { return false; } if (Types.isArrayLike(type)) { retu...
java
private static boolean isObject(Type[] formalParameters) { if (formalParameters.length != 1) { return false; } final Type type = formalParameters[0]; if (!(type instanceof Class)) { return false; } if (Types.isPrimitive(type)) { return false; } if (Types.isArrayLike(type)) { retu...
[ "private", "static", "boolean", "isObject", "(", "Type", "[", "]", "formalParameters", ")", "{", "if", "(", "formalParameters", ".", "length", "!=", "1", ")", "{", "return", "false", ";", "}", "final", "Type", "type", "=", "formalParameters", "[", "0", "...
Test if method formal parameters designates a strict object, that is, is not primitive, array, collection or map. @param formalParameters method formal parameters list. @return true if formal parameters designates a strict object.
[ "Test", "if", "method", "formal", "parameters", "designates", "a", "strict", "object", "that", "is", "is", "not", "primitive", "array", "collection", "or", "map", "." ]
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/http/encoder/QueryParametersParser.java#L309-L330
test
Checks if the given formal parameters are of the type class type.
Of course, here is the Java code you requested: ```java private static boolean isObject(Type[] formalParameters) { if (formalParameters.length != 1) { return false; } final Type type = formalParameters[0]; if (!(type instanceof Class)) { return false; } if (Types.isPrimitive(type)) { retu...
oblac/jodd
jodd-json/src/main/java/jodd/json/JsonSerializer.java
JsonSerializer.excludeTypes
public JsonSerializer excludeTypes(final String... typeNames) { if (excludedTypeNames == null) { excludedTypeNames = typeNames; } else { excludedTypeNames = ArraysUtil.join(excludedTypeNames, typeNames); } return this; }
java
public JsonSerializer excludeTypes(final String... typeNames) { if (excludedTypeNames == null) { excludedTypeNames = typeNames; } else { excludedTypeNames = ArraysUtil.join(excludedTypeNames, typeNames); } return this; }
[ "public", "JsonSerializer", "excludeTypes", "(", "final", "String", "...", "typeNames", ")", "{", "if", "(", "excludedTypeNames", "==", "null", ")", "{", "excludedTypeNames", "=", "typeNames", ";", "}", "else", "{", "excludedTypeNames", "=", "ArraysUtil", ".", ...
Excludes type names. You can disable serialization of properties that are of some type. For example, you can disable properties of <code>InputStream</code>. You can use wildcards to describe type names.
[ "Excludes", "type", "names", ".", "You", "can", "disable", "serialization", "of", "properties", "that", "are", "of", "some", "type", ".", "For", "example", "you", "can", "disable", "properties", "of", "<code", ">", "InputStream<", "/", "code", ">", ".", "Y...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-json/src/main/java/jodd/json/JsonSerializer.java#L242-L249
test
Exclude the given types from being serialized.
Of course, here is the Java code you requested: ```java public JsonSerializer excludeTypes(final String... typeNames) { if (excludedTypeNames == null) { excludedTypeNames = typeNames; } else { excludedTypeNames = ArraysUtil.join(excludedTypeNames, typeNames); } return this; } ``` Hope this helps!
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Einzelhandel.java
Einzelhandel.setHandelTyp
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setHandelTyp(Einzelhandel.HandelTyp value) { this.handelTyp = value; }
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setHandelTyp(Einzelhandel.HandelTyp value) { this.handelTyp = value; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:54:50+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "void", "setHandelTyp", "(", "Einzelhandel", ".", "HandelTyp", "value", ")", "{", "thi...
Sets the value of the handelTyp property. @param value allowed object is {@link Einzelhandel.HandelTyp }
[ "Sets", "the", "value", "of", "the", "handelTyp", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Einzelhandel.java#L63-L66
test
Sets the value of the handelTyp property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setHandelTyp(Einzelhandel.HandelTyp value) { this.handelTyp = value; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/util/rc/RC.java
RC.insert
public Triple insert(Triple t) { if (t.key == null) return null; List<Triple> list = triplestore.get(t.key); if (list == null) list = new ArrayList<Triple>(); Triple prev = addtriple(list, t); triplestore.put(t.key, list); return prev; }
java
public Triple insert(Triple t) { if (t.key == null) return null; List<Triple> list = triplestore.get(t.key); if (list == null) list = new ArrayList<Triple>(); Triple prev = addtriple(list, t); triplestore.put(t.key, list); return prev; }
[ "public", "Triple", "insert", "(", "Triple", "t", ")", "{", "if", "(", "t", ".", "key", "==", "null", ")", "return", "null", ";", "List", "<", "Triple", ">", "list", "=", "triplestore", ".", "get", "(", "t", ".", "key", ")", ";", "if", "(", "li...
Allow for external loading
[ "Allow", "for", "external", "loading" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/rc/RC.java#L417-L425
test
Insert a new triple into the list of triples.
Of course, here is the Java code you requested: ```java public Triple insert(Triple t) { if (t.key == null) return null; List<Triple> list = triplestore.get(t.key); if (list == null) list = new ArrayList<Triple>(); Triple prev = addtriple(list, t); triplestore.put(t.key, list); return prev; ...
abmargb/jamppa
src/main/java/org/jamppa/component/utils/XMPPUtils.java
XMPPUtils.error
public static IQ error(IQ iq, String errorMessage) { return XMPPUtils.createErrorResponse(iq, errorMessage, Condition.bad_request, Type.modify); }
java
public static IQ error(IQ iq, String errorMessage) { return XMPPUtils.createErrorResponse(iq, errorMessage, Condition.bad_request, Type.modify); }
[ "public", "static", "IQ", "error", "(", "IQ", "iq", ",", "String", "errorMessage", ")", "{", "return", "XMPPUtils", ".", "createErrorResponse", "(", "iq", ",", "errorMessage", ",", "Condition", ".", "bad_request", ",", "Type", ".", "modify", ")", ";", "}" ...
Logs the error and returns an IQ error response @param iq @param errorMessage @param logger @return
[ "Logs", "the", "error", "and", "returns", "an", "IQ", "error", "response" ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jamppa/component/utils/XMPPUtils.java#L47-L50
test
Create an error response for a CID language request.
Of course, here is the Java code you requested: ```java public static IQ error(IQ iq, String errorMessage) { return XMPPUtils.createErrorResponse(iq, errorMessage, Condition.bad_request, Type.modify); } ``` Hope this helps!
oblac/jodd
jodd-petite/src/main/java/jodd/petite/BeanDefinition.java
BeanDefinition.addDestroyMethodPoints
protected void addDestroyMethodPoints(final DestroyMethodPoint[] methods) { if (destroyMethods == null) { destroyMethods = methods; } else { destroyMethods = ArraysUtil.join(destroyMethods, methods); } }
java
protected void addDestroyMethodPoints(final DestroyMethodPoint[] methods) { if (destroyMethods == null) { destroyMethods = methods; } else { destroyMethods = ArraysUtil.join(destroyMethods, methods); } }
[ "protected", "void", "addDestroyMethodPoints", "(", "final", "DestroyMethodPoint", "[", "]", "methods", ")", "{", "if", "(", "destroyMethods", "==", "null", ")", "{", "destroyMethods", "=", "methods", ";", "}", "else", "{", "destroyMethods", "=", "ArraysUtil", ...
Adds destroy methods.
[ "Adds", "destroy", "methods", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/BeanDefinition.java#L244-L250
test
Add destroy method points.
Of course, here is the Java code you requested: ```java protected void addDestroyMethodPoints(final DestroyMethodPoint[] methods) { if (destroyMethods == null) { destroyMethods = methods; } else { destroyMethods = ArraysUtil.join(destroyMethods, methods); } } ``` Hope this helps!
streamsets/datacollector
omniture-lib/src/main/java/com/streamsets/pipeline/stage/origin/omniture/OmnitureSource.java
OmnitureSource.validateReportDescription
private void validateReportDescription(List<ConfigIssue> issues){ if(!jsonMapper.isValidJson(this.reportDescription)) { issues.add( getContext().createConfigIssue( Groups.REPORT.name(), "reportDescription", Errors.OMNITURE_03 )); } }
java
private void validateReportDescription(List<ConfigIssue> issues){ if(!jsonMapper.isValidJson(this.reportDescription)) { issues.add( getContext().createConfigIssue( Groups.REPORT.name(), "reportDescription", Errors.OMNITURE_03 )); } }
[ "private", "void", "validateReportDescription", "(", "List", "<", "ConfigIssue", ">", "issues", ")", "{", "if", "(", "!", "jsonMapper", ".", "isValidJson", "(", "this", ".", "reportDescription", ")", ")", "{", "issues", ".", "add", "(", "getContext", "(", ...
Validate Ominture Report Description.
[ "Validate", "Ominture", "Report", "Description", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/omniture-lib/src/main/java/com/streamsets/pipeline/stage/origin/omniture/OmnitureSource.java#L96-L105
test
Validate the reportDescription
Of course, here is the Java code you requested: ```java private void validateReportDescription(List<ConfigIssue> issues){ if(!jsonMapper.isValidJson(this.reportDescription)) { issues.add( getContext().createConfigIssue( Groups.REPORT.name(), "reportDescription", ...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.materialize
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<Notification<T>> materialize() { return RxJavaPlugins.onAssembly(new FlowableMaterialize<T>(this)); }
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<Notification<T>> materialize() { return RxJavaPlugins.onAssembly(new FlowableMaterialize<T>(this)); }
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "Notification", "<", "T", ">", ">", "materialize", "(", ")", ...
Returns a Flowable that represents all of the emissions <em>and</em> notifications from the source Publisher into emissions marked with their original types within {@link Notification} objects. <p> <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/materialize.png" alt="...
[ "Returns", "a", "Flowable", "that", "represents", "all", "of", "the", "emissions", "<em", ">", "and<", "/", "em", ">", "notifications", "from", "the", "source", "Publisher", "into", "emissions", "marked", "with", "their", "original", "types", "within", "{", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L11374-L11379
test
Materialize the source notification.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<Notification<T>> materialize() { return RxJavaPlugins.onAssembly(new FlowableMaterialize<T>(this)); } ``` Hope th...
walokra/markdown-page-generator-plugin
src/main/java/com/ruleoftech/markdown/page/generator/plugin/MdPageGeneratorMojo.java
MdPageGeneratorMojo.processAttributes
private Map<String, Attributes> processAttributes(String[] attributeList) { HashMap<String, Attributes> nodeAttributeMap = new HashMap<>(); for (String attribute : attributeList) { String[] nodeAttributes = attribute.split("\\|"); Attributes attributes = new Attributes(); ...
java
private Map<String, Attributes> processAttributes(String[] attributeList) { HashMap<String, Attributes> nodeAttributeMap = new HashMap<>(); for (String attribute : attributeList) { String[] nodeAttributes = attribute.split("\\|"); Attributes attributes = new Attributes(); ...
[ "private", "Map", "<", "String", ",", "Attributes", ">", "processAttributes", "(", "String", "[", "]", "attributeList", ")", "{", "HashMap", "<", "String", ",", "Attributes", ">", "nodeAttributeMap", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", ...
Parse attributes of the form NodeName:attributeName=attribute value:attributeName=attribute value... @param attributeList list of attributes @return map of Node class to attributable part and attributes
[ "Parse", "attributes", "of", "the", "form", "NodeName", ":", "attributeName", "=", "attribute", "value", ":", "attributeName", "=", "attribute", "value", "..." ]
2d5e0e6ca7a4509c9443d6d2fcf99dd9486bc5f7
https://github.com/walokra/markdown-page-generator-plugin/blob/2d5e0e6ca7a4509c9443d6d2fcf99dd9486bc5f7/src/main/java/com/ruleoftech/markdown/page/generator/plugin/MdPageGeneratorMojo.java#L288-L313
test
Process attributes.
Of course, here is the Java code you requested: ```java private Map<String, Attributes> processAttributes(String[] attributeList) { HashMap<String, Attributes> nodeAttributeMap = new HashMap<>(); for (String attribute : attributeList) { String[] nodeAttributes = attribute.split("\\|"); ...
Unidata/thredds
ui/src/main/java/ucar/util/prefs/ui/Debug.java
Debug.addToMenu
static private void addToMenu( JMenu menu, Preferences prefs) throws BackingStoreException { if (debug) System.out.println(" addMenu "+ prefs.name()); String[] keys = prefs.keys(); for (String key : keys) { boolean bval = prefs.getBoolean(key, false); String fullname = prefs.absolutePath() + "/...
java
static private void addToMenu( JMenu menu, Preferences prefs) throws BackingStoreException { if (debug) System.out.println(" addMenu "+ prefs.name()); String[] keys = prefs.keys(); for (String key : keys) { boolean bval = prefs.getBoolean(key, false); String fullname = prefs.absolutePath() + "/...
[ "static", "private", "void", "addToMenu", "(", "JMenu", "menu", ",", "Preferences", "prefs", ")", "throws", "BackingStoreException", "{", "if", "(", "debug", ")", "System", ".", "out", ".", "println", "(", "\" addMenu \"", "+", "prefs", ".", "name", "(", "...
recursive menu adding
[ "recursive", "menu", "adding" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/util/prefs/ui/Debug.java#L157-L175
test
Add all the items in the preferences to the menu
Of course, here is the Java code you requested: ```java static private void addToMenu( JMenu menu, Preferences prefs) throws BackingStoreException { if (debug) System.out.println(" addMenu "+ prefs.name()); String[] keys = prefs.keys(); for (String key : keys) { boolean bval = prefs.getBoolean(key, ...
Unidata/thredds
tds/src/main/java/thredds/core/ConfigCatalogInitialization.java
ConfigCatalogInitialization.makeDebugActions
public void makeDebugActions() { DebugCommands.Category debugHandler = debugCommands.findCategory("Catalogs"); DebugCommands.Action act; act = new DebugCommands.Action("showCatalogExt", "Show known catalogs") { public void doAction(DebugCommands.Event e) { e.pw.printf("numberCatalogs=%d ne...
java
public void makeDebugActions() { DebugCommands.Category debugHandler = debugCommands.findCategory("Catalogs"); DebugCommands.Action act; act = new DebugCommands.Action("showCatalogExt", "Show known catalogs") { public void doAction(DebugCommands.Event e) { e.pw.printf("numberCatalogs=%d ne...
[ "public", "void", "makeDebugActions", "(", ")", "{", "DebugCommands", ".", "Category", "debugHandler", "=", "debugCommands", ".", "findCategory", "(", "\"Catalogs\"", ")", ";", "DebugCommands", ".", "Action", "act", ";", "act", "=", "new", "DebugCommands", ".", ...
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
[ "/////////////////////////////////////////////////////////////////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/core/ConfigCatalogInitialization.java#L466-L508
test
Make the debug actions
Of course, here is the Java code you requested: ```java public void makeDebugActions() { DebugCommands.Category debugHandler = debugCommands.findCategory("Catalogs"); DebugCommands.Action act; act = new DebugCommands.Action("showCatalogExt", "Show known catalogs") { public void doAction(DebugComma...
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/kb/Concept.java
Concept.getUris
public StringList getUris() { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_uris == null) jcasType.jcas.throwFeatMissing("uris", "edu.cmu.lti.oaqa.type.kb.Concept"); return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Concept_Type)jcasType).casFeatCod...
java
public StringList getUris() { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_uris == null) jcasType.jcas.throwFeatMissing("uris", "edu.cmu.lti.oaqa.type.kb.Concept"); return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Concept_Type)jcasType).casFeatCod...
[ "public", "StringList", "getUris", "(", ")", "{", "if", "(", "Concept_Type", ".", "featOkTst", "&&", "(", "(", "Concept_Type", ")", "jcasType", ")", ".", "casFeat_uris", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"uris\"", ...
getter for uris - gets Array of uris that identify this named entity. There may be more than one uri if this named entity is ambiguous. @generated @return value of the feature
[ "getter", "for", "uris", "-", "gets", "Array", "of", "uris", "that", "identify", "this", "named", "entity", ".", "There", "may", "be", "more", "than", "one", "uri", "if", "this", "named", "entity", "is", "ambiguous", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/kb/Concept.java#L98-L101
test
getter for uris - gets
Of course, here is the Java code you requested: ```java public StringList getUris() { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_uris == null) jcasType.jcas.throwFeatMissing("uris", "edu.cmu.lti.oaqa.type.kb.Concept"); return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas...
stanfy/enroscar
io/src/main/java/com/stanfy/enroscar/io/PoolableBufferedInputStream.java
PoolableBufferedInputStream.available
@Override public synchronized int available() throws IOException { final InputStream localIn = in; // 'in' could be invalidated by close() if (buf == null || localIn == null) { throw new IOException("Stream is closed"); } return count - pos + localIn.available(); }
java
@Override public synchronized int available() throws IOException { final InputStream localIn = in; // 'in' could be invalidated by close() if (buf == null || localIn == null) { throw new IOException("Stream is closed"); } return count - pos + localIn.available(); }
[ "@", "Override", "public", "synchronized", "int", "available", "(", ")", "throws", "IOException", "{", "final", "InputStream", "localIn", "=", "in", ";", "// 'in' could be invalidated by close()\r", "if", "(", "buf", "==", "null", "||", "localIn", "==", "null", ...
Returns the number of bytes that are available before this stream will block. This method returns the number of bytes available in the buffer plus those available in the source stream. @return the number of bytes available before blocking. @throws IOException if this stream is closed.
[ "Returns", "the", "number", "of", "bytes", "that", "are", "available", "before", "this", "stream", "will", "block", ".", "This", "method", "returns", "the", "number", "of", "bytes", "available", "in", "the", "buffer", "plus", "those", "available", "in", "the...
0e64f3c309d62e359b55ddcba10e3cc592f5e083
https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/io/src/main/java/com/stanfy/enroscar/io/PoolableBufferedInputStream.java#L71-L76
test
Returns the number of bytes available in this stream.
Of course, here is the Java code you requested: ```java @Override public synchronized int available() throws IOException { final InputStream localIn = in; // 'in' could be invalidated by close() if (buf == null || localIn == null) { throw new IOException("Stream is closed"); } return count - pos + lo...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasSgemv
public static void cublasSgemv(char trans, int m, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy) { cublasSgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy); checkResultBLAS(); }
java
public static void cublasSgemv(char trans, int m, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy) { cublasSgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy); checkResultBLAS(); }
[ "public", "static", "void", "cublasSgemv", "(", "char", "trans", ",", "int", "m", ",", "int", "n", ",", "float", "alpha", ",", "Pointer", "A", ",", "int", "lda", ",", "Pointer", "x", ",", "int", "incx", ",", "float", "beta", ",", "Pointer", "y", ",...
<pre> cublasSgemv (char trans, int m, int n, float alpha, const float *A, int lda, const float *x, int incx, float beta, float *y, int incy) performs one of the matrix-vector operations y = alpha * op(A) * x + beta * y, where op(A) is one of op(A) = A or op(A) = transpose(A) where alpha and beta are single pre...
[ "<pre", ">", "cublasSgemv", "(", "char", "trans", "int", "m", "int", "n", "float", "alpha", "const", "float", "*", "A", "int", "lda", "const", "float", "*", "x", "int", "incx", "float", "beta", "float", "*", "y", "int", "incy", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L3020-L3024
test
Cublas S GEMV operation
Of course, here is the Java code you requested: ```java public static void cublasSgemv(char trans, int m, int n, float alpha, Pointer A, int lda, Pointer x, int incx, float beta, Pointer y, int incy) { cublasSgemvNative(trans, m, n, alpha, A, lda, x, incx, beta, y, incy); checkResultBLAS(); ...
playframework/playframework
core/play-guice/src/main/java/play/inject/guice/GuiceApplicationBuilder.java
GuiceApplicationBuilder.withConfigLoader
public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) { return newBuilder( delegate.loadConfig( func( (play.api.Environment env) -> new play.api.Configuration(load.apply(new Environment(env)))))); }
java
public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) { return newBuilder( delegate.loadConfig( func( (play.api.Environment env) -> new play.api.Configuration(load.apply(new Environment(env)))))); }
[ "public", "GuiceApplicationBuilder", "withConfigLoader", "(", "Function", "<", "Environment", ",", "Config", ">", "load", ")", "{", "return", "newBuilder", "(", "delegate", ".", "loadConfig", "(", "func", "(", "(", "play", ".", "api", ".", "Environment", "env"...
Set the initial configuration loader. Overrides the default or any previously configured values. @param load the configuration loader @return the configured application builder
[ "Set", "the", "initial", "configuration", "loader", ".", "Overrides", "the", "default", "or", "any", "previously", "configured", "values", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play-guice/src/main/java/play/inject/guice/GuiceApplicationBuilder.java#L42-L48
test
Creates a new application builder using the specified configuration loader.
Of course, here is the Java code you requested: ```java public GuiceApplicationBuilder withConfigLoader(Function<Environment, Config> load) { return newBuilder( delegate.loadConfig( func( (play.api.Environment env) -> new play.api.Configuration(load.apply(new...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java
CFpointObs.identifyEncodingStation
protected boolean identifyEncodingStation(NetcdfDataset ds, EncodingInfo info, CF.FeatureType ftype, Formatter errlog) { // find the obs dimension Dimension obsDim = null; if (info.time.getRank() > 0) obsDim = info.time.getDimension(info.time.getRank() - 1); // may be time(time) or time(stn, obs) ...
java
protected boolean identifyEncodingStation(NetcdfDataset ds, EncodingInfo info, CF.FeatureType ftype, Formatter errlog) { // find the obs dimension Dimension obsDim = null; if (info.time.getRank() > 0) obsDim = info.time.getDimension(info.time.getRank() - 1); // may be time(time) or time(stn, obs) ...
[ "protected", "boolean", "identifyEncodingStation", "(", "NetcdfDataset", "ds", ",", "EncodingInfo", "info", ",", "CF", ".", "FeatureType", "ftype", ",", "Formatter", "errlog", ")", "{", "// find the obs dimension\r", "Dimension", "obsDim", "=", "null", ";", "if", ...
for stations, figure out the encoding
[ "for", "stations", "figure", "out", "the", "encoding" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java#L691-L730
test
identifyEncodingStation This is a helper method for identifyStation to identify the station.
Of course, here is the Java code you requested: ```java protected boolean identifyEncodingStation(NetcdfDataset ds, EncodingInfo info, CF.FeatureType ftype, Formatter errlog) { // find the obs dimension Dimension obsDim = null; if (info.time.getRank() > 0) obsDim = info.time.getDimension(info.tim...
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PositionAndOccurrenceVisitor.java
PositionAndOccurrenceVisitor.enterVariable
protected void enterVariable(Variable variable) { // Initialize the count to one or add one to an existing count. Integer count = (Integer) symbolTable.get(variable.getSymbolKey(), SymbolTableKeys.SYMKEY_VAR_OCCURRENCE_COUNT); count = (count == null) ? 1 : (count + 1); symbolTable.pu...
java
protected void enterVariable(Variable variable) { // Initialize the count to one or add one to an existing count. Integer count = (Integer) symbolTable.get(variable.getSymbolKey(), SymbolTableKeys.SYMKEY_VAR_OCCURRENCE_COUNT); count = (count == null) ? 1 : (count + 1); symbolTable.pu...
[ "protected", "void", "enterVariable", "(", "Variable", "variable", ")", "{", "// Initialize the count to one or add one to an existing count.", "Integer", "count", "=", "(", "Integer", ")", "symbolTable", ".", "get", "(", "variable", ".", "getSymbolKey", "(", ")", ","...
{@inheritDoc} <p/>Counts variable occurrences and detects if the variable ever appears in an argument position.
[ "{", "@inheritDoc", "}" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PositionAndOccurrenceVisitor.java#L97-L129
test
Enter a variable in the C ++ language.
Of course, here is the Java code you requested: ```java protected void enterVariable(Variable variable) { // Initialize the count to one or add one to an existing count. Integer count = (Integer) symbolTable.get(variable.getSymbolKey(), SymbolTableKeys.SYMKEY_VAR_OCCURRENCE_COUNT); count = ...
Unidata/thredds
udunits/src/main/java/ucar/units/UnitDBImpl.java
UnitDBImpl.get
public Unit get(final String id) { Unit unit = getBySymbol(id); if (unit == null) { unit = getByName(id); } return unit; }
java
public Unit get(final String id) { Unit unit = getBySymbol(id); if (unit == null) { unit = getByName(id); } return unit; }
[ "public", "Unit", "get", "(", "final", "String", "id", ")", "{", "Unit", "unit", "=", "getBySymbol", "(", "id", ")", ";", "if", "(", "unit", "==", "null", ")", "{", "unit", "=", "getByName", "(", "id", ")", ";", "}", "return", "unit", ";", "}" ]
Gets a unit by either name, plural, or symbol. Retrieving the unit by symbol is attempted before retrieving the unit by name because symbol comparisons are case sensitive and, hence, should be more robust. @param id The id to be matched. @return The unit whose name, plural, or symbol matches or <code>null</code> if no...
[ "Gets", "a", "unit", "by", "either", "name", "plural", "or", "symbol", ".", "Retrieving", "the", "unit", "by", "symbol", "is", "attempted", "before", "retrieving", "the", "unit", "by", "name", "because", "symbol", "comparisons", "are", "case", "sensitive", "...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/UnitDBImpl.java#L231-L237
test
Get a Unit object by its ID.
Of course, here is the Java code you requested: ```java public Unit get(final String id) { Unit unit = getBySymbol(id); if (unit == null) { unit = getByName(id); } return unit; } ``` Hope this helps!
js-lib-com/tiny-container
src/main/java/js/servlet/TinyContainer.java
TinyContainer.contextInitialized
@Override public void contextInitialized(ServletContextEvent contextEvent) { final ServletContext servletContext = contextEvent.getServletContext(); /** Logger diagnostic context stores contextual information regarding current request. */ LogContext logContext = LogFactory.getLogContext(); logContext.pu...
java
@Override public void contextInitialized(ServletContextEvent contextEvent) { final ServletContext servletContext = contextEvent.getServletContext(); /** Logger diagnostic context stores contextual information regarding current request. */ LogContext logContext = LogFactory.getLogContext(); logContext.pu...
[ "@", "Override", "public", "void", "contextInitialized", "(", "ServletContextEvent", "contextEvent", ")", "{", "final", "ServletContext", "servletContext", "=", "contextEvent", ".", "getServletContext", "(", ")", ";", "/** Logger diagnostic context stores contextual informati...
Implements tiny container boostrap logic. See class description for overall performed steps. Also loads context parameters from external descriptors using {@link ServletContext#getInitParameter(String)}. <p> Context initialized listener is not allowed to throw exceptions and it seems there is no standard way to ask ser...
[ "Implements", "tiny", "container", "boostrap", "logic", ".", "See", "class", "description", "for", "overall", "performed", "steps", ".", "Also", "loads", "context", "parameters", "from", "external", "descriptors", "using", "{", "@link", "ServletContext#getInitParamete...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/servlet/TinyContainer.java#L239-L274
test
Handle servlet context initialization.
Of course, here is the Java code you requested: ```java @Override public void contextInitialized(ServletContextEvent contextEvent) { final ServletContext servletContext = contextEvent.getServletContext(); /** Logger diagnostic context stores contextual information regarding current request. */ LogContext ...
RestComm/jain-slee
container/resource/src/main/java/org/mobicents/slee/resource/SleeEndpointImpl.java
SleeEndpointImpl.checkStartActivityParameters
private void checkStartActivityParameters(ActivityHandle handle, Object activity) throws NullPointerException, IllegalStateException { // check args if (handle == null) { throw new NullPointerException("null handle"); } if (activity == null) { throw new NullPointerException("null activity"); } // ...
java
private void checkStartActivityParameters(ActivityHandle handle, Object activity) throws NullPointerException, IllegalStateException { // check args if (handle == null) { throw new NullPointerException("null handle"); } if (activity == null) { throw new NullPointerException("null activity"); } // ...
[ "private", "void", "checkStartActivityParameters", "(", "ActivityHandle", "handle", ",", "Object", "activity", ")", "throws", "NullPointerException", ",", "IllegalStateException", "{", "// check args", "if", "(", "handle", "==", "null", ")", "{", "throw", "new", "Nu...
Checks the parameters of startActivity* methods @param handle @param activity @throws NullPointerException @throws IllegalStateException
[ "Checks", "the", "parameters", "of", "startActivity", "*", "methods" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/resource/src/main/java/org/mobicents/slee/resource/SleeEndpointImpl.java#L265-L280
test
Check if the start activity parameters are valid.
Of course, here is the Java code you requested: ```java private void checkStartActivityParameters(ActivityHandle handle, Object activity) throws NullPointerException, IllegalStateException { // check args if (handle == null) { throw new NullPointerException("null handle"); } if (activity == null) { t...
cologneintelligence/FitGoodies
fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/date/SetupFixture.java
SetupFixture.format
public void format(final String format) { FitDateHelper helper = DependencyManager.getOrCreate(FitDateHelper.class); helper.setFormat(format); }
java
public void format(final String format) { FitDateHelper helper = DependencyManager.getOrCreate(FitDateHelper.class); helper.setFormat(format); }
[ "public", "void", "format", "(", "final", "String", "format", ")", "{", "FitDateHelper", "helper", "=", "DependencyManager", ".", "getOrCreate", "(", "FitDateHelper", ".", "class", ")", ";", "helper", ".", "setFormat", "(", "format", ")", ";", "}" ]
Sets the format value to {@code format}. @param format format string which is parsable by {@link SimpleDateFormat} @see FitDateHelper#setFormat(String) SetupHelper.setFormat(String) @see FitDateHelper#getFormat() SetupHelper.getFormat()
[ "Sets", "the", "format", "value", "to", "{", "@code", "format", "}", "." ]
834e42d1f41b4b9226060b1e83a80cc69ea88c7b
https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/date/SetupFixture.java#L79-L82
test
Set the format of the date.
Of course, here is the Java code you requested: ```java public void format(final String format) { FitDateHelper helper = DependencyManager.getOrCreate(FitDateHelper.class); helper.setFormat(format); } ``` Hope this helps!
oblac/jodd
jodd-bean/src/main/java/jodd/typeconverter/Converter.java
Converter.toFloatValue
public float toFloatValue(final Object value, final float defaultValue) { final Float result = toFloat(value); if (result == null) { return defaultValue; } return result.floatValue(); }
java
public float toFloatValue(final Object value, final float defaultValue) { final Float result = toFloat(value); if (result == null) { return defaultValue; } return result.floatValue(); }
[ "public", "float", "toFloatValue", "(", "final", "Object", "value", ",", "final", "float", "defaultValue", ")", "{", "final", "Float", "result", "=", "toFloat", "(", "value", ")", ";", "if", "(", "result", "==", "null", ")", "{", "return", "defaultValue", ...
Converts value to <code>float</code>. Returns default value when conversion result is <code>null</code>.
[ "Converts", "value", "to", "<code", ">", "float<", "/", "code", ">", ".", "Returns", "default", "value", "when", "conversion", "result", "is", "<code", ">", "null<", "/", "code", ">", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/typeconverter/Converter.java#L194-L200
test
Converts value into a float.
Of course, here is the Java code you requested: ```java public float toFloatValue(final Object value, final float defaultValue) { final Float result = toFloat(value); if (result == null) { return defaultValue; } return result.floatValue(); } ``` Hope this helps!
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/factory/SimpleProcessorsFactory.java
SimpleProcessorsFactory.setResourcePreProcessors
public void setResourcePreProcessors(final Collection<ResourcePreProcessor> processors) { preProcessors.clear(); if (processors != null) { preProcessors.addAll(processors); } }
java
public void setResourcePreProcessors(final Collection<ResourcePreProcessor> processors) { preProcessors.clear(); if (processors != null) { preProcessors.addAll(processors); } }
[ "public", "void", "setResourcePreProcessors", "(", "final", "Collection", "<", "ResourcePreProcessor", ">", "processors", ")", "{", "preProcessors", ".", "clear", "(", ")", ";", "if", "(", "processors", "!=", "null", ")", "{", "preProcessors", ".", "addAll", "...
{@inheritDoc}
[ "{" ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/factory/SimpleProcessorsFactory.java#L59-L64
test
Sets the list of resource pre processors.
Of course, here is the Java code you requested: ```java public void setResourcePreProcessors(final Collection<ResourcePreProcessor> processors) { preProcessors.clear(); if (processors != null) { preProcessors.addAll(processors); } } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/io/TextFiles.java
TextFiles.tail
public static List<String> tail(File f, Charset charset) throws IOException { return tail(f, 10, charset); }
java
public static List<String> tail(File f, Charset charset) throws IOException { return tail(f, 10, charset); }
[ "public", "static", "List", "<", "String", ">", "tail", "(", "File", "f", ",", "Charset", "charset", ")", "throws", "IOException", "{", "return", "tail", "(", "f", ",", "10", ",", "charset", ")", ";", "}" ]
Returns the last (up to 10) lines of the given {@code File} using the specified charset. Named after the Unix command of the same name. @param f the {@code File} to read. @param charset the charset to use. @return the last lines of the given {@code File}. @throws NullPointerException if one of the arguments is {@cod...
[ "Returns", "the", "last", "(", "up", "to", "10", ")", "lines", "of", "the", "given", "{", "@code", "File", "}", "using", "the", "specified", "charset", ".", "Named", "after", "the", "Unix", "command", "of", "the", "same", "name", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/TextFiles.java#L180-L183
test
Returns the tail of the file.
Of course, here is the Java code you requested: ```java public static List<String> tail(File f, Charset charset) throws IOException { return tail(f, 10, charset); } ``` Hope this helps!
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/kb/Concept.java
Concept.getNames
public StringList getNames() { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_names == null) jcasType.jcas.throwFeatMissing("names", "edu.cmu.lti.oaqa.type.kb.Concept"); return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Concept_Type)jcasType).casFeat...
java
public StringList getNames() { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_names == null) jcasType.jcas.throwFeatMissing("names", "edu.cmu.lti.oaqa.type.kb.Concept"); return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Concept_Type)jcasType).casFeat...
[ "public", "StringList", "getNames", "(", ")", "{", "if", "(", "Concept_Type", ".", "featOkTst", "&&", "(", "(", "Concept_Type", ")", "jcasType", ")", ".", "casFeat_names", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"names\"",...
getter for names - gets All name variants (preferred/default name, synonyms, lexicial variants, etc) of the concept. @generated @return value of the feature
[ "getter", "for", "names", "-", "gets", "All", "name", "variants", "(", "preferred", "/", "default", "name", "synonyms", "lexicial", "variants", "etc", ")", "of", "the", "concept", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/kb/Concept.java#L76-L79
test
getter for names - gets
Of course, here is the Java code you requested: ```java public StringList getNames() { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_names == null) jcasType.jcas.throwFeatMissing("names", "edu.cmu.lti.oaqa.type.kb.Concept"); return (StringList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_...
tiefaces/TieFaces
src/org/tiefaces/common/FacesUtility.java
FacesUtility.findBean
@SuppressWarnings("unchecked") public static <T> T findBean(final String beanName) { FacesContext context = FacesContext.getCurrentInstance(); return (T) context.getApplication().evaluateExpressionGet(context, TieConstants.EL_START + beanName + TieConstants.EL_END, Object.class); }
java
@SuppressWarnings("unchecked") public static <T> T findBean(final String beanName) { FacesContext context = FacesContext.getCurrentInstance(); return (T) context.getApplication().evaluateExpressionGet(context, TieConstants.EL_START + beanName + TieConstants.EL_END, Object.class); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "T", "findBean", "(", "final", "String", "beanName", ")", "{", "FacesContext", "context", "=", "FacesContext", ".", "getCurrentInstance", "(", ")", ";", "return", "(", "T"...
Find bean in context. @param <T> This is the type parameter. @param beanName bean name. @return bean object.
[ "Find", "bean", "in", "context", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/common/FacesUtility.java#L205-L211
test
Find a bean by its name.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T> T findBean(final String beanName) { FacesContext context = FacesContext.getCurrentInstance(); return (T) context.getApplication().evaluateExpressionGet(context, TieConstants.EL_START + beanName + TieCo...
chenlb/mmseg4j-from-googlecode
src/com/chenlb/mmseg4j/Seg.java
Seg.printChunk
protected void printChunk(List<Chunk> chunks) { for(Chunk ck : chunks) { System.out.println(ck+" -> "+ck.toFactorString()); } }
java
protected void printChunk(List<Chunk> chunks) { for(Chunk ck : chunks) { System.out.println(ck+" -> "+ck.toFactorString()); } }
[ "protected", "void", "printChunk", "(", "List", "<", "Chunk", ">", "chunks", ")", "{", "for", "(", "Chunk", "ck", ":", "chunks", ")", "{", "System", ".", "out", ".", "println", "(", "ck", "+", "\" -> \"", "+", "ck", ".", "toFactorString", "(", ")", ...
输出 chunks, 调试用.
[ "输出", "chunks", "调试用", "." ]
3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb
https://github.com/chenlb/mmseg4j-from-googlecode/blob/3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb/src/com/chenlb/mmseg4j/Seg.java#L23-L27
test
Print a list of chunks to stdout.
Of course, here is the Java code you requested: ```java protected void printChunk(List<Chunk> chunks) { for(Chunk ck : chunks) { System.out.println(ck+" -> "+ck.toFactorString()); } } ``` Hope this helps!
objectify/objectify
src/main/java/com/googlecode/objectify/impl/KeyMetadata.java
KeyMetadata.getIncompleteKey
public IncompleteKey getIncompleteKey(final P pojo) { log.trace("Getting key from {}", pojo); if (!clazz.isAssignableFrom(pojo.getClass())) throw new IllegalArgumentException("Trying to use metadata for " + clazz.getName() + " to get key of " + pojo.getClass().getName()); final Object id = getId(pojo); fin...
java
public IncompleteKey getIncompleteKey(final P pojo) { log.trace("Getting key from {}", pojo); if (!clazz.isAssignableFrom(pojo.getClass())) throw new IllegalArgumentException("Trying to use metadata for " + clazz.getName() + " to get key of " + pojo.getClass().getName()); final Object id = getId(pojo); fin...
[ "public", "IncompleteKey", "getIncompleteKey", "(", "final", "P", "pojo", ")", "{", "log", ".", "trace", "(", "\"Getting key from {}\"", ",", "pojo", ")", ";", "if", "(", "!", "clazz", ".", "isAssignableFrom", "(", "pojo", ".", "getClass", "(", ")", ")", ...
Gets a key composed of the relevant id and parent fields in the object. @param pojo must be of the entityClass type for this metadata. @return either a Key or IncompleteKey depending on whether the id is null or not
[ "Gets", "a", "key", "composed", "of", "the", "relevant", "id", "and", "parent", "fields", "in", "the", "object", "." ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/KeyMetadata.java#L174-L187
test
Gets the incomplete key for the given pojo.
Of course, here is the Java code you requested: ```java public IncompleteKey getIncompleteKey(final P pojo) { log.trace("Getting key from {}", pojo); if (!clazz.isAssignableFrom(pojo.getClass())) throw new IllegalArgumentException("Trying to use metadata for " + clazz.getName() + " to get key of " + pojo.getCl...
streamsets/datacollector
common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Pattern.java
Pattern.isSlashEscapedChar
static private boolean isSlashEscapedChar(String s, int pos) { // Count the backslashes preceding this position. If it's // even, there is no escape and the slashes are just literals. // If it's odd, one of the slashes (the last one) is escaping // the character at the given position. ...
java
static private boolean isSlashEscapedChar(String s, int pos) { // Count the backslashes preceding this position. If it's // even, there is no escape and the slashes are just literals. // If it's odd, one of the slashes (the last one) is escaping // the character at the given position. ...
[ "static", "private", "boolean", "isSlashEscapedChar", "(", "String", "s", ",", "int", "pos", ")", "{", "// Count the backslashes preceding this position. If it's", "// even, there is no escape and the slashes are just literals.", "// If it's odd, one of the slashes (the last one) is esca...
Determines if the character at the specified position of a string is escaped with a backslash @param s string to evaluate @param pos the position of the character to evaluate @return true if the character is escaped; otherwise false
[ "Determines", "if", "the", "character", "at", "the", "specified", "position", "of", "a", "string", "is", "escaped", "with", "a", "backslash" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Pattern.java#L304-L316
test
isSlashEscapedChar This method checks if the given string contains a backslash character at the given position.
Of course, here is the Java code you requested: ```java static private boolean isSlashEscapedChar(String s, int pos) { // Count the backslashes preceding this position. If it's // even, there is no escape and the slashes are just literals. // If it's odd, one of the slashes (the last one) is e...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.doAfterNext
@CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> doAfterNext(Consumer<? super T> onAfterNext) { ObjectHelper.requireNonNull(onAfterNext, "onAfterNext is null"); return RxJavaPlugins.onAssembly(new Flowable...
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> doAfterNext(Consumer<? super T> onAfterNext) { ObjectHelper.requireNonNull(onAfterNext, "onAfterNext is null"); return RxJavaPlugins.onAssembly(new Flowable...
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "PASS_THROUGH", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "T", ">", "doAfterNext", "(", "Consumer", "<", "?", "s...
Calls the specified consumer with the current item after this item has been emitted to the downstream. <p>Note that the {@code onAfterNext} action is shared between subscriptions and as such should be thread-safe. <dl> <dt><b>Backpressure:</b></dt> <dd>The operator doesn't interfere with backpressure which is determine...
[ "Calls", "the", "specified", "consumer", "with", "the", "current", "item", "after", "this", "item", "has", "been", "emitted", "to", "the", "downstream", ".", "<p", ">", "Note", "that", "the", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L9025-L9031
test
Asynchronously executes a sequence of items after the next sequence of items has been received.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> doAfterNext(Consumer<? super T> onAfterNext) { ObjectHelper.requireNonNull(onAfterNext, "onAfterNext is nul...