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
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.blockingSubscribe
@BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) public final void blockingSubscribe(Subscriber<? super T> subscriber) { FlowableBlockingSubscribe.subscribe(this, subscriber); }
java
@BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) public final void blockingSubscribe(Subscriber<? super T> subscriber) { FlowableBlockingSubscribe.subscribe(this, subscriber); }
[ "@", "BackpressureSupport", "(", "BackpressureKind", ".", "SPECIAL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "void", "blockingSubscribe", "(", "Subscriber", "<", "?", "super", "T", ">", "subscriber", ")", "{", ...
Subscribes to the source and calls the {@link Subscriber} methods <strong>on the current thread</strong>. <p> Note that calling this method will block the caller thread until the upstream terminates normally, with an error or the {@code Subscriber} cancels the {@link Subscription} it receives via {@link Subscriber#onSu...
[ "Subscribes", "to", "the", "source", "and", "calls", "the", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L6178-L6182
test
Blocking subscribe method.
Of course, here is the Java code you requested: ```java @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) public final void blockingSubscribe(Subscriber<? super T> subscriber) { FlowableBlockingSubscribe.subscribe(this, subscriber); } ``` Hope this helps!
amedia/meteo
meteo-core/src/main/java/no/api/meteo/service/locationforecast/LocationforecastLTSService.java
LocationforecastLTSService.fetchContent
public MeteoData<LocationForecast> fetchContent(double longitude, double latitude, int altitude) throws MeteoException { MeteoResponse response = getMeteoClient().fetchContent( createServiceUriBuilder() .addParameter(PARAM_LATITUDE, latitude) ...
java
public MeteoData<LocationForecast> fetchContent(double longitude, double latitude, int altitude) throws MeteoException { MeteoResponse response = getMeteoClient().fetchContent( createServiceUriBuilder() .addParameter(PARAM_LATITUDE, latitude) ...
[ "public", "MeteoData", "<", "LocationForecast", ">", "fetchContent", "(", "double", "longitude", ",", "double", "latitude", ",", "int", "altitude", ")", "throws", "MeteoException", "{", "MeteoResponse", "response", "=", "getMeteoClient", "(", ")", ".", "fetchConte...
Fetch a LocationforecastLTS from the MET API, based on longitude, latitude and altitude. @param longitude The longitude of the location where the forecast should be fetched for. @param latitude The latitude of the location where the forecast should be fetched for. @param altitude The altitude of the location where the...
[ "Fetch", "a", "LocationforecastLTS", "from", "the", "MET", "API", "based", "on", "longitude", "latitude", "and", "altitude", "." ]
cbb59e1c2f889d15c24f3625d1769b543d4af595
https://github.com/amedia/meteo/blob/cbb59e1c2f889d15c24f3625d1769b543d4af595/meteo-core/src/main/java/no/api/meteo/service/locationforecast/LocationforecastLTSService.java#L67-L76
test
Fetch content from Meteo.
Of course, here is the Java code you requested: ```java public MeteoData<LocationForecast> fetchContent(double longitude, double latitude, int altitude) throws MeteoException { MeteoResponse response = getMeteoClient().fetchContent( createServiceUriBuilder() ...
abmargb/jamppa
src/main/java/org/jivesoftware/smack/keepalive/KeepAliveManager.java
KeepAliveManager.enableExecutorService
private synchronized static void enableExecutorService() { if (periodicPingExecutorService == null) { periodicPingExecutorService = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { @Override public Thread newThread(Runnable ...
java
private synchronized static void enableExecutorService() { if (periodicPingExecutorService == null) { periodicPingExecutorService = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { @Override public Thread newThread(Runnable ...
[ "private", "synchronized", "static", "void", "enableExecutorService", "(", ")", "{", "if", "(", "periodicPingExecutorService", "==", "null", ")", "{", "periodicPingExecutorService", "=", "new", "ScheduledThreadPoolExecutor", "(", "1", ",", "new", "ThreadFactory", "(",...
/* Start the executor service if it hasn't been started yet.
[ "/", "*", "Start", "the", "executor", "service", "if", "it", "hasn", "t", "been", "started", "yet", "." ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/keepalive/KeepAliveManager.java#L103-L116
test
Enable the ExecutorService
Of course, here is the Java code you requested: ```java private synchronized static void enableExecutorService() { if (periodicPingExecutorService == null) { periodicPingExecutorService = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { @Override ...
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/result/AbstractTemplateViewActionResult.java
AbstractTemplateViewActionResult.resolveTarget
protected String resolveTarget(final ActionRequest actionRequest, final String resultValue) { String resultBasePath = actionRequest.getActionRuntime().getResultBasePath(); ResultPath resultPath = resultMapper.resolveResultPath(resultBasePath, resultValue); String actionPath = resultPath.path(); String path = ...
java
protected String resolveTarget(final ActionRequest actionRequest, final String resultValue) { String resultBasePath = actionRequest.getActionRuntime().getResultBasePath(); ResultPath resultPath = resultMapper.resolveResultPath(resultBasePath, resultValue); String actionPath = resultPath.path(); String path = ...
[ "protected", "String", "resolveTarget", "(", "final", "ActionRequest", "actionRequest", ",", "final", "String", "resultValue", ")", "{", "String", "resultBasePath", "=", "actionRequest", ".", "getActionRuntime", "(", ")", ".", "getResultBasePath", "(", ")", ";", "...
Locates the target file from action path and the result value.
[ "Locates", "the", "target", "file", "from", "action", "path", "and", "the", "result", "value", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/result/AbstractTemplateViewActionResult.java#L116-L179
test
Resolves the target for the action.
Of course, here is the Java code you requested: ```java protected String resolveTarget(final ActionRequest actionRequest, final String resultValue) { String resultBasePath = actionRequest.getActionRuntime().getResultBasePath(); ResultPath resultPath = resultMapper.resolveResultPath(resultBasePath, resultValue); ...
Unidata/thredds
httpservices/src/main/java/ucar/httpservices/HTTPSession.java
HTTPSession.setDefaults
static synchronized protected void setDefaults(Map<Prop, Object> props) { if(false) {// turn off for now props.put(Prop.HANDLE_AUTHENTICATION, Boolean.TRUE); } props.put(Prop.HANDLE_REDIRECTS, Boolean.TRUE); props.put(Prop.ALLOW_CIRCULAR_REDIRECTS, Boolean.TRUE); ...
java
static synchronized protected void setDefaults(Map<Prop, Object> props) { if(false) {// turn off for now props.put(Prop.HANDLE_AUTHENTICATION, Boolean.TRUE); } props.put(Prop.HANDLE_REDIRECTS, Boolean.TRUE); props.put(Prop.ALLOW_CIRCULAR_REDIRECTS, Boolean.TRUE); ...
[ "static", "synchronized", "protected", "void", "setDefaults", "(", "Map", "<", "Prop", ",", "Object", ">", "props", ")", "{", "if", "(", "false", ")", "{", "// turn off for now", "props", ".", "put", "(", "Prop", ".", "HANDLE_AUTHENTICATION", ",", "Boolean",...
Provide defaults for a settings map
[ "Provide", "defaults", "for", "a", "settings", "map" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/httpservices/src/main/java/ucar/httpservices/HTTPSession.java#L436-L448
test
Set the default values for the tca banner.
Of course, here is the Java code you requested: ```java static synchronized protected void setDefaults(Map<Prop, Object> props) { if(false) {// turn off for now props.put(Prop.HANDLE_AUTHENTICATION, Boolean.TRUE); } props.put(Prop.HANDLE_REDIRECTS, Boolean.TRUE); props.p...
yunify/qingstor-sdk-java
src/main/java/com/qingstor/sdk/utils/Base64.java
Base64.encode
public static String encode(byte[] binaryData) { if (binaryData == null) { return null; } int lengthDataBits = binaryData.length * EIGHTBIT; if (lengthDataBits == 0) { return ""; } int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP; ...
java
public static String encode(byte[] binaryData) { if (binaryData == null) { return null; } int lengthDataBits = binaryData.length * EIGHTBIT; if (lengthDataBits == 0) { return ""; } int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP; ...
[ "public", "static", "String", "encode", "(", "byte", "[", "]", "binaryData", ")", "{", "if", "(", "binaryData", "==", "null", ")", "{", "return", "null", ";", "}", "int", "lengthDataBits", "=", "binaryData", ".", "length", "*", "EIGHTBIT", ";", "if", "...
Encodes hex octects into Base64 @param binaryData Array containing binaryData @return Encoded Base64 array
[ "Encodes", "hex", "octects", "into", "Base64" ]
b44a228a99e60e4d6e5a450b7c05972552ab9962
https://github.com/yunify/qingstor-sdk-java/blob/b44a228a99e60e4d6e5a450b7c05972552ab9962/src/main/java/com/qingstor/sdk/utils/Base64.java#L83-L150
test
Encode a byte array into Base64 string.
Of course, here is the Java code you requested: ```java public static String encode(byte[] binaryData) { if (binaryData == null) { return null; } int lengthDataBits = binaryData.length * EIGHTBIT; if (lengthDataBits == 0) { return ""; } int few...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/BitReader.java
BitReader.setBitOffset
public void setBitOffset(int bitOffset) throws IOException { if (bitOffset % 8 == 0) { raf.seek(startPos + bitOffset / 8); bitPos = 0; bitBuf = 0; } else { raf.seek(startPos + bitOffset / 8); bitPos = 8 - (bitOffset % 8); bitBuf = (byte) raf.read(); bitBuf &= 0...
java
public void setBitOffset(int bitOffset) throws IOException { if (bitOffset % 8 == 0) { raf.seek(startPos + bitOffset / 8); bitPos = 0; bitBuf = 0; } else { raf.seek(startPos + bitOffset / 8); bitPos = 8 - (bitOffset % 8); bitBuf = (byte) raf.read(); bitBuf &= 0...
[ "public", "void", "setBitOffset", "(", "int", "bitOffset", ")", "throws", "IOException", "{", "if", "(", "bitOffset", "%", "8", "==", "0", ")", "{", "raf", ".", "seek", "(", "startPos", "+", "bitOffset", "/", "8", ")", ";", "bitPos", "=", "0", ";", ...
Position file at bitOffset from startPos @param bitOffset bit offset from starting position @throws IOException on io error
[ "Position", "file", "at", "bitOffset", "from", "startPos" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/BitReader.java#L66-L77
test
Sets the bit offset of the file.
Of course, here is the Java code you requested: ```java public void setBitOffset(int bitOffset) throws IOException { if (bitOffset % 8 == 0) { raf.seek(startPos + bitOffset / 8); bitPos = 0; bitBuf = 0; } else { raf.seek(startPos + bitOffset / 8); bitPos = 8 - (bitOffset % ...
ReactiveX/RxJava
src/main/java/io/reactivex/subjects/ReplaySubject.java
ReplaySubject.createWithSize
@CheckReturnValue @NonNull public static <T> ReplaySubject<T> createWithSize(int maxSize) { return new ReplaySubject<T>(new SizeBoundReplayBuffer<T>(maxSize)); }
java
@CheckReturnValue @NonNull public static <T> ReplaySubject<T> createWithSize(int maxSize) { return new ReplaySubject<T>(new SizeBoundReplayBuffer<T>(maxSize)); }
[ "@", "CheckReturnValue", "@", "NonNull", "public", "static", "<", "T", ">", "ReplaySubject", "<", "T", ">", "createWithSize", "(", "int", "maxSize", ")", "{", "return", "new", "ReplaySubject", "<", "T", ">", "(", "new", "SizeBoundReplayBuffer", "<", "T", "...
Creates a size-bounded replay subject. <p> In this setting, the {@code ReplaySubject} holds at most {@code size} items in its internal buffer and discards the oldest item. <p> When observers subscribe to a terminated {@code ReplaySubject}, they are guaranteed to see at most {@code size} {@code onNext} events followed b...
[ "Creates", "a", "size", "-", "bounded", "replay", "subject", ".", "<p", ">", "In", "this", "setting", "the", "{", "@code", "ReplaySubject", "}", "holds", "at", "most", "{", "@code", "size", "}", "items", "in", "its", "internal", "buffer", "and", "discard...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/subjects/ReplaySubject.java#L207-L211
test
Create a replay subject with a maximum size.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull public static <T> ReplaySubject<T> createWithSize(int maxSize) { return new ReplaySubject<T>(new SizeBoundReplayBuffer<T>(maxSize)); } ``` Hope this helps!
Unidata/thredds
dap4/d4core/src/main/java/dap4/core/util/MultiOdometer.java
MultiOdometer.hasNext
@Override public boolean hasNext() { if(this.current >= odomset.size()) return false; Odometer ocurrent = odomset.get(this.current); if(ocurrent.hasNext()) return true; // Try to move to next odometer this.current++; return hasNext(); ...
java
@Override public boolean hasNext() { if(this.current >= odomset.size()) return false; Odometer ocurrent = odomset.get(this.current); if(ocurrent.hasNext()) return true; // Try to move to next odometer this.current++; return hasNext(); ...
[ "@", "Override", "public", "boolean", "hasNext", "(", ")", "{", "if", "(", "this", ".", "current", ">=", "odomset", ".", "size", "(", ")", ")", "return", "false", ";", "Odometer", "ocurrent", "=", "odomset", ".", "get", "(", "this", ".", "current", "...
Iterator API Overrides
[ "Iterator", "API", "Overrides" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/util/MultiOdometer.java#L110-L122
test
Returns true if the next n - gram cover cover
Of course, here is the Java code you requested: ```java @Override public boolean hasNext() { if(this.current >= odomset.size()) return false; Odometer ocurrent = odomset.get(this.current); if(ocurrent.hasNext()) return true; // Try to move to next odo...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormFieldClient.java
FormFieldClient.updateFieldDecimalSlider
public Field updateFieldDecimalSlider( Field formFieldParam, double minParam, double maxParam, double stepFactorParam) { if(formFieldParam != null && this.serviceTicket != null) { formFieldParam.setServiceTicket(this.serviceTicket); ...
java
public Field updateFieldDecimalSlider( Field formFieldParam, double minParam, double maxParam, double stepFactorParam) { if(formFieldParam != null && this.serviceTicket != null) { formFieldParam.setServiceTicket(this.serviceTicket); ...
[ "public", "Field", "updateFieldDecimalSlider", "(", "Field", "formFieldParam", ",", "double", "minParam", ",", "double", "maxParam", ",", "double", "stepFactorParam", ")", "{", "if", "(", "formFieldParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", ...
Updates the Decimal Slider field. @param formFieldParam The Field. @param minParam The min allowed value. @param maxParam The max allowed value. @param stepFactorParam The increments or step factor. @return Updated Decimal Slider.
[ "Updates", "the", "Decimal", "Slider", "field", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormFieldClient.java#L1034-L1056
test
UpdateFieldDecimalSlider Method.
Of course, here is the Java code you requested: ```java public Field updateFieldDecimalSlider( Field formFieldParam, double minParam, double maxParam, double stepFactorParam) { if(formFieldParam != null && this.serviceTicket != null) { for...
rupertlssmith/lojix
lojix/learning/src/main/com/thesett/aima/math/InformationTheory.java
InformationTheory.remainder
public static double remainder(double[] pA, double[][] pGgivenA) { double result = 0.0d; // Loop over the probabilities for all the symbols of A calculating the contribution of each to // the expected value. for (int v = 0; v < pA.length; v++) { double phv = pA[v...
java
public static double remainder(double[] pA, double[][] pGgivenA) { double result = 0.0d; // Loop over the probabilities for all the symbols of A calculating the contribution of each to // the expected value. for (int v = 0; v < pA.length; v++) { double phv = pA[v...
[ "public", "static", "double", "remainder", "(", "double", "[", "]", "pA", ",", "double", "[", "]", "[", "]", "pGgivenA", ")", "{", "double", "result", "=", "0.0d", ";", "// Loop over the probabilities for all the symbols of A calculating the contribution of each to", ...
Supposing a stream generates pairs of symbols. Let the first be A and the second be G. A ranges over a set of symbols, {h1, ... , hv} and G ranges over a set of symbols, {g1, ..., gn}. <p>G alone has a probability distribution which tells us what the expected information content of knowing what G is, measured in bits....
[ "Supposing", "a", "stream", "generates", "pairs", "of", "symbols", ".", "Let", "the", "first", "be", "A", "and", "the", "second", "be", "G", ".", "A", "ranges", "over", "a", "set", "of", "symbols", "{", "h1", "...", "hv", "}", "and", "G", "ranges", ...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/learning/src/main/com/thesett/aima/math/InformationTheory.java#L94-L112
test
Returns the remainder of the expected information content of the A given by the expected information function.
Of course, here is the Java code you requested: ```java public static double remainder(double[] pA, double[][] pGgivenA) { double result = 0.0d; // Loop over the probabilities for all the symbols of A calculating the contribution of each to // the expected value. for (int v = 0; v ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/util/OArrays.java
OArrays.contains
public static boolean contains(final int[] iArray, final int iToFind) { if (iArray == null || iArray.length == 0) return false; for (int e : iArray) if (e == iToFind) return true; return false; }
java
public static boolean contains(final int[] iArray, final int iToFind) { if (iArray == null || iArray.length == 0) return false; for (int e : iArray) if (e == iToFind) return true; return false; }
[ "public", "static", "boolean", "contains", "(", "final", "int", "[", "]", "iArray", ",", "final", "int", "iToFind", ")", "{", "if", "(", "iArray", "==", "null", "||", "iArray", ".", "length", "==", "0", ")", "return", "false", ";", "for", "(", "int",...
Returns true if an arrays contains a value, otherwise false
[ "Returns", "true", "if", "an", "arrays", "contains", "a", "value", "otherwise", "false" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/util/OArrays.java#L78-L87
test
Check if the array contains the iToFind element.
Of course, here is the Java code you requested: ```java public static boolean contains(final int[] iArray, final int iToFind) { if (iArray == null || iArray.length == 0) return false; for (int e : iArray) if (e == iToFind) return true; return false; } ``` Hope this helps!
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/ComponentConfiguration.java
ComponentConfiguration.getPostActivateInterceptors
public List<InterceptorFactory> getPostActivateInterceptors() { List<List<InterceptorFactory>> sortedItems = postActivateInterceptors.getSortedItems(); List<InterceptorFactory> interceptorFactories = new ArrayList<>(); for(List<InterceptorFactory> i : sortedItems) { interceptorFactor...
java
public List<InterceptorFactory> getPostActivateInterceptors() { List<List<InterceptorFactory>> sortedItems = postActivateInterceptors.getSortedItems(); List<InterceptorFactory> interceptorFactories = new ArrayList<>(); for(List<InterceptorFactory> i : sortedItems) { interceptorFactor...
[ "public", "List", "<", "InterceptorFactory", ">", "getPostActivateInterceptors", "(", ")", "{", "List", "<", "List", "<", "InterceptorFactory", ">>", "sortedItems", "=", "postActivateInterceptors", ".", "getSortedItems", "(", ")", ";", "List", "<", "InterceptorFacto...
Get the post-activate interceptors. <p/> This method should only be called after all interceptors have been added @return the sorted interceptors
[ "Get", "the", "post", "-", "activate", "interceptors", ".", "<p", "/", ">", "This", "method", "should", "only", "be", "called", "after", "all", "interceptors", "have", "been", "added" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ComponentConfiguration.java#L444-L451
test
Gets the post activate interceptors.
Of course, here is the Java code you requested: ```java public List<InterceptorFactory> getPostActivateInterceptors() { List<List<InterceptorFactory>> sortedItems = postActivateInterceptors.getSortedItems(); List<InterceptorFactory> interceptorFactories = new ArrayList<>(); for(List<Interceptor...
oblac/jodd
jodd-core/src/main/java/jodd/crypt/PBKDF2Encryptor.java
PBKDF2Encryptor.encrypt
public String encrypt(final String str) { try { byte[] utf8 = StringUtil.getBytes(str); // encode the string into bytes using utf-8 byte[] enc = ecipher.doFinal(utf8); // encrypt return Base64.encodeToString(enc); // encode bytes to base64 to get a string } catch (Throwable ignore) { return null; }...
java
public String encrypt(final String str) { try { byte[] utf8 = StringUtil.getBytes(str); // encode the string into bytes using utf-8 byte[] enc = ecipher.doFinal(utf8); // encrypt return Base64.encodeToString(enc); // encode bytes to base64 to get a string } catch (Throwable ignore) { return null; }...
[ "public", "String", "encrypt", "(", "final", "String", "str", ")", "{", "try", "{", "byte", "[", "]", "utf8", "=", "StringUtil", ".", "getBytes", "(", "str", ")", ";", "// encode the string into bytes using utf-8", "byte", "[", "]", "enc", "=", "ecipher", ...
Symmetrically encrypts the string.
[ "Symmetrically", "encrypts", "the", "string", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/crypt/PBKDF2Encryptor.java#L83-L91
test
Encrypt a string using the AES - 256 algorithm.
Of course, here is the Java code you requested: ```java public String encrypt(final String str) { try { byte[] utf8 = StringUtil.getBytes(str); // encode the string into bytes using utf-8 byte[] enc = ecipher.doFinal(utf8); // encrypt return Base64.encodeToString(enc); // encode bytes to base64 to get a ...
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/mathutils/SecantRootFinder.java
SecantRootFinder.doIterationProcedure
@Override protected void doIterationProcedure (final int n) { if (n == 1) return; // already initialized // Use the latest two points. m_fXnm1 = m_fXn; // x[n-1] = x[n] m_fXn = m_fXnp1; // x[n] = x[n+1] m_fFnm1 = m_fFn; // f(x[n-1]) = f(x[n]) m_fFn = m_fFnp1; // f(x[n]) = f(x[n+1]) ...
java
@Override protected void doIterationProcedure (final int n) { if (n == 1) return; // already initialized // Use the latest two points. m_fXnm1 = m_fXn; // x[n-1] = x[n] m_fXn = m_fXnp1; // x[n] = x[n+1] m_fFnm1 = m_fFn; // f(x[n-1]) = f(x[n]) m_fFn = m_fFnp1; // f(x[n]) = f(x[n+1]) ...
[ "@", "Override", "protected", "void", "doIterationProcedure", "(", "final", "int", "n", ")", "{", "if", "(", "n", "==", "1", ")", "return", ";", "// already initialized", "// Use the latest two points.", "m_fXnm1", "=", "m_fXn", ";", "// x[n-1] = x[n]", "m_fXn", ...
Do the secant iteration procedure. @param n the iteration count
[ "Do", "the", "secant", "iteration", "procedure", "." ]
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/mathutils/SecantRootFinder.java#L139-L150
test
This method is called by the iteration procedure.
Of course, here is the Java code you requested: ```java @Override protected void doIterationProcedure (final int n) { if (n == 1) return; // already initialized // Use the latest two points. m_fXnm1 = m_fXn; // x[n-1] = x[n] m_fXn = m_fXnp1; // x[n] = x[n+1] m_fFnm1 = m_fFn; // f(x[n-1])...
oblac/jodd
jodd-db/src/main/java/jodd/db/oom/DbListIterator.java
DbListIterator.moveToNext
private boolean moveToNext() { if (last) { // last has been set to true, so no more rows to iterate - close everything if (closeOnEnd) { query.close(); } else { query.closeResultSet(resultSetMapper.getResultSet()); } return false; } while (true) { if (!resultSetMapper.next()) { /...
java
private boolean moveToNext() { if (last) { // last has been set to true, so no more rows to iterate - close everything if (closeOnEnd) { query.close(); } else { query.closeResultSet(resultSetMapper.getResultSet()); } return false; } while (true) { if (!resultSetMapper.next()) { /...
[ "private", "boolean", "moveToNext", "(", ")", "{", "if", "(", "last", ")", "{", "// last has been set to true, so no more rows to iterate - close everything", "if", "(", "closeOnEnd", ")", "{", "query", ".", "close", "(", ")", ";", "}", "else", "{", "query", "."...
Moves to next element.
[ "Moves", "to", "next", "element", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/DbListIterator.java#L119-L175
test
Move to the next row of the result set.
Of course, here is the Java code you requested: ```java private boolean moveToNext() { if (last) { // last has been set to true, so no more rows to iterate - close everything if (closeOnEnd) { query.close(); } else { query.closeResultSet(resultSetMapper.getResultSet()); } return false; } ...
js-lib-com/tiny-container
src/main/java/js/container/InstanceScope.java
InstanceScope.asObject
@SuppressWarnings("unchecked") @Override public <T> T asObject(String string, Class<T> valueType) { return (T) new InstanceScope(string); }
java
@SuppressWarnings("unchecked") @Override public <T> T asObject(String string, Class<T> valueType) { return (T) new InstanceScope(string); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "<", "T", ">", "T", "asObject", "(", "String", "string", ",", "Class", "<", "T", ">", "valueType", ")", "{", "return", "(", "T", ")", "new", "InstanceScope", "(", "string", ...
Create a scope instance from its string value.
[ "Create", "a", "scope", "instance", "from", "its", "string", "value", "." ]
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/InstanceScope.java#L142-L146
test
Creates an instance scope.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public <T> T asObject(String string, Class<T> valueType) { return (T) new InstanceScope(string); } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/net/MimeTypes.java
MimeTypes.getMimeType
public static String getMimeType(final String ext) { String mimeType = lookupMimeType(ext); if (mimeType == null) { mimeType = MIME_APPLICATION_OCTET_STREAM; } return mimeType; }
java
public static String getMimeType(final String ext) { String mimeType = lookupMimeType(ext); if (mimeType == null) { mimeType = MIME_APPLICATION_OCTET_STREAM; } return mimeType; }
[ "public", "static", "String", "getMimeType", "(", "final", "String", "ext", ")", "{", "String", "mimeType", "=", "lookupMimeType", "(", "ext", ")", ";", "if", "(", "mimeType", "==", "null", ")", "{", "mimeType", "=", "MIME_APPLICATION_OCTET_STREAM", ";", "}"...
Returns the corresponding MIME type to the given extension. If no MIME type was found it returns <code>application/octet-stream</code> type.
[ "Returns", "the", "corresponding", "MIME", "type", "to", "the", "given", "extension", ".", "If", "no", "MIME", "type", "was", "found", "it", "returns", "<code", ">", "application", "/", "octet", "-", "stream<", "/", "code", ">", "type", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/net/MimeTypes.java#L119-L125
test
Gets the mime type of the file extension.
Of course, here is the Java code you requested: ```java public static String getMimeType(final String ext) { String mimeType = lookupMimeType(ext); if (mimeType == null) { mimeType = MIME_APPLICATION_OCTET_STREAM; } return mimeType; } ``` Hope this helps!
Unidata/thredds
tds/src/main/java/thredds/util/StringValidateEncodeUtils.java
StringValidateEncodeUtils.validFilePath
@SuppressWarnings({"SimplifiableIfStatement"}) public static boolean validFilePath(String path) { if (path == null) return false; if (path.indexOf(File.pathSeparatorChar) != -1) return false; return validPath(path); }
java
@SuppressWarnings({"SimplifiableIfStatement"}) public static boolean validFilePath(String path) { if (path == null) return false; if (path.indexOf(File.pathSeparatorChar) != -1) return false; return validPath(path); }
[ "@", "SuppressWarnings", "(", "{", "\"SimplifiableIfStatement\"", "}", ")", "public", "static", "boolean", "validFilePath", "(", "String", "path", ")", "{", "if", "(", "path", "==", "null", ")", "return", "false", ";", "if", "(", "path", ".", "indexOf", "(...
Return true if the given String is a valid File path. <p> <p> A String is considered a valid File path if: <ul> <li> when passed to validPath(String) true is returned; and</li> <li> it does not contain the Java File path separator (java.io.File.pathSeparatorChar) which is system dependant.</li> </ul> @param path the S...
[ "Return", "true", "if", "the", "given", "String", "is", "a", "valid", "File", "path", ".", "<p", ">", "<p", ">", "A", "String", "is", "considered", "a", "valid", "File", "path", "if", ":", "<ul", ">", "<li", ">", "when", "passed", "to", "validPath", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/util/StringValidateEncodeUtils.java#L105-L112
test
Check if the path is a valid file path.
Of course, here is the Java code you requested: ```java @SuppressWarnings({"SimplifiableIfStatement"}) public static boolean validFilePath(String path) { if (path == null) return false; if (path.indexOf(File.pathSeparatorChar) != -1) return false; return validPath(path); } ``` Hope this he...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Haus.java
Haus.setHaustyp
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setHaustyp(Haus.Haustyp value) { this.haustyp = 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 setHaustyp(Haus.Haustyp value) { this.haustyp = value; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:54:50+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "void", "setHaustyp", "(", "Haus", ".", "Haustyp", "value", ")", "{", "this", ".", ...
Sets the value of the haustyp property. @param value allowed object is {@link Haus.Haustyp }
[ "Sets", "the", "value", "of", "the", "haustyp", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Haus.java#L64-L67
test
Sets the value of the haustyp 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 setHaustyp(Haus.Haustyp value) { this.haustyp = value; } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Completable.java
Completable.subscribeOn
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.CUSTOM) public final Completable subscribeOn(final Scheduler scheduler) { ObjectHelper.requireNonNull(scheduler, "scheduler is null"); return RxJavaPlugins.onAssembly(new CompletableSubscribeOn(this, scheduler)); }
java
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.CUSTOM) public final Completable subscribeOn(final Scheduler scheduler) { ObjectHelper.requireNonNull(scheduler, "scheduler is null"); return RxJavaPlugins.onAssembly(new CompletableSubscribeOn(this, scheduler)); }
[ "@", "CheckReturnValue", "@", "NonNull", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Completable", "subscribeOn", "(", "final", "Scheduler", "scheduler", ")", "{", "ObjectHelper", ".", "requireNonNull", "(", "scheduler",...
Returns a Completable which subscribes the child subscriber on the specified scheduler, making sure the subscription side-effects happen on that specific thread of the scheduler. <p> <img width="640" height="686" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.subscribeOn.png" alt=""> ...
[ "Returns", "a", "Completable", "which", "subscribes", "the", "child", "subscriber", "on", "the", "specified", "scheduler", "making", "sure", "the", "subscription", "side", "-", "effects", "happen", "on", "that", "specific", "thread", "of", "the", "scheduler", "....
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L2427-L2434
test
Subscribe to a sequence of tokens.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.CUSTOM) public final Completable subscribeOn(final Scheduler scheduler) { ObjectHelper.requireNonNull(scheduler, "scheduler is null"); return RxJavaPlugins.onAssembly(new C...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/AsyncTransactionImpl.java
AsyncTransactionImpl.commit
@Override public Response commit() { // Complete any enlisted operations so that the session becomes consistent. Note that some of the // enlisted load operations might result in further enlistment... so we have to do this in a loop // that protects against concurrent modification exceptions while (!enlisted.i...
java
@Override public Response commit() { // Complete any enlisted operations so that the session becomes consistent. Note that some of the // enlisted load operations might result in further enlistment... so we have to do this in a loop // that protects against concurrent modification exceptions while (!enlisted.i...
[ "@", "Override", "public", "Response", "commit", "(", ")", "{", "// Complete any enlisted operations so that the session becomes consistent. Note that some of the", "// enlisted load operations might result in further enlistment... so we have to do this in a loop", "// that protects against conc...
/* (non-Javadoc) @see com.googlecode.objectify.util.cmd.TransactionWrapper#commit()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/AsyncTransactionImpl.java#L80-L96
test
Commit the transaction.
Of course, here is the Java code you requested: ```java @Override public Response commit() { // Complete any enlisted operations so that the session becomes consistent. Note that some of the // enlisted load operations might result in further enlistment... so we have to do this in a loop // that protects agains...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/configuration/RowsMapping.java
RowsMapping.removeRow
public final void removeRow(final Integer sourceRowNum, final Row targetRow) { List<SerialRow> mapRowList = rowsMap.get(sourceRowNum); if (mapRowList != null) { mapRowList.remove(new SerialRow(targetRow, -1)); rowsMap.put(sourceRowNum, mapRowList); } }
java
public final void removeRow(final Integer sourceRowNum, final Row targetRow) { List<SerialRow> mapRowList = rowsMap.get(sourceRowNum); if (mapRowList != null) { mapRowList.remove(new SerialRow(targetRow, -1)); rowsMap.put(sourceRowNum, mapRowList); } }
[ "public", "final", "void", "removeRow", "(", "final", "Integer", "sourceRowNum", ",", "final", "Row", "targetRow", ")", "{", "List", "<", "SerialRow", ">", "mapRowList", "=", "rowsMap", ".", "get", "(", "sourceRowNum", ")", ";", "if", "(", "mapRowList", "!...
Removes the row. @param sourceRowNum the source row num @param targetRow the target row
[ "Removes", "the", "row", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/configuration/RowsMapping.java#L84-L91
test
Removes the given row from the table.
Of course, here is the Java code you requested: ```java public final void removeRow(final Integer sourceRowNum, final Row targetRow) { List<SerialRow> mapRowList = rowsMap.get(sourceRowNum); if (mapRowList != null) { mapRowList.remove(new SerialRow(targetRow, -1)); rowsMap.put(sourceRowNum, mapRowLis...
playframework/playframework
web/play-java-forms/src/main/java/play/data/format/Formatters.java
Formatters.registerOptional
private Formatters registerOptional() { conversion.addConverter( new GenericConverter() { public Object convert( Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (sourceType.getObjectType().equals(String.class)) { // From String to ...
java
private Formatters registerOptional() { conversion.addConverter( new GenericConverter() { public Object convert( Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (sourceType.getObjectType().equals(String.class)) { // From String to ...
[ "private", "Formatters", "registerOptional", "(", ")", "{", "conversion", ".", "addConverter", "(", "new", "GenericConverter", "(", ")", "{", "public", "Object", "convert", "(", "Object", "source", ",", "TypeDescriptor", "sourceType", ",", "TypeDescriptor", "targe...
Converter for String -> Optional and Optional -> String
[ "Converter", "for", "String", "-", ">", "Optional", "and", "Optional", "-", ">", "String" ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/web/play-java-forms/src/main/java/play/data/format/Formatters.java#L176-L210
test
Register optional.
Of course, here is the Java code you requested: ```java private Formatters registerOptional() { conversion.addConverter( new GenericConverter() { public Object convert( Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (sourceType.getObjectType()...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.request
public static Response request(Method method, URL url) { return given().request(method, url); }
java
public static Response request(Method method, URL url) { return given().request(method, url); }
[ "public", "static", "Response", "request", "(", "Method", "method", ",", "URL", "url", ")", "{", "return", "given", "(", ")", ".", "request", "(", "method", ",", "url", ")", ";", "}" ]
Perform a request to a <code>url</code>. @param method The HTTP method to use @param url The url to send the request to. @return The response of the GET request.
[ "Perform", "a", "request", "to", "a", "<code", ">", "url<", "/", "code", ">", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L1144-L1146
test
A request to the given URL.
Of course, here is the Java code you requested: ```java public static Response request(Method method, URL url) { return given().request(method, url); } ``` Hope this helps!
jboss/jboss-common-core
src/main/java/org/jboss/util/xml/catalog/Catalog.java
Catalog.unknownEntry
public void unknownEntry(Vector strings) { if (strings != null && strings.size() > 0) { String keyword = (String) strings.elementAt(0); catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword); } }
java
public void unknownEntry(Vector strings) { if (strings != null && strings.size() > 0) { String keyword = (String) strings.elementAt(0); catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword); } }
[ "public", "void", "unknownEntry", "(", "Vector", "strings", ")", "{", "if", "(", "strings", "!=", "null", "&&", "strings", ".", "size", "(", ")", ">", "0", ")", "{", "String", "keyword", "=", "(", "String", ")", "strings", ".", "elementAt", "(", "0",...
Handle unknown CatalogEntry types. <p>This method exists to allow subclasses to deal with unknown entry types.</p> @param strings
[ "Handle", "unknown", "CatalogEntry", "types", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Catalog.java#L1071-L1076
test
This method is called when an unknown entry is encountered in the catalog.
Of course, here is the Java code you requested: ```java public void unknownEntry(Vector strings) { if (strings != null && strings.size() > 0) { String keyword = (String) strings.elementAt(0); catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword); } } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/parallel/ParallelFlowable.java
ParallelFlowable.concatMapDelayError
@CheckReturnValue @NonNull public final <R> ParallelFlowable<R> concatMapDelayError( @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper, int prefetch, boolean tillTheEnd) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.veri...
java
@CheckReturnValue @NonNull public final <R> ParallelFlowable<R> concatMapDelayError( @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper, int prefetch, boolean tillTheEnd) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.veri...
[ "@", "CheckReturnValue", "@", "NonNull", "public", "final", "<", "R", ">", "ParallelFlowable", "<", "R", ">", "concatMapDelayError", "(", "@", "NonNull", "Function", "<", "?", "super", "T", ",", "?", "extends", "Publisher", "<", "?", "extends", "R", ">", ...
Generates and concatenates Publishers on each 'rail', optionally delaying errors and using the given prefetch amount for generating Publishers upfront. @param <R> the result type @param mapper the function to map each rail's value into a Publisher @param prefetch the number of items to prefetch from each inner Publish...
[ "Generates", "and", "concatenates", "Publishers", "on", "each", "rail", "optionally", "delaying", "errors", "and", "using", "the", "given", "prefetch", "amount", "for", "generating", "Publishers", "upfront", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L937-L946
test
Creates a parallel concat map from a sequence of items.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull public final <R> ParallelFlowable<R> concatMapDelayError( @NonNull Function<? super T, ? extends Publisher<? extends R>> mapper, int prefetch, boolean tillTheEnd) { ObjectHelper.requireNon...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/ComplexUtil.java
ComplexUtil.ceil
public static IComplexNumber ceil(IComplexNumber num) { Complex c = new Complex(FastMath.ceil(num.realComponent().doubleValue()), FastMath.ceil(num.imaginaryComponent().doubleValue())); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
java
public static IComplexNumber ceil(IComplexNumber num) { Complex c = new Complex(FastMath.ceil(num.realComponent().doubleValue()), FastMath.ceil(num.imaginaryComponent().doubleValue())); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
[ "public", "static", "IComplexNumber", "ceil", "(", "IComplexNumber", "num", ")", "{", "Complex", "c", "=", "new", "Complex", "(", "FastMath", ".", "ceil", "(", "num", ".", "realComponent", "(", ")", ".", "doubleValue", "(", ")", ")", ",", "FastMath", "."...
Return the ceiling value of the given complex number @param num the number to getScalar the absolute value for @return the absolute value of this complex number
[ "Return", "the", "ceiling", "value", "of", "the", "given", "complex", "number" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/util/ComplexUtil.java#L135-L139
test
Ceil the complex number
Of course, here is the Java code you requested: ```java public static IComplexNumber ceil(IComplexNumber num) { Complex c = new Complex(FastMath.ceil(num.realComponent().doubleValue()), FastMath.ceil(num.imaginaryComponent().doubleValue())); return Nd4j.createDouble(c.getReal(),...
RestComm/jain-slee
container/profiles/src/main/java/org/mobicents/slee/runtime/facilities/profile/AbstractProfileEvent.java
AbstractProfileEvent.getProfileObjectValidInCurrentTransaction
ProfileObjectImpl getProfileObjectValidInCurrentTransaction(ProfileEntity profileEntity) throws TransactionRequiredLocalException { // check tx final SleeTransactionManager txManager = profileManagement.getSleeContainer().getTransactionManager(); txManager.mandateTransaction(); // look for an assigned o...
java
ProfileObjectImpl getProfileObjectValidInCurrentTransaction(ProfileEntity profileEntity) throws TransactionRequiredLocalException { // check tx final SleeTransactionManager txManager = profileManagement.getSleeContainer().getTransactionManager(); txManager.mandateTransaction(); // look for an assigned o...
[ "ProfileObjectImpl", "getProfileObjectValidInCurrentTransaction", "(", "ProfileEntity", "profileEntity", ")", "throws", "TransactionRequiredLocalException", "{", "// check tx\r", "final", "SleeTransactionManager", "txManager", "=", "profileManagement", ".", "getSleeContainer", "(",...
Retrieves a local object valid for thus current transaction. @param profilePojo @return @throws TransactionRequiredLocalException
[ "Retrieves", "a", "local", "object", "valid", "for", "thus", "current", "transaction", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/runtime/facilities/profile/AbstractProfileEvent.java#L121-L142
test
Gets the profile object valid in the current transaction.
Of course, here is the Java code you requested: ```java ProfileObjectImpl getProfileObjectValidInCurrentTransaction(ProfileEntity profileEntity) throws TransactionRequiredLocalException { // check tx final SleeTransactionManager txManager = profileManagement.getSleeContainer().getTransactionManager(); txManag...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.publish
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> publish(Function<? super Observable<T>, ? extends ObservableSource<R>> selector) { ObjectHelper.requireNonNull(selector, "selector is null"); return RxJavaPlugins.onAssembly(new ObservablePublishSelector<T,...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> publish(Function<? super Observable<T>, ? extends ObservableSource<R>> selector) { ObjectHelper.requireNonNull(selector, "selector is null"); return RxJavaPlugins.onAssembly(new ObservablePublishSelector<T,...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Observable", "<", "R", ">", "publish", "(", "Function", "<", "?", "super", "Observable", "<", "T", ">", ",", "?", "extends", "...
Returns an Observable that emits the results of invoking a specified selector on items emitted by a {@link ConnectableObservable} that shares a single subscription to the underlying sequence. <p> <img width="640" height="647" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/publishFunction.o.png" a...
[ "Returns", "an", "Observable", "that", "emits", "the", "results", "of", "invoking", "a", "specified", "selector", "on", "items", "emitted", "by", "a", "{", "@link", "ConnectableObservable", "}", "that", "shares", "a", "single", "subscription", "to", "the", "un...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L10253-L10258
test
Publish an observable source using a CID language.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> publish(Function<? super Observable<T>, ? extends ObservableSource<R>> selector) { ObjectHelper.requireNonNull(selector, "selector is null"); return ...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java
SymbolTable.addConstantMemberReference
private Entry addConstantMemberReference( final int tag, final String owner, final String name, final String descriptor) { int hashCode = hash(tag, owner, name, descriptor); Entry entry = get(hashCode); while (entry != null) { if (entry.tag == tag && entry.hashCode == hashCode ...
java
private Entry addConstantMemberReference( final int tag, final String owner, final String name, final String descriptor) { int hashCode = hash(tag, owner, name, descriptor); Entry entry = get(hashCode); while (entry != null) { if (entry.tag == tag && entry.hashCode == hashCode ...
[ "private", "Entry", "addConstantMemberReference", "(", "final", "int", "tag", ",", "final", "String", "owner", ",", "final", "String", "name", ",", "final", "String", "descriptor", ")", "{", "int", "hashCode", "=", "hash", "(", "tag", ",", "owner", ",", "n...
Adds a CONSTANT_Fieldref_info, CONSTANT_Methodref_info or CONSTANT_InterfaceMethodref_info to the constant pool of this symbol table. Does nothing if the constant pool already contains a similar item. @param tag one of {@link Symbol#CONSTANT_FIELDREF_TAG}, {@link Symbol#CONSTANT_METHODREF_TAG} or {@link Symbol#CONSTAN...
[ "Adds", "a", "CONSTANT_Fieldref_info", "CONSTANT_Methodref_info", "or", "CONSTANT_InterfaceMethodref_info", "to", "the", "constant", "pool", "of", "this", "symbol", "table", ".", "Does", "nothing", "if", "the", "constant", "pool", "already", "contains", "a", "similar"...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java#L557-L574
test
Add a member reference to the constant pool.
Of course, here is the Java code you requested: ```java private Entry addConstantMemberReference( final int tag, final String owner, final String name, final String descriptor) { int hashCode = hash(tag, owner, name, descriptor); Entry entry = get(hashCode); while (entry != null) { if (entry.ta...
wro4j/wro4j
wro4j-maven-plugin/src/main/java/ro/isdc/wro/maven/plugin/support/ProgressIndicator.java
ProgressIndicator.onProcessingResource
public synchronized void onProcessingResource(final Resource resource) { totalResources++; log.debug("processing resource: " + resource.getUri()); if (isLogRequired()) { log.info("Processed until now: " + getTotalResources() + ". Last processed: " + resource.getUri()); updateLastInvocation(); ...
java
public synchronized void onProcessingResource(final Resource resource) { totalResources++; log.debug("processing resource: " + resource.getUri()); if (isLogRequired()) { log.info("Processed until now: " + getTotalResources() + ". Last processed: " + resource.getUri()); updateLastInvocation(); ...
[ "public", "synchronized", "void", "onProcessingResource", "(", "final", "Resource", "resource", ")", "{", "totalResources", "++", ";", "log", ".", "debug", "(", "\"processing resource: \"", "+", "resource", ".", "getUri", "(", ")", ")", ";", "if", "(", "isLogR...
A method which should be invoked on each new resource processing, having as a side effect an increment of the counter holding the number of total processed resources.
[ "A", "method", "which", "should", "be", "invoked", "on", "each", "new", "resource", "processing", "having", "as", "a", "side", "effect", "an", "increment", "of", "the", "counter", "holding", "the", "number", "of", "total", "processed", "resources", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-maven-plugin/src/main/java/ro/isdc/wro/maven/plugin/support/ProgressIndicator.java#L74-L81
test
Called when a resource is being processed.
Of course, here is the Java code you requested: ```java public synchronized void onProcessingResource(final Resource resource) { totalResources++; log.debug("processing resource: " + resource.getUri()); if (isLogRequired()) { log.info("Processed until now: " + getTotalResources() + ". Last processed:...
boonproject/boon
boon/src/main/java/org/boon/sort/Sorting.java
Sorting.sort
public static <V> Iterable<V> sort( Class<V> componentType, Iterable<V> iterable, String sortBy, boolean ascending, boolean nullsFirst ) { if (iterable instanceof List) { sort ((List) iterable, sortBy, ascending, nullsFirst); return iterable; } else if (iterable instanceof Coll...
java
public static <V> Iterable<V> sort( Class<V> componentType, Iterable<V> iterable, String sortBy, boolean ascending, boolean nullsFirst ) { if (iterable instanceof List) { sort ((List) iterable, sortBy, ascending, nullsFirst); return iterable; } else if (iterable instanceof Coll...
[ "public", "static", "<", "V", ">", "Iterable", "<", "V", ">", "sort", "(", "Class", "<", "V", ">", "componentType", ",", "Iterable", "<", "V", ">", "iterable", ",", "String", "sortBy", ",", "boolean", "ascending", ",", "boolean", "nullsFirst", ")", "{"...
Sort collection. @param iterable the iterable you want to sort @param sortBy what you want to sort the list by @param ascending do you want ascending order @param nullsFirst do you want nulls first
[ "Sort", "collection", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/sort/Sorting.java#L190-L202
test
Sort an Iterable of the given type using the given sort by name and ascending flag.
Of course, here is the Java code you requested: ```java public static <V> Iterable<V> sort( Class<V> componentType, Iterable<V> iterable, String sortBy, boolean ascending, boolean nullsFirst ) { if (iterable instanceof List) { sort ((List) iterable, sortBy, ascending, nullsFirst); retu...
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/component/RootPackages.java
RootPackages.findRootPackageForActionPath
public String findRootPackageForActionPath(final String actionPath) { if (mappings == null) { return null; } int ndx = -1; int delta = Integer.MAX_VALUE; for (int i = 0; i < mappings.length; i++) { String mapping = mappings[i]; boolean found = false; if (actionPath.equals(mapping)) { found ...
java
public String findRootPackageForActionPath(final String actionPath) { if (mappings == null) { return null; } int ndx = -1; int delta = Integer.MAX_VALUE; for (int i = 0; i < mappings.length; i++) { String mapping = mappings[i]; boolean found = false; if (actionPath.equals(mapping)) { found ...
[ "public", "String", "findRootPackageForActionPath", "(", "final", "String", "actionPath", ")", "{", "if", "(", "mappings", "==", "null", ")", "{", "return", "null", ";", "}", "int", "ndx", "=", "-", "1", ";", "int", "delta", "=", "Integer", ".", "MAX_VAL...
Finds closest root package for the given action path.
[ "Finds", "closest", "root", "package", "for", "the", "given", "action", "path", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/RootPackages.java#L111-L146
test
Find the root package for the given action path.
Of course, here is the Java code you requested: ```java public String findRootPackageForActionPath(final String actionPath) { if (mappings == null) { return null; } int ndx = -1; int delta = Integer.MAX_VALUE; for (int i = 0; i < mappings.length; i++) { String mapping = mappings[i]; boolean found...
ieb/sparsemapcontent
extensions/memory/src/main/java/uk/co/tfd/sm/memory/ehcache/CacheImpl.java
CacheImpl.removeChildren
public void removeChildren(String key) { cache.remove(key); if (!key.endsWith("/")) { key = key + "/"; } List<?> keys = cache.getKeys(); for (Object k : keys) { if (((String) k).startsWith(key)) { cache.remove(k); } } }
java
public void removeChildren(String key) { cache.remove(key); if (!key.endsWith("/")) { key = key + "/"; } List<?> keys = cache.getKeys(); for (Object k : keys) { if (((String) k).startsWith(key)) { cache.remove(k); } } }
[ "public", "void", "removeChildren", "(", "String", "key", ")", "{", "cache", ".", "remove", "(", "key", ")", ";", "if", "(", "!", "key", ".", "endsWith", "(", "\"/\"", ")", ")", "{", "key", "=", "key", "+", "\"/\"", ";", "}", "List", "<", "?", ...
{@inheritDoc} @see org.sakaiproject.nakamura.api.memory.Cache#removeChildren(java.lang.String)
[ "{", "@inheritDoc", "}" ]
0570fdf868adbbf7734790cbc09fe66480e5f2dc
https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/extensions/memory/src/main/java/uk/co/tfd/sm/memory/ehcache/CacheImpl.java#L145-L156
test
Remove all children of a key
Of course, here is the Java code you requested: ```java public void removeChildren(String key) { cache.remove(key); if (!key.endsWith("/")) { key = key + "/"; } List<?> keys = cache.getKeys(); for (Object k : keys) { if (((String) k).startsWith(key)) { cache.remove(k); } ...
deeplearning4j/nd4j
nd4j-common/src/main/java/org/nd4j/util/StringUtils.java
StringUtils.join
public static String join(CharSequence separator, Iterable<?> strings) { Iterator<?> i = strings.iterator(); if (!i.hasNext()) { return ""; } StringBuilder sb = new StringBuilder(i.next().toString()); while (i.hasNext()) { sb.append(separator); ...
java
public static String join(CharSequence separator, Iterable<?> strings) { Iterator<?> i = strings.iterator(); if (!i.hasNext()) { return ""; } StringBuilder sb = new StringBuilder(i.next().toString()); while (i.hasNext()) { sb.append(separator); ...
[ "public", "static", "String", "join", "(", "CharSequence", "separator", ",", "Iterable", "<", "?", ">", "strings", ")", "{", "Iterator", "<", "?", ">", "i", "=", "strings", ".", "iterator", "(", ")", ";", "if", "(", "!", "i", ".", "hasNext", "(", "...
Concatenates strings, using a separator. @param separator Separator to join with. @param strings Strings to join.
[ "Concatenates", "strings", "using", "a", "separator", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/util/StringUtils.java#L841-L852
test
Join the Iterable of strings with the given separator.
Of course, here is the Java code you requested: ```java public static String join(CharSequence separator, Iterable<?> strings) { Iterator<?> i = strings.iterator(); if (!i.hasNext()) { return ""; } StringBuilder sb = new StringBuilder(i.next().toString()); while (i.h...
wildfly/wildfly
jpa/subsystem/src/main/java/org/jboss/as/jpa/config/Configuration.java
Configuration.allowTwoPhaseBootstrap
public static boolean allowTwoPhaseBootstrap(PersistenceUnitMetadata pu) { boolean result = true; if (EE_DEFAULT_DATASOURCE.equals(pu.getJtaDataSourceName())) { result = false; } if (pu.getProperties().containsKey(Configuration.JPA_ALLOW_TWO_PHASE_BOOTSTRAP)) { r...
java
public static boolean allowTwoPhaseBootstrap(PersistenceUnitMetadata pu) { boolean result = true; if (EE_DEFAULT_DATASOURCE.equals(pu.getJtaDataSourceName())) { result = false; } if (pu.getProperties().containsKey(Configuration.JPA_ALLOW_TWO_PHASE_BOOTSTRAP)) { r...
[ "public", "static", "boolean", "allowTwoPhaseBootstrap", "(", "PersistenceUnitMetadata", "pu", ")", "{", "boolean", "result", "=", "true", ";", "if", "(", "EE_DEFAULT_DATASOURCE", ".", "equals", "(", "pu", ".", "getJtaDataSourceName", "(", ")", ")", ")", "{", ...
Determine if two phase persistence unit start is allowed @param pu @return
[ "Determine", "if", "two", "phase", "persistence", "unit", "start", "is", "allowed" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/subsystem/src/main/java/org/jboss/as/jpa/config/Configuration.java#L282-L292
test
Allow two - phase bootstrap for the persistence unit
Of course, here is the Java code you requested: ```java public static boolean allowTwoPhaseBootstrap(PersistenceUnitMetadata pu) { boolean result = true; if (EE_DEFAULT_DATASOURCE.equals(pu.getJtaDataSourceName())) { result = false; } if (pu.getProperties().containsKey(Conf...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/mcidas/AreaReader.java
AreaReader.setAreaDirectoryAttributes
private void setAreaDirectoryAttributes(Variable v) { if ((dirBlock == null) || (ad == null)) { return; } for (int i = 1; i < 14; i++) { if (i == 7) { continue; } v.addAttribute(new Attribute(getADDescription(i), dirBlock[i])); } }
java
private void setAreaDirectoryAttributes(Variable v) { if ((dirBlock == null) || (ad == null)) { return; } for (int i = 1; i < 14; i++) { if (i == 7) { continue; } v.addAttribute(new Attribute(getADDescription(i), dirBlock[i])); } }
[ "private", "void", "setAreaDirectoryAttributes", "(", "Variable", "v", ")", "{", "if", "(", "(", "dirBlock", "==", "null", ")", "||", "(", "ad", "==", "null", ")", ")", "{", "return", ";", "}", "for", "(", "int", "i", "=", "1", ";", "i", "<", "14...
Set the area directory attributes on the variable @param v the variable to set them on
[ "Set", "the", "area", "directory", "attributes", "on", "the", "variable" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/mcidas/AreaReader.java#L453-L463
test
Sets the area directory attributes.
Of course, here is the Java code you requested: ```java private void setAreaDirectoryAttributes(Variable v) { if ((dirBlock == null) || (ad == null)) { return; } for (int i = 1; i < 14; i++) { if (i == 7) { continue; } v.addAttribute(new Attribute(getADDescription(i)...
real-logic/aeron
aeron-client/src/main/java/io/aeron/logbuffer/TermAppender.java
TermAppender.appendUnfragmentedMessage
public int appendUnfragmentedMessage( final HeaderWriter header, final DirectBuffer bufferOne, final int offsetOne, final int lengthOne, final DirectBuffer bufferTwo, final int offsetTwo, final int lengthTwo, final ReservedValueSupplier reservedValueSuppli...
java
public int appendUnfragmentedMessage( final HeaderWriter header, final DirectBuffer bufferOne, final int offsetOne, final int lengthOne, final DirectBuffer bufferTwo, final int offsetTwo, final int lengthTwo, final ReservedValueSupplier reservedValueSuppli...
[ "public", "int", "appendUnfragmentedMessage", "(", "final", "HeaderWriter", "header", ",", "final", "DirectBuffer", "bufferOne", ",", "final", "int", "offsetOne", ",", "final", "int", "lengthOne", ",", "final", "DirectBuffer", "bufferTwo", ",", "final", "int", "of...
Append an unfragmented message to the the term buffer. @param header for writing the default header. @param bufferOne containing the first part of the message. @param offsetOne at which the first part of the message begins. @param lengthOne of the first part of the me...
[ "Append", "an", "unfragmented", "message", "to", "the", "the", "term", "buffer", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/logbuffer/TermAppender.java#L143-L187
test
Append an uncontainer message to the log.
Of course, here is the Java code you requested: ```java public int appendUnfragmentedMessage( final HeaderWriter header, final DirectBuffer bufferOne, final int offsetOne, final int lengthOne, final DirectBuffer bufferTwo, final int offsetTwo, final int lengthTwo...
oblac/jodd
jodd-core/src/main/java/jodd/util/collection/IntHashMap.java
IntHashMap.clear
@Override public void clear() { Entry[] tab = table; modCount++; for (int index = tab.length; --index >= 0; ) { tab[index] = null; } count = 0; }
java
@Override public void clear() { Entry[] tab = table; modCount++; for (int index = tab.length; --index >= 0; ) { tab[index] = null; } count = 0; }
[ "@", "Override", "public", "void", "clear", "(", ")", "{", "Entry", "[", "]", "tab", "=", "table", ";", "modCount", "++", ";", "for", "(", "int", "index", "=", "tab", ".", "length", ";", "--", "index", ">=", "0", ";", ")", "{", "tab", "[", "ind...
Removes all mappings from this map.
[ "Removes", "all", "mappings", "from", "this", "map", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/collection/IntHashMap.java#L424-L432
test
Clear the contents of the context.
Of course, here is the Java code you requested: ```java @Override public void clear() { Entry[] tab = table; modCount++; for (int index = tab.length; --index >= 0; ) { tab[index] = null; } count = 0; } ``` Hope this helps!
rackerlabs/blueflood
blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMetricsIngestionServer.java
HttpMetricsIngestionServer.startServer
public void startServer() throws InterruptedException { RouteMatcher router = new RouteMatcher(); router.get("/v1.0", new DefaultHandler()); router.post("/v1.0/multitenant/experimental/metrics", new HttpMultitenantMetricsIngestionHandler(processor, timeout, ENABLE_PER_TENANT_MET...
java
public void startServer() throws InterruptedException { RouteMatcher router = new RouteMatcher(); router.get("/v1.0", new DefaultHandler()); router.post("/v1.0/multitenant/experimental/metrics", new HttpMultitenantMetricsIngestionHandler(processor, timeout, ENABLE_PER_TENANT_MET...
[ "public", "void", "startServer", "(", ")", "throws", "InterruptedException", "{", "RouteMatcher", "router", "=", "new", "RouteMatcher", "(", ")", ";", "router", ".", "get", "(", "\"/v1.0\"", ",", "new", "DefaultHandler", "(", ")", ")", ";", "router", ".", ...
Starts the Ingest server @throws InterruptedException
[ "Starts", "the", "Ingest", "server" ]
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-http/src/main/java/com/rackspacecloud/blueflood/inputs/handlers/HttpMetricsIngestionServer.java#L107-L149
test
Start the metrics listener HTTP server.
Of course, here is the Java code you requested: ```java public void startServer() throws InterruptedException { RouteMatcher router = new RouteMatcher(); router.get("/v1.0", new DefaultHandler()); router.post("/v1.0/multitenant/experimental/metrics", new HttpMultitenantMetricsI...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/collection/PartitionCollectionMutable.java
Partition.makeGribCollection
@Nullable public GribCollectionMutable makeGribCollection() { GribCollectionMutable result = GribCdmIndex.openMutableGCFromIndex(dcm.getIndexFilename(GribCdmIndex.NCX_SUFFIX), config, false, true, logger); if (result == null) { logger.error("Failed on openMutableGCFromIndex {}", dcm.getIndexFile...
java
@Nullable public GribCollectionMutable makeGribCollection() { GribCollectionMutable result = GribCdmIndex.openMutableGCFromIndex(dcm.getIndexFilename(GribCdmIndex.NCX_SUFFIX), config, false, true, logger); if (result == null) { logger.error("Failed on openMutableGCFromIndex {}", dcm.getIndexFile...
[ "@", "Nullable", "public", "GribCollectionMutable", "makeGribCollection", "(", ")", "{", "GribCollectionMutable", "result", "=", "GribCdmIndex", ".", "openMutableGCFromIndex", "(", "dcm", ".", "getIndexFilename", "(", "GribCdmIndex", ".", "NCX_SUFFIX", ")", ",", "conf...
the children must already exist
[ "the", "children", "must", "already", "exist" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/collection/PartitionCollectionMutable.java#L232-L244
test
Create a GribCollectionMutable from the dcm index.
Of course, here is the Java code you requested: ```java @Nullable public GribCollectionMutable makeGribCollection() { GribCollectionMutable result = GribCdmIndex.openMutableGCFromIndex(dcm.getIndexFilename(GribCdmIndex.NCX_SUFFIX), config, false, true, logger); if (result == null) { logger.erro...
sialcasa/mvvmFX
mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/itemlist/ListTransformation.java
ListTransformation.processUpdateEvent
private void processUpdateEvent(ListChangeListener.Change<? extends SourceType> listEvent) { for (int i = listEvent.getFrom(); i < listEvent.getTo(); i++) { SourceType item = listEvent.getList().get(i); viewModelList.set(i, ListTransformation.this.function.apply(item)); } }
java
private void processUpdateEvent(ListChangeListener.Change<? extends SourceType> listEvent) { for (int i = listEvent.getFrom(); i < listEvent.getTo(); i++) { SourceType item = listEvent.getList().get(i); viewModelList.set(i, ListTransformation.this.function.apply(item)); } }
[ "private", "void", "processUpdateEvent", "(", "ListChangeListener", ".", "Change", "<", "?", "extends", "SourceType", ">", "listEvent", ")", "{", "for", "(", "int", "i", "=", "listEvent", ".", "getFrom", "(", ")", ";", "i", "<", "listEvent", ".", "getTo", ...
Maps an update event of the model list to new elements of the {@link #viewModelList}. @param listEvent to process
[ "Maps", "an", "update", "event", "of", "the", "model", "list", "to", "new", "elements", "of", "the", "{", "@link", "#viewModelList", "}", "." ]
240566a358a8e01c94c0bbb99228140a69690d02
https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/itemlist/ListTransformation.java#L153-L158
test
Process a list change event.
Of course, here is the Java code you requested: ```java private void processUpdateEvent(ListChangeListener.Change<? extends SourceType> listEvent) { for (int i = listEvent.getFrom(); i < listEvent.getTo(); i++) { SourceType item = listEvent.getList().get(i); viewModelList.set(i, ListTransformation.this.functio...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/HrefSet.java
HrefSet.removeHref
public void removeHref(String href) { String encodedHref = encodeHref(href); Element child = getFirstChild(root, "href"); //$NON-NLS-1$ while (child != null) { if (encodedHref.equals(getFirstText(child))) { root.removeChild(child); return; ...
java
public void removeHref(String href) { String encodedHref = encodeHref(href); Element child = getFirstChild(root, "href"); //$NON-NLS-1$ while (child != null) { if (encodedHref.equals(getFirstText(child))) { root.removeChild(child); return; ...
[ "public", "void", "removeHref", "(", "String", "href", ")", "{", "String", "encodedHref", "=", "encodeHref", "(", "href", ")", ";", "Element", "child", "=", "getFirstChild", "(", "root", ",", "\"href\"", ")", ";", "//$NON-NLS-1$", "while", "(", "child", "!...
Remove the given href from the set of hrefs. @param href the href to remove from the set of hrefs
[ "Remove", "the", "given", "href", "from", "the", "set", "of", "hrefs", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/HrefSet.java#L178-L188
test
Remove a href from the XML document.
Of course, here is the Java code you requested: ```java public void removeHref(String href) { String encodedHref = encodeHref(href); Element child = getFirstChild(root, "href"); //$NON-NLS-1$ while (child != null) { if (encodedHref.equals(getFirstText(child))) { root...
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/dom/NodeSelector.java
NodeSelector.selectFirst
public Node selectFirst(final NodeFilter nodeFilter) { List<Node> selectedNodes = select(nodeFilter); if (selectedNodes.isEmpty()) { return null; } return selectedNodes.get(0); }
java
public Node selectFirst(final NodeFilter nodeFilter) { List<Node> selectedNodes = select(nodeFilter); if (selectedNodes.isEmpty()) { return null; } return selectedNodes.get(0); }
[ "public", "Node", "selectFirst", "(", "final", "NodeFilter", "nodeFilter", ")", "{", "List", "<", "Node", ">", "selectedNodes", "=", "select", "(", "nodeFilter", ")", ";", "if", "(", "selectedNodes", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ...
Selects nodes using {@link NodeFilter node filter} and return the very first one.
[ "Selects", "nodes", "using", "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/NodeSelector.java#L107-L113
test
Selects the first node matching the given filter.
Of course, here is the Java code you requested: ```java public Node selectFirst(final NodeFilter nodeFilter) { List<Node> selectedNodes = select(nodeFilter); if (selectedNodes.isEmpty()) { return null; } return selectedNodes.get(0); } ``` Hope this helps!
lightcouch/LightCouch
src/main/java/org/lightcouch/CouchDbClientBase.java
CouchDbClientBase.put
Response put(URI uri, InputStream instream, String contentType) { HttpResponse response = null; try { final HttpPut httpPut = new HttpPut(uri); final InputStreamEntity entity = new InputStreamEntity(instream, -1); entity.setContentType(contentType); httpPut.setEntity(entity); response = executeReques...
java
Response put(URI uri, InputStream instream, String contentType) { HttpResponse response = null; try { final HttpPut httpPut = new HttpPut(uri); final InputStreamEntity entity = new InputStreamEntity(instream, -1); entity.setContentType(contentType); httpPut.setEntity(entity); response = executeReques...
[ "Response", "put", "(", "URI", "uri", ",", "InputStream", "instream", ",", "String", "contentType", ")", "{", "HttpResponse", "response", "=", "null", ";", "try", "{", "final", "HttpPut", "httpPut", "=", "new", "HttpPut", "(", "uri", ")", ";", "final", "...
Performs a HTTP PUT request, saves an attachment. @return {@link Response}
[ "Performs", "a", "HTTP", "PUT", "request", "saves", "an", "attachment", "." ]
9646889503475e862fd2158487e1cdd805447f4a
https://github.com/lightcouch/LightCouch/blob/9646889503475e862fd2158487e1cdd805447f4a/src/main/java/org/lightcouch/CouchDbClientBase.java#L600-L612
test
Execute a PUT request.
Of course, here is the Java code you requested: ```java Response put(URI uri, InputStream instream, String contentType) { HttpResponse response = null; try { final HttpPut httpPut = new HttpPut(uri); final InputStreamEntity entity = new InputStreamEntity(instream, -1); entity.setContentType(contentType); ...
vigna/fastutil
src/it/unimi/dsi/fastutil/Arrays.java
Arrays.swap
protected static void swap(final Swapper swapper, int a, int b, final int n) { for (int i = 0; i < n; i++, a++, b++) swapper.swap(a, b); }
java
protected static void swap(final Swapper swapper, int a, int b, final int n) { for (int i = 0; i < n; i++, a++, b++) swapper.swap(a, b); }
[ "protected", "static", "void", "swap", "(", "final", "Swapper", "swapper", ",", "int", "a", ",", "int", "b", ",", "final", "int", "n", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n", ";", "i", "++", ",", "a", "++", ",", "b", ...
Swaps two sequences of elements using a provided swapper. @param swapper the swapper. @param a a position in {@code x}. @param b another position in {@code x}. @param n the number of elements to exchange starting at {@code a} and {@code b}.
[ "Swaps", "two", "sequences", "of", "elements", "using", "a", "provided", "swapper", "." ]
192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c
https://github.com/vigna/fastutil/blob/192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c/src/it/unimi/dsi/fastutil/Arrays.java#L250-L252
test
Swap two elements.
Of course, here is the Java code you requested: ```java protected static void swap(final Swapper swapper, int a, int b, final int n) { for (int i = 0; i < n; i++, a++, b++) swapper.swap(a, b); } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/PropertyBehavior.java
PropertyBehavior.setIsOmit
public void setIsOmit(boolean isOmit) { Element child = getFirstChild(root, childNames); boolean isAlreadyOmit = isDAVElement(child, "omit"); //$NON-NLS-1$ if (isOmit) { if (!isAlreadyOmit) { if (child != null) root.removeChild(child); ...
java
public void setIsOmit(boolean isOmit) { Element child = getFirstChild(root, childNames); boolean isAlreadyOmit = isDAVElement(child, "omit"); //$NON-NLS-1$ if (isOmit) { if (!isAlreadyOmit) { if (child != null) root.removeChild(child); ...
[ "public", "void", "setIsOmit", "(", "boolean", "isOmit", ")", "{", "Element", "child", "=", "getFirstChild", "(", "root", ",", "childNames", ")", ";", "boolean", "isAlreadyOmit", "=", "isDAVElement", "(", "child", ",", "\"omit\"", ")", ";", "//$NON-NLS-1$", ...
Sets whether this propertybehavior is in the "omit" form or not. @param isOmit a boolean indicating whether this propertybehavior will be in the "omit" form
[ "Sets", "whether", "this", "propertybehavior", "is", "in", "the", "omit", "form", "or", "not", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/PropertyBehavior.java#L221-L232
test
Set the flag indicating if the audit log should be ignored.
Of course, here is the Java code you requested: ```java public void setIsOmit(boolean isOmit) { Element child = getFirstChild(root, childNames); boolean isAlreadyOmit = isDAVElement(child, "omit"); //$NON-NLS-1$ if (isOmit) { if (!isAlreadyOmit) { if (child != null) ...
deliveredtechnologies/rulebook
rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/ThenRuleBuilder.java
ThenRuleBuilder.then
public ThenRuleBuilder<T, U> then(Consumer<NameValueReferableTypeConvertibleMap<T>> action) { _rule.addAction(action); return this; }
java
public ThenRuleBuilder<T, U> then(Consumer<NameValueReferableTypeConvertibleMap<T>> action) { _rule.addAction(action); return this; }
[ "public", "ThenRuleBuilder", "<", "T", ",", "U", ">", "then", "(", "Consumer", "<", "NameValueReferableTypeConvertibleMap", "<", "T", ">", ">", "action", ")", "{", "_rule", ".", "addAction", "(", "action", ")", ";", "return", "this", ";", "}" ]
Adds a then action into the Rule. @param action an action that the rule will execute based on the condition @return a builder that allows for the Rule to be built following the 'then' statement
[ "Adds", "a", "then", "action", "into", "the", "Rule", "." ]
253738f6bc1e7804bb8649863e969956075a19ae
https://github.com/deliveredtechnologies/rulebook/blob/253738f6bc1e7804bb8649863e969956075a19ae/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/ThenRuleBuilder.java#L42-L45
test
Add an action to the then rule.
Of course, here is the Java code you requested: ```java public ThenRuleBuilder<T, U> then(Consumer<NameValueReferableTypeConvertibleMap<T>> action) { _rule.addAction(action); return this; } ``` Hope this helps!
streamsets/datacollector
sdk/src/main/java/com/streamsets/pipeline/sdk/StageValidator.java
StageValidator.isSameVersion
public static boolean isSameVersion(Class<? extends Stage> a, Class<? extends Stage> b) { StageDef aDef = a.getAnnotation(StageDef.class); StageDef bDef = b.getAnnotation(StageDef.class); return aDef.version() == bDef.version(); }
java
public static boolean isSameVersion(Class<? extends Stage> a, Class<? extends Stage> b) { StageDef aDef = a.getAnnotation(StageDef.class); StageDef bDef = b.getAnnotation(StageDef.class); return aDef.version() == bDef.version(); }
[ "public", "static", "boolean", "isSameVersion", "(", "Class", "<", "?", "extends", "Stage", ">", "a", ",", "Class", "<", "?", "extends", "Stage", ">", "b", ")", "{", "StageDef", "aDef", "=", "a", ".", "getAnnotation", "(", "StageDef", ".", "class", ")"...
Returns if and only if both stage classes have defined the same version.
[ "Returns", "if", "and", "only", "if", "both", "stage", "classes", "have", "defined", "the", "same", "version", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/sdk/src/main/java/com/streamsets/pipeline/sdk/StageValidator.java#L33-L38
test
Checks if two stages have the same version.
Of course, here is the Java code you requested: ```java public static boolean isSameVersion(Class<? extends Stage> a, Class<? extends Stage> b) { StageDef aDef = a.getAnnotation(StageDef.class); StageDef bDef = b.getAnnotation(StageDef.class); return aDef.version() == bDef.version(); } ``` Hope this he...
polyjdbc/polyjdbc
src/main/java/org/polyjdbc/core/query/SelectQuery.java
SelectQuery.orderBy
public SelectQuery orderBy(String name, Order order) { if (orderBy == null) { orderBy = new StringBuilder(ORDER_BY_LENGTH); orderBy.append(" ORDER BY "); } orderBy.append(name).append(" ").append(order.getStringCode()).append(", "); return this; }
java
public SelectQuery orderBy(String name, Order order) { if (orderBy == null) { orderBy = new StringBuilder(ORDER_BY_LENGTH); orderBy.append(" ORDER BY "); } orderBy.append(name).append(" ").append(order.getStringCode()).append(", "); return this; }
[ "public", "SelectQuery", "orderBy", "(", "String", "name", ",", "Order", "order", ")", "{", "if", "(", "orderBy", "==", "null", ")", "{", "orderBy", "=", "new", "StringBuilder", "(", "ORDER_BY_LENGTH", ")", ";", "orderBy", ".", "append", "(", "\" ORDER BY ...
Create <b>ORDER BY</b> clause for given column, can be used multiple times with multiple columns.
[ "Create", "<b", ">", "ORDER", "BY<", "/", "b", ">", "clause", "for", "given", "column", "can", "be", "used", "multiple", "times", "with", "multiple", "columns", "." ]
824d0e1ad14390a5b52cb96e527c943c14e28339
https://github.com/polyjdbc/polyjdbc/blob/824d0e1ad14390a5b52cb96e527c943c14e28339/src/main/java/org/polyjdbc/core/query/SelectQuery.java#L109-L117
test
Add a ORDER BY clause to the result.
Of course, here is the Java code you requested: ```java public SelectQuery orderBy(String name, Order order) { if (orderBy == null) { orderBy = new StringBuilder(ORDER_BY_LENGTH); orderBy.append(" ORDER BY "); } orderBy.append(name).append(" ").append(order.getStringCode...
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/InterfaceDefImpl.java
InterfaceDefImpl.type
public TypeCode type() { if (typeCode == null) typeCode = getORB().create_interface_tc(id, name); return typeCode; }
java
public TypeCode type() { if (typeCode == null) typeCode = getORB().create_interface_tc(id, name); return typeCode; }
[ "public", "TypeCode", "type", "(", ")", "{", "if", "(", "typeCode", "==", "null", ")", "typeCode", "=", "getORB", "(", ")", ".", "create_interface_tc", "(", "id", ",", "name", ")", ";", "return", "typeCode", ";", "}" ]
IDLTypeOperations implementation ------------------------------
[ "IDLTypeOperations", "implementation", "------------------------------" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/InterfaceDefImpl.java#L300-L305
test
Get the TypeCode of the interface.
Of course, here is the Java code you requested: ```java public TypeCode type() { if (typeCode == null) typeCode = getORB().create_interface_tc(id, name); return typeCode; } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-buffer/src/main/java/org/nd4j/linalg/api/buffer/factory/DefaultDataBufferFactory.java
DefaultDataBufferFactory.create
@Override public DataBuffer create(Pointer pointer, DataBuffer.Type type, long length, Indexer indexer) { switch (type) { case INT: return new IntBuffer(pointer, indexer, length); case DOUBLE: return new DoubleBuffer(pointer, indexer, length); ...
java
@Override public DataBuffer create(Pointer pointer, DataBuffer.Type type, long length, Indexer indexer) { switch (type) { case INT: return new IntBuffer(pointer, indexer, length); case DOUBLE: return new DoubleBuffer(pointer, indexer, length); ...
[ "@", "Override", "public", "DataBuffer", "create", "(", "Pointer", "pointer", ",", "DataBuffer", ".", "Type", "type", ",", "long", "length", ",", "Indexer", "indexer", ")", "{", "switch", "(", "type", ")", "{", "case", "INT", ":", "return", "new", "IntBu...
Create a data buffer based on the given pointer, data buffer opType, and length of the buffer @param pointer the pointer to use @param type the opType of buffer @param length the length of the buffer @param indexer the indexer for the pointer @return the data buffer backed by this pointer with the given opType and...
[ "Create", "a", "data", "buffer", "based", "on", "the", "given", "pointer", "data", "buffer", "opType", "and", "length", "of", "the", "buffer" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-buffer/src/main/java/org/nd4j/linalg/api/buffer/factory/DefaultDataBufferFactory.java#L500-L513
test
Create a new data buffer of the specified type.
Of course, here is the Java code you requested: ```java @Override public DataBuffer create(Pointer pointer, DataBuffer.Type type, long length, Indexer indexer) { switch (type) { case INT: return new IntBuffer(pointer, indexer, length); case DOUBLE: re...
jbundle/util
jbackup/src/main/java/org/jbundle/jbackup/source/ZipSourcePropertyView.java
ZipSourcePropertyView.controlsToProperties
public void controlsToProperties() { super.controlsToProperties(); String strPathname = m_tfRootPathname.getText(); m_properties.setProperty(ZIPIN_FILENAME_PARAM, strPathname); }
java
public void controlsToProperties() { super.controlsToProperties(); String strPathname = m_tfRootPathname.getText(); m_properties.setProperty(ZIPIN_FILENAME_PARAM, strPathname); }
[ "public", "void", "controlsToProperties", "(", ")", "{", "super", ".", "controlsToProperties", "(", ")", ";", "String", "strPathname", "=", "m_tfRootPathname", ".", "getText", "(", ")", ";", "m_properties", ".", "setProperty", "(", "ZIPIN_FILENAME_PARAM", ",", "...
/* Set the properties to the current control values.
[ "/", "*", "Set", "the", "properties", "to", "the", "current", "control", "values", "." ]
5af0f2292f56f29f70cbc26d0bfa72f89ae31be0
https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/source/ZipSourcePropertyView.java#L75-L80
test
Set the properties of the link.
Of course, here is the Java code you requested: ```java public void controlsToProperties() { super.controlsToProperties(); String strPathname = m_tfRootPathname.getText(); m_properties.setProperty(ZIPIN_FILENAME_PARAM, strPathname); } ``` Hope this helps!
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/server/WebSocketServer.java
WebSocketServer.getSocket
private Socket getSocket( WebSocket conn ) { WebSocketImpl impl = (WebSocketImpl) conn; return ( (SocketChannel) impl.getSelectionKey().channel() ).socket(); }
java
private Socket getSocket( WebSocket conn ) { WebSocketImpl impl = (WebSocketImpl) conn; return ( (SocketChannel) impl.getSelectionKey().channel() ).socket(); }
[ "private", "Socket", "getSocket", "(", "WebSocket", "conn", ")", "{", "WebSocketImpl", "impl", "=", "(", "WebSocketImpl", ")", "conn", ";", "return", "(", "(", "SocketChannel", ")", "impl", ".", "getSelectionKey", "(", ")", ".", "channel", "(", ")", ")", ...
Getter to return the socket used by this specific connection @param conn The specific connection @return The socket used by this connection
[ "Getter", "to", "return", "the", "socket", "used", "by", "this", "specific", "connection" ]
73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9
https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/server/WebSocketServer.java#L779-L782
test
Get the socket for the given connection.
Of course, here is the Java code you requested: ```java private Socket getSocket( WebSocket conn ) { WebSocketImpl impl = (WebSocketImpl) conn; return ( (SocketChannel) impl.getSelectionKey().channel() ).socket(); } ``` Hope this helps!
wildfly/wildfly
connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/CommonIronJacamarParser.java
CommonIronJacamarParser.parseConnectionDefinitions_5_0
protected void parseConnectionDefinitions_5_0(final XMLExtendedStreamReader reader, final Map<String, ModelNode> map, final Map<String, HashMap<String, ModelNode>> configMap, final boolean isXa) throws XMLStreamException, ParserException, ValidateException {...
java
protected void parseConnectionDefinitions_5_0(final XMLExtendedStreamReader reader, final Map<String, ModelNode> map, final Map<String, HashMap<String, ModelNode>> configMap, final boolean isXa) throws XMLStreamException, ParserException, ValidateException {...
[ "protected", "void", "parseConnectionDefinitions_5_0", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "Map", "<", "String", ",", "ModelNode", ">", "map", ",", "final", "Map", "<", "String", ",", "HashMap", "<", "String", ",", "ModelNode", ">", ...
parse a single connection-definition tag @param reader the reader @throws javax.xml.stream.XMLStreamException XMLStreamException @throws ParserException ParserException @throws org.jboss.jca.common.api.validator.ValidateException ValidateException
[ "parse", "a", "single", "connection", "-", "definition", "tag" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/CommonIronJacamarParser.java#L574-L655
test
Parses the connection definitions of the version 5. 0.
Of course, here is the Java code you requested: ```java protected void parseConnectionDefinitions_5_0(final XMLExtendedStreamReader reader, final Map<String, ModelNode> map, final Map<String, HashMap<String, ModelNode>> configMap, final boolean isXa) throws...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/features/user/ManualFeatureQuery.java
ManualFeatureQuery.query
public ManualFeatureQueryResults query(double minX, double minY, double maxX, double maxY) { List<Long> featureIds = new ArrayList<>(); long offset = 0; boolean hasResults = true; minX -= tolerance; maxX += tolerance; minY -= ...
java
public ManualFeatureQueryResults query(double minX, double minY, double maxX, double maxY) { List<Long> featureIds = new ArrayList<>(); long offset = 0; boolean hasResults = true; minX -= tolerance; maxX += tolerance; minY -= ...
[ "public", "ManualFeatureQueryResults", "query", "(", "double", "minX", ",", "double", "minY", ",", "double", "maxX", ",", "double", "maxY", ")", "{", "List", "<", "Long", ">", "featureIds", "=", "new", "ArrayList", "<>", "(", ")", ";", "long", "offset", ...
Manually query for rows within the bounds @param minX min x @param minY min y @param maxX max x @param maxY max y @return results
[ "Manually", "query", "for", "rows", "within", "the", "bounds" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/features/user/ManualFeatureQuery.java#L254-L304
test
Query for features in a range of points.
Of course, here is the Java code you requested: ```java public ManualFeatureQueryResults query(double minX, double minY, double maxX, double maxY) { List<Long> featureIds = new ArrayList<>(); long offset = 0; boolean hasResults = true; minX ...
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/component/stateful/StatefulSessionSynchronizationInterceptor.java
StatefulSessionSynchronizationInterceptor.getLockOwner
private static Object getLockOwner(final TransactionSynchronizationRegistry transactionSynchronizationRegistry) { Object owner = transactionSynchronizationRegistry.getTransactionKey(); return owner != null ? owner : Thread.currentThread(); }
java
private static Object getLockOwner(final TransactionSynchronizationRegistry transactionSynchronizationRegistry) { Object owner = transactionSynchronizationRegistry.getTransactionKey(); return owner != null ? owner : Thread.currentThread(); }
[ "private", "static", "Object", "getLockOwner", "(", "final", "TransactionSynchronizationRegistry", "transactionSynchronizationRegistry", ")", "{", "Object", "owner", "=", "transactionSynchronizationRegistry", ".", "getTransactionKey", "(", ")", ";", "return", "owner", "!=",...
Use either the active transaction or the current thread as the lock owner @return The lock owner
[ "Use", "either", "the", "active", "transaction", "or", "the", "current", "thread", "as", "the", "lock", "owner" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/component/stateful/StatefulSessionSynchronizationInterceptor.java#L194-L197
test
Get the owner of the lock.
Of course, here is the Java code you requested: ```java private static Object getLockOwner(final TransactionSynchronizationRegistry transactionSynchronizationRegistry) { Object owner = transactionSynchronizationRegistry.getTransactionKey(); return owner != null ? owner : Thread.currentThread(); } `...
kocakosm/pitaya
src/org/kocakosm/pitaya/io/CharStreams.java
CharStreams.equal
public static boolean equal(Reader in1, Reader in2) throws IOException { if (in1 == in2) { return true; } if (in1 == null || in2 == null) { return false; } in1 = buffer(in1); in2 = buffer(in2); int c1 = in1.read(); int c2 = in2.read(); while (c1 != -1 && c2 != -1 && c1 == c2) { c1 = in1.read...
java
public static boolean equal(Reader in1, Reader in2) throws IOException { if (in1 == in2) { return true; } if (in1 == null || in2 == null) { return false; } in1 = buffer(in1); in2 = buffer(in2); int c1 = in1.read(); int c2 = in2.read(); while (c1 != -1 && c2 != -1 && c1 == c2) { c1 = in1.read...
[ "public", "static", "boolean", "equal", "(", "Reader", "in1", ",", "Reader", "in2", ")", "throws", "IOException", "{", "if", "(", "in1", "==", "in2", ")", "{", "return", "true", ";", "}", "if", "(", "in1", "==", "null", "||", "in2", "==", "null", "...
Returns whether the given streams have the same content. @param in1 the first stream. @param in2 the second stream. @return {@code true} if the streams have the same content. @throws IOException if an I/O error occurs during the process.
[ "Returns", "whether", "the", "given", "streams", "have", "the", "same", "content", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/CharStreams.java#L177-L194
test
Returns true if the reader in1 and in2 are equal.
Of course, here is the Java code you requested: ```java public static boolean equal(Reader in1, Reader in2) throws IOException { if (in1 == in2) { return true; } if (in1 == null || in2 == null) { return false; } in1 = buffer(in1); in2 = buffer(in2); int c1 = in1.read(); int c2 = in2.read(); wh...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/pattern/parser/Compiler.java
Compiler.createConverter
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter<E>) OptionHelper.instantiateByCl...
java
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter<E>) OptionHelper.instantiateByCl...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "DynamicConverter", "<", "E", ">", "createConverter", "(", "SimpleKeywordNode", "kn", ")", "{", "String", "keyword", "=", "(", "String", ")", "kn", ".", "getValue", "(", ")", ";", "String", "converterClassStr...
Attempt to create a converter using the information found in 'converterMap'. @param kn @return
[ "Attempt", "to", "create", "a", "converter", "using", "the", "information", "found", "in", "converterMap", "." ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/pattern/parser/Compiler.java#L102-L121
test
Create a converter for a given simple keyword.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { ...
streamsets/datacollector
commonlib/src/main/java/com/streamsets/pipeline/lib/util/AvroSchemaHelper.java
AvroSchemaHelper.loadFromRegistry
public Schema loadFromRegistry(int id) throws SchemaRegistryException { try { return registryClient.getByID(id); } catch (IOException | RestClientException e) { throw new SchemaRegistryException(e); } }
java
public Schema loadFromRegistry(int id) throws SchemaRegistryException { try { return registryClient.getByID(id); } catch (IOException | RestClientException e) { throw new SchemaRegistryException(e); } }
[ "public", "Schema", "loadFromRegistry", "(", "int", "id", ")", "throws", "SchemaRegistryException", "{", "try", "{", "return", "registryClient", ".", "getByID", "(", "id", ")", ";", "}", "catch", "(", "IOException", "|", "RestClientException", "e", ")", "{", ...
Loads and parses a schema for the specified schema ID from the schema registry @param id schema ID to fetch from the registry @return parsed avro schema @throws SchemaRegistryException if there is an error with the registry client
[ "Loads", "and", "parses", "a", "schema", "for", "the", "specified", "schema", "ID", "from", "the", "schema", "registry" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/commonlib/src/main/java/com/streamsets/pipeline/lib/util/AvroSchemaHelper.java#L194-L200
test
Load a schema from the registry.
Of course, here is the Java code you requested: ```java public Schema loadFromRegistry(int id) throws SchemaRegistryException { try { return registryClient.getByID(id); } catch (IOException | RestClientException e) { throw new SchemaRegistryException(e); } } ``` Hope this helps!
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/TableMetadataDataSource.java
TableMetadataDataSource.createTableMetadata
private TableMetadata createTableMetadata(Cursor cursor) { TableMetadata metadata = new TableMetadata(); metadata.setGeoPackageId(cursor.getLong(0)); metadata.setTableName(cursor.getString(1)); if (!cursor.isNull(2)) { metadata.setLastIndexed(cursor.getLong(2)); } ...
java
private TableMetadata createTableMetadata(Cursor cursor) { TableMetadata metadata = new TableMetadata(); metadata.setGeoPackageId(cursor.getLong(0)); metadata.setTableName(cursor.getString(1)); if (!cursor.isNull(2)) { metadata.setLastIndexed(cursor.getLong(2)); } ...
[ "private", "TableMetadata", "createTableMetadata", "(", "Cursor", "cursor", ")", "{", "TableMetadata", "metadata", "=", "new", "TableMetadata", "(", ")", ";", "metadata", ".", "setGeoPackageId", "(", "cursor", ".", "getLong", "(", "0", ")", ")", ";", "metadata...
Create a table metadata from the current cursor location @param cursor cursor @return table metadata
[ "Create", "a", "table", "metadata", "from", "the", "current", "cursor", "location" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/TableMetadataDataSource.java#L261-L269
test
Create the TableMetadata object from the table metadata table.
Of course, here is the Java code you requested: ```java private TableMetadata createTableMetadata(Cursor cursor) { TableMetadata metadata = new TableMetadata(); metadata.setGeoPackageId(cursor.getLong(0)); metadata.setTableName(cursor.getString(1)); if (!cursor.isNull(2)) { ...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/grid/GridVertCoord.java
GridVertCoord.matchLevels
boolean matchLevels(List<GridRecord> records) { // first create a new list List<LevelCoord> levelList = new ArrayList<LevelCoord>(records.size()); for (GridRecord record : records) { LevelCoord lc = new LevelCoord(record.getLevel1(), record.getLevel2()); if (!levelList.contains(lc)) { l...
java
boolean matchLevels(List<GridRecord> records) { // first create a new list List<LevelCoord> levelList = new ArrayList<LevelCoord>(records.size()); for (GridRecord record : records) { LevelCoord lc = new LevelCoord(record.getLevel1(), record.getLevel2()); if (!levelList.contains(lc)) { l...
[ "boolean", "matchLevels", "(", "List", "<", "GridRecord", ">", "records", ")", "{", "// first create a new list", "List", "<", "LevelCoord", ">", "levelList", "=", "new", "ArrayList", "<", "LevelCoord", ">", "(", "records", ".", "size", "(", ")", ")", ";", ...
Match levels @param records records to match @return true if they have the same levels
[ "Match", "levels" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridVertCoord.java#L205-L223
test
Checks if the levels are the same.
Of course, here is the Java code you requested: ```java boolean matchLevels(List<GridRecord> records) { // first create a new list List<LevelCoord> levelList = new ArrayList<LevelCoord>(records.size()); for (GridRecord record : records) { LevelCoord lc = new LevelCoord(record.getLevel1(), record.get...
Unidata/thredds
cdm/src/main/java/ucar/util/prefs/PreferencesExt.java
PreferencesExt.removeNodeSpi
protected void removeNodeSpi() throws BackingStoreException { //System.out.println(" removeNodeSpi :"+name()); if (parent != null) { if (null == parent.children.remove( name())) System.out.println("ERROR PreferencesExt.removeNodeSpi :"+name()); } }
java
protected void removeNodeSpi() throws BackingStoreException { //System.out.println(" removeNodeSpi :"+name()); if (parent != null) { if (null == parent.children.remove( name())) System.out.println("ERROR PreferencesExt.removeNodeSpi :"+name()); } }
[ "protected", "void", "removeNodeSpi", "(", ")", "throws", "BackingStoreException", "{", "//System.out.println(\" removeNodeSpi :\"+name());", "if", "(", "parent", "!=", "null", ")", "{", "if", "(", "null", "==", "parent", ".", "children", ".", "remove", "(", "name...
/* removes node, no effect on storedDefaults Removes this preference node, invalidating it and any preferences that it contains. The named child will have no descendants at the time this invocation is made (i.e., the Preferences.removeNode() method invokes this method repeatedly in a bottom-up fashion, removing each o...
[ "/", "*", "removes", "node", "no", "effect", "on", "storedDefaults" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/util/prefs/PreferencesExt.java#L411-L417
test
Remove the node SPI from the node list.
Of course, here is the Java code you requested: ```java protected void removeNodeSpi() throws BackingStoreException { //System.out.println(" removeNodeSpi :"+name()); if (parent != null) { if (null == parent.children.remove( name())) System.out.println("ERROR PreferencesExt.removeNodeSpi ...
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/kb/Triple.java
Triple.setPredicate
public void setPredicate(String v) { if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_predicate == null) jcasType.jcas.throwFeatMissing("predicate", "edu.cmu.lti.oaqa.type.kb.Triple"); jcasType.ll_cas.ll_setStringValue(addr, ((Triple_Type)jcasType).casFeatCode_predicate, v);}
java
public void setPredicate(String v) { if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_predicate == null) jcasType.jcas.throwFeatMissing("predicate", "edu.cmu.lti.oaqa.type.kb.Triple"); jcasType.ll_cas.ll_setStringValue(addr, ((Triple_Type)jcasType).casFeatCode_predicate, v);}
[ "public", "void", "setPredicate", "(", "String", "v", ")", "{", "if", "(", "Triple_Type", ".", "featOkTst", "&&", "(", "(", "Triple_Type", ")", "jcasType", ")", ".", "casFeat_predicate", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", ...
setter for predicate - sets The predicate of the triple - always a URI. @generated @param v value to set into the feature
[ "setter", "for", "predicate", "-", "sets", "The", "predicate", "of", "the", "triple", "-", "always", "a", "URI", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/kb/Triple.java#L105-L108
test
setter for predicate - sets
Of course, here is the Java code you requested: ```java public void setPredicate(String v) { if (Triple_Type.featOkTst && ((Triple_Type)jcasType).casFeat_predicate == null) jcasType.jcas.throwFeatMissing("predicate", "edu.cmu.lti.oaqa.type.kb.Triple"); jcasType.ll_cas.ll_setStringValue(addr, ((Triple_Typ...
NanoHttpd/nanohttpd
core/src/main/java/org/nanohttpd/protocols/http/HTTPSession.java
HTTPSession.decodeHeader
private void decodeHeader(BufferedReader in, Map<String, String> pre, Map<String, List<String>> parms, Map<String, String> headers) throws ResponseException { try { // Read the request line String inLine = in.readLine(); if (inLine == null) { return; ...
java
private void decodeHeader(BufferedReader in, Map<String, String> pre, Map<String, List<String>> parms, Map<String, String> headers) throws ResponseException { try { // Read the request line String inLine = in.readLine(); if (inLine == null) { return; ...
[ "private", "void", "decodeHeader", "(", "BufferedReader", "in", ",", "Map", "<", "String", ",", "String", ">", "pre", ",", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "parms", ",", "Map", "<", "String", ",", "String", ">", "headers", ...
Decodes the sent headers and loads the data into Key/value pairs
[ "Decodes", "the", "sent", "headers", "and", "loads", "the", "data", "into", "Key", "/", "value", "pairs" ]
b04a342a4bcd0ff44be65138acffc73a29381c72
https://github.com/NanoHttpd/nanohttpd/blob/b04a342a4bcd0ff44be65138acffc73a29381c72/core/src/main/java/org/nanohttpd/protocols/http/HTTPSession.java#L136-L189
test
Decode header.
Of course, here is the Java code you requested: ```java private void decodeHeader(BufferedReader in, Map<String, String> pre, Map<String, List<String>> parms, Map<String, String> headers) throws ResponseException { try { // Read the request line String inLine = in.readLine(); ...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java
WebSecurityConfigurerAdapter.createSharedObjects
private Map<Class<? extends Object>, Object> createSharedObjects() { Map<Class<? extends Object>, Object> sharedObjects = new HashMap<Class<? extends Object>, Object>(); sharedObjects.putAll(localConfigureAuthenticationBldr.getSharedObjects()); sharedObjects.put(UserDetailsService.class, userDetailsService()); ...
java
private Map<Class<? extends Object>, Object> createSharedObjects() { Map<Class<? extends Object>, Object> sharedObjects = new HashMap<Class<? extends Object>, Object>(); sharedObjects.putAll(localConfigureAuthenticationBldr.getSharedObjects()); sharedObjects.put(UserDetailsService.class, userDetailsService()); ...
[ "private", "Map", "<", "Class", "<", "?", "extends", "Object", ">", ",", "Object", ">", "createSharedObjects", "(", ")", "{", "Map", "<", "Class", "<", "?", "extends", "Object", ">", ",", "Object", ">", "sharedObjects", "=", "new", "HashMap", "<", "Cla...
Creates the shared objects @return the shared Objects
[ "Creates", "the", "shared", "objects" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java#L417-L425
test
Creates a map of shared objects for the application.
Of course, here is the Java code you requested: ```java private Map<Class<? extends Object>, Object> createSharedObjects() { Map<Class<? extends Object>, Object> sharedObjects = new HashMap<Class<? extends Object>, Object>(); sharedObjects.putAll(localConfigureAuthenticationBldr.getSharedObjects()); sharedObject...
deeplearning4j/nd4j
nd4j-common/src/main/java/org/nd4j/util/StringUtils.java
StringUtils.format
public static String format(final String format, final Object... objects) { return String.format(Locale.ENGLISH, format, objects); }
java
public static String format(final String format, final Object... objects) { return String.format(Locale.ENGLISH, format, objects); }
[ "public", "static", "String", "format", "(", "final", "String", "format", ",", "final", "Object", "...", "objects", ")", "{", "return", "String", ".", "format", "(", "Locale", ".", "ENGLISH", ",", "format", ",", "objects", ")", ";", "}" ]
The same as String.format(Locale.ENGLISH, format, objects).
[ "The", "same", "as", "String", ".", "format", "(", "Locale", ".", "ENGLISH", "format", "objects", ")", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/util/StringUtils.java#L92-L94
test
Format a string with the specified format and objects.
Of course, here is the Java code you requested: ```java public static String format(final String format, final Object... objects) { return String.format(Locale.ENGLISH, format, objects); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/CoordinateSystem.java
CoordinateSystem.getProjectionCT
public ProjectionCT getProjectionCT() { for (CoordinateTransform ct : coordTrans) { if (ct instanceof ProjectionCT) return (ProjectionCT) ct; } return null; }
java
public ProjectionCT getProjectionCT() { for (CoordinateTransform ct : coordTrans) { if (ct instanceof ProjectionCT) return (ProjectionCT) ct; } return null; }
[ "public", "ProjectionCT", "getProjectionCT", "(", ")", "{", "for", "(", "CoordinateTransform", "ct", ":", "coordTrans", ")", "{", "if", "(", "ct", "instanceof", "ProjectionCT", ")", "return", "(", "ProjectionCT", ")", "ct", ";", "}", "return", "null", ";", ...
Find the first ProjectionCT from the list of CoordinateTransforms. @return ProjectionCT or null if none.
[ "Find", "the", "first", "ProjectionCT", "from", "the", "list", "of", "CoordinateTransforms", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/CoordinateSystem.java#L288-L294
test
Get the projection CT
Of course, here is the Java code you requested: ```java public ProjectionCT getProjectionCT() { for (CoordinateTransform ct : coordTrans) { if (ct instanceof ProjectionCT) return (ProjectionCT) ct; } return null; } ``` Hope this helps!
OpenEstate/OpenEstate-IO
CasaIT/src/main/java/org/openestate/io/casa_it/CasaItDocument.java
CasaItDocument.newDocument
public static CasaItDocument newDocument(Container container) throws ParserConfigurationException, JAXBException { Document document = XmlUtils.newDocument(); CasaItUtils.createMarshaller("UTF-8", true).marshal(container, document); return new CasaItDocument(document); }
java
public static CasaItDocument newDocument(Container container) throws ParserConfigurationException, JAXBException { Document document = XmlUtils.newDocument(); CasaItUtils.createMarshaller("UTF-8", true).marshal(container, document); return new CasaItDocument(document); }
[ "public", "static", "CasaItDocument", "newDocument", "(", "Container", "container", ")", "throws", "ParserConfigurationException", ",", "JAXBException", "{", "Document", "document", "=", "XmlUtils", ".", "newDocument", "(", ")", ";", "CasaItUtils", ".", "createMarshal...
Creates a {@link CasaItDocument} from a {@link Container} object. @param container Java object, that represents the &lt;container&gt; root element @return created document @throws ParserConfigurationException if the parser is not properly configured @throws JAXBException if a problem with JAXB occurred
[ "Creates", "a", "{", "@link", "CasaItDocument", "}", "from", "a", "{", "@link", "Container", "}", "object", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/CasaIT/src/main/java/org/openestate/io/casa_it/CasaItDocument.java#L81-L85
test
Create a new document from a container.
Of course, here is the Java code you requested: ```java public static CasaItDocument newDocument(Container container) throws ParserConfigurationException, JAXBException { Document document = XmlUtils.newDocument(); CasaItUtils.createMarshaller("UTF-8", true).marshal(container, document); return...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createAnzahlBetten
@XmlElementDecl(namespace = "", name = "anzahl_betten") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createAnzahlBetten(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlBetten_QNAME, BigDecimal.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "anzahl_betten") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createAnzahlBetten(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlBetten_QNAME, BigDecimal.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"anzahl_betten\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter2", ".", "class", ")", "public", "JAXBElement", "<", "BigDecimal", ">", "createAnzahlBetten", "(", "BigDecimal", "value", ")...
Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "BigDecimal", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2438-L2442
test
Create an instance of an AnzahlBetten.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "anzahl_betten") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createAnzahlBetten(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlBetten_QNAME, BigDecimal.class, null, valu...
jcodec/jcodec
src/main/java/net/sourceforge/jaad/aac/sbr/FBT.java
FBT.find_bands
public static int find_bands(int warp, int bands, int a0, int a1) { float div = (float) Math.log(2.0); if(warp!=0) div *= 1.3f; return (int) (bands*Math.log((float) a1/(float) a0)/div+0.5); }
java
public static int find_bands(int warp, int bands, int a0, int a1) { float div = (float) Math.log(2.0); if(warp!=0) div *= 1.3f; return (int) (bands*Math.log((float) a1/(float) a0)/div+0.5); }
[ "public", "static", "int", "find_bands", "(", "int", "warp", ",", "int", "bands", ",", "int", "a0", ",", "int", "a1", ")", "{", "float", "div", "=", "(", "float", ")", "Math", ".", "log", "(", "2.0", ")", ";", "if", "(", "warp", "!=", "0", ")",...
/* This function finds the number of bands using this formula: bands * log(a1/a0)/log(2.0) + 0.5
[ "/", "*", "This", "function", "finds", "the", "number", "of", "bands", "using", "this", "formula", ":", "bands", "*", "log", "(", "a1", "/", "a0", ")", "/", "log", "(", "2", ".", "0", ")", "+", "0", ".", "5" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/net/sourceforge/jaad/aac/sbr/FBT.java#L131-L136
test
Find the bands of a given warp and a1
Of course, here is the Java code you requested: ```java public static int find_bands(int warp, int bands, int a0, int a1) { float div = (float) Math.log(2.0); if(warp!=0) div *= 1.3f; return (int) (bands*Math.log((float) a1/(float) a0)/div+0.5); } ``` Hope this helps!
streamsets/datacollector
google-cloud-lib/src/main/java/com/streamsets/pipeline/stage/bigquery/destination/BigQueryTarget.java
BigQueryTarget.convertToRowObjectFromRecord
private Map<String, Object> convertToRowObjectFromRecord(Record record) throws OnRecordErrorException { Field rootField = record.get(); Map<String, Object> rowObject = new LinkedHashMap<>(); if (rootField.getType().isOneOf(Field.Type.MAP, Field.Type.LIST_MAP)) { Map<String, Field> fieldMap = rootField...
java
private Map<String, Object> convertToRowObjectFromRecord(Record record) throws OnRecordErrorException { Field rootField = record.get(); Map<String, Object> rowObject = new LinkedHashMap<>(); if (rootField.getType().isOneOf(Field.Type.MAP, Field.Type.LIST_MAP)) { Map<String, Field> fieldMap = rootField...
[ "private", "Map", "<", "String", ",", "Object", ">", "convertToRowObjectFromRecord", "(", "Record", "record", ")", "throws", "OnRecordErrorException", "{", "Field", "rootField", "=", "record", ".", "get", "(", ")", ";", "Map", "<", "String", ",", "Object", "...
Convert the root field to a java map object implicitly mapping each field to the column (only non nested objects) @param record record to be converted @return Java row representation for the record
[ "Convert", "the", "root", "field", "to", "a", "java", "map", "object", "implicitly", "mapping", "each", "field", "to", "the", "column", "(", "only", "non", "nested", "objects", ")" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/google-cloud-lib/src/main/java/com/streamsets/pipeline/stage/bigquery/destination/BigQueryTarget.java#L259-L279
test
Converts a record to a Map of Map of String and Object.
Of course, here is the Java code you requested: ```java private Map<String, Object> convertToRowObjectFromRecord(Record record) throws OnRecordErrorException { Field rootField = record.get(); Map<String, Object> rowObject = new LinkedHashMap<>(); if (rootField.getType().isOneOf(Field.Type.MAP, Field.Type.L...
boonproject/boon
slumberdb/slumberdb-mysql/src/main/java/org/boon/slumberdb/mysql/BaseVersionedMySQLSupport.java
BaseVersionedMySQLSupport.createLoadAllVersionDataSQL
protected void createLoadAllVersionDataSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, 1, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.remo...
java
protected void createLoadAllVersionDataSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, 1, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.remo...
[ "protected", "void", "createLoadAllVersionDataSQL", "(", "String", "table", ")", "{", "CharBuf", "buf", "=", "CharBuf", ".", "create", "(", "100", ")", ";", "buf", ".", "add", "(", "\"select kv_key, 1, version, update_timestamp, create_timestamp from `\"", ")", ";", ...
Create load all keys SQL. @param table table
[ "Create", "load", "all", "keys", "SQL", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/slumberdb/slumberdb-mysql/src/main/java/org/boon/slumberdb/mysql/BaseVersionedMySQLSupport.java#L821-L833
test
Create the load all version data SQL statement.
Of course, here is the Java code you requested: ```java protected void createLoadAllVersionDataSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, 1, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); ...
wildfly/wildfly
naming/src/main/java/org/jboss/as/naming/NamingEventCoordinator.java
NamingEventCoordinator.removeListener
synchronized void removeListener(final NamingListener namingListener) { // Do we have a holder for this listener final ListenerHolder holder = holdersByListener.get(namingListener); if (holder == null) { return; } final Map<NamingListener, ListenerHolder> byListenerC...
java
synchronized void removeListener(final NamingListener namingListener) { // Do we have a holder for this listener final ListenerHolder holder = holdersByListener.get(namingListener); if (holder == null) { return; } final Map<NamingListener, ListenerHolder> byListenerC...
[ "synchronized", "void", "removeListener", "(", "final", "NamingListener", "namingListener", ")", "{", "// Do we have a holder for this listener", "final", "ListenerHolder", "holder", "=", "holdersByListener", ".", "get", "(", "namingListener", ")", ";", "if", "(", "hold...
Remove a listener. Will remove it from all target mappings. Once this method returns, the listener will no longer receive any events. @param namingListener The listener
[ "Remove", "a", "listener", ".", "Will", "remove", "it", "from", "all", "target", "mappings", ".", "Once", "this", "method", "returns", "the", "listener", "will", "no", "longer", "receive", "any", "events", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/NamingEventCoordinator.java#L107-L127
test
Remove a listener from the cache.
Of course, here is the Java code you requested: ```java synchronized void removeListener(final NamingListener namingListener) { // Do we have a holder for this listener final ListenerHolder holder = holdersByListener.get(namingListener); if (holder == null) { return; } ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMatchStatement.java
OMatchStatement.parse
@Override public <RET extends OCommandExecutor> RET parse(OCommandRequest iRequest) { final OCommandRequestText textRequest = (OCommandRequestText) iRequest; if (iRequest instanceof OSQLSynchQuery) { request = (OSQLSynchQuery<ODocument>) iRequest; } else if (iRequest instanceof OSQLAsynchQuery) { ...
java
@Override public <RET extends OCommandExecutor> RET parse(OCommandRequest iRequest) { final OCommandRequestText textRequest = (OCommandRequestText) iRequest; if (iRequest instanceof OSQLSynchQuery) { request = (OSQLSynchQuery<ODocument>) iRequest; } else if (iRequest instanceof OSQLAsynchQuery) { ...
[ "@", "Override", "public", "<", "RET", "extends", "OCommandExecutor", ">", "RET", "parse", "(", "OCommandRequest", "iRequest", ")", "{", "final", "OCommandRequestText", "textRequest", "=", "(", "OCommandRequestText", ")", "iRequest", ";", "if", "(", "iRequest", ...
this method parses the statement @param iRequest Command request implementation. @param <RET> @return
[ "this", "method", "parses", "the", "statement" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMatchStatement.java#L204-L251
test
Parses the command request.
Of course, here is the Java code you requested: ```java @Override public <RET extends OCommandExecutor> RET parse(OCommandRequest iRequest) { final OCommandRequestText textRequest = (OCommandRequestText) iRequest; if (iRequest instanceof OSQLSynchQuery) { request = (OSQLSynchQuery<ODocument>) iRequest;...
boonproject/boon
slumberdb/slumberdb-service-model/src/main/java/org/boon/slumberdb/stores/log/CollectorManager.java
CollectorManager.waitForNextDataToWrite
private ByteBuffer waitForNextDataToWrite() throws InterruptedException { ByteBuffer dataToWriteToFile; dataToWriteToFile = inputChannel.poll(FORCE_FLUSH_AFTER_THIS_MANY_MILI_SECONDS, TimeUnit.MILLISECONDS); return dataToWriteToFile; }
java
private ByteBuffer waitForNextDataToWrite() throws InterruptedException { ByteBuffer dataToWriteToFile; dataToWriteToFile = inputChannel.poll(FORCE_FLUSH_AFTER_THIS_MANY_MILI_SECONDS, TimeUnit.MILLISECONDS); return dataToWriteToFile; }
[ "private", "ByteBuffer", "waitForNextDataToWrite", "(", ")", "throws", "InterruptedException", "{", "ByteBuffer", "dataToWriteToFile", ";", "dataToWriteToFile", "=", "inputChannel", ".", "poll", "(", "FORCE_FLUSH_AFTER_THIS_MANY_MILI_SECONDS", ",", "TimeUnit", ".", "MILLISE...
If we don't have any data, and we have flushed, then we can wait on the outputDataQueue. There is no sense spin-locking. The poll(time, timeunit) call will block until there is something to do or until the timeout. @return the next byte buffer. @throws InterruptedException
[ "If", "we", "don", "t", "have", "any", "data", "and", "we", "have", "flushed", "then", "we", "can", "wait", "on", "the", "outputDataQueue", ".", "There", "is", "no", "sense", "spin", "-", "locking", ".", "The", "poll", "(", "time", "timeunit", ")", "...
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/slumberdb/slumberdb-service-model/src/main/java/org/boon/slumberdb/stores/log/CollectorManager.java#L280-L288
test
Wait for the next data to be written to disk.
Of course, here is the Java code you requested: ```java private ByteBuffer waitForNextDataToWrite() throws InterruptedException { ByteBuffer dataToWriteToFile; dataToWriteToFile = inputChannel.poll(FORCE_FLUSH_AFTER_THIS_MANY_MILI_SECONDS, TimeUnit.MILLISECONDS)...
rupertlssmith/lojix
lojix/jpc.lojix/src/main/com/thesett/aima/logic/fol/jpc/salt/LojixTermWriter.java
LojixTermWriter.createCompoundBuilder
protected TermBuilder<com.thesett.aima.logic.fol.Term> createCompoundBuilder() { return new LojixTermBuilder(interner); }
java
protected TermBuilder<com.thesett.aima.logic.fol.Term> createCompoundBuilder() { return new LojixTermBuilder(interner); }
[ "protected", "TermBuilder", "<", "com", ".", "thesett", ".", "aima", ".", "logic", ".", "fol", ".", "Term", ">", "createCompoundBuilder", "(", ")", "{", "return", "new", "LojixTermBuilder", "(", "interner", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/jpc.lojix/src/main/com/thesett/aima/logic/fol/jpc/salt/LojixTermWriter.java#L78-L81
test
Create a compound builder for a CID .
Of course, here is the Java code you requested: ```java protected TermBuilder<com.thesett.aima.logic.fol.Term> createCompoundBuilder() { return new LojixTermBuilder(interner); } ``` Hope this helps!
boonproject/boon
boon/src/main/java/org/boon/core/Conversions.java
Conversions.unifyList
public static Object unifyList(Object o, List list) { if (o==null) { return null; } if (list == null) { list = new ArrayList(); } if (o instanceof Iterable) { Iterable i = ((Iterable) o); for (Object item : i) { ...
java
public static Object unifyList(Object o, List list) { if (o==null) { return null; } if (list == null) { list = new ArrayList(); } if (o instanceof Iterable) { Iterable i = ((Iterable) o); for (Object item : i) { ...
[ "public", "static", "Object", "unifyList", "(", "Object", "o", ",", "List", "list", ")", "{", "if", "(", "o", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "list", "==", "null", ")", "{", "list", "=", "new", "ArrayList", "(", ")"...
This flattens a list. @param o object that might be a list @param list list to add o to or all of o's items to. @return an object or a list
[ "This", "flattens", "a", "list", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/core/Conversions.java#L1526-L1556
test
Unify list.
Of course, here is the Java code you requested: ```java public static Object unifyList(Object o, List list) { if (o==null) { return null; } if (list == null) { list = new ArrayList(); } if (o instanceof Iterable) { Iterable i = ((Iterable)...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.skip
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skip(long count) { if (count <= 0L) { return RxJavaPlugins.onAssembly(this); } return RxJavaPlugins.onAssembly(new FlowableSkip<T>(this, count))...
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skip(long count) { if (count <= 0L) { return RxJavaPlugins.onAssembly(this); } return RxJavaPlugins.onAssembly(new FlowableSkip<T>(this, count))...
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "T", ">", "skip", "(", "long", "count", ")", "{", "if", "(...
Returns a Flowable that skips the first {@code count} items emitted by the source Publisher and emits the remainder. <p> <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.png" alt=""> <dl> <dt><b>Backpressure:</b></dt> <dd>The operator doesn't interfere with backpr...
[ "Returns", "a", "Flowable", "that", "skips", "the", "first", "{", "@code", "count", "}", "items", "emitted", "by", "the", "source", "Publisher", "and", "emits", "the", "remainder", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "305", "src",...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L14084-L14092
test
Skips a sequence of tokens from the source stream.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skip(long count) { if (count <= 0L) { return RxJavaPlugins.onAssembly(this); } return R...
algolia/algoliasearch-client-android
algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java
MirroredIndex.getObjectOfflineAsync
public Request getObjectOfflineAsync(@NonNull final String objectID, final @Nullable List<String> attributesToRetrieve, @NonNull CompletionHandler completionHandler) { if (!mirrored) { throw new IllegalStateException("Mirroring not activated on this index"); } return getClient().new ...
java
public Request getObjectOfflineAsync(@NonNull final String objectID, final @Nullable List<String> attributesToRetrieve, @NonNull CompletionHandler completionHandler) { if (!mirrored) { throw new IllegalStateException("Mirroring not activated on this index"); } return getClient().new ...
[ "public", "Request", "getObjectOfflineAsync", "(", "@", "NonNull", "final", "String", "objectID", ",", "final", "@", "Nullable", "List", "<", "String", ">", "attributesToRetrieve", ",", "@", "NonNull", "CompletionHandler", "completionHandler", ")", "{", "if", "(",...
Get an individual object, explicitly targeting the offline mirror, not the online API. @param objectID Identifier of the object to retrieve. @param attributesToRetrieve Attributes to retrieve. If `null` or if at least one item is `*`, all retrievable attributes will be retrieved. @param completionHandler The listener ...
[ "Get", "an", "individual", "object", "explicitly", "targeting", "the", "offline", "mirror", "not", "the", "online", "API", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java#L1365-L1376
test
Get an asynchronous object from the server.
Of course, here is the Java code you requested: ```java public Request getObjectOfflineAsync(@NonNull final String objectID, final @Nullable List<String> attributesToRetrieve, @NonNull CompletionHandler completionHandler) { if (!mirrored) { throw new IllegalStateException("Mirroring not activated o...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/grid/GridServiceProvider.java
GridServiceProvider.setDebugFlags
static public void setDebugFlags(ucar.nc2.util.DebugFlags debugFlag) { debugOpen = debugFlag.isSet("Grid/open"); debugMissing = debugFlag.isSet("Grid/missing"); debugMissingDetails = debugFlag.isSet("Grid/missingDetails"); debugProj = debugFlag.isSet("Grid/projection"); debugVert = debugFlag.isSet("...
java
static public void setDebugFlags(ucar.nc2.util.DebugFlags debugFlag) { debugOpen = debugFlag.isSet("Grid/open"); debugMissing = debugFlag.isSet("Grid/missing"); debugMissingDetails = debugFlag.isSet("Grid/missingDetails"); debugProj = debugFlag.isSet("Grid/projection"); debugVert = debugFlag.isSet("...
[ "static", "public", "void", "setDebugFlags", "(", "ucar", ".", "nc2", ".", "util", ".", "DebugFlags", "debugFlag", ")", "{", "debugOpen", "=", "debugFlag", ".", "isSet", "(", "\"Grid/open\"", ")", ";", "debugMissing", "=", "debugFlag", ".", "isSet", "(", "...
Set the debug flags @param debugFlag debug flags
[ "Set", "the", "debug", "flags" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridServiceProvider.java#L75-L82
test
Sets the debug flags
Of course, here is the Java code you requested: ```java static public void setDebugFlags(ucar.nc2.util.DebugFlags debugFlag) { debugOpen = debugFlag.isSet("Grid/open"); debugMissing = debugFlag.isSet("Grid/missing"); debugMissingDetails = debugFlag.isSet("Grid/missingDetails"); debugProj = debugFlag.is...
DDTH/ddth-cql-utils
src/main/java/com/github/ddth/cql/SessionManager.java
SessionManager.getCluster
public Cluster getCluster(String hostsAndPorts, String username, String password) { return getCluster(ClusterIdentifier.getInstance(hostsAndPorts, username, password)); }
java
public Cluster getCluster(String hostsAndPorts, String username, String password) { return getCluster(ClusterIdentifier.getInstance(hostsAndPorts, username, password)); }
[ "public", "Cluster", "getCluster", "(", "String", "hostsAndPorts", ",", "String", "username", ",", "String", "password", ")", "{", "return", "getCluster", "(", "ClusterIdentifier", ".", "getInstance", "(", "hostsAndPorts", ",", "username", ",", "password", ")", ...
Obtain a Cassandra cluster instance. @param hostsAndPorts format: "host1:port1,host2,host3:port3". If no port is specified, the {@link CqlUtils#DEFAULT_CASSANDRA_PORT} is used. @param username @param password @return
[ "Obtain", "a", "Cassandra", "cluster", "instance", "." ]
debd5d86f64fe06e43d6f0f58cb2f7f0f6a84489
https://github.com/DDTH/ddth-cql-utils/blob/debd5d86f64fe06e43d6f0f58cb2f7f0f6a84489/src/main/java/com/github/ddth/cql/SessionManager.java#L757-L759
test
Get a Cluster object from the ClusterIdentifier.
Of course, here is the Java code you requested: ```java public Cluster getCluster(String hostsAndPorts, String username, String password) { return getCluster(ClusterIdentifier.getInstance(hostsAndPorts, username, password)); } ``` Hope this helps!
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/classic/util/LogbackMDCAdapter.java
LogbackMDCAdapter.getCopyOfContextMap
public Map<String, String> getCopyOfContextMap() { Map<String, String> hashMap = copyOnThreadLocal.get(); if (hashMap == null) { return null; } else { return new HashMap<String, String>(hashMap); } }
java
public Map<String, String> getCopyOfContextMap() { Map<String, String> hashMap = copyOnThreadLocal.get(); if (hashMap == null) { return null; } else { return new HashMap<String, String>(hashMap); } }
[ "public", "Map", "<", "String", ",", "String", ">", "getCopyOfContextMap", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "hashMap", "=", "copyOnThreadLocal", ".", "get", "(", ")", ";", "if", "(", "hashMap", "==", "null", ")", "{", "return", ...
Return a copy of the current thread's context map. Returned value may be null.
[ "Return", "a", "copy", "of", "the", "current", "thread", "s", "context", "map", ".", "Returned", "value", "may", "be", "null", "." ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/classic/util/LogbackMDCAdapter.java#L180-L187
test
Get a copy of the context map.
Of course, here is the Java code you requested: ```java public Map<String, String> getCopyOfContextMap() { Map<String, String> hashMap = copyOnThreadLocal.get(); if (hashMap == null) { return null; } else { return new HashMap<String, String>(hashMap); } } ``` Hope this helps!
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/drafts/Draft_6455.java
Draft_6455.translateSingleFramePayloadLength
private TranslatedPayloadMetaData translateSingleFramePayloadLength(ByteBuffer buffer, Opcode optcode, int oldPayloadlength, int maxpacketsize, int oldRealpacketsize) throws InvalidFrameException, IncompleteException, LimitExceededException { int payloadlength = oldPayloadlength, realpacketsize = oldRealpac...
java
private TranslatedPayloadMetaData translateSingleFramePayloadLength(ByteBuffer buffer, Opcode optcode, int oldPayloadlength, int maxpacketsize, int oldRealpacketsize) throws InvalidFrameException, IncompleteException, LimitExceededException { int payloadlength = oldPayloadlength, realpacketsize = oldRealpac...
[ "private", "TranslatedPayloadMetaData", "translateSingleFramePayloadLength", "(", "ByteBuffer", "buffer", ",", "Opcode", "optcode", ",", "int", "oldPayloadlength", ",", "int", "maxpacketsize", ",", "int", "oldRealpacketsize", ")", "throws", "InvalidFrameException", ",", "...
Translate the buffer depending when it has an extended payload length (126 or 127) @param buffer the buffer to read from @param optcode the decoded optcode @param oldPayloadlength the old payload length @param maxpacketsize the max packet size allowed @param oldRealpacketsize the real packet size @return the new payloa...
[ "Translate", "the", "buffer", "depending", "when", "it", "has", "an", "extended", "payload", "length", "(", "126", "or", "127", ")" ]
73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9
https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/drafts/Draft_6455.java#L527-L553
test
Translate single frame payload length.
Of course, here is the Java code you requested: ```java private TranslatedPayloadMetaData translateSingleFramePayloadLength(ByteBuffer buffer, Opcode optcode, int oldPayloadlength, int maxpacketsize, int oldRealpacketsize) throws InvalidFrameException, IncompleteException, LimitExceededException { int payloadl...
wildfly/wildfly
pojo/src/main/java/org/jboss/as/pojo/descriptor/AbstractConfigVisitorNode.java
AbstractConfigVisitorNode.getType
protected static Class<?> getType(ConfigVisitor visitor, String className) { if (className != null) { try { return visitor.getModule().getClassLoader().loadClass(className); } catch (Exception e) { throw new IllegalArgumentException(e); } ...
java
protected static Class<?> getType(ConfigVisitor visitor, String className) { if (className != null) { try { return visitor.getModule().getClassLoader().loadClass(className); } catch (Exception e) { throw new IllegalArgumentException(e); } ...
[ "protected", "static", "Class", "<", "?", ">", "getType", "(", "ConfigVisitor", "visitor", ",", "String", "className", ")", "{", "if", "(", "className", "!=", "null", ")", "{", "try", "{", "return", "visitor", ".", "getModule", "(", ")", ".", "getClassLo...
Load class. @param visitor the visitor @param className the class name @return class or null if null class name
[ "Load", "class", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/pojo/src/main/java/org/jboss/as/pojo/descriptor/AbstractConfigVisitorNode.java#L101-L110
test
Get the type of the class with the given name.
Of course, here is the Java code you requested: ```java protected static Class<?> getType(ConfigVisitor visitor, String className) { if (className != null) { try { return visitor.getModule().getClassLoader().loadClass(className); } catch (Exception e) { t...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/access/AccessDeniedHandlerImpl.java
AccessDeniedHandlerImpl.handle
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { if (!response.isCommitted()) { if (errorPage != null) { // Put exception into request scope (perhaps of use to a view) request.setAttribute(...
java
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { if (!response.isCommitted()) { if (errorPage != null) { // Put exception into request scope (perhaps of use to a view) request.setAttribute(...
[ "public", "void", "handle", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "AccessDeniedException", "accessDeniedException", ")", "throws", "IOException", ",", "ServletException", "{", "if", "(", "!", "response", ".", "isCommitted", ...
========================================================================================================
[ "========================================================================================================" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/access/AccessDeniedHandlerImpl.java#L59-L80
test
Handle a request.
Of course, here is the Java code you requested: ```java public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { if (!response.isCommitted()) { if (errorPage != null) { // Put exception into request s...
playframework/playframework
core/play/src/main/java/play/mvc/Results.java
Results.forbidden
public static Result forbidden(File content, String filename) { return forbidden(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
java
public static Result forbidden(File content, String filename) { return forbidden(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
[ "public", "static", "Result", "forbidden", "(", "File", "content", ",", "String", "filename", ")", "{", "return", "forbidden", "(", "content", ",", "filename", ",", "StaticFileMimeTypes", ".", "fileMimeTypes", "(", ")", ")", ";", "}" ]
Generates a 403 Forbidden result. @param content The file to send. @param filename The name to send the file as. @return the result
[ "Generates", "a", "403", "Forbidden", "result", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L1995-L1997
test
Returns a Result indicating that the content is forbidden.
Of course, here is the Java code you requested: ```java public static Result forbidden(File content, String filename) { return forbidden(content, filename, StaticFileMimeTypes.fileMimeTypes()); } ``` Hope this helps!
sinetja/netty-router
src/main/java/io/netty/handler/codec/http/router/OrderlessRouter.java
OrderlessRouter.removePathPattern
public void removePathPattern(String pathPattern) { PathPattern p = new PathPattern(pathPattern); T target = routes.remove(p); if (target == null) { return; } Set<PathPattern> paths = reverseRoutes.remove(target); paths.remove(p); }
java
public void removePathPattern(String pathPattern) { PathPattern p = new PathPattern(pathPattern); T target = routes.remove(p); if (target == null) { return; } Set<PathPattern> paths = reverseRoutes.remove(target); paths.remove(p); }
[ "public", "void", "removePathPattern", "(", "String", "pathPattern", ")", "{", "PathPattern", "p", "=", "new", "PathPattern", "(", "pathPattern", ")", ";", "T", "target", "=", "routes", ".", "remove", "(", "p", ")", ";", "if", "(", "target", "==", "null"...
Removes the route specified by the path pattern.
[ "Removes", "the", "route", "specified", "by", "the", "path", "pattern", "." ]
1bdace050de26bc4d7629b7a0c1fbea238f88e5a
https://github.com/sinetja/netty-router/blob/1bdace050de26bc4d7629b7a0c1fbea238f88e5a/src/main/java/io/netty/handler/codec/http/router/OrderlessRouter.java#L84-L93
test
Remove a path pattern from the set of path patterns.
Of course, here is the Java code you requested: ```java public void removePathPattern(String pathPattern) { PathPattern p = new PathPattern(pathPattern); T target = routes.remove(p); if (target == null) { return; } Set<PathPattern> paths = reverseRoutes.remove(targe...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/util/StringCollectionUtil.java
StringCollectionUtil.removeMatching
public static void removeMatching(Collection<String> values, String... patterns) { removeMatching(values, Arrays.asList(patterns)); }
java
public static void removeMatching(Collection<String> values, String... patterns) { removeMatching(values, Arrays.asList(patterns)); }
[ "public", "static", "void", "removeMatching", "(", "Collection", "<", "String", ">", "values", ",", "String", "...", "patterns", ")", "{", "removeMatching", "(", "values", ",", "Arrays", ".", "asList", "(", "patterns", ")", ")", ";", "}" ]
Removes all values in the subject collection that are matched by at least one of a collection of regular expressions. <p> This method is a convenience overload for {@link #removeMatching(Collection, Collection)}. @param values subject value collection @param patterns patterns to match
[ "Removes", "all", "values", "in", "the", "subject", "collection", "that", "are", "matched", "by", "at", "least", "one", "of", "a", "collection", "of", "regular", "expressions", ".", "<p", ">", "This", "method", "is", "a", "convenience", "overload", "for", ...
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/util/StringCollectionUtil.java#L82-L85
test
Remove the matching tokens from the given values.
Of course, here is the Java code you requested: ```java public static void removeMatching(Collection<String> values, String... patterns) { removeMatching(values, Arrays.asList(patterns)); } ``` Hope this helps!
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/collections/ListOrderedMap.java
ListOrderedMap.getEntry
public Entry<K, V> getEntry(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } LinkedEntry<K, V> entry = header.next; for (int i = 0; i < index; i++) { entry = entry.next; } return entry; }
java
public Entry<K, V> getEntry(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } LinkedEntry<K, V> entry = header.next; for (int i = 0; i < index; i++) { entry = entry.next; } return entry; }
[ "public", "Entry", "<", "K", ",", "V", ">", "getEntry", "(", "int", "index", ")", "{", "if", "(", "index", "<", "0", "||", "index", ">=", "size", "(", ")", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", ")", ";", "}", "LinkedEntry", "<...
OrderedMap interface
[ "OrderedMap", "interface" ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/collections/ListOrderedMap.java#L55-L64
test
Gets the entry at the specified index.
Of course, here is the Java code you requested: ```java public Entry<K, V> getEntry(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException(); } LinkedEntry<K, V> entry = header.next; for (int i = 0; i < index; i++) { entry = entry.ne...
jboss/jboss-common-core
src/main/java/org/jboss/util/timeout/TimeoutPriorityQueueImpl.java
TimeoutPriorityQueueImpl.checkTree
void checkTree() { assertExpr(size >= 0); assertExpr(size < queue.length); assertExpr(queue[0] == null); if (size > 0) { assertExpr(queue[1] != null); assertExpr(queue[1].index == 1); for (int i = 2; i <= size; ++i) { assertExpr(queue[i] !...
java
void checkTree() { assertExpr(size >= 0); assertExpr(size < queue.length); assertExpr(queue[0] == null); if (size > 0) { assertExpr(queue[1] != null); assertExpr(queue[1].index == 1); for (int i = 2; i <= size; ++i) { assertExpr(queue[i] !...
[ "void", "checkTree", "(", ")", "{", "assertExpr", "(", "size", ">=", "0", ")", ";", "assertExpr", "(", "size", "<", "queue", ".", "length", ")", ";", "assertExpr", "(", "queue", "[", "0", "]", "==", "null", ")", ";", "if", "(", "size", ">", "0", ...
Check invariants of the queue.
[ "Check", "invariants", "of", "the", "queue", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/timeout/TimeoutPriorityQueueImpl.java#L496-L565
test
Check the tree.
Of course, here is the Java code you requested: ```java void checkTree() { assertExpr(size >= 0); assertExpr(size < queue.length); assertExpr(queue[0] == null); if (size > 0) { assertExpr(queue[1] != null); assertExpr(queue[1].index == 1); for (int i = 2; i <...
jbundle/util
jbackup/src/main/java/org/jbundle/jbackup/util/FileExtensionFilter.java
FileExtensionFilter.accept
public boolean accept(File pathname) { String name = pathname.getName(); int iLastDot = name.lastIndexOf('.'); String strExtension = ""; if ((iLastDot != -1) && (iLastDot != name.length() -1 )) strExtension = name.substring(iLastDot + 1); if (m_rgstrIncludeExtensions != null) { for (int i = 0; i ...
java
public boolean accept(File pathname) { String name = pathname.getName(); int iLastDot = name.lastIndexOf('.'); String strExtension = ""; if ((iLastDot != -1) && (iLastDot != name.length() -1 )) strExtension = name.substring(iLastDot + 1); if (m_rgstrIncludeExtensions != null) { for (int i = 0; i ...
[ "public", "boolean", "accept", "(", "File", "pathname", ")", "{", "String", "name", "=", "pathname", ".", "getName", "(", ")", ";", "int", "iLastDot", "=", "name", ".", "lastIndexOf", "(", "'", "'", ")", ";", "String", "strExtension", "=", "\"\"", ";",...
Tests whether or not the specified abstract pathname should be included in a pathname list. @param pathname The abstract pathname to be tested @return <code>true</code> if and only if <code>pathname</code> should be included
[ "Tests", "whether", "or", "not", "the", "specified", "abstract", "pathname", "should", "be", "included", "in", "a", "pathname", "list", "." ]
5af0f2292f56f29f70cbc26d0bfa72f89ae31be0
https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/util/FileExtensionFilter.java#L40-L66
test
Accept this file.
Of course, here is the Java code you requested: ```java public boolean accept(File pathname) { String name = pathname.getName(); int iLastDot = name.lastIndexOf('.'); String strExtension = ""; if ((iLastDot != -1) && (iLastDot != name.length() -1 )) strExtension = name.substring(iLastDot + 1); if (m_...
rest-assured/rest-assured
modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/RestAssuredMockMvc.java
RestAssuredMockMvc.patch
public static MockMvcResponse patch(String path, Object... pathParams) { return given().patch(path, pathParams); }
java
public static MockMvcResponse patch(String path, Object... pathParams) { return given().patch(path, pathParams); }
[ "public", "static", "MockMvcResponse", "patch", "(", "String", "path", ",", "Object", "...", "pathParams", ")", "{", "return", "given", "(", ")", ".", "patch", "(", "path", ",", "pathParams", ")", ";", "}" ]
Perform a PATCH request to a <code>path</code>. Normally the path doesn't have to be fully-qualified e.g. you don't need to specify the path as <tt>http://localhost:8080/path</tt>. In this case it's enough to use <tt>/path</tt>. @param path The path to send the request to. @param pathParams The path parameters. ...
[ "Perform", "a", "PATCH", "request", "to", "a", "<code", ">", "path<", "/", "code", ">", ".", "Normally", "the", "path", "doesn", "t", "have", "to", "be", "fully", "-", "qualified", "e", ".", "g", ".", "you", "don", "t", "need", "to", "specify", "th...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/RestAssuredMockMvc.java#L424-L426
test
MockMvcResponse for PATCH requests
Of course, here is the Java code you requested: ```java public static MockMvcResponse patch(String path, Object... pathParams) { return given().patch(path, pathParams); } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java
BaseNDArrayFactory.createComplex
@Override public IComplexNDArray createComplex(double[] data) { assert data.length % 2 == 0 : "Length of data must be even. A complex ndarray is made up of pairs of real and imaginary components"; return createComplex(data, new int[] {1, data.length / 2}); }
java
@Override public IComplexNDArray createComplex(double[] data) { assert data.length % 2 == 0 : "Length of data must be even. A complex ndarray is made up of pairs of real and imaginary components"; return createComplex(data, new int[] {1, data.length / 2}); }
[ "@", "Override", "public", "IComplexNDArray", "createComplex", "(", "double", "[", "]", "data", ")", "{", "assert", "data", ".", "length", "%", "2", "==", "0", ":", "\"Length of data must be even. A complex ndarray is made up of pairs of real and imaginary components\"", ...
Creates an ndarray with the specified data @param data the number of columns in the row vector @return ndarray
[ "Creates", "an", "ndarray", "with", "the", "specified", "data" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java#L826-L831
test
Create a complex ndarray from a double array.
Of course, here is the Java code you requested: ```java @Override public IComplexNDArray createComplex(double[] data) { assert data.length % 2 == 0 : "Length of data must be even. A complex ndarray is made up of pairs of real and imaginary components"; return createComplex(d...
amedia/meteo
meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java
ObjectFactory.createLocationTypeWindSpeed
@XmlElementDecl(namespace = "", name = "windSpeed", scope = LocationType.class) public JAXBElement<Windspeed> createLocationTypeWindSpeed(Windspeed value) { return new JAXBElement<Windspeed>(_LocationTypeWindSpeed_QNAME, Windspeed.class, LocationType.class, value); }
java
@XmlElementDecl(namespace = "", name = "windSpeed", scope = LocationType.class) public JAXBElement<Windspeed> createLocationTypeWindSpeed(Windspeed value) { return new JAXBElement<Windspeed>(_LocationTypeWindSpeed_QNAME, Windspeed.class, LocationType.class, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"windSpeed\"", ",", "scope", "=", "LocationType", ".", "class", ")", "public", "JAXBElement", "<", "Windspeed", ">", "createLocationTypeWindSpeed", "(", "Windspeed", "value", ")", "{", "...
Create an instance of {@link JAXBElement }{@code <}{@link Windspeed }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Windspeed", "}", "{", "@code", ">", "}}" ]
cbb59e1c2f889d15c24f3625d1769b543d4af595
https://github.com/amedia/meteo/blob/cbb59e1c2f889d15c24f3625d1769b543d4af595/meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java#L474-L477
test
Create an instance of a Windspeed object.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "windSpeed", scope = LocationType.class) public JAXBElement<Windspeed> createLocationTypeWindSpeed(Windspeed value) { return new JAXBElement<Windspeed>(_LocationTypeWindSpeed_QNAME, Windspeed.class, LocationType....
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/adapter/StripHtmlTagAdapter.java
StripHtmlTagAdapter.text
@Override public void text(final CharSequence text) { if (!strip) { super.text(text); return; } int textLength = text.length(); char[] dest = new char[textLength]; int ndx = 0; boolean regularChar = true; for (int i = 0; i < textLength; i++) { char c = text.charAt(i); if (CharUtil.isWhite...
java
@Override public void text(final CharSequence text) { if (!strip) { super.text(text); return; } int textLength = text.length(); char[] dest = new char[textLength]; int ndx = 0; boolean regularChar = true; for (int i = 0; i < textLength; i++) { char c = text.charAt(i); if (CharUtil.isWhite...
[ "@", "Override", "public", "void", "text", "(", "final", "CharSequence", "text", ")", "{", "if", "(", "!", "strip", ")", "{", "super", ".", "text", "(", "text", ")", ";", "return", ";", "}", "int", "textLength", "=", "text", ".", "length", "(", ")"...
Cleans unnecessary whitespaces.
[ "Cleans", "unnecessary", "whitespaces", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/adapter/StripHtmlTagAdapter.java#L84-L121
test
Override text to add whitespace to the text.
Of course, here is the Java code you requested: ```java @Override public void text(final CharSequence text) { if (!strip) { super.text(text); return; } int textLength = text.length(); char[] dest = new char[textLength]; int ndx = 0; boolean regularChar = true; for (int i = 0; i < textLength; i+...
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java
ODistributedConfiguration.getServers
public Set<String> getServers(Collection<String> iClusterNames) { if (iClusterNames == null || iClusterNames.isEmpty()) return getAllConfiguredServers(); final Set<String> partitions = new HashSet<String>(iClusterNames.size()); for (String p : iClusterNames) { final List<String> serverList = ge...
java
public Set<String> getServers(Collection<String> iClusterNames) { if (iClusterNames == null || iClusterNames.isEmpty()) return getAllConfiguredServers(); final Set<String> partitions = new HashSet<String>(iClusterNames.size()); for (String p : iClusterNames) { final List<String> serverList = ge...
[ "public", "Set", "<", "String", ">", "getServers", "(", "Collection", "<", "String", ">", "iClusterNames", ")", "{", "if", "(", "iClusterNames", "==", "null", "||", "iClusterNames", ".", "isEmpty", "(", ")", ")", "return", "getAllConfiguredServers", "(", ")"...
Returns the set of server names involved on the passed cluster collection. @param iClusterNames Collection of cluster names to find
[ "Returns", "the", "set", "of", "server", "names", "involved", "on", "the", "passed", "cluster", "collection", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java#L288-L302
test
Get the servers from the configuration.
Of course, here is the Java code you requested: ```java public Set<String> getServers(Collection<String> iClusterNames) { if (iClusterNames == null || iClusterNames.isEmpty()) return getAllConfiguredServers(); final Set<String> partitions = new HashSet<String>(iClusterNames.size()); for (String p : ...
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/ImmoXmlReadingExample.java
ImmoXmlReadingExample.read
protected static void read(InputStream xmlInputStream) throws SAXException, IOException, ParserConfigurationException, JAXBException { LOGGER.info("process example file"); ImmoXmlDocument doc = ImmoXmlUtils.createDocument(xmlInputStream); if (doc == null) { LOGGER.warn("> provided XM...
java
protected static void read(InputStream xmlInputStream) throws SAXException, IOException, ParserConfigurationException, JAXBException { LOGGER.info("process example file"); ImmoXmlDocument doc = ImmoXmlUtils.createDocument(xmlInputStream); if (doc == null) { LOGGER.warn("> provided XM...
[ "protected", "static", "void", "read", "(", "InputStream", "xmlInputStream", ")", "throws", "SAXException", ",", "IOException", ",", "ParserConfigurationException", ",", "JAXBException", "{", "LOGGER", ".", "info", "(", "\"process example file\"", ")", ";", "ImmoXmlDo...
Read a {@link InputStream} into an {@link ImmoXmlDocument} and print some of its content to console. @param xmlInputStream the input stream to read @throws SAXException if the file is not readable by the XML parser @throws IOException if the file is not readable @throws ParserConfigura...
[ "Read", "a", "{", "@link", "InputStream", "}", "into", "an", "{", "@link", "ImmoXmlDocument", "}", "and", "print", "some", "of", "its", "content", "to", "console", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/ImmoXmlReadingExample.java#L116-L124
test
Read an XML document from an input stream.
Of course, here is the Java code you requested: ```java protected static void read(InputStream xmlInputStream) throws SAXException, IOException, ParserConfigurationException, JAXBException { LOGGER.info("process example file"); ImmoXmlDocument doc = ImmoXmlUtils.createDocument(xmlInputStream); ...
ReactiveX/RxJava
src/main/java/io/reactivex/Maybe.java
Maybe.lift
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final <R> Maybe<R> lift(final MaybeOperator<? extends R, ? super T> lift) { ObjectHelper.requireNonNull(lift, "lift is null"); return RxJavaPlugins.onAssembly(new MaybeLift<T, R>(this, lift)); }
java
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final <R> Maybe<R> lift(final MaybeOperator<? extends R, ? super T> lift) { ObjectHelper.requireNonNull(lift, "lift is null"); return RxJavaPlugins.onAssembly(new MaybeLift<T, R>(this, lift)); }
[ "@", "CheckReturnValue", "@", "NonNull", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Maybe", "<", "R", ">", "lift", "(", "final", "MaybeOperator", "<", "?", "extends", "R", ",", "?", "super", "T"...
<strong>This method requires advanced knowledge about building operators, please consider other standard composition methods first;</strong> Returns a {@code Maybe} which, when subscribed to, invokes the {@link MaybeOperator#apply(MaybeObserver) apply(MaybeObserver)} method of the provided {@link MaybeOperator} for eac...
[ "<strong", ">", "This", "method", "requires", "advanced", "knowledge", "about", "building", "operators", "please", "consider", "other", "standard", "composition", "methods", "first", ";", "<", "/", "strong", ">", "Returns", "a", "{", "@code", "Maybe", "}", "wh...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L3451-L3457
test
Lift a Maybe object into a single Maybe object.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final <R> Maybe<R> lift(final MaybeOperator<? extends R, ? super T> lift) { ObjectHelper.requireNonNull(lift, "lift is null"); return RxJavaPlugins.onAssembly(n...