repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
landawn/AbacusUtil
src/com/landawn/abacus/util/DoubleList.java
DoubleList.noneMatch
public <E extends Exception> boolean noneMatch(Try.DoublePredicate<E> filter) throws E { return noneMatch(0, size(), filter); }
java
public <E extends Exception> boolean noneMatch(Try.DoublePredicate<E> filter) throws E { return noneMatch(0, size(), filter); }
[ "public", "<", "E", "extends", "Exception", ">", "boolean", "noneMatch", "(", "Try", ".", "DoublePredicate", "<", "E", ">", "filter", ")", "throws", "E", "{", "return", "noneMatch", "(", "0", ",", "size", "(", ")", ",", "filter", ")", ";", "}" ]
Returns whether no elements of this List match the provided predicate. @param filter @return
[ "Returns", "whether", "no", "elements", "of", "this", "List", "match", "the", "provided", "predicate", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DoubleList.java#L951-L953
train
Returns true if this set contains no elements of the specified type.
Of course, here is the Java code you requested: ```java public <E extends Exception> boolean noneMatch(Try.DoublePredicate<E> filter) throws E { return noneMatch(0, size(), filter); } ``` Hope this helps!
landawn/AbacusUtil
src/com/landawn/abacus/util/Array.java
Array.binarySearch
static int binarySearch(final short[] a, final int fromIndex, final int toIndex, final short key) { if (N.isNullOrEmpty(a)) { return N.INDEX_NOT_FOUND; } return Arrays.binarySearch(a, fromIndex, toIndex, key); }
java
static int binarySearch(final short[] a, final int fromIndex, final int toIndex, final short key) { if (N.isNullOrEmpty(a)) { return N.INDEX_NOT_FOUND; } return Arrays.binarySearch(a, fromIndex, toIndex, key); }
[ "static", "int", "binarySearch", "(", "final", "short", "[", "]", "a", ",", "final", "int", "fromIndex", ",", "final", "int", "toIndex", ",", "final", "short", "key", ")", "{", "if", "(", "N", ".", "isNullOrEmpty", "(", "a", ")", ")", "{", "return", ...
{@link Arrays#binarySearch(short[], int, int, short)} @param a @param fromIndex @param toIndex @param key @return
[ "{", "@link", "Arrays#binarySearch", "(", "short", "[]", "int", "int", "short", ")", "}" ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Array.java#L3349-L3355
train
Binary search for the given short array.
Of course, here is the Java code you requested: ```java static int binarySearch(final short[] a, final int fromIndex, final int toIndex, final short key) { if (N.isNullOrEmpty(a)) { return N.INDEX_NOT_FOUND; } return Arrays.binarySearch(a, fromIndex, toIndex, key); } ``` ...
googleapis/api-client-staging
generated/java/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java
AuditLog.getServiceName
public java.lang.String getServiceName() { java.lang.Object ref = serviceName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ...
java
public java.lang.String getServiceName() { java.lang.Object ref = serviceName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ...
[ "public", "java", ".", "lang", ".", "String", "getServiceName", "(", ")", "{", "java", ".", "lang", ".", "Object", "ref", "=", "serviceName_", ";", "if", "(", "ref", "instanceof", "java", ".", "lang", ".", "String", ")", "{", "return", "(", "java", "...
<pre> The name of the API service performing the operation. For example, `"datastore.googleapis.com"`. </pre> <code>string service_name = 7;</code>
[ "<pre", ">", "The", "name", "of", "the", "API", "service", "performing", "the", "operation", ".", "For", "example", "datastore", ".", "googleapis", ".", "com", ".", "<", "/", "pre", ">" ]
126aee68401977b5dc2b1b4be48decd0e9759db7
https://github.com/googleapis/api-client-staging/blob/126aee68401977b5dc2b1b4be48decd0e9759db7/generated/java/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java#L210-L221
train
Gets the name of the service.
Of course, here is the Java code you requested: ```java public java.lang.String getServiceName() { java.lang.Object ref = serviceName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ...
RestComm/mss-arquillian
mss-tomcat-embedded-7/src/main/java/org/jboss/arquillian/container/mobicents/servlet/sip/tomcat/embedded_7/MobicentsSipServletsEmbeddedImpl.java
MobicentsSipServletsEmbeddedImpl.getSipConnectors
@Override public List<Connector> getSipConnectors() { List<Connector> connectors = new ArrayList<Connector>(); Connector[] conns = service.findConnectors(); for (Connector conn : conns) { if (conn.getProtocolHandler() instanceof SipProtocolHandler){ connectors.add(conn); } } return connect...
java
@Override public List<Connector> getSipConnectors() { List<Connector> connectors = new ArrayList<Connector>(); Connector[] conns = service.findConnectors(); for (Connector conn : conns) { if (conn.getProtocolHandler() instanceof SipProtocolHandler){ connectors.add(conn); } } return connect...
[ "@", "Override", "public", "List", "<", "Connector", ">", "getSipConnectors", "(", ")", "{", "List", "<", "Connector", ">", "connectors", "=", "new", "ArrayList", "<", "Connector", ">", "(", ")", ";", "Connector", "[", "]", "conns", "=", "service", ".", ...
Return the SipConnectors
[ "Return", "the", "SipConnectors" ]
d217b4e53701282c6e7176365a03be6f898342be
https://github.com/RestComm/mss-arquillian/blob/d217b4e53701282c6e7176365a03be6f898342be/mss-tomcat-embedded-7/src/main/java/org/jboss/arquillian/container/mobicents/servlet/sip/tomcat/embedded_7/MobicentsSipServletsEmbeddedImpl.java#L666-L679
train
Get the list of sip connectors.
Of course, here is the Java code you requested: ```java @Override public List<Connector> getSipConnectors() { List<Connector> connectors = new ArrayList<Connector>(); Connector[] conns = service.findConnectors(); for (Connector conn : conns) { if (conn.getProtocolHandler() instanceof SipProtocolHandler...
ontop/ontop
core/model/src/main/java/it/unibz/inf/ontop/evaluator/ExpressionEvaluator.java
ExpressionEvaluator.evalDatatype
private Term evalDatatype(Function term) { Term innerTerm = term.getTerm(0); if (innerTerm instanceof Function) { Function function = (Function) innerTerm; return getDatatype(function); } return term; }
java
private Term evalDatatype(Function term) { Term innerTerm = term.getTerm(0); if (innerTerm instanceof Function) { Function function = (Function) innerTerm; return getDatatype(function); } return term; }
[ "private", "Term", "evalDatatype", "(", "Function", "term", ")", "{", "Term", "innerTerm", "=", "term", ".", "getTerm", "(", "0", ")", ";", "if", "(", "innerTerm", "instanceof", "Function", ")", "{", "Function", "function", "=", "(", "Function", ")", "in...
/* Expression evaluator for datatype() function
[ "/", "*", "Expression", "evaluator", "for", "datatype", "()", "function" ]
ddf78b26981b6129ee9a1a59310016830f5352e4
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/evaluator/ExpressionEvaluator.java#L467-L474
train
Evaluate a data type function.
Of course, here is the Java code you requested: ```java private Term evalDatatype(Function term) { Term innerTerm = term.getTerm(0); if (innerTerm instanceof Function) { Function function = (Function) innerTerm; return getDatatype(function); } return term; } ``` Hope this helps!
j256/ormlite-android
src/main/java/com/j256/ormlite/android/apptools/OrmLiteSqliteOpenHelper.java
OrmLiteSqliteOpenHelper.onCreate
@Override public final void onCreate(SQLiteDatabase db) { ConnectionSource cs = getConnectionSource(); /* * The method is called by Android database helper's get-database calls when Android detects that we need to * create or update the database. So we have to use the database argument and save a connection ...
java
@Override public final void onCreate(SQLiteDatabase db) { ConnectionSource cs = getConnectionSource(); /* * The method is called by Android database helper's get-database calls when Android detects that we need to * create or update the database. So we have to use the database argument and save a connection ...
[ "@", "Override", "public", "final", "void", "onCreate", "(", "SQLiteDatabase", "db", ")", "{", "ConnectionSource", "cs", "=", "getConnectionSource", "(", ")", ";", "/*\n\t\t * The method is called by Android database helper's get-database calls when Android detects that we need t...
Satisfies the {@link SQLiteOpenHelper#onCreate(SQLiteDatabase)} interface method.
[ "Satisfies", "the", "{" ]
e82327a868ae242f994730fe2389f79684d7bcab
https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteSqliteOpenHelper.java#L187-L213
train
This method is called by the database helper when a new database is created.
Of course, here is the Java code you requested: ```java @Override public final void onCreate(SQLiteDatabase db) { ConnectionSource cs = getConnectionSource(); /* * The method is called by Android database helper's get-database calls when Android detects that we need to * create or update the database. So we...
sosandstrom/mardao
mardao-core/src/main/java/net/sf/mardao/core/filter/Filter.java
Filter.inFilter
public static Filter inFilter(String column, Object operand) { return new Filter(column, FilterOperator.IN, operand); }
java
public static Filter inFilter(String column, Object operand) { return new Filter(column, FilterOperator.IN, operand); }
[ "public", "static", "Filter", "inFilter", "(", "String", "column", ",", "Object", "operand", ")", "{", "return", "new", "Filter", "(", "column", ",", "FilterOperator", ".", "IN", ",", "operand", ")", ";", "}" ]
Builds an InFilter
[ "Builds", "an", "InFilter" ]
b77e3a2ac1d8932e0a3174f3645f71b211dfc055
https://github.com/sosandstrom/mardao/blob/b77e3a2ac1d8932e0a3174f3645f71b211dfc055/mardao-core/src/main/java/net/sf/mardao/core/filter/Filter.java#L42-L44
train
Create an IN filter
Of course, here is the Java code you requested: ```java public static Filter inFilter(String column, Object operand) { return new Filter(column, FilterOperator.IN, operand); } ``` Hope this helps!
jenkinsci/jenkins
core/src/main/java/jenkins/util/SystemProperties.java
SystemProperties.optBoolean
@CheckForNull public static Boolean optBoolean(String name) { String v = getString(name); return v == null ? null : Boolean.parseBoolean(v); }
java
@CheckForNull public static Boolean optBoolean(String name) { String v = getString(name); return v == null ? null : Boolean.parseBoolean(v); }
[ "@", "CheckForNull", "public", "static", "Boolean", "optBoolean", "(", "String", "name", ")", "{", "String", "v", "=", "getString", "(", "name", ")", ";", "return", "v", "==", "null", "?", "null", ":", "Boolean", ".", "parseBoolean", "(", "v", ")", ";"...
Returns {@link Boolean#TRUE} if the named system property exists and is equal to the string {@code "true} (ignoring case), returns {@link Boolean#FALSE} if the system property exists and doesn't equal {@code "true} otherwise returns {@code null} if the named system property does not exist. @param name the system prope...
[ "Returns", "{", "@link", "Boolean#TRUE", "}", "if", "the", "named", "system", "property", "exists", "and", "is", "equal", "to", "the", "string", "{", "@code", "true", "}", "(", "ignoring", "case", ")", "returns", "{", "@link", "Boolean#FALSE", "}", "if", ...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/SystemProperties.java#L312-L316
train
Get the optional boolean value for a name.
Of course, here is the Java code you requested: ```java @CheckForNull public static Boolean optBoolean(String name) { String v = getString(name); return v == null ? null : Boolean.parseBoolean(v); } ``` Hope this helps!
googleapis/google-cloud-java
google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java
ProductSearchClient.addProductToProductSet
public final void addProductToProductSet(String name, String product) { AddProductToProductSetRequest request = AddProductToProductSetRequest.newBuilder().setName(name).setProduct(product).build(); addProductToProductSet(request); }
java
public final void addProductToProductSet(String name, String product) { AddProductToProductSetRequest request = AddProductToProductSetRequest.newBuilder().setName(name).setProduct(product).build(); addProductToProductSet(request); }
[ "public", "final", "void", "addProductToProductSet", "(", "String", "name", ",", "String", "product", ")", "{", "AddProductToProductSetRequest", "request", "=", "AddProductToProductSetRequest", ".", "newBuilder", "(", ")", ".", "setName", "(", "name", ")", ".", "s...
Adds a Product to the specified ProductSet. If the Product is already present, no change is made. <p>One Product can be added to at most 100 ProductSets. <p>Possible errors: <p>&#42; Returns NOT_FOUND if the Product or the ProductSet doesn't exist. <p>Sample code: <pre><code> try (ProductSearchClient productSearch...
[ "Adds", "a", "Product", "to", "the", "specified", "ProductSet", ".", "If", "the", "Product", "is", "already", "present", "no", "change", "is", "made", "." ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java#L2294-L2299
train
Add a product to a product set
Of course, here is the Java code you requested: ```java public final void addProductToProductSet(String name, String product) { AddProductToProductSetRequest request = AddProductToProductSetRequest.newBuilder().setName(name).setProduct(product).build(); addProductToProductSet(request); } ``` Hope t...
Squarespace/cldr
runtime/src/main/java/com/squarespace/cldr/PartitionTable.java
PartitionTable.set
private static <K, V> void set(Map<K, Set<V>> map, K key, V value) { Set<V> values = map.get(key); if (values == null) { values = new HashSet<>(); map.put(key, values); } values.add(value); }
java
private static <K, V> void set(Map<K, Set<V>> map, K key, V value) { Set<V> values = map.get(key); if (values == null) { values = new HashSet<>(); map.put(key, values); } values.add(value); }
[ "private", "static", "<", "K", ",", "V", ">", "void", "set", "(", "Map", "<", "K", ",", "Set", "<", "V", ">", ">", "map", ",", "K", "key", ",", "V", "value", ")", "{", "Set", "<", "V", ">", "values", "=", "map", ".", "get", "(", "key", ")...
Helper to set values in Map<K, Set<V>>.
[ "Helper", "to", "set", "values", "in", "Map<K", "Set<V", ">>", "." ]
54b752d4ec2457df56e98461618f9c0eec41e1e1
https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/PartitionTable.java#L163-L170
train
Set a value in a map.
Of course, here is the Java code you requested: ```java private static <K, V> void set(Map<K, Set<V>> map, K key, V value) { Set<V> values = map.get(key); if (values == null) { values = new HashSet<>(); map.put(key, values); } values.add(value); } ``` Hope this helps!
lucee/Lucee
core/src/main/java/lucee/runtime/sql/SelectParser.java
SelectParser.parse
public Selects parse(String sql) throws SQLParserException { columnIndex = 0; ParserString raw = new ParserString(sql.trim()); Selects selects = new Selects(); Select select = new Select(); boolean runAgain = false; do { // select if (!raw.forwardIfCurrentAndNoWordNumberAfter("select")) throw new SQLP...
java
public Selects parse(String sql) throws SQLParserException { columnIndex = 0; ParserString raw = new ParserString(sql.trim()); Selects selects = new Selects(); Select select = new Select(); boolean runAgain = false; do { // select if (!raw.forwardIfCurrentAndNoWordNumberAfter("select")) throw new SQLP...
[ "public", "Selects", "parse", "(", "String", "sql", ")", "throws", "SQLParserException", "{", "columnIndex", "=", "0", ";", "ParserString", "raw", "=", "new", "ParserString", "(", "sql", ".", "trim", "(", ")", ")", ";", "Selects", "selects", "=", "new", ...
select <select-statement> from <tables> where <where-statement>
[ "select", "<select", "-", "statement", ">", "from", "<tables", ">", "where", "<where", "-", "statement", ">" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/sql/SelectParser.java#L56-L143
train
Parses the SQL string and returns a Selects object.
Of course, here is the Java code you requested: ```java public Selects parse(String sql) throws SQLParserException { columnIndex = 0; ParserString raw = new ParserString(sql.trim()); Selects selects = new Selects(); Select select = new Select(); boolean runAgain = false; do { // select if (!raw.forwa...
h2oai/h2o-3
h2o-core/src/main/java/water/ExternalFrameReaderClient.java
ExternalFrameReaderClient.waitUntilAllReceived
public void waitUntilAllReceived(int timeout) throws ExternalFrameConfirmationException { try { byte flag = ExternalFrameConfirmationCheck.getConfirmation(ab, timeout); assert (flag == ExternalFrameHandler.CONFIRM_READING_DONE); } catch (TimeoutException ex) { throw n...
java
public void waitUntilAllReceived(int timeout) throws ExternalFrameConfirmationException { try { byte flag = ExternalFrameConfirmationCheck.getConfirmation(ab, timeout); assert (flag == ExternalFrameHandler.CONFIRM_READING_DONE); } catch (TimeoutException ex) { throw n...
[ "public", "void", "waitUntilAllReceived", "(", "int", "timeout", ")", "throws", "ExternalFrameConfirmationException", "{", "try", "{", "byte", "flag", "=", "ExternalFrameConfirmationCheck", ".", "getConfirmation", "(", "ab", ",", "timeout", ")", ";", "assert", "(", ...
This method ensures the application waits for all bytes to be received before continuing in the application's control flow. It has to be called at the end of reading. @param timeout timeout in seconds @throws ExternalFrameConfirmationException
[ "This", "method", "ensures", "the", "application", "waits", "for", "all", "bytes", "to", "be", "received", "before", "continuing", "in", "the", "application", "s", "control", "flow", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExternalFrameReaderClient.java#L169-L180
train
Wait until all messages have been received.
Of course, here is the Java code you requested: ```java public void waitUntilAllReceived(int timeout) throws ExternalFrameConfirmationException { try { byte flag = ExternalFrameConfirmationCheck.getConfirmation(ab, timeout); assert (flag == ExternalFrameHandler.CONFIRM_READING_DONE); ...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/SamplingRatiosRGImpl.java
SamplingRatiosRGImpl.eGet
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.SAMPLING_RATIOS_RG__HSAMPLE: return getHSAMPLE(); case AfplibPackage.SAMPLING_RATIOS_RG__VSAMPLE: return getVSAMPLE(); } return super.eGet(featureID, resolve, coreType); }
java
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.SAMPLING_RATIOS_RG__HSAMPLE: return getHSAMPLE(); case AfplibPackage.SAMPLING_RATIOS_RG__VSAMPLE: return getVSAMPLE(); } return super.eGet(featureID, resolve, coreType); }
[ "@", "Override", "public", "Object", "eGet", "(", "int", "featureID", ",", "boolean", "resolve", ",", "boolean", "coreType", ")", "{", "switch", "(", "featureID", ")", "{", "case", "AfplibPackage", ".", "SAMPLING_RATIOS_RG__HSAMPLE", ":", "return", "getHSAMPLE",...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/SamplingRatiosRGImpl.java#L137-L146
train
Override eGet to return the value of the featureID.
Of course, here is the Java code you requested: ```java @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.SAMPLING_RATIOS_RG__HSAMPLE: return getHSAMPLE(); case AfplibPackage.SAMPLING_RATIOS_RG__VSAMPLE: return getVSAMPLE(); } ...
konmik/solid
streams/src/main/java/solid/optional/Optional.java
Optional.of
public static <T> Optional<T> of(T value) { return value == null ? (Optional<T>) EMPTY : new Optional<>(value); }
java
public static <T> Optional<T> of(T value) { return value == null ? (Optional<T>) EMPTY : new Optional<>(value); }
[ "public", "static", "<", "T", ">", "Optional", "<", "T", ">", "of", "(", "T", "value", ")", "{", "return", "value", "==", "null", "?", "(", "Optional", "<", "T", ">", ")", "EMPTY", ":", "new", "Optional", "<>", "(", "value", ")", ";", "}" ]
Returns an optional for a given value
[ "Returns", "an", "optional", "for", "a", "given", "value" ]
3d6c452ef3219fd843547f3590b3d2e1ad3f1d17
https://github.com/konmik/solid/blob/3d6c452ef3219fd843547f3590b3d2e1ad3f1d17/streams/src/main/java/solid/optional/Optional.java#L31-L33
train
Returns an optional instance of the specified value.
Of course, here is the Java code you requested: ```java public static <T> Optional<T> of(T value) { return value == null ? (Optional<T>) EMPTY : new Optional<>(value); } ``` Hope this helps!
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/io/GeoPackageIOUtils.java
GeoPackageIOUtils.streamBytes
public static byte[] streamBytes(InputStream stream) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); copyStream(stream, bytes); return bytes.toByteArray(); }
java
public static byte[] streamBytes(InputStream stream) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); copyStream(stream, bytes); return bytes.toByteArray(); }
[ "public", "static", "byte", "[", "]", "streamBytes", "(", "InputStream", "stream", ")", "throws", "IOException", "{", "ByteArrayOutputStream", "bytes", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "copyStream", "(", "stream", ",", "bytes", ")", ";", "re...
Get the stream bytes @param stream input stream @return stream bytes @throws IOException upon failure
[ "Get", "the", "stream", "bytes" ]
6431c3b041a45b7f3802904ea4156b4082a72daa
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/io/GeoPackageIOUtils.java#L177-L184
train
Stream bytes.
Of course, here is the Java code you requested: ```java public static byte[] streamBytes(InputStream stream) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); copyStream(stream, bytes); return bytes.toByteArray(); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/naming/InjectionJavaColonHelper.java
InjectionJavaColonHelper.getRemoteObjectInstance
@Override public RemoteObjectInstance getRemoteObjectInstance(JavaColonNamespace namespace, String name) throws NamingException { RemoteObjectInstance roi = null; InjectionBinding<?> binding = getInjectionBinding(namespace, name); if (binding != null) { Object bindingObject = bin...
java
@Override public RemoteObjectInstance getRemoteObjectInstance(JavaColonNamespace namespace, String name) throws NamingException { RemoteObjectInstance roi = null; InjectionBinding<?> binding = getInjectionBinding(namespace, name); if (binding != null) { Object bindingObject = bin...
[ "@", "Override", "public", "RemoteObjectInstance", "getRemoteObjectInstance", "(", "JavaColonNamespace", "namespace", ",", "String", "name", ")", "throws", "NamingException", "{", "RemoteObjectInstance", "roi", "=", "null", ";", "InjectionBinding", "<", "?", ">", "bin...
/* (non-Javadoc) @see com.ibm.ws.container.service.naming.remote.RemoteJavaColonNamingHelper#getRemoteObjectInstance(com.ibm.ws.container.service.naming.NamingConstants.JavaColonNamespace, java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/naming/InjectionJavaColonHelper.java#L235-L272
train
Get the RemoteObjectInstance for the specified namespace and name.
Of course, here is the Java code you requested: ```java @Override public RemoteObjectInstance getRemoteObjectInstance(JavaColonNamespace namespace, String name) throws NamingException { RemoteObjectInstance roi = null; InjectionBinding<?> binding = getInjectionBinding(namespace, name); if (...
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/Layout.java
Layout.invalidate
public void invalidate() { synchronized (mMeasuredChildren) { Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "invalidate all [%d]", mMeasuredChildren.size()); mMeasuredChildren.clear(); } }
java
public void invalidate() { synchronized (mMeasuredChildren) { Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "invalidate all [%d]", mMeasuredChildren.size()); mMeasuredChildren.clear(); } }
[ "public", "void", "invalidate", "(", ")", "{", "synchronized", "(", "mMeasuredChildren", ")", "{", "Log", ".", "d", "(", "Log", ".", "SUBSYSTEM", ".", "LAYOUT", ",", "TAG", ",", "\"invalidate all [%d]\"", ",", "mMeasuredChildren", ".", "size", "(", ")", ")...
Invalidate layout setup.
[ "Invalidate", "layout", "setup", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/Layout.java#L120-L125
train
Invalidate all the image.
Of course, here is the Java code you requested: ```java public void invalidate() { synchronized (mMeasuredChildren) { Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "invalidate all [%d]", mMeasuredChildren.size()); mMeasuredChildren.clear(); } } ``` Hope this helps!
google/closure-templates
java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java
TranslateToPyExprVisitor.genCodeForFieldAccess
private String genCodeForFieldAccess( ExprNode node, SoyType baseType, String containerExpr, String fieldName) { if (baseType != null && baseType.getKind() == SoyType.Kind.PROTO) { errorReporter.report(node.getSourceLocation(), PROTO_ACCESS_NOT_SUPPORTED); return ".ERROR"; } return genCode...
java
private String genCodeForFieldAccess( ExprNode node, SoyType baseType, String containerExpr, String fieldName) { if (baseType != null && baseType.getKind() == SoyType.Kind.PROTO) { errorReporter.report(node.getSourceLocation(), PROTO_ACCESS_NOT_SUPPORTED); return ".ERROR"; } return genCode...
[ "private", "String", "genCodeForFieldAccess", "(", "ExprNode", "node", ",", "SoyType", "baseType", ",", "String", "containerExpr", ",", "String", "fieldName", ")", "{", "if", "(", "baseType", "!=", "null", "&&", "baseType", ".", "getKind", "(", ")", "==", "S...
Generates the code for a field name access, e.g. ".foo" or "['bar']". @param node the field access source node @param baseType the type of the object that contains the field @param containerExpr an expression that evaluates to the container of the named field. This expression may have any operator precedence that bind...
[ "Generates", "the", "code", "for", "a", "field", "name", "access", "e", ".", "g", ".", ".", "foo", "or", "[", "bar", "]", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java#L625-L632
train
Generate code for a field access.
Of course, here is the Java code you requested: ```java private String genCodeForFieldAccess( ExprNode node, SoyType baseType, String containerExpr, String fieldName) { if (baseType != null && baseType.getKind() == SoyType.Kind.PROTO) { errorReporter.report(node.getSourceLocation(), PROTO_ACCESS_NOT_SU...
Whiley/WhileyCompiler
src/main/java/wyc/io/WhileyFileParser.java
WhileyFileParser.eventuallyMatch
private Token eventuallyMatch(Token.Kind kind) { checkNotEof(); Token token = tokens.get(index); if (token.kind != kind) { return null; } else { index = index + 1; return token; } }
java
private Token eventuallyMatch(Token.Kind kind) { checkNotEof(); Token token = tokens.get(index); if (token.kind != kind) { return null; } else { index = index + 1; return token; } }
[ "private", "Token", "eventuallyMatch", "(", "Token", ".", "Kind", "kind", ")", "{", "checkNotEof", "(", ")", ";", "Token", "token", "=", "tokens", ".", "get", "(", "index", ")", ";", "if", "(", "token", ".", "kind", "!=", "kind", ")", "{", "return", ...
Attempt to match a given kind of token with the view that it must *eventually* be matched. This differs from <code>tryAndMatch()</code> because it calls <code>checkNotEof()</code>. Thus, it is guaranteed to skip any whitespace encountered in between. This is safe because we know there is a terminating token still to co...
[ "Attempt", "to", "match", "a", "given", "kind", "of", "token", "with", "the", "view", "that", "it", "must", "*", "eventually", "*", "be", "matched", ".", "This", "differs", "from", "<code", ">", "tryAndMatch", "()", "<", "/", "code", ">", "because", "i...
680f8a657d3fc286f8cc422755988b6d74ab3f4c
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L4198-L4207
train
Returns the next token that matches the given kind.
Of course, here is the Java code you requested: ```java private Token eventuallyMatch(Token.Kind kind) { checkNotEof(); Token token = tokens.get(index); if (token.kind != kind) { return null; } else { index = index + 1; return token; } } ``` Hope this helps!
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java
HttpSecurity.getOrApply
@SuppressWarnings("unchecked") private <C extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity>> C getOrApply( C configurer) throws Exception { C existingConfig = (C) getConfigurer(configurer.getClass()); if (existingConfig != null) { return existingConfig; } return apply(configurer...
java
@SuppressWarnings("unchecked") private <C extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity>> C getOrApply( C configurer) throws Exception { C existingConfig = (C) getConfigurer(configurer.getClass()); if (existingConfig != null) { return existingConfig; } return apply(configurer...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "C", "extends", "SecurityConfigurerAdapter", "<", "DefaultSecurityFilterChain", ",", "HttpSecurity", ">", ">", "C", "getOrApply", "(", "C", "configurer", ")", "throws", "Exception", "{", "C", "exi...
If the {@link SecurityConfigurer} has already been specified get the original, otherwise apply the new {@link SecurityConfigurerAdapter}. @param configurer the {@link SecurityConfigurer} to apply if one is not found for this {@link SecurityConfigurer} class. @return the current {@link SecurityConfigurer} for the confi...
[ "If", "the", "{", "@link", "SecurityConfigurer", "}", "has", "already", "been", "specified", "get", "the", "original", "otherwise", "apply", "the", "new", "{", "@link", "SecurityConfigurerAdapter", "}", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java#L1494-L1502
test
Get or apply the given configurer.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") private <C extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity>> C getOrApply( C configurer) throws Exception { C existingConfig = (C) getConfigurer(configurer.getClass()); if (existingConfig != null) ...
raphw/byte-buddy
byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java
ForRawType.onGenericArray
public Generic onGenericArray(Generic genericArray) { return declaringType.isGenerified() ? new Generic.OfNonGenericType.Latent(genericArray.asErasure(), genericArray) : genericArray; }
java
public Generic onGenericArray(Generic genericArray) { return declaringType.isGenerified() ? new Generic.OfNonGenericType.Latent(genericArray.asErasure(), genericArray) : genericArray; }
[ "public", "Generic", "onGenericArray", "(", "Generic", "genericArray", ")", "{", "return", "declaringType", ".", "isGenerified", "(", ")", "?", "new", "Generic", ".", "OfNonGenericType", ".", "Latent", "(", "genericArray", ".", "asErasure", "(", ")", ",", "gen...
{@inheritDoc}
[ "{" ]
4d2dac80efb6bed89367567260f6811c2f712d12
https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java#L2196-L2200
train
On generic array.
Of course, here is the Java code you requested: ```java public Generic onGenericArray(Generic genericArray) { return declaringType.isGenerified() ? new Generic.OfNonGenericType.Latent(genericArray.asErasure(), genericArray) : genericArray; ...
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java
SARLValidator.checkSpaceUse
@Check public void checkSpaceUse(SarlSpace space) { error(MessageFormat.format( Messages.SARLValidator_0, this.grammarAccess.getSpaceKeyword()), space, null); }
java
@Check public void checkSpaceUse(SarlSpace space) { error(MessageFormat.format( Messages.SARLValidator_0, this.grammarAccess.getSpaceKeyword()), space, null); }
[ "@", "Check", "public", "void", "checkSpaceUse", "(", "SarlSpace", "space", ")", "{", "error", "(", "MessageFormat", ".", "format", "(", "Messages", ".", "SARLValidator_0", ",", "this", ".", "grammarAccess", ".", "getSpaceKeyword", "(", ")", ")", ",", "space...
Space keyword is reserved. @param space the space to check.
[ "Space", "keyword", "is", "reserved", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java#L531-L538
train
Check if the given space is a valid space.
Of course, here is the Java code you requested: ```java @Check public void checkSpaceUse(SarlSpace space) { error(MessageFormat.format( Messages.SARLValidator_0, this.grammarAccess.getSpaceKeyword()), space, null); } ``` Hope this helps!
medallia/Word2VecJava
src/main/java/com/medallia/word2vec/util/IO.java
IO.runWithFile
public static <X> X runWithFile(InputStream stream, Function<File, X> function) throws IOException { File f = File.createTempFile("run-with-file", null); try { try (FileOutputStream out = new FileOutputStream(f)) { IOUtils.copy(stream, out); } return function.apply(f); } finally { f.delete(); } ...
java
public static <X> X runWithFile(InputStream stream, Function<File, X> function) throws IOException { File f = File.createTempFile("run-with-file", null); try { try (FileOutputStream out = new FileOutputStream(f)) { IOUtils.copy(stream, out); } return function.apply(f); } finally { f.delete(); } ...
[ "public", "static", "<", "X", ">", "X", "runWithFile", "(", "InputStream", "stream", ",", "Function", "<", "File", ",", "X", ">", "function", ")", "throws", "IOException", "{", "File", "f", "=", "File", ".", "createTempFile", "(", "\"run-with-file\"", ",",...
Copy the data from the given {@link InputStream} to a temporary file and call the given {@link Function} with it; after the function returns the file is deleted.
[ "Copy", "the", "data", "from", "the", "given", "{" ]
eb31fbb99ac6bbab82d7f807b3e2240edca50eb7
https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/IO.java#L117-L127
train
Run with file.
Of course, here is the Java code you requested: ```java public static <X> X runWithFile(InputStream stream, Function<File, X> function) throws IOException { File f = File.createTempFile("run-with-file", null); try { try (FileOutputStream out = new FileOutputStream(f)) { IOUtils.copy(stream, out); } re...
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java
SegmentClipper.isInClipArea
public boolean isInClipArea(final long pX, final long pY) { return pX > mXMin && pX < mXMax && pY > mYMin && pY < mYMax; }
java
public boolean isInClipArea(final long pX, final long pY) { return pX > mXMin && pX < mXMax && pY > mYMin && pY < mYMax; }
[ "public", "boolean", "isInClipArea", "(", "final", "long", "pX", ",", "final", "long", "pY", ")", "{", "return", "pX", ">", "mXMin", "&&", "pX", "<", "mXMax", "&&", "pY", ">", "mYMin", "&&", "pY", "<", "mYMax", ";", "}" ]
Check if a point is in the clip area
[ "Check", "if", "a", "point", "is", "in", "the", "clip", "area" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L161-L163
train
Checks if the given point is inside the clip area.
Of course, here is the Java code you requested: ```java public boolean isInClipArea(final long pX, final long pY) { return pX > mXMin && pX < mXMax && pY > mYMin && pY < mYMax; } ``` Hope this helps!
airlift/airlift
concurrent/src/main/java/io/airlift/concurrent/MoreFutures.java
MoreFutures.addExceptionCallback
public static <T> void addExceptionCallback(ListenableFuture<T> future, Consumer<Throwable> exceptionCallback) { addExceptionCallback(future, exceptionCallback, directExecutor()); }
java
public static <T> void addExceptionCallback(ListenableFuture<T> future, Consumer<Throwable> exceptionCallback) { addExceptionCallback(future, exceptionCallback, directExecutor()); }
[ "public", "static", "<", "T", ">", "void", "addExceptionCallback", "(", "ListenableFuture", "<", "T", ">", "future", ",", "Consumer", "<", "Throwable", ">", "exceptionCallback", ")", "{", "addExceptionCallback", "(", "future", ",", "exceptionCallback", ",", "dir...
Invokes the callback if the future fails. Note, this uses the direct executor, so the callback should not be resource intensive.
[ "Invokes", "the", "callback", "if", "the", "future", "fails", ".", "Note", "this", "uses", "the", "direct", "executor", "so", "the", "callback", "should", "not", "be", "resource", "intensive", "." ]
eb6949a63c998e914f498a7147cefc9dca923d51
https://github.com/airlift/airlift/blob/eb6949a63c998e914f498a7147cefc9dca923d51/concurrent/src/main/java/io/airlift/concurrent/MoreFutures.java#L551-L554
valid
Add an exception callback to the given listenable future.
Of course, here is the Java code you requested: ```java public static <T> void addExceptionCallback(ListenableFuture<T> future, Consumer<Throwable> exceptionCallback) { addExceptionCallback(future, exceptionCallback, directExecutor()); } ``` Hope this helps!
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java
SARLJvmModelInferrer.translateSarlFormalParametersForSyntheticOperation
protected List<String> translateSarlFormalParametersForSyntheticOperation(JvmExecutable owner, JvmGenericType actionContainer, boolean varargs, List<InferredStandardParameter> signature) { final List<String> arguments = CollectionLiterals.newArrayList(); for (final InferredStandardParameter parameterSpec : signa...
java
protected List<String> translateSarlFormalParametersForSyntheticOperation(JvmExecutable owner, JvmGenericType actionContainer, boolean varargs, List<InferredStandardParameter> signature) { final List<String> arguments = CollectionLiterals.newArrayList(); for (final InferredStandardParameter parameterSpec : signa...
[ "protected", "List", "<", "String", ">", "translateSarlFormalParametersForSyntheticOperation", "(", "JvmExecutable", "owner", ",", "JvmGenericType", "actionContainer", ",", "boolean", "varargs", ",", "List", "<", "InferredStandardParameter", ">", "signature", ")", "{", ...
Generate a list of formal parameters with annotations for the default values. @param owner the JVM element to change. @param actionContainer the container of the action. @param varargs indicates if the signature has variadic parameter. @param signature the description of the parameters. @return the arguments to pass t...
[ "Generate", "a", "list", "of", "formal", "parameters", "with", "annotations", "for", "the", "default", "values", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L3011-L3045
train
Translate formal parameters for synthetic operations.
Of course, here is the Java code you requested: ```java protected List<String> translateSarlFormalParametersForSyntheticOperation(JvmExecutable owner, JvmGenericType actionContainer, boolean varargs, List<InferredStandardParameter> signature) { final List<String> arguments = CollectionLiterals.newArrayList(); f...
alibaba/jstorm
jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/container/Executor.java
Executor.setupInitialRegistryPaths
protected void setupInitialRegistryPaths() throws IOException { if (registryOperations instanceof RMRegistryOperationsService) { RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations; rmRegOperations.initUserRegistryAsync(Regis...
java
protected void setupInitialRegistryPaths() throws IOException { if (registryOperations instanceof RMRegistryOperationsService) { RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations; rmRegOperations.initUserRegistryAsync(Regis...
[ "protected", "void", "setupInitialRegistryPaths", "(", ")", "throws", "IOException", "{", "if", "(", "registryOperations", "instanceof", "RMRegistryOperationsService", ")", "{", "RMRegistryOperationsService", "rmRegOperations", "=", "(", "RMRegistryOperationsService", ")", ...
TODO: purge this once RM is doing the work @throws IOException
[ "TODO", ":", "purge", "this", "once", "RM", "is", "doing", "the", "work" ]
5d6cde22dbca7df3d6e6830bf94f98a6639ab559
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/container/Executor.java#L110-L116
train
Setup initial paths for the user registry.
Of course, here is the Java code you requested: ```java protected void setupInitialRegistryPaths() throws IOException { if (registryOperations instanceof RMRegistryOperationsService) { RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations...
msgpack/msgpack-java
msgpack-core/src/main/java/org/msgpack/core/MessageBufferPacker.java
MessageBufferPacker.toBufferList
public List<MessageBuffer> toBufferList() { try { flush(); } catch (IOException ex) { // IOException must not happen because underlying ArrayBufferOutput never throws IOException throw new RuntimeException(ex); } return getArrayBufferOut()....
java
public List<MessageBuffer> toBufferList() { try { flush(); } catch (IOException ex) { // IOException must not happen because underlying ArrayBufferOutput never throws IOException throw new RuntimeException(ex); } return getArrayBufferOut()....
[ "public", "List", "<", "MessageBuffer", ">", "toBufferList", "(", ")", "{", "try", "{", "flush", "(", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "// IOException must not happen because underlying ArrayBufferOutput never throws IOException", "throw", "...
Returns the written data as a list of MessageBuffer. <p> Unlike {@link #toByteArray()} or {@link #toMessageBuffer()}, this is the fastest method that doesn't copy contents in any cases. @return the list of MessageBuffer instances
[ "Returns", "the", "written", "data", "as", "a", "list", "of", "MessageBuffer", ".", "<p", ">", "Unlike", "{", "@link", "#toByteArray", "()", "}", "or", "{", "@link", "#toMessageBuffer", "()", "}", "this", "is", "the", "fastest", "method", "that", "doesn", ...
16e370e348215a72a14c210b42d448d513aee015
https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/MessageBufferPacker.java#L114-L124
train
Returns a list of buffers that can be used to write the contents of this object to the output stream.
Of course, here is the Java code you requested: ```java public List<MessageBuffer> toBufferList() { try { flush(); } catch (IOException ex) { // IOException must not happen because underlying ArrayBufferOutput never throws IOException throw new RuntimeExc...
OryxProject/oryx
app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/EstimateForAnonymous.java
EstimateForAnonymous.buildTemporaryUserVector
static float[] buildTemporaryUserVector(ALSServingModel model, List<Pair<String,Double>> parsedPathSegments, float[] Xu) throws OryxServingException { boolean implicit = model.isImplicit(); Solver solver = model.getYTYSolver(); ...
java
static float[] buildTemporaryUserVector(ALSServingModel model, List<Pair<String,Double>> parsedPathSegments, float[] Xu) throws OryxServingException { boolean implicit = model.isImplicit(); Solver solver = model.getYTYSolver(); ...
[ "static", "float", "[", "]", "buildTemporaryUserVector", "(", "ALSServingModel", "model", ",", "List", "<", "Pair", "<", "String", ",", "Double", ">", ">", "parsedPathSegments", ",", "float", "[", "]", "Xu", ")", "throws", "OryxServingException", "{", "boolean...
Builds a temporary user feature vector given an (optional) existing user vector and a context of items. @param model current ALS model @param parsedPathSegments request path segments containing item-value pairs @param Xu existing feature vector for the user (may be {@code null}) @return user feature vector
[ "Builds", "a", "temporary", "user", "feature", "vector", "given", "an", "(", "optional", ")", "existing", "user", "vector", "and", "a", "context", "of", "items", "." ]
684bac0af002d2619ced652b5339e239da48df93
https://github.com/OryxProject/oryx/blob/684bac0af002d2619ced652b5339e239da48df93/app/oryx-app-serving/src/main/java/com/cloudera/oryx/app/serving/als/EstimateForAnonymous.java#L74-L89
valid
Build temporary user vector.
Of course, here is the Java code you requested: ```java static float[] buildTemporaryUserVector(ALSServingModel model, List<Pair<String,Double>> parsedPathSegments, float[] Xu) throws OryxServingException { boolean implicit = model...
simpligility/android-maven-plugin
src/main/java/com/simpligility/maven/plugins/android/phase01generatesources/GenerateSourcesMojo.java
GenerateSourcesMojo.validateStandardLocations
private void validateStandardLocations() throws MojoExecutionException { boolean hasNonStandardStructure = false; if ( androidManifestFilePre4.exists() && !androidManifestFilePre4.equals( androidManifestFile ) ) { getLog().warn( "Non-standard location of AndroidManifest.xml file ...
java
private void validateStandardLocations() throws MojoExecutionException { boolean hasNonStandardStructure = false; if ( androidManifestFilePre4.exists() && !androidManifestFilePre4.equals( androidManifestFile ) ) { getLog().warn( "Non-standard location of AndroidManifest.xml file ...
[ "private", "void", "validateStandardLocations", "(", ")", "throws", "MojoExecutionException", "{", "boolean", "hasNonStandardStructure", "=", "false", ";", "if", "(", "androidManifestFilePre4", ".", "exists", "(", ")", "&&", "!", "androidManifestFilePre4", ".", "equal...
Performs some level of validation on the configured files and folders in light of the change to AndroidStudio/Gradle style folder structures instead of the original Ant/Eclipse structures. <p> Essentially we will be noisy if we see an artifact that looks like before Android Maven Plugin 4 and is not explicitly configur...
[ "Performs", "some", "level", "of", "validation", "on", "the", "configured", "files", "and", "folders", "in", "light", "of", "the", "change", "to", "AndroidStudio", "/", "Gradle", "style", "folder", "structures", "instead", "of", "the", "original", "Ant", "/", ...
4d54d38b03bd3601bc25ab314719626a623da460
https://github.com/simpligility/android-maven-plugin/blob/4d54d38b03bd3601bc25ab314719626a623da460/src/main/java/com/simpligility/maven/plugins/android/phase01generatesources/GenerateSourcesMojo.java#L276-L320
valid
Validate the standard locations.
Of course, here is the Java code you requested: ```java private void validateStandardLocations() throws MojoExecutionException { boolean hasNonStandardStructure = false; if ( androidManifestFilePre4.exists() && !androidManifestFilePre4.equals( androidManifestFile ) ) { getLog()....
vvakame/JsonPullParser
jsonpullparser-usage/src/main/java/net/vvakame/sample/converter/StringDiscardConverter.java
StringDiscardConverter.parse
@Override public String parse(JsonPullParser parser, OnJsonObjectAddListener listener) throws IOException, JsonFormatException { if (parser == null) { throw new IllegalArgumentException(); } State state = parser.getEventType(); switch (state) { case VALUE_NULL: return null; case VALUE_STRING:...
java
@Override public String parse(JsonPullParser parser, OnJsonObjectAddListener listener) throws IOException, JsonFormatException { if (parser == null) { throw new IllegalArgumentException(); } State state = parser.getEventType(); switch (state) { case VALUE_NULL: return null; case VALUE_STRING:...
[ "@", "Override", "public", "String", "parse", "(", "JsonPullParser", "parser", ",", "OnJsonObjectAddListener", "listener", ")", "throws", "IOException", ",", "JsonFormatException", "{", "if", "(", "parser", "==", "null", ")", "{", "throw", "new", "IllegalArgumentE...
{@inheritDoc}
[ "{" ]
fce183ca66354723323a77f2ae8cb5222b5836bc
https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-usage/src/main/java/net/vvakame/sample/converter/StringDiscardConverter.java#L47-L64
train
Parses a single value from the given parser.
Of course, here is the Java code you requested: ```java @Override public String parse(JsonPullParser parser, OnJsonObjectAddListener listener) throws IOException, JsonFormatException { if (parser == null) { throw new IllegalArgumentException(); } State state = parser.getEventType(); switch (state) { ...
pavlospt/RxFile
rxfile/src/main/java/com/pavlospt/rxfile/RxFile.java
RxFile.getThumbnailFromUri
private static Observable<Bitmap> getThumbnailFromUri(final Context context, final Uri data) { return getThumbnailFromUriWithSizeAndKind(context, data, 0, 0, MediaStore.Images.Thumbnails.MINI_KIND); }
java
private static Observable<Bitmap> getThumbnailFromUri(final Context context, final Uri data) { return getThumbnailFromUriWithSizeAndKind(context, data, 0, 0, MediaStore.Images.Thumbnails.MINI_KIND); }
[ "private", "static", "Observable", "<", "Bitmap", ">", "getThumbnailFromUri", "(", "final", "Context", "context", ",", "final", "Uri", "data", ")", "{", "return", "getThumbnailFromUriWithSizeAndKind", "(", "context", ",", "data", ",", "0", ",", "0", ",", "Medi...
/* Get a thumbnail from the provided Image or Video Uri.
[ "/", "*", "Get", "a", "thumbnail", "from", "the", "provided", "Image", "or", "Video", "Uri", "." ]
54210b02631f4b27d31bea040eca86183136cf46
https://github.com/pavlospt/RxFile/blob/54210b02631f4b27d31bea040eca86183136cf46/rxfile/src/main/java/com/pavlospt/rxfile/RxFile.java#L202-L205
train
Gets thumbnail from uri.
Of course, here is the Java code you requested: ```java private static Observable<Bitmap> getThumbnailFromUri(final Context context, final Uri data) { return getThumbnailFromUriWithSizeAndKind(context, data, 0, 0, MediaStore.Images.Thumbnails.MINI_KIND); } ``` Hope this helps!
vdmeer/skb-java-base
src/main/java/de/vandermeer/skb/base/message/Message5WH_Builder.java
Message5WH_Builder.setWhere
public Message5WH_Builder setWhere(Object where, RecognitionException lineAndColumn){ if(where!=null && lineAndColumn!=null){ IsAntlrRuntimeObject iaro = IsAntlrRuntimeObject.create(lineAndColumn); this.setWhere(where, iaro.getLine(), iaro.getColumn()); } return this; }
java
public Message5WH_Builder setWhere(Object where, RecognitionException lineAndColumn){ if(where!=null && lineAndColumn!=null){ IsAntlrRuntimeObject iaro = IsAntlrRuntimeObject.create(lineAndColumn); this.setWhere(where, iaro.getLine(), iaro.getColumn()); } return this; }
[ "public", "Message5WH_Builder", "setWhere", "(", "Object", "where", ",", "RecognitionException", "lineAndColumn", ")", "{", "if", "(", "where", "!=", "null", "&&", "lineAndColumn", "!=", "null", ")", "{", "IsAntlrRuntimeObject", "iaro", "=", "IsAntlrRuntimeObject", ...
Sets the Where? part of the message. Line and column information are taken from the recognition exception, if they are larger than 0. Nothing will be set if the two parameters are null. @param where location for Where? @param lineAndColumn source for the Where? part @return self to allow chaining
[ "Sets", "the", "Where?", "part", "of", "the", "message", ".", "Line", "and", "column", "information", "are", "taken", "from", "the", "recognition", "exception", "if", "they", "are", "larger", "than", "0", ".", "Nothing", "will", "be", "set", "if", "the", ...
6d845bcc482aa9344d016e80c0c3455aeae13a13
https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/message/Message5WH_Builder.java#L175-L181
train
Sets the where clause.
Of course, here is the Java code you requested: ```java public Message5WH_Builder setWhere(Object where, RecognitionException lineAndColumn){ if(where!=null && lineAndColumn!=null){ IsAntlrRuntimeObject iaro = IsAntlrRuntimeObject.create(lineAndColumn); this.setWhere(where, iaro.getLine(), iaro.getColumn()); ...
albfernandez/itext2
src/main/java/com/lowagie/text/rtf/document/output/RtfByteArrayBuffer.java
RtfByteArrayBuffer.toByteArray
public byte[] toByteArray() { final byte[] r = new byte[size]; int off = 0; final int n = arrays.size(); for(int k = 0; k < n; k++) { byte[] src = (byte[])arrays.get(k); System.arraycopy(src, 0, r, off, src.length); off += src.length; } if(pos > 0) System.arraycopy(buffer, 0, r, off, pos); retur...
java
public byte[] toByteArray() { final byte[] r = new byte[size]; int off = 0; final int n = arrays.size(); for(int k = 0; k < n; k++) { byte[] src = (byte[])arrays.get(k); System.arraycopy(src, 0, r, off, src.length); off += src.length; } if(pos > 0) System.arraycopy(buffer, 0, r, off, pos); retur...
[ "public", "byte", "[", "]", "toByteArray", "(", ")", "{", "final", "byte", "[", "]", "r", "=", "new", "byte", "[", "size", "]", ";", "int", "off", "=", "0", ";", "final", "int", "n", "=", "arrays", ".", "size", "(", ")", ";", "for", "(", "int...
Allocates a new array and copies all data that has been written to this buffer to the newly allocated array. @return a new byte array
[ "Allocates", "a", "new", "array", "and", "copies", "all", "data", "that", "has", "been", "written", "to", "this", "buffer", "to", "the", "newly", "allocated", "array", "." ]
438fc1899367fd13dfdfa8dfdca9a3c1a7783b84
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/document/output/RtfByteArrayBuffer.java#L276-L288
train
Returns a byte array containing all the bytes in this buffer.
Of course, here is the Java code you requested: ```java public byte[] toByteArray() { final byte[] r = new byte[size]; int off = 0; final int n = arrays.size(); for(int k = 0; k < n; k++) { byte[] src = (byte[])arrays.get(k); System.arraycopy(src, 0, r, off, src.length); off += src.length; } if(p...
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
SearchManager.optimize
@Managed @ManagedDescription("Index optimization ") public void optimize() { if (handler instanceof SearchIndex) { try { if (isSuspended.get()) { resume(); try { ((SearchIndex)han...
java
@Managed @ManagedDescription("Index optimization ") public void optimize() { if (handler instanceof SearchIndex) { try { if (isSuspended.get()) { resume(); try { ((SearchIndex)han...
[ "@", "Managed", "@", "ManagedDescription", "(", "\"Index optimization \"", ")", "public", "void", "optimize", "(", ")", "{", "if", "(", "handler", "instanceof", "SearchIndex", ")", "{", "try", "{", "if", "(", "isSuspended", ".", "get", "(", ")", ")", "{", ...
Public method, designed to be called via JMX. Optimizes lucene index. See {@link IndexWriter#forceMerge(int)} for details.
[ "Public", "method", "designed", "to", "be", "called", "via", "JMX", ".", "Optimizes", "lucene", "index", ".", "See", "{" ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java#L1243-L1286
train
Override the optimize method for the Index optimization.
Of course, here is the Java code you requested: ```java @Managed @ManagedDescription("Index optimization ") public void optimize() { if (handler instanceof SearchIndex) { try { if (isSuspended.get()) { resume(); t...
apereo/cas
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/artifact/Saml1ArtifactResolutionProfileHandlerController.java
Saml1ArtifactResolutionProfileHandlerController.handlePostRequest
@PostMapping(path = SamlIdPConstants.ENDPOINT_SAML1_SOAP_ARTIFACT_RESOLUTION) protected void handlePostRequest(final HttpServletResponse response, final HttpServletRequest request) { val ctx = decodeSoapRequest(request); val artifactMsg = (ArtifactResolve) ctx.ge...
java
@PostMapping(path = SamlIdPConstants.ENDPOINT_SAML1_SOAP_ARTIFACT_RESOLUTION) protected void handlePostRequest(final HttpServletResponse response, final HttpServletRequest request) { val ctx = decodeSoapRequest(request); val artifactMsg = (ArtifactResolve) ctx.ge...
[ "@", "PostMapping", "(", "path", "=", "SamlIdPConstants", ".", "ENDPOINT_SAML1_SOAP_ARTIFACT_RESOLUTION", ")", "protected", "void", "handlePostRequest", "(", "final", "HttpServletResponse", "response", ",", "final", "HttpServletRequest", "request", ")", "{", "val", "ctx...
Handle post request. @param response the response @param request the request
[ "Handle", "post", "request", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/artifact/Saml1ArtifactResolutionProfileHandlerController.java#L37-L67
train
Handle post request.
Of course, here is the Java code you requested: ```java @PostMapping(path = SamlIdPConstants.ENDPOINT_SAML1_SOAP_ARTIFACT_RESOLUTION) protected void handlePostRequest(final HttpServletResponse response, final HttpServletRequest request) { val ctx = decodeSoapRequest(req...
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/CassQuery.java
CassQuery.getCompoundKeyColumn
private boolean getCompoundKeyColumn(MetamodelImpl metamodel, EmbeddableType keyObj, StringBuilder builder, boolean isPresent, CQLTranslator translator, String fieldName, String condition, List<Object> value, boolean useInClause) { fieldName = fieldName.substring(fieldName.indexOf(".") + 1); ...
java
private boolean getCompoundKeyColumn(MetamodelImpl metamodel, EmbeddableType keyObj, StringBuilder builder, boolean isPresent, CQLTranslator translator, String fieldName, String condition, List<Object> value, boolean useInClause) { fieldName = fieldName.substring(fieldName.indexOf(".") + 1); ...
[ "private", "boolean", "getCompoundKeyColumn", "(", "MetamodelImpl", "metamodel", ",", "EmbeddableType", "keyObj", ",", "StringBuilder", "builder", ",", "boolean", "isPresent", ",", "CQLTranslator", "translator", ",", "String", "fieldName", ",", "String", "condition", ...
Gets the compound key column. @param metamodel the metamodel @param keyObj the key obj @param builder the builder @param isPresent the is present @param translator the translator @param fieldName the field name @param condition the condition @param value the value @param useInClause the use in clause @return the compo...
[ "Gets", "the", "compound", "key", "column", "." ]
268958ab1ec09d14ec4d9184f0c8ded7a9158908
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/CassQuery.java#L824-L875
train
Gets the compound key column.
Of course, here is the Java code you requested: ```java private boolean getCompoundKeyColumn(MetamodelImpl metamodel, EmbeddableType keyObj, StringBuilder builder, boolean isPresent, CQLTranslator translator, String fieldName, String condition, List<Object> value, boolean useInClause) { fieldNa...
eclipse/xtext-core
org.eclipse.xtext.xtext.ide/src-gen/org/eclipse/xtext/xtext/ide/contentassist/antlr/internal/InternalXtextParser.java
InternalXtextParser.entryRuleTerminalRule
public final void entryRuleTerminalRule() throws RecognitionException { try { // InternalXtext.g:1096:1: ( ruleTerminalRule EOF ) // InternalXtext.g:1097:1: ruleTerminalRule EOF { before(grammarAccess.getTerminalRuleRule()); pushFollow(FollowSets000....
java
public final void entryRuleTerminalRule() throws RecognitionException { try { // InternalXtext.g:1096:1: ( ruleTerminalRule EOF ) // InternalXtext.g:1097:1: ruleTerminalRule EOF { before(grammarAccess.getTerminalRuleRule()); pushFollow(FollowSets000....
[ "public", "final", "void", "entryRuleTerminalRule", "(", ")", "throws", "RecognitionException", "{", "try", "{", "// InternalXtext.g:1096:1: ( ruleTerminalRule EOF )", "// InternalXtext.g:1097:1: ruleTerminalRule EOF", "{", "before", "(", "grammarAccess", ".", "getTerminalRuleRul...
InternalXtext.g:1095:1: entryRuleTerminalRule : ruleTerminalRule EOF ;
[ "InternalXtext", ".", "g", ":", "1095", ":", "1", ":", "entryRuleTerminalRule", ":", "ruleTerminalRule", "EOF", ";" ]
bac941cb75cb24706519845ec174cfef874d7557
https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.xtext.ide/src-gen/org/eclipse/xtext/xtext/ide/contentassist/antlr/internal/InternalXtextParser.java#L3317-L3341
train
Generates the sequence of rules that are terminal rules.
Of course, here is the Java code you requested: ```java public final void entryRuleTerminalRule() throws RecognitionException { try { // InternalXtext.g:1096:1: ( ruleTerminalRule EOF ) // InternalXtext.g:1097:1: ruleTerminalRule EOF { before(grammarAccess.getTe...
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/util/UserProperties.java
UserProperties.saveField
public void saveField(BaseField field) { String strFieldName = field.getFieldName(); // Fieldname only String strData = field.getString(); this.setProperty(strFieldName, strData); }
java
public void saveField(BaseField field) { String strFieldName = field.getFieldName(); // Fieldname only String strData = field.getString(); this.setProperty(strFieldName, strData); }
[ "public", "void", "saveField", "(", "BaseField", "field", ")", "{", "String", "strFieldName", "=", "field", ".", "getFieldName", "(", ")", ";", "// Fieldname only", "String", "strData", "=", "field", ".", "getString", "(", ")", ";", "this", ".", "setProperty...
Set a property with this field's name as the key to this field's current value. (Utility method). @param field The field to save.
[ "Set", "a", "property", "with", "this", "field", "s", "name", "as", "the", "key", "to", "this", "field", "s", "current", "value", ".", "(", "Utility", "method", ")", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/UserProperties.java#L244-L249
train
SaveField Method.
Of course, here is the Java code you requested: ```java public void saveField(BaseField field) { String strFieldName = field.getFieldName(); // Fieldname only String strData = field.getString(); this.setProperty(strFieldName, strData); } ``` Hope this helps!
apache/incubator-gobblin
gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitConfigMonitor.java
GitConfigMonitor.loadConfigFileWithFlowNameOverrides
private Config loadConfigFileWithFlowNameOverrides(Path configFilePath) throws IOException { Config flowConfig = this.pullFileLoader.loadPullFile(configFilePath, emptyConfig, false); String flowName = FSSpecStore.getSpecName(configFilePath); String flowGroup = FSSpecStore.getSpecGroup(configFilePath); ...
java
private Config loadConfigFileWithFlowNameOverrides(Path configFilePath) throws IOException { Config flowConfig = this.pullFileLoader.loadPullFile(configFilePath, emptyConfig, false); String flowName = FSSpecStore.getSpecName(configFilePath); String flowGroup = FSSpecStore.getSpecGroup(configFilePath); ...
[ "private", "Config", "loadConfigFileWithFlowNameOverrides", "(", "Path", "configFilePath", ")", "throws", "IOException", "{", "Config", "flowConfig", "=", "this", ".", "pullFileLoader", ".", "loadPullFile", "(", "configFilePath", ",", "emptyConfig", ",", "false", ")",...
Load the config file and override the flow name and flow path properties with the names from the file path @param configFilePath path of the config file relative to the repository root @return the configuration object @throws IOException
[ "Load", "the", "config", "file", "and", "override", "the", "flow", "name", "and", "flow", "path", "properties", "with", "the", "names", "from", "the", "file", "path" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitConfigMonitor.java#L170-L177
train
Load config file with flow name overrides
Of course, here is the Java code you requested: ```java private Config loadConfigFileWithFlowNameOverrides(Path configFilePath) throws IOException { Config flowConfig = this.pullFileLoader.loadPullFile(configFilePath, emptyConfig, false); String flowName = FSSpecStore.getSpecName(configFilePath); String fl...
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/util/ThreadPool.java
ThreadPool.start
public Thread start(Runnable target, String name) throws NoThreadException, InterruptedException { try { return start0(target, getTimeout(), name); } catch (NoThreadException e) { e.fillInStackTrace(); throw e; } }
java
public Thread start(Runnable target, String name) throws NoThreadException, InterruptedException { try { return start0(target, getTimeout(), name); } catch (NoThreadException e) { e.fillInStackTrace(); throw e; } }
[ "public", "Thread", "start", "(", "Runnable", "target", ",", "String", "name", ")", "throws", "NoThreadException", ",", "InterruptedException", "{", "try", "{", "return", "start0", "(", "target", ",", "getTimeout", "(", ")", ",", "name", ")", ";", "}", "ca...
Waits for a Thread to become available and starts a Runnable in it. If there are no available threads and the number of active threads is less than the maximum allowed, then a newly created thread is returned. @param target The Runnable instance that gets started by the returned thread. @param name The name to give th...
[ "Waits", "for", "a", "Thread", "to", "become", "available", "and", "starts", "a", "Runnable", "in", "it", ".", "If", "there", "are", "no", "available", "threads", "and", "the", "number", "of", "active", "threads", "is", "less", "than", "the", "maximum", ...
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/ThreadPool.java#L334-L344
train
Start a thread with the specified name.
Of course, here is the Java code you requested: ```java public Thread start(Runnable target, String name) throws NoThreadException, InterruptedException { try { return start0(target, getTimeout(), name); } catch (NoThreadException e) { e.fillInStackTrace(); ...
zaproxy/zaproxy
src/org/parosproxy/paros/view/FindDialog.java
FindDialog.initialize
private void initialize() { this.setTitle(Constant.messages.getString("edit.find.title")); this.infoLabel = new JLabel(Constant.messages.getString("edit.find.label.notfound")); this.infoLabel.setVisible(false); this.setContentPane(getJPanel()); centreDialog(); txtFi...
java
private void initialize() { this.setTitle(Constant.messages.getString("edit.find.title")); this.infoLabel = new JLabel(Constant.messages.getString("edit.find.label.notfound")); this.infoLabel.setVisible(false); this.setContentPane(getJPanel()); centreDialog(); txtFi...
[ "private", "void", "initialize", "(", ")", "{", "this", ".", "setTitle", "(", "Constant", ".", "messages", ".", "getString", "(", "\"edit.find.title\"", ")", ")", ";", "this", ".", "infoLabel", "=", "new", "JLabel", "(", "Constant", ".", "messages", ".", ...
This method initializes this
[ "This", "method", "initializes", "this" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/FindDialog.java#L122-L132
train
Initialize the component.
Of course, here is the Java code you requested: ```java private void initialize() { this.setTitle(Constant.messages.getString("edit.find.title")); this.infoLabel = new JLabel(Constant.messages.getString("edit.find.label.notfound")); this.infoLabel.setVisible(false); this.setContentP...
haraldk/TwelveMonkeys
common/common-io/src/main/java/com/twelvemonkeys/io/FileUtil.java
FileUtil.copy
public static boolean copy(File pFromFile, File pToFile, boolean pOverWrite) throws IOException { // Copy all directory structure if (pFromFile.isDirectory()) { return copyDir(pFromFile, pToFile, pOverWrite); } // Check if destination is a directory if (pToFil...
java
public static boolean copy(File pFromFile, File pToFile, boolean pOverWrite) throws IOException { // Copy all directory structure if (pFromFile.isDirectory()) { return copyDir(pFromFile, pToFile, pOverWrite); } // Check if destination is a directory if (pToFil...
[ "public", "static", "boolean", "copy", "(", "File", "pFromFile", ",", "File", "pToFile", ",", "boolean", "pOverWrite", ")", "throws", "IOException", "{", "// Copy all directory structure\r", "if", "(", "pFromFile", ".", "isDirectory", "(", ")", ")", "{", "return...
Copies the fromFile to the toFile location. If toFile is a directory, a new file is created in that directory, with the name of the fromFile. If the toFile exists, the file will not be copied, unless owerWrite is true. @param pFromFile The file to copy from @param pToFile The file to copy to @param pOverWrite Spec...
[ "Copies", "the", "fromFile", "to", "the", "toFile", "location", ".", "If", "toFile", "is", "a", "directory", "a", "new", "file", "is", "created", "in", "that", "directory", "with", "the", "name", "of", "the", "fromFile", ".", "If", "the", "toFile", "exis...
7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/FileUtil.java#L176-L211
train
Copy the contents of a file from one file to another.
Of course, here is the Java code you requested: ```java public static boolean copy(File pFromFile, File pToFile, boolean pOverWrite) throws IOException { // Copy all directory structure if (pFromFile.isDirectory()) { return copyDir(pFromFile, pToFile, pOverWrite); } /...
xm-online/xm-commons
xm-commons-metric/src/main/java/com/icthh/xm/commons/metric/MetricsConfiguration.java
MetricsConfiguration.init
@PostConstruct public void init() { log.debug("Registering JVM gauges"); metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet()); metricRegistry.register(PROP_METRIC_REG_JVM_...
java
@PostConstruct public void init() { log.debug("Registering JVM gauges"); metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet()); metricRegistry.register(PROP_METRIC_REG_JVM_...
[ "@", "PostConstruct", "public", "void", "init", "(", ")", "{", "log", ".", "debug", "(", "\"Registering JVM gauges\"", ")", ";", "metricRegistry", ".", "register", "(", "PROP_METRIC_REG_JVM_MEMORY", ",", "new", "MemoryUsageGaugeSet", "(", ")", ")", ";", "metricR...
Init commons metrics
[ "Init", "commons", "metrics" ]
43eb2273adb96f40830d7b905ee3a767b8715caf
https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-metric/src/main/java/com/icthh/xm/commons/metric/MetricsConfiguration.java#L68-L95
train
Initialize the metric registry.
Of course, here is the Java code you requested: ```java @PostConstruct public void init() { log.debug("Registering JVM gauges"); metricRegistry.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet()); metricRegistry.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet...
aws/aws-sdk-java
aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/GetCelebrityInfoResult.java
GetCelebrityInfoResult.withUrls
public GetCelebrityInfoResult withUrls(String... urls) { if (this.urls == null) { setUrls(new java.util.ArrayList<String>(urls.length)); } for (String ele : urls) { this.urls.add(ele); } return this; }
java
public GetCelebrityInfoResult withUrls(String... urls) { if (this.urls == null) { setUrls(new java.util.ArrayList<String>(urls.length)); } for (String ele : urls) { this.urls.add(ele); } return this; }
[ "public", "GetCelebrityInfoResult", "withUrls", "(", "String", "...", "urls", ")", "{", "if", "(", "this", ".", "urls", "==", "null", ")", "{", "setUrls", "(", "new", "java", ".", "util", ".", "ArrayList", "<", "String", ">", "(", "urls", ".", "length"...
<p> An array of URLs pointing to additional celebrity information. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setUrls(java.util.Collection)} or {@link #withUrls(java.util.Collection)} if you want to override the existing values. </p> @param urls An array of URLs poi...
[ "<p", ">", "An", "array", "of", "URLs", "pointing", "to", "additional", "celebrity", "information", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing",...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/GetCelebrityInfoResult.java#L79-L87
train
A list of URLs to retrieve the Celebrity information for this Celebrity.
Of course, here is the Java code you requested: ```java public GetCelebrityInfoResult withUrls(String... urls) { if (this.urls == null) { setUrls(new java.util.ArrayList<String>(urls.length)); } for (String ele : urls) { this.urls.add(ele); } return this;...
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletRequestImpl.java
SipServletRequestImpl.getParameterNames
public Enumeration<String> getParameterNames() { // JSR 289 Section 5.6.1 Parameters : // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header. // For initial requests where the application is invoked the ...
java
public Enumeration<String> getParameterNames() { // JSR 289 Section 5.6.1 Parameters : // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header. // For initial requests where the application is invoked the ...
[ "public", "Enumeration", "<", "String", ">", "getParameterNames", "(", ")", "{", "// JSR 289 Section 5.6.1 Parameters :", "// For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header.", "//...
/* (non-Javadoc) @see javax.servlet.ServletRequest#getParameterNames()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
fd7011d2803ab1d205b140768a760c8c69e0c997
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipServletRequestImpl.java#L864-L890
train
Returns an enumeration of the parameter names of the request.
Of course, here is the Java code you requested: ```java public Enumeration<String> getParameterNames() { // JSR 289 Section 5.6.1 Parameters : // For initial requests where a preloaded Route header specified the application to be invoked, the parameters are those of the SIP or SIPS URI in that Route header. // F...
pawelprazak/java-extended
guava/src/main/java/com/bluecatcode/common/base/Environment.java
Environment.getLocalHostNameWithRecovery
private static String getLocalHostNameWithRecovery() throws UnknownHostException { try { return (InetAddress.getLocalHost()).getHostName(); } catch (UnknownHostException exception) { String host = exception.getMessage(); // host = "hostname: hostname" if (host != null...
java
private static String getLocalHostNameWithRecovery() throws UnknownHostException { try { return (InetAddress.getLocalHost()).getHostName(); } catch (UnknownHostException exception) { String host = exception.getMessage(); // host = "hostname: hostname" if (host != null...
[ "private", "static", "String", "getLocalHostNameWithRecovery", "(", ")", "throws", "UnknownHostException", "{", "try", "{", "return", "(", "InetAddress", ".", "getLocalHost", "(", ")", ")", ".", "getHostName", "(", ")", ";", "}", "catch", "(", "UnknownHostExcept...
When using the {@link java.net.InetAddress#getHostName()} method in an environment where neither a proper DNS lookup nor an <tt>/etc/hosts</tt> entry exists for a given host, the following exception will be thrown: <p> <code> java.net.UnknownHostException: &lt;hostname&gt;: &lt;hostname&gt; at java.net.InetAddress.getL...
[ "When", "using", "the", "{", "@link", "java", ".", "net", ".", "InetAddress#getHostName", "()", "}", "method", "in", "an", "environment", "where", "neither", "a", "proper", "DNS", "lookup", "nor", "an", "<tt", ">", "/", "etc", "/", "hosts<", "/", "tt", ...
ce1a556a95cbbf7c950a03662938bc02622de69b
https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/base/Environment.java#L61-L74
train
getLocalHostNameWithRecovery This method returns the hostname of the local host.
Of course, here is the Java code you requested: ```java private static String getLocalHostNameWithRecovery() throws UnknownHostException { try { return (InetAddress.getLocalHost()).getHostName(); } catch (UnknownHostException exception) { String host = exception.getMessage(); //...
jfree/jfreesvg
src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java
SVGGraphics2D.fillOval
@Override public void fillOval(int x, int y, int width, int height) { setOval(x, y, width, height); fill(this.oval); }
java
@Override public void fillOval(int x, int y, int width, int height) { setOval(x, y, width, height); fill(this.oval); }
[ "@", "Override", "public", "void", "fillOval", "(", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ")", "{", "setOval", "(", "x", ",", "y", ",", "width", ",", "height", ")", ";", "fill", "(", "this", ".", "oval", ")", "...
Fills an oval framed by the rectangle {@code (x, y, width, height)}. @param x the x-coordinate. @param y the y-coordinate. @param width the width. @param height the height. @see #drawOval(int, int, int, int)
[ "Fills", "an", "oval", "framed", "by", "the", "rectangle", "{", "@code", "(", "x", "y", "width", "height", ")", "}", "." ]
2e6cd5f8dde71e37704e4d786e3b64235326adaf
https://github.com/jfree/jfreesvg/blob/2e6cd5f8dde71e37704e4d786e3b64235326adaf/src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java#L2254-L2258
valid
Fill the Oval field of the segment with the data from the specified coordinates.
Of course, here is the Java code you requested: ```java @Override public void fillOval(int x, int y, int width, int height) { setOval(x, y, width, height); fill(this.oval); } ``` Hope this helps!
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
Graph.mapEdges
public <NV> Graph<K, VV, NV> mapEdges(final MapFunction<Edge<K, EV>, NV> mapper, TypeInformation<Edge<K, NV>> returnType) { DataSet<Edge<K, NV>> mappedEdges = edges.map( new MapFunction<Edge<K, EV>, Edge<K, NV>>() { private Edge<K, NV> output = new Edge<>(); public Edge<K, NV> map(Edge<K, EV> value) throw...
java
public <NV> Graph<K, VV, NV> mapEdges(final MapFunction<Edge<K, EV>, NV> mapper, TypeInformation<Edge<K, NV>> returnType) { DataSet<Edge<K, NV>> mappedEdges = edges.map( new MapFunction<Edge<K, EV>, Edge<K, NV>>() { private Edge<K, NV> output = new Edge<>(); public Edge<K, NV> map(Edge<K, EV> value) throw...
[ "public", "<", "NV", ">", "Graph", "<", "K", ",", "VV", ",", "NV", ">", "mapEdges", "(", "final", "MapFunction", "<", "Edge", "<", "K", ",", "EV", ">", ",", "NV", ">", "mapper", ",", "TypeInformation", "<", "Edge", "<", "K", ",", "NV", ">", ">"...
Apply a function to the attribute of each edge in the graph. @param mapper the map function to apply. @param returnType the explicit return type. @return a new graph
[ "Apply", "a", "function", "to", "the", "attribute", "of", "each", "edge", "in", "the", "graph", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L603-L620
train
Maps edges of this graph to the vertices of the given mapping function.
Of course, here is the Java code you requested: ```java public <NV> Graph<K, VV, NV> mapEdges(final MapFunction<Edge<K, EV>, NV> mapper, TypeInformation<Edge<K, NV>> returnType) { DataSet<Edge<K, NV>> mappedEdges = edges.map( new MapFunction<Edge<K, EV>, Edge<K, NV>>() { private Edge<K, NV> output = new Edge<...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsrunningconfig.java
nsrunningconfig.get
public static nsrunningconfig[] get(nitro_service service, nsrunningconfig_args args) throws Exception{ nsrunningconfig obj = new nsrunningconfig(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); nsrunningconfig[] response = (nsrunningconfig[])obj.get_resources...
java
public static nsrunningconfig[] get(nitro_service service, nsrunningconfig_args args) throws Exception{ nsrunningconfig obj = new nsrunningconfig(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); nsrunningconfig[] response = (nsrunningconfig[])obj.get_resources...
[ "public", "static", "nsrunningconfig", "[", "]", "get", "(", "nitro_service", "service", ",", "nsrunningconfig_args", "args", ")", "throws", "Exception", "{", "nsrunningconfig", "obj", "=", "new", "nsrunningconfig", "(", ")", ";", "options", "option", "=", "new"...
Use this API to fetch all the nsrunningconfig resources that are configured on netscaler. This uses nsrunningconfig_args which is a way to provide additional arguments while fetching the resources.
[ "Use", "this", "API", "to", "fetch", "all", "the", "nsrunningconfig", "resources", "that", "are", "configured", "on", "netscaler", ".", "This", "uses", "nsrunningconfig_args", "which", "is", "a", "way", "to", "provide", "additional", "arguments", "while", "fetch...
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsrunningconfig.java#L135-L141
train
Use this API to fetch all the nsrunningconfig resources that are configured on netscaler. This uses nsrunningconfig_args which is a way to provide additional arguments while fetching the resources.
Of course, here is the Java code you requested: ```java public static nsrunningconfig[] get(nitro_service service, nsrunningconfig_args args) throws Exception{ nsrunningconfig obj = new nsrunningconfig(); options option = new options(); option.set_args(nitro_util.object_to_string_withoutquotes(args)); nsrunnin...
OpenLiberty/open-liberty
dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceService.java
BaseTraceService.filterSourcelist
private List<String> filterSourcelist(List<String> sourceList) { List<String> filteredList = new ArrayList<String>(sourceList); filteredList.remove(CollectorConstants.TRACE_CONFIG_VAL); filteredList.remove(CollectorConstants.MESSAGES_CONFIG_VAL); return filteredList; }
java
private List<String> filterSourcelist(List<String> sourceList) { List<String> filteredList = new ArrayList<String>(sourceList); filteredList.remove(CollectorConstants.TRACE_CONFIG_VAL); filteredList.remove(CollectorConstants.MESSAGES_CONFIG_VAL); return filteredList; }
[ "private", "List", "<", "String", ">", "filterSourcelist", "(", "List", "<", "String", ">", "sourceList", ")", "{", "List", "<", "String", ">", "filteredList", "=", "new", "ArrayList", "<", "String", ">", "(", "sourceList", ")", ";", "filteredList", ".", ...
/* Helper method to clean up the original source list by removing messages and trace from it. Otherwise, our json handlers will subscribe these and cause collectorManager to create 'new' conduits/Buffermanagers.
[ "/", "*", "Helper", "method", "to", "clean", "up", "the", "original", "source", "list", "by", "removing", "messages", "and", "trace", "from", "it", ".", "Otherwise", "our", "json", "handlers", "will", "subscribe", "these", "and", "cause", "collectorManager", ...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceService.java#L1364-L1369
train
Filter the source list to remove the trace and messages configuration values
Of course, here is the Java code you requested: ```java private List<String> filterSourcelist(List<String> sourceList) { List<String> filteredList = new ArrayList<String>(sourceList); filteredList.remove(CollectorConstants.TRACE_CONFIG_VAL); filteredList.remove(CollectorConstants.MESSAGES_CONFI...
lucee/Lucee
core/src/main/java/lucee/transformer/util/SourceCode.java
SourceCode.getColumn
public int getColumn(int pos) { int line = getLine(pos) - 1; if (line == 0) return pos + 1; return pos - lines[line - 1].intValue(); }
java
public int getColumn(int pos) { int line = getLine(pos) - 1; if (line == 0) return pos + 1; return pos - lines[line - 1].intValue(); }
[ "public", "int", "getColumn", "(", "int", "pos", ")", "{", "int", "line", "=", "getLine", "(", "pos", ")", "-", "1", ";", "if", "(", "line", "==", "0", ")", "return", "pos", "+", "1", ";", "return", "pos", "-", "lines", "[", "line", "-", "1", ...
Gibt die Stelle in der Zeile auf die pos zeigt zurueck. @param pos Position von welcher die Zeile erfragt wird @return Position innerhalb der Zeile.
[ "Gibt", "die", "Stelle", "in", "der", "Zeile", "auf", "die", "pos", "zeigt", "zurueck", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L778-L782
train
Get the column number of the given position.
Of course, here is the Java code you requested: ```java public int getColumn(int pos) { int line = getLine(pos) - 1; if (line == 0) return pos + 1; return pos - lines[line - 1].intValue(); } ``` Hope this helps!
baratine/baratine
core/src/main/java/com/caucho/v5/bytecode/attr/SignatureAttribute.java
SignatureAttribute.read
public void read(ByteCodeParser in) throws IOException { int length = in.readInt(); if (length != 2) throw new IOException("expected length of 2 at " + length); int code = in.readShort(); _signature = in.getUTF8(code); }
java
public void read(ByteCodeParser in) throws IOException { int length = in.readInt(); if (length != 2) throw new IOException("expected length of 2 at " + length); int code = in.readShort(); _signature = in.getUTF8(code); }
[ "public", "void", "read", "(", "ByteCodeParser", "in", ")", "throws", "IOException", "{", "int", "length", "=", "in", ".", "readInt", "(", ")", ";", "if", "(", "length", "!=", "2", ")", "throw", "new", "IOException", "(", "\"expected length of 2 at \"", "+...
Reads the signature.
[ "Reads", "the", "signature", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/attr/SignatureAttribute.java#L68-L78
train
read the sequence of bytes from the input stream
Of course, here is the Java code you requested: ```java public void read(ByteCodeParser in) throws IOException { int length = in.readInt(); if (length != 2) throw new IOException("expected length of 2 at " + length); int code = in.readShort(); _signature = in.getUTF8(code); } ``` H...
nispok/snackbar
lib/src/main/java/com/nispok/snackbar/Snackbar.java
Snackbar.show
public void show(ViewGroup parent, boolean usePhoneLayout) { MarginLayoutParams params = init(parent.getContext(), null, parent, usePhoneLayout); updateLayoutParamsMargins(null, params); showInternal(null, params, parent); }
java
public void show(ViewGroup parent, boolean usePhoneLayout) { MarginLayoutParams params = init(parent.getContext(), null, parent, usePhoneLayout); updateLayoutParamsMargins(null, params); showInternal(null, params, parent); }
[ "public", "void", "show", "(", "ViewGroup", "parent", ",", "boolean", "usePhoneLayout", ")", "{", "MarginLayoutParams", "params", "=", "init", "(", "parent", ".", "getContext", "(", ")", ",", "null", ",", "parent", ",", "usePhoneLayout", ")", ";", "updateLay...
Displays the {@link Snackbar} at the bottom of the {@link android.view.ViewGroup} provided. @param parent @param usePhoneLayout
[ "Displays", "the", "{", "@link", "Snackbar", "}", "at", "the", "bottom", "of", "the", "{", "@link", "android", ".", "view", ".", "ViewGroup", "}", "provided", "." ]
a4e0449874423031107f6aaa7e97d0f1714a1d3b
https://github.com/nispok/snackbar/blob/a4e0449874423031107f6aaa7e97d0f1714a1d3b/lib/src/main/java/com/nispok/snackbar/Snackbar.java#L824-L828
train
Show the image.
Of course, here is the Java code you requested: ```java public void show(ViewGroup parent, boolean usePhoneLayout) { MarginLayoutParams params = init(parent.getContext(), null, parent, usePhoneLayout); updateLayoutParamsMargins(null, params); showInternal(null, params, parent); } ``` Hope ...
mgledi/DRUMS
src/main/java/com/unister/semweb/drums/storable/GeneralStructure.java
GeneralStructure.addKeyPart
public boolean addKeyPart(String name, Basic_Field_Types type) throws IOException { return addKeyPart(name, type.size); }
java
public boolean addKeyPart(String name, Basic_Field_Types type) throws IOException { return addKeyPart(name, type.size); }
[ "public", "boolean", "addKeyPart", "(", "String", "name", ",", "Basic_Field_Types", "type", ")", "throws", "IOException", "{", "return", "addKeyPart", "(", "name", ",", "type", ".", "size", ")", ";", "}" ]
Adds a new KeyPart. This is a wrapper method for <code>addKeyPart(String, int)</code>. @param name the name of the key part. With this name you can access this part @param type the type of the key part. @return true if adding the key part was successful @throws IOException
[ "Adds", "a", "new", "KeyPart", ".", "This", "is", "a", "wrapper", "method", "for", "<code", ">", "addKeyPart", "(", "String", "int", ")", "<", "/", "code", ">", "." ]
a670f17a2186c9a15725f26617d77ce8e444e072
https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/storable/GeneralStructure.java#L154-L156
train
Add a key part to the class.
Of course, here is the Java code you requested: ```java public boolean addKeyPart(String name, Basic_Field_Types type) throws IOException { return addKeyPart(name, type.size); } ``` Hope this helps!
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilter.java
AbstractAuthenticationProcessingFilter.doFilter
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; if (!requiresAuthentication(request, response)) { chain.doFilter(request,...
java
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; if (!requiresAuthentication(request, response)) { chain.doFilter(request,...
[ "public", "void", "doFilter", "(", "ServletRequest", "req", ",", "ServletResponse", "res", ",", "FilterChain", "chain", ")", "throws", "IOException", ",", "ServletException", "{", "HttpServletRequest", "request", "=", "(", "HttpServletRequest", ")", "req", ";", "H...
Invokes the {@link #requiresAuthentication(HttpServletRequest, HttpServletResponse) requiresAuthentication} method to determine whether the request is for authentication and should be handled by this filter. If it is an authentication request, the {@link #attemptAuthentication(HttpServletRequest, HttpServletResponse) a...
[ "Invokes", "the", "{" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilter.java#L193-L241
test
This method is called by the servlet to process the request.
Of course, here is the Java code you requested: ```java public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; if (!requiresAuthen...
Alluxio/alluxio
core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java
FileSystemContext.acquireBlockMasterClientResource
public CloseableResource<BlockMasterClient> acquireBlockMasterClientResource() { return new CloseableResource<BlockMasterClient>(mBlockMasterClientPool.acquire()) { @Override public void close() { mBlockMasterClientPool.release(get()); } }; }
java
public CloseableResource<BlockMasterClient> acquireBlockMasterClientResource() { return new CloseableResource<BlockMasterClient>(mBlockMasterClientPool.acquire()) { @Override public void close() { mBlockMasterClientPool.release(get()); } }; }
[ "public", "CloseableResource", "<", "BlockMasterClient", ">", "acquireBlockMasterClientResource", "(", ")", "{", "return", "new", "CloseableResource", "<", "BlockMasterClient", ">", "(", "mBlockMasterClientPool", ".", "acquire", "(", ")", ")", "{", "@", "Override", ...
Acquires a block master client resource from the block master client pool. The resource is {@code Closeable}. @return the acquired block master client resource
[ "Acquires", "a", "block", "master", "client", "resource", "from", "the", "block", "master", "client", "pool", ".", "The", "resource", "is", "{", "@code", "Closeable", "}", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java#L382-L389
train
Acquire a new resource from the pool.
Of course, here is the Java code you requested: ```java public CloseableResource<BlockMasterClient> acquireBlockMasterClientResource() { return new CloseableResource<BlockMasterClient>(mBlockMasterClientPool.acquire()) { @Override public void close() { mBlockMasterClientPool.release(get()); ...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpntrafficpolicy.java
vpntrafficpolicy.get_filtered
public static vpntrafficpolicy[] get_filtered(nitro_service service, String filter) throws Exception{ vpntrafficpolicy obj = new vpntrafficpolicy(); options option = new options(); option.set_filter(filter); vpntrafficpolicy[] response = (vpntrafficpolicy[]) obj.getfiltered(service, option); return response; ...
java
public static vpntrafficpolicy[] get_filtered(nitro_service service, String filter) throws Exception{ vpntrafficpolicy obj = new vpntrafficpolicy(); options option = new options(); option.set_filter(filter); vpntrafficpolicy[] response = (vpntrafficpolicy[]) obj.getfiltered(service, option); return response; ...
[ "public", "static", "vpntrafficpolicy", "[", "]", "get_filtered", "(", "nitro_service", "service", ",", "String", "filter", ")", "throws", "Exception", "{", "vpntrafficpolicy", "obj", "=", "new", "vpntrafficpolicy", "(", ")", ";", "options", "option", "=", "new"...
Use this API to fetch filtered set of vpntrafficpolicy resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
[ "Use", "this", "API", "to", "fetch", "filtered", "set", "of", "vpntrafficpolicy", "resources", ".", "filter", "string", "should", "be", "in", "JSON", "format", ".", "eg", ":", "port", ":", "80", "servicetype", ":", "HTTP", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpntrafficpolicy.java#L344-L350
train
Use this API to fetch filtered set of vpntrafficpolicy resources. set the filter parameter values in filter parameter value.
Of course, here is the Java code you requested: ```java public static vpntrafficpolicy[] get_filtered(nitro_service service, String filter) throws Exception{ vpntrafficpolicy obj = new vpntrafficpolicy(); options option = new options(); option.set_filter(filter); vpntrafficpolicy[] response = (vpntrafficpolicy...
gwtplus/google-gin
src/main/java/com/google/gwt/inject/client/multibindings/GinMapBinder.java
GinMapBinder.addBinding
public GinLinkedBindingBuilder<V> addBinding( Class<? extends javax.inject.Provider<? extends K>> keyProvider) { return addBinding(TypeLiteral.get(keyProvider)); }
java
public GinLinkedBindingBuilder<V> addBinding( Class<? extends javax.inject.Provider<? extends K>> keyProvider) { return addBinding(TypeLiteral.get(keyProvider)); }
[ "public", "GinLinkedBindingBuilder", "<", "V", ">", "addBinding", "(", "Class", "<", "?", "extends", "javax", ".", "inject", ".", "Provider", "<", "?", "extends", "K", ">", ">", "keyProvider", ")", "{", "return", "addBinding", "(", "TypeLiteral", ".", "get...
Returns a binding builder used to add a new entry in the map using a key provider. <p> This API is not compatible with Guice however it is provided as GIN has limitation to bind 'instances'. For that reason for all key types that are not defined in {@link com.google.gwt.inject.client.binder.GinConstantBindingBuilder} n...
[ "Returns", "a", "binding", "builder", "used", "to", "add", "a", "new", "entry", "in", "the", "map", "using", "a", "key", "provider", ".", "<p", ">", "This", "API", "is", "not", "compatible", "with", "Guice", "however", "it", "is", "provided", "as", "GI...
595e61ee0d2fa508815c016e924ec0e5cea2a2aa
https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/client/multibindings/GinMapBinder.java#L240-L243
train
Add a binding to the given key provider.
Of course, here is the Java code you requested: ```java public GinLinkedBindingBuilder<V> addBinding( Class<? extends javax.inject.Provider<? extends K>> keyProvider) { return addBinding(TypeLiteral.get(keyProvider)); } ``` Hope this helps!
apache/incubator-druid
processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java
RowBasedGrouperHelper.createGrouperAccumulatorPair
public static Pair<Grouper<RowBasedKey>, Accumulator<AggregateResult, Row>> createGrouperAccumulatorPair( final GroupByQuery query, final boolean isInputRaw, final Map<String, ValueType> rawInputRowSignature, final GroupByQueryConfig config, final Supplier<ByteBuffer> bufferSupplier, ...
java
public static Pair<Grouper<RowBasedKey>, Accumulator<AggregateResult, Row>> createGrouperAccumulatorPair( final GroupByQuery query, final boolean isInputRaw, final Map<String, ValueType> rawInputRowSignature, final GroupByQueryConfig config, final Supplier<ByteBuffer> bufferSupplier, ...
[ "public", "static", "Pair", "<", "Grouper", "<", "RowBasedKey", ">", ",", "Accumulator", "<", "AggregateResult", ",", "Row", ">", ">", "createGrouperAccumulatorPair", "(", "final", "GroupByQuery", "query", ",", "final", "boolean", "isInputRaw", ",", "final", "Ma...
If isInputRaw is true, transformations such as timestamp truncation and extraction functions have not been applied to the input rows yet, for example, in a nested query, if an extraction function is being applied in the outer query to a field of the inner query. This method must apply those transformations.
[ "If", "isInputRaw", "is", "true", "transformations", "such", "as", "timestamp", "truncation", "and", "extraction", "functions", "have", "not", "been", "applied", "to", "the", "input", "rows", "yet", "for", "example", "in", "a", "nested", "query", "if", "an", ...
f776b9408962b9006cfcfe4d6c1794751972cc8e
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java#L135-L278
train
Create a Pair of Grouper Accumulator objects.
Of course, here is the Java code you requested: ```java public static Pair<Grouper<RowBasedKey>, Accumulator<AggregateResult, Row>> createGrouperAccumulatorPair( final GroupByQuery query, final boolean isInputRaw, final Map<String, ValueType> rawInputRowSignature, final GroupByQueryConfig confi...
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java
CommonOps_DDF2.changeSign
public static void changeSign( DMatrix2x2 a ) { a.a11 = -a.a11; a.a12 = -a.a12; a.a21 = -a.a21; a.a22 = -a.a22; }
java
public static void changeSign( DMatrix2x2 a ) { a.a11 = -a.a11; a.a12 = -a.a12; a.a21 = -a.a21; a.a22 = -a.a22; }
[ "public", "static", "void", "changeSign", "(", "DMatrix2x2", "a", ")", "{", "a", ".", "a11", "=", "-", "a", ".", "a11", ";", "a", ".", "a12", "=", "-", "a", ".", "a12", ";", "a", ".", "a21", "=", "-", "a", ".", "a21", ";", "a", ".", "a22", ...
<p> Changes the sign of every element in the matrix.<br> <br> a<sub>ij</sub> = -a<sub>ij</sub> </p> @param a A matrix. Modified.
[ "<p", ">", "Changes", "the", "sign", "of", "every", "element", "in", "the", "matrix", ".", "<br", ">", "<br", ">", "a<sub", ">", "ij<", "/", "sub", ">", "=", "-", "a<sub", ">", "ij<", "/", "sub", ">", "<", "/", "p", ">" ]
1444680cc487af5e866730e62f48f5f9636850d9
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L1099-L1103
train
Changes the sign of the image.
Of course, here is the Java code you requested: ```java public static void changeSign( DMatrix2x2 a ) { a.a11 = -a.a11; a.a12 = -a.a12; a.a21 = -a.a21; a.a22 = -a.a22; } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/GatheringBrowseCursor.java
GatheringBrowseCursor.next
public JsMessage next() throws SIResourceException, SISessionDroppedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "next"); JsMessage msg = null; Iterator<BrowseCursor> it = cursors.iterator(); while(it.hasNext() && msg==null) msg = it.ne...
java
public JsMessage next() throws SIResourceException, SISessionDroppedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "next"); JsMessage msg = null; Iterator<BrowseCursor> it = cursors.iterator(); while(it.hasNext() && msg==null) msg = it.ne...
[ "public", "JsMessage", "next", "(", ")", "throws", "SIResourceException", ",", "SISessionDroppedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "t...
The gathering browse will browse messages from the local itemstream as a priority. If none are found it will move through the other queue points until it finds a message.
[ "The", "gathering", "browse", "will", "browse", "messages", "from", "the", "local", "itemstream", "as", "a", "priority", ".", "If", "none", "are", "found", "it", "will", "move", "through", "the", "other", "queue", "points", "until", "it", "finds", "a", "me...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/GatheringBrowseCursor.java#L81-L95
train
Returns the next message in the list.
Of course, here is the Java code you requested: ```java public JsMessage next() throws SIResourceException, SISessionDroppedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "next"); JsMessage msg = null; Iterator<BrowseCursor> it = cursors.iterator(...
Faylixe/googlecodejam-client
src/main/java/fr/faylixe/googlecodejam/client/executor/HttpRequestExecutor.java
HttpRequestExecutor.readResolve
private Object readResolve() throws ObjectStreamException { try { return create(hostname, cookieValue); } catch (final IOException | GeneralSecurityException e) { throw new ObjectStreamException(e.getMessage()) { /** Serialization index. **/ private static final long serialVersionUID = 1L; }; ...
java
private Object readResolve() throws ObjectStreamException { try { return create(hostname, cookieValue); } catch (final IOException | GeneralSecurityException e) { throw new ObjectStreamException(e.getMessage()) { /** Serialization index. **/ private static final long serialVersionUID = 1L; }; ...
[ "private", "Object", "readResolve", "(", ")", "throws", "ObjectStreamException", "{", "try", "{", "return", "create", "(", "hostname", ",", "cookieValue", ")", ";", "}", "catch", "(", "final", "IOException", "|", "GeneralSecurityException", "e", ")", "{", "thr...
Custom deserialization processing method that create a new valid {@link HttpRequestExecutor} instance from the internally stored cookie value. @return Valid {@link HttpRequestExecutor} instance. @throws ObjectStreamException If any error occurs during deserialization process.
[ "Custom", "deserialization", "processing", "method", "that", "create", "a", "new", "valid", "{", "@link", "HttpRequestExecutor", "}", "instance", "from", "the", "internally", "stored", "cookie", "value", "." ]
84a5fed4e049dca48994dc3f70213976aaff4bd3
https://github.com/Faylixe/googlecodejam-client/blob/84a5fed4e049dca48994dc3f70213976aaff4bd3/src/main/java/fr/faylixe/googlecodejam/client/executor/HttpRequestExecutor.java#L164-L176
train
Reads the object from the cookie value.
Of course, here is the Java code you requested: ```java private Object readResolve() throws ObjectStreamException { try { return create(hostname, cookieValue); } catch (final IOException | GeneralSecurityException e) { throw new ObjectStreamException(e.getMessage()) { /** Serialization index. **/ ...
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/TermWalkers.java
TermWalkers.positionalPostfixWalker
public static TermWalker positionalPostfixWalker(PositionalTermVisitor visitor) { PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl(); positionalTraverser.setContextChangeVisitor(visitor); visitor.setPositionalTraverser(positionalTraverser); return new Te...
java
public static TermWalker positionalPostfixWalker(PositionalTermVisitor visitor) { PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl(); positionalTraverser.setContextChangeVisitor(visitor); visitor.setPositionalTraverser(positionalTraverser); return new Te...
[ "public", "static", "TermWalker", "positionalPostfixWalker", "(", "PositionalTermVisitor", "visitor", ")", "{", "PositionalTermTraverser", "positionalTraverser", "=", "new", "PositionalTermTraverserImpl", "(", ")", ";", "positionalTraverser", ".", "setContextChangeVisitor", "...
Provides a positional postfix walk over a term. @param visitor The visitor to apply to each term, and to notify of positional context changes. @return A positional postfix first walk over a term.
[ "Provides", "a", "positional", "postfix", "walk", "over", "a", "term", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/TermWalkers.java#L122-L129
test
Create a term walker that walks a sequence of terms using a post - fix search.
Of course, here is the Java code you requested: ```java public static TermWalker positionalPostfixWalker(PositionalTermVisitor visitor) { PositionalTermTraverser positionalTraverser = new PositionalTermTraverserImpl(); positionalTraverser.setContextChangeVisitor(visitor); visitor.setPositio...
bwkimmel/java-util
src/main/java/ca/eandb/util/LongArray.java
LongArray.addAll
public boolean addAll(LongArray items) { ensureCapacity(size + items.size); for (int i = 0; i < items.size; i++) { elements[size++] = items.elements[i]; } return items.size > 0; }
java
public boolean addAll(LongArray items) { ensureCapacity(size + items.size); for (int i = 0; i < items.size; i++) { elements[size++] = items.elements[i]; } return items.size > 0; }
[ "public", "boolean", "addAll", "(", "LongArray", "items", ")", "{", "ensureCapacity", "(", "size", "+", "items", ".", "size", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "items", ".", "size", ";", "i", "++", ")", "{", "elements", "...
Appends a range of values to the end of this array. @param items The values to append. @return A value indicating if the array has changed.
[ "Appends", "a", "range", "of", "values", "to", "the", "end", "of", "this", "array", "." ]
0c03664d42f0e6b111f64447f222aa73c2819e5c
https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/LongArray.java#L362-L368
train
Adds all the elements of the specified long array to this array.
Of course, here is the Java code you requested: ```java public boolean addAll(LongArray items) { ensureCapacity(size + items.size); for (int i = 0; i < items.size; i++) { elements[size++] = items.elements[i]; } return items.size > 0; } ``` Hope this helps!
rey5137/material
material/src/main/java/com/rey/material/widget/SnackBar.java
SnackBar.show
public void show(Activity activity){ show((ViewGroup)activity.getWindow().findViewById(Window.ID_ANDROID_CONTENT)); }
java
public void show(Activity activity){ show((ViewGroup)activity.getWindow().findViewById(Window.ID_ANDROID_CONTENT)); }
[ "public", "void", "show", "(", "Activity", "activity", ")", "{", "show", "(", "(", "ViewGroup", ")", "activity", ".", "getWindow", "(", ")", ".", "findViewById", "(", "Window", ".", "ID_ANDROID_CONTENT", ")", ")", ";", "}" ]
Show this SnackBar. It will auto attach to the activity's root view. @param activity
[ "Show", "this", "SnackBar", ".", "It", "will", "auto", "attach", "to", "the", "activity", "s", "root", "view", "." ]
1bbcac2686a0023ef7720d3fe455bb116d115af8
https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/widget/SnackBar.java#L755-L757
train
Show the application.
Of course, here is the Java code you requested: ```java public void show(Activity activity){ show((ViewGroup)activity.getWindow().findViewById(Window.ID_ANDROID_CONTENT)); } ``` Hope this helps!
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
ClassReader.readExportsFlags
Set<ExportsFlag> readExportsFlags(int flags) { Set<ExportsFlag> set = EnumSet.noneOf(ExportsFlag.class); for (ExportsFlag f: ExportsFlag.values()) { if ((flags & f.value) != 0) set.add(f); } return set; }
java
Set<ExportsFlag> readExportsFlags(int flags) { Set<ExportsFlag> set = EnumSet.noneOf(ExportsFlag.class); for (ExportsFlag f: ExportsFlag.values()) { if ((flags & f.value) != 0) set.add(f); } return set; }
[ "Set", "<", "ExportsFlag", ">", "readExportsFlags", "(", "int", "flags", ")", "{", "Set", "<", "ExportsFlag", ">", "set", "=", "EnumSet", ".", "noneOf", "(", "ExportsFlag", ".", "class", ")", ";", "for", "(", "ExportsFlag", "f", ":", "ExportsFlag", ".", ...
Read exports_flags.
[ "Read", "exports_flags", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L607-L614
train
Read the flags of the export file.
Of course, here is the Java code you requested: ```java Set<ExportsFlag> readExportsFlags(int flags) { Set<ExportsFlag> set = EnumSet.noneOf(ExportsFlag.class); for (ExportsFlag f: ExportsFlag.values()) { if ((flags & f.value) != 0) set.add(f); } return set; ...
Unidata/thredds
ldm/src/main/thredds/ldm/MessageBroker.java
MessageBroker.process
private int process(Buffer b, InputStream is) throws IOException { int start = 0; while (start < b.have) { int matchPos = matcher.indexOf(b.buff, start, b.have - start); // didnt find "BUFR" match if (matchPos < 0) { if (start == 0) // discard all but last 3 bytes return b.h...
java
private int process(Buffer b, InputStream is) throws IOException { int start = 0; while (start < b.have) { int matchPos = matcher.indexOf(b.buff, start, b.have - start); // didnt find "BUFR" match if (matchPos < 0) { if (start == 0) // discard all but last 3 bytes return b.h...
[ "private", "int", "process", "(", "Buffer", "b", ",", "InputStream", "is", ")", "throws", "IOException", "{", "int", "start", "=", "0", ";", "while", "(", "start", "<", "b", ".", "have", ")", "{", "int", "matchPos", "=", "matcher", ".", "indexOf", "(...
return where in the buffer we got to.
[ "return", "where", "in", "the", "buffer", "we", "got", "to", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ldm/src/main/thredds/ldm/MessageBroker.java#L263-L335
test
Process the buffer b. have bytes and return the number of bytes that were processed.
Of course, here is the Java code you requested: ```java private int process(Buffer b, InputStream is) throws IOException { int start = 0; while (start < b.have) { int matchPos = matcher.indexOf(b.buff, start, b.have - start); // didnt find "BUFR" match if (matchPos < 0) { if (start =...
blackdoor/blackdoor
src/main/java/black/door/util/CSV.java
CSV.cacheFile
public void cacheFile() { if (orientation == Orientation.INV) cache = new String[fields][elements]; else cache = new String[elements][fields]; int x = 0, y = 0; Scanner file = null; try { file = new Scanner(csvFile); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.pri...
java
public void cacheFile() { if (orientation == Orientation.INV) cache = new String[fields][elements]; else cache = new String[elements][fields]; int x = 0, y = 0; Scanner file = null; try { file = new Scanner(csvFile); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.pri...
[ "public", "void", "cacheFile", "(", ")", "{", "if", "(", "orientation", "==", "Orientation", ".", "INV", ")", "cache", "=", "new", "String", "[", "fields", "]", "[", "elements", "]", ";", "else", "cache", "=", "new", "String", "[", "elements", "]", "...
load the entire CSV file into memory for much faster access subsequent use of getField will not use file access and will occur in constant time
[ "load", "the", "entire", "CSV", "file", "into", "memory", "for", "much", "faster", "access", "subsequent", "use", "of", "getField", "will", "not", "use", "file", "access", "and", "will", "occur", "in", "constant", "time" ]
060c7a71dfafb85e10e8717736e6d3160262e96b
https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/util/CSV.java#L58-L86
train
This method is used to cache the CSV file.
Of course, here is the Java code you requested: ```java public void cacheFile() { if (orientation == Orientation.INV) cache = new String[fields][elements]; else cache = new String[elements][fields]; int x = 0, y = 0; Scanner file = null; try { file = new Scanner(csvFile); } catch (FileNotFoundExce...
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionManager.java
RaftSessionManager.close
public CompletableFuture<Void> close() { if (open.compareAndSet(true, false)) { CompletableFuture<Void> future = new CompletableFuture<>(); threadContext.execute(() -> { synchronized (this) { for (Scheduled keepAliveFuture : keepAliveTimers.values()) { keepAliveFuture.cance...
java
public CompletableFuture<Void> close() { if (open.compareAndSet(true, false)) { CompletableFuture<Void> future = new CompletableFuture<>(); threadContext.execute(() -> { synchronized (this) { for (Scheduled keepAliveFuture : keepAliveTimers.values()) { keepAliveFuture.cance...
[ "public", "CompletableFuture", "<", "Void", ">", "close", "(", ")", "{", "if", "(", "open", ".", "compareAndSet", "(", "true", ",", "false", ")", ")", "{", "CompletableFuture", "<", "Void", ">", "future", "=", "new", "CompletableFuture", "<>", "(", ")", ...
Closes the session manager. @return A completable future to be completed once the session manager is closed.
[ "Closes", "the", "session", "manager", "." ]
3a94b7c80576d762dd0d396d4645df07a0b37c31
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionManager.java#L442-L457
train
Closes the server.
Of course, here is the Java code you requested: ```java public CompletableFuture<Void> close() { if (open.compareAndSet(true, false)) { CompletableFuture<Void> future = new CompletableFuture<>(); threadContext.execute(() -> { synchronized (this) { for (Scheduled keepAliveFuture : keep...
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java
Retryer.fibonacciWait
public Retryer<R> fibonacciWait(final long multiplier, final long maximumWait) { return withWaitStrategy(new WaitStrategy() { @Override public long computeSleepTime(int previousAttemptNumber, long delaySinceFirstAttemptInMillis) { long fib = fib(previousAttem...
java
public Retryer<R> fibonacciWait(final long multiplier, final long maximumWait) { return withWaitStrategy(new WaitStrategy() { @Override public long computeSleepTime(int previousAttemptNumber, long delaySinceFirstAttemptInMillis) { long fib = fib(previousAttem...
[ "public", "Retryer", "<", "R", ">", "fibonacciWait", "(", "final", "long", "multiplier", ",", "final", "long", "maximumWait", ")", "{", "return", "withWaitStrategy", "(", "new", "WaitStrategy", "(", ")", "{", "@", "Override", "public", "long", "computeSleepTim...
Sets the wait strategy which sleeps for an increasing amount of time after the first failed attempt, and in Fibonacci increments after each failed attempt up to the {@code maximumTime}. The wait time between the retries can be controlled by the multiplier. nextWaitTime = fibonacciIncrement * {@code multiplier}. @param...
[ "Sets", "the", "wait", "strategy", "which", "sleeps", "for", "an", "increasing", "amount", "of", "time", "after", "the", "first", "failed", "attempt", "and", "in", "Fibonacci", "increments", "after", "each", "failed", "attempt", "up", "to", "the", "{", "@cod...
7585152e10e4cac07b4274c65f1c72ad7061ae69
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java#L570-L602
train
Creates a retryer that sleeps for a specified number of milliseconds after a specified number of times.
Of course, here is the Java code you requested: ```java public Retryer<R> fibonacciWait(final long multiplier, final long maximumWait) { return withWaitStrategy(new WaitStrategy() { @Override public long computeSleepTime(int previousAttemptNumber, long delaySinceFirstAttemp...
eurekaclinical/protempa
protempa-framework/src/main/java/org/protempa/LowLevelAbstractionFinder.java
LowLevelAbstractionFinder.firstSegment
private static Segment<PrimitiveParameter> firstSegment( PatternFinderUser def, Sequence<PrimitiveParameter> sequence, Algorithm algorithm, int maxPatternLength) { int size = sequence.size(); int minPatternLength = minPatternLength(algorithm, def); if (size > 0 && size >=...
java
private static Segment<PrimitiveParameter> firstSegment( PatternFinderUser def, Sequence<PrimitiveParameter> sequence, Algorithm algorithm, int maxPatternLength) { int size = sequence.size(); int minPatternLength = minPatternLength(algorithm, def); if (size > 0 && size >=...
[ "private", "static", "Segment", "<", "PrimitiveParameter", ">", "firstSegment", "(", "PatternFinderUser", "def", ",", "Sequence", "<", "PrimitiveParameter", ">", "sequence", ",", "Algorithm", "algorithm", ",", "int", "maxPatternLength", ")", "{", "int", "size", "=...
Return the first segment of the given sequence to be searched by the given <code>PatternFinderUser</code>. If the minimum and maximum pattern lengths of the <code>PatternFinderUser</code> are unset, the first segment will be the entire sequence. @param def a <code>PatternFinderUser</code> object. @param sequence a <co...
[ "Return", "the", "first", "segment", "of", "the", "given", "sequence", "to", "be", "searched", "by", "the", "given", "<code", ">", "PatternFinderUser<", "/", "code", ">", ".", "If", "the", "minimum", "and", "maximum", "pattern", "lengths", "of", "the", "<c...
5a620d1a407c7a5426d1cf17d47b97717cf71634
https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/LowLevelAbstractionFinder.java#L62-L77
train
Method to reset the first segment of a sequence.
Of course, here is the Java code you requested: ```java private static Segment<PrimitiveParameter> firstSegment( PatternFinderUser def, Sequence<PrimitiveParameter> sequence, Algorithm algorithm, int maxPatternLength) { int size = sequence.size(); int minPatternLength = minPatte...
molgenis/molgenis
molgenis-api-data/src/main/java/org/molgenis/api/data/v1/SortV1.java
SortV1.and
public SortV1 and(SortV1 sort) { if (sort == null) { return this; } ArrayList<OrderV1> these = new ArrayList<>(this.orders); for (OrderV1 order : sort) { these.add(order); } return new SortV1(these); }
java
public SortV1 and(SortV1 sort) { if (sort == null) { return this; } ArrayList<OrderV1> these = new ArrayList<>(this.orders); for (OrderV1 order : sort) { these.add(order); } return new SortV1(these); }
[ "public", "SortV1", "and", "(", "SortV1", "sort", ")", "{", "if", "(", "sort", "==", "null", ")", "{", "return", "this", ";", "}", "ArrayList", "<", "OrderV1", ">", "these", "=", "new", "ArrayList", "<>", "(", "this", ".", "orders", ")", ";", "for"...
Returns a new {@link SortV1} consisting of the {@link OrderV1}s of the current {@link SortV1} combined with the given ones. @param sort can be {@literal null}.
[ "Returns", "a", "new", "{", "@link", "SortV1", "}", "consisting", "of", "the", "{", "@link", "OrderV1", "}", "s", "of", "the", "current", "{", "@link", "SortV1", "}", "combined", "with", "the", "given", "ones", "." ]
b4d0d6b27e6f6c8d7505a3863dc03b589601f987
https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-api-data/src/main/java/org/molgenis/api/data/v1/SortV1.java#L105-L118
train
Returns a new Sort object containing the order of the two terms.
Of course, here is the Java code you requested: ```java public SortV1 and(SortV1 sort) { if (sort == null) { return this; } ArrayList<OrderV1> these = new ArrayList<>(this.orders); for (OrderV1 order : sort) { these.add(order); } return new SortV1(these); } ``` Hope this help...
jcodec/jcodec
src/main/java/org/jcodec/codecs/h264/decode/SliceHeaderReader.java
SliceHeaderReader.readDecoderPicMarking
private static void readDecoderPicMarking(NALUnit nalUnit, SliceHeader sh, BitReader _in) { if (nalUnit.type == NALUnitType.IDR_SLICE) { boolean noOutputOfPriorPicsFlag = readBool(_in, "SH: no_output_of_prior_pics_flag"); boolean longTermReferenceFlag = readBool(_in, "SH: long_term_refer...
java
private static void readDecoderPicMarking(NALUnit nalUnit, SliceHeader sh, BitReader _in) { if (nalUnit.type == NALUnitType.IDR_SLICE) { boolean noOutputOfPriorPicsFlag = readBool(_in, "SH: no_output_of_prior_pics_flag"); boolean longTermReferenceFlag = readBool(_in, "SH: long_term_refer...
[ "private", "static", "void", "readDecoderPicMarking", "(", "NALUnit", "nalUnit", ",", "SliceHeader", "sh", ",", "BitReader", "_in", ")", "{", "if", "(", "nalUnit", ".", "type", "==", "NALUnitType", ".", "IDR_SLICE", ")", "{", "boolean", "noOutputOfPriorPicsFlag"...
static int i = 0;
[ "static", "int", "i", "=", "0", ";" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/decode/SliceHeaderReader.java#L143-L189
test
readDecoderPicMarking Method.
Of course, here is the Java code you requested: ```java private static void readDecoderPicMarking(NALUnit nalUnit, SliceHeader sh, BitReader _in) { if (nalUnit.type == NALUnitType.IDR_SLICE) { boolean noOutputOfPriorPicsFlag = readBool(_in, "SH: no_output_of_prior_pics_flag"); boolean l...
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getCharacterEquipment
public void getCharacterEquipment(String API, String name, Callback<CharacterEquipment> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); gw2API.getCharacterEquipment(name, API).enqueue(callback); }
java
public void getCharacterEquipment(String API, String name, Callback<CharacterEquipment> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); gw2API.getCharacterEquipment(name, API).enqueue(callback); }
[ "public", "void", "getCharacterEquipment", "(", "String", "API", ",", "String", "name", ",", "Callback", "<", "CharacterEquipment", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker", "...
For more info on character equipment API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Equipment">here</a><br/> @param API API key @param name name of character @param callback callback that is going to be used for {@link Call#enqueue(Callback)} @throws GuildWars2Exception invalid API key | e...
[ "For", "more", "info", "on", "character", "equipment", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "characters#Equipment", ">", "here<", "/", "a", ">", "<br", "/",...
c8a43b51f363b032074fb152ee6efe657e33e525
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L751-L754
train
Get Character Equipment
Of course, here is the Java code you requested: ```java public void getCharacterEquipment(String API, String name, Callback<CharacterEquipment> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); gw2API.getCharacte...
fuinorg/units4j
src/main/java/org/fuin/units4j/assertionrules/Utils.java
Utils.findOverrideMethods
public static List<MethodInfo> findOverrideMethods(final Index index, final MethodInfo method) { return findOverrideMethods(index, method.declaringClass(), method, 0); }
java
public static List<MethodInfo> findOverrideMethods(final Index index, final MethodInfo method) { return findOverrideMethods(index, method.declaringClass(), method, 0); }
[ "public", "static", "List", "<", "MethodInfo", ">", "findOverrideMethods", "(", "final", "Index", "index", ",", "final", "MethodInfo", "method", ")", "{", "return", "findOverrideMethods", "(", "index", ",", "method", ".", "declaringClass", "(", ")", ",", "meth...
Returns a list of all methods the given one overrides. Such methods can be found in interfaces and super classes. @param index Index with all known classes. @param method Method signature to find. @return List of methods the given one overrides.
[ "Returns", "a", "list", "of", "all", "methods", "the", "given", "one", "overrides", ".", "Such", "methods", "can", "be", "found", "in", "interfaces", "and", "super", "classes", "." ]
29383e30b0f9c246b309e734df9cc63dc5d5499e
https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/assertionrules/Utils.java#L122-L126
train
Find all methods that override a managed base class.
Of course, here is the Java code you requested: ```java public static List<MethodInfo> findOverrideMethods(final Index index, final MethodInfo method) { return findOverrideMethods(index, method.declaringClass(), method, 0); } ``` Hope this helps!
ReactiveX/RxJavaJoins
src/main/java/rx/joins/Pattern4.java
Pattern4.and
public <T5> Pattern5<T1, T2, T3, T4, T5> and(Observable<T5> other) { if (other == null) { throw new NullPointerException(); } return new Pattern5<T1, T2, T3, T4, T5>(o1, o2, o3, o4, other); }
java
public <T5> Pattern5<T1, T2, T3, T4, T5> and(Observable<T5> other) { if (other == null) { throw new NullPointerException(); } return new Pattern5<T1, T2, T3, T4, T5>(o1, o2, o3, o4, other); }
[ "public", "<", "T5", ">", "Pattern5", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ">", "and", "(", "Observable", "<", "T5", ">", "other", ")", "{", "if", "(", "other", "==", "null", ")", "{", "throw", "new", "NullPointerException", "("...
Creates a pattern that matches when all four observable sequences have an available element. @param other Observable sequence to match with the three previous sequences. @return Pattern object that matches when all observable sequences have an available element.
[ "Creates", "a", "pattern", "that", "matches", "when", "all", "four", "observable", "sequences", "have", "an", "available", "element", "." ]
65b5c7fa03bd375c9e1f7906d7143068fde9b714
https://github.com/ReactiveX/RxJavaJoins/blob/65b5c7fa03bd375c9e1f7906d7143068fde9b714/src/main/java/rx/joins/Pattern4.java#L65-L70
train
Create a pattern that matches when both observable sequences have been combined.
Of course, here is the Java code you requested: ```java public <T5> Pattern5<T1, T2, T3, T4, T5> and(Observable<T5> other) { if (other == null) { throw new NullPointerException(); } return new Pattern5<T1, T2, T3, T4, T5>(o1, o2, o3, o4, other); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java
Configuration.setAccessController
public static final void setAccessController(AccessController mgr) { if (tc.isEntryEnabled()) Tr.entry(tc, "setAccessController", mgr); _accessController = mgr; if (tc.isEntryEnabled()) Tr.exit(tc, "setAccessController"); }
java
public static final void setAccessController(AccessController mgr) { if (tc.isEntryEnabled()) Tr.entry(tc, "setAccessController", mgr); _accessController = mgr; if (tc.isEntryEnabled()) Tr.exit(tc, "setAccessController"); }
[ "public", "static", "final", "void", "setAccessController", "(", "AccessController", "mgr", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"setAccessController\"", ",", "mgr", ")", ";", "_accessControll...
---------------------------------------------------------------------------
[ "---------------------------------------------------------------------------" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Configuration.java#L666-L673
train
Set the access controller for this class.
Of course, here is the Java code you requested: ```java public static final void setAccessController(AccessController mgr) { if (tc.isEntryEnabled()) Tr.entry(tc, "setAccessController", mgr); _accessController = mgr; if (tc.isEntryEnabled()) Tr.exit(tc, "setAccessCon...
aws/aws-sdk-java
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/DescribeDBParameterGroupsResult.java
DescribeDBParameterGroupsResult.withDBParameterGroups
public DescribeDBParameterGroupsResult withDBParameterGroups(DBParameterGroup... dBParameterGroups) { if (this.dBParameterGroups == null) { setDBParameterGroups(new com.amazonaws.internal.SdkInternalList<DBParameterGroup>(dBParameterGroups.length)); } for (DBParameterGroup ele : dBPa...
java
public DescribeDBParameterGroupsResult withDBParameterGroups(DBParameterGroup... dBParameterGroups) { if (this.dBParameterGroups == null) { setDBParameterGroups(new com.amazonaws.internal.SdkInternalList<DBParameterGroup>(dBParameterGroups.length)); } for (DBParameterGroup ele : dBPa...
[ "public", "DescribeDBParameterGroupsResult", "withDBParameterGroups", "(", "DBParameterGroup", "...", "dBParameterGroups", ")", "{", "if", "(", "this", ".", "dBParameterGroups", "==", "null", ")", "{", "setDBParameterGroups", "(", "new", "com", ".", "amazonaws", ".", ...
<p> A list of <a>DBParameterGroup</a> instances. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setDBParameterGroups(java.util.Collection)} or {@link #withDBParameterGroups(java.util.Collection)} if you want to override the existing values. </p> @param dBParameterGroups...
[ "<p", ">", "A", "list", "of", "<a", ">", "DBParameterGroup<", "/", "a", ">", "instances", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing", "list...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/DescribeDBParameterGroupsResult.java#L137-L145
train
Sets the value of the dBParameterGroups property.
Of course, here is the Java code you requested: ```java public DescribeDBParameterGroupsResult withDBParameterGroups(DBParameterGroup... dBParameterGroups) { if (this.dBParameterGroups == null) { setDBParameterGroups(new com.amazonaws.internal.SdkInternalList<DBParameterGroup>(dBParameterGroups.len...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java
Ifc4PackageImpl.getIfcMassPerLengthMeasure
@Override public EClass getIfcMassPerLengthMeasure() { if (ifcMassPerLengthMeasureEClass == null) { ifcMassPerLengthMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(837); } return ifcMassPerLengthMeasureEClass; }
java
@Override public EClass getIfcMassPerLengthMeasure() { if (ifcMassPerLengthMeasureEClass == null) { ifcMassPerLengthMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(837); } return ifcMassPerLengthMeasureEClass; }
[ "@", "Override", "public", "EClass", "getIfcMassPerLengthMeasure", "(", ")", "{", "if", "(", "ifcMassPerLengthMeasureEClass", "==", "null", ")", "{", "ifcMassPerLengthMeasureEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getE...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java#L41168-L41175
train
Get the IfcMassPerLengthMeasure feature from the IFCMassPerLengthMeasure.
Of course, here is the Java code you requested: ```java @Override public EClass getIfcMassPerLengthMeasure() { if (ifcMassPerLengthMeasureEClass == null) { ifcMassPerLengthMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(837); } return ifc...
needle4j/needle4j
src/main/java/org/needle4j/db/operation/AbstractDBOperation.java
AbstractDBOperation.closeConnection
protected void closeConnection() throws SQLException { if (connection != null && !connection.isClosed()) { connection.close(); connection = null; } }
java
protected void closeConnection() throws SQLException { if (connection != null && !connection.isClosed()) { connection.close(); connection = null; } }
[ "protected", "void", "closeConnection", "(", ")", "throws", "SQLException", "{", "if", "(", "connection", "!=", "null", "&&", "!", "connection", ".", "isClosed", "(", ")", ")", "{", "connection", ".", "close", "(", ")", ";", "connection", "=", "null", ";...
Close the connection to the database. @throws SQLException if a database access error occurs
[ "Close", "the", "connection", "to", "the", "database", "." ]
55fbcdeed72be5cf26e4404b0fe40282792b51f2
https://github.com/needle4j/needle4j/blob/55fbcdeed72be5cf26e4404b0fe40282792b51f2/src/main/java/org/needle4j/db/operation/AbstractDBOperation.java#L65-L71
train
Close the connection.
Of course, here is the Java code you requested: ```java protected void closeConnection() throws SQLException { if (connection != null && !connection.isClosed()) { connection.close(); connection = null; } } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/EBSOptionsStatusMarshaller.java
EBSOptionsStatusMarshaller.marshall
public void marshall(EBSOptionsStatus eBSOptionsStatus, ProtocolMarshaller protocolMarshaller) { if (eBSOptionsStatus == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(eBSOptionsStatus.getOptions(), ...
java
public void marshall(EBSOptionsStatus eBSOptionsStatus, ProtocolMarshaller protocolMarshaller) { if (eBSOptionsStatus == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(eBSOptionsStatus.getOptions(), ...
[ "public", "void", "marshall", "(", "EBSOptionsStatus", "eBSOptionsStatus", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "eBSOptionsStatus", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshall(....
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/EBSOptionsStatusMarshaller.java#L44-L56
train
marshalls the given EBSOptionsStatus object to the JSON - compatible parameter object.
Of course, here is the Java code you requested: ```java public void marshall(EBSOptionsStatus eBSOptionsStatus, ProtocolMarshaller protocolMarshaller) { if (eBSOptionsStatus == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { pr...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java
AfplibPackageImpl.getGDD
public EClass getGDD() { if (gddEClass == null) { gddEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(271); } return gddEClass; }
java
public EClass getGDD() { if (gddEClass == null) { gddEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(271); } return gddEClass; }
[ "public", "EClass", "getGDD", "(", ")", "{", "if", "(", "gddEClass", "==", "null", ")", "{", "gddEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "AfplibPackage", ".", "eNS_URI", ")", ".", "getEClas...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java#L6553-L6558
train
Get the GDD.
Of course, here is the Java code you requested: ```java public EClass getGDD() { if (gddEClass == null) { gddEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(271); } return gddEClass; } ``` Hope this helps!
linkedin/linkedin-utils
org.linkedin.util-core/src/main/java/org/linkedin/util/reflect/ReflectUtils.java
ReflectUtils.extractAllInterfaces
public static Class[] extractAllInterfaces(Object o) { Set<Class> interfaces = new LinkedHashSet<Class>(); Class c = o.getClass(); do { interfaces.addAll(Arrays.asList(c.getInterfaces())); c = c.getSuperclass(); } while(c != null); return interfaces.toArray(new Class[interfac...
java
public static Class[] extractAllInterfaces(Object o) { Set<Class> interfaces = new LinkedHashSet<Class>(); Class c = o.getClass(); do { interfaces.addAll(Arrays.asList(c.getInterfaces())); c = c.getSuperclass(); } while(c != null); return interfaces.toArray(new Class[interfac...
[ "public", "static", "Class", "[", "]", "extractAllInterfaces", "(", "Object", "o", ")", "{", "Set", "<", "Class", ">", "interfaces", "=", "new", "LinkedHashSet", "<", "Class", ">", "(", ")", ";", "Class", "c", "=", "o", ".", "getClass", "(", ")", ";"...
Utility which extract the interfaces implemented by o: it goes up the chain of inheritance to find all the interfaces. @param o @return all the interfaces implemented by o
[ "Utility", "which", "extract", "the", "interfaces", "implemented", "by", "o", ":", "it", "goes", "up", "the", "chain", "of", "inheritance", "to", "find", "all", "the", "interfaces", "." ]
ca097410b537fb09847c42037593c0f474c0571f
https://github.com/linkedin/linkedin-utils/blob/ca097410b537fb09847c42037593c0f474c0571f/org.linkedin.util-core/src/main/java/org/linkedin/util/reflect/ReflectUtils.java#L282-L295
valid
Extract all interfaces from an object
Of course, here is the Java code you requested: ```java public static Class[] extractAllInterfaces(Object o) { Set<Class> interfaces = new LinkedHashSet<Class>(); Class c = o.getClass(); do { interfaces.addAll(Arrays.asList(c.getInterfaces())); c = c.getSuperclass(); } while(c !=...
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java
StructureTools.extractAtoms
private static void extractAtoms(String[] atomNames, List<Chain> chains, List<Atom> atoms) { for (Chain c : chains) { for (Group g : c.getAtomGroups()) { // a temp container for the atoms of this group List<Atom> thisGroupAtoms = new ArrayList<Atom>(); // flag to check if this group contains all ...
java
private static void extractAtoms(String[] atomNames, List<Chain> chains, List<Atom> atoms) { for (Chain c : chains) { for (Group g : c.getAtomGroups()) { // a temp container for the atoms of this group List<Atom> thisGroupAtoms = new ArrayList<Atom>(); // flag to check if this group contains all ...
[ "private", "static", "void", "extractAtoms", "(", "String", "[", "]", "atomNames", ",", "List", "<", "Chain", ">", "chains", ",", "List", "<", "Atom", ">", "atoms", ")", "{", "for", "(", "Chain", "c", ":", "chains", ")", "{", "for", "(", "Group", "...
Adds to the given atoms list, all atoms of groups that contained all requested atomNames, i.e. if a group does not contain all of the requested atom names, its atoms won't be added. @param atomNames @param chains @param atoms
[ "Adds", "to", "the", "given", "atoms", "list", "all", "atoms", "of", "groups", "that", "contained", "all", "requested", "atomNames", "i", ".", "e", ".", "if", "a", "group", "does", "not", "contain", "all", "of", "the", "requested", "atom", "names", "its"...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L780-L810
train
Extract the atoms of a list of chains from a list of chains.
Of course, here is the Java code you requested: ```java private static void extractAtoms(String[] atomNames, List<Chain> chains, List<Atom> atoms) { for (Chain c : chains) { for (Group g : c.getAtomGroups()) { // a temp container for the atoms of this group List<Atom> thisGroupAtoms = new ArrayList<...
reactor/reactor-core
reactor-core/src/main/java/reactor/util/function/Tuples.java
Tuples.fn6
public static <T1, T2, T3, T4, T5, T6, R> Function<Object[], R> fn6(final Function<Tuple6<T1, T2, T3, T4, T5, T6>, R> delegate) { return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6>fn6().apply(objects)); }
java
public static <T1, T2, T3, T4, T5, T6, R> Function<Object[], R> fn6(final Function<Tuple6<T1, T2, T3, T4, T5, T6>, R> delegate) { return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6>fn6().apply(objects)); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ",", "T6", ",", "R", ">", "Function", "<", "Object", "[", "]", ",", "R", ">", "fn6", "(", "final", "Function", "<", "Tuple6", "<", "T1", ",", "T2", ",", "T3", ",", "...
A converting function from Object array to {@link Tuple6} to R. @param <T1> The type of the first value. @param <T2> The type of the second value. @param <T3> The type of the third value. @param <T4> The type of the fourth value. @param <T5> The type of the fifth value. @param <T6> The type of the sixth value. @param ...
[ "A", "converting", "function", "from", "Object", "array", "to", "{", "@link", "Tuple6", "}", "to", "R", "." ]
df2eba4ab7d2393e1a942ce972c3307fbbd47ff9
https://github.com/reactor/reactor-core/blob/df2eba4ab7d2393e1a942ce972c3307fbbd47ff9/reactor-core/src/main/java/reactor/util/function/Tuples.java#L383-L385
valid
Wrap a function with a tuple.
Of course, here is the Java code you requested: ```java public static <T1, T2, T3, T4, T5, T6, R> Function<Object[], R> fn6(final Function<Tuple6<T1, T2, T3, T4, T5, T6>, R> delegate) { return objects -> delegate.apply(Tuples.<T1, T2, T3, T4, T5, T6>fn6().apply(objects)); } ``` Hope this helps!
BBN-E/bue-common-open
gnuplot-util/src/main/java/com/bbn/bue/gnuplot/NormalGrid.java
NormalGrid.appendPlotCommands
@Override public void appendPlotCommands(PlotBundle.Builder sb) { sb.append("set grid "); sb.append(yesNo(showXMajor)).append("xtics "); sb.append(yesNo(showXMinor)).append("mxtics "); sb.append(yesNo(showYMajor)).append("ytics "); sb.append(yesNo(showYMinor)).append("mytics "); sb.append(zIn...
java
@Override public void appendPlotCommands(PlotBundle.Builder sb) { sb.append("set grid "); sb.append(yesNo(showXMajor)).append("xtics "); sb.append(yesNo(showXMinor)).append("mxtics "); sb.append(yesNo(showYMajor)).append("ytics "); sb.append(yesNo(showYMinor)).append("mytics "); sb.append(zIn...
[ "@", "Override", "public", "void", "appendPlotCommands", "(", "PlotBundle", ".", "Builder", "sb", ")", "{", "sb", ".", "append", "(", "\"set grid \"", ")", ";", "sb", ".", "append", "(", "yesNo", "(", "showXMajor", ")", ")", ".", "append", "(", "\"xtics ...
/* set grid {{no}{m}xtics} {{no}{m}ytics} {{no}{m}ztics} {{no}{m}x2tics} {{no}{m}y2tics} {{no}{m}cbtics} {polar {<angle>}} {layerdefault | front | back} { {linestyle <major_linestyle>} | {linetype | lt <major_linetype>} {linewidth | lw <major_linewidth>} { , {linestyle | ls <minor_linestyle>} | {linetype | lt <minor...
[ "/", "*", "set", "grid", "{{", "no", "}", "{", "m", "}", "xtics", "}", "{{", "no", "}", "{", "m", "}", "ytics", "}", "{{", "no", "}", "{", "m", "}", "ztics", "}", "{{", "no", "}", "{", "m", "}", "x2tics", "}", "{{", "no", "}", "{", "m",...
d618652674d647867306e2e4b987a21b7c29c015
https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/gnuplot-util/src/main/java/com/bbn/bue/gnuplot/NormalGrid.java#L45-L58
train
Append the plot commands to the plot bundle.
Of course, here is the Java code you requested: ```java @Override public void appendPlotCommands(PlotBundle.Builder sb) { sb.append("set grid "); sb.append(yesNo(showXMajor)).append("xtics "); sb.append(yesNo(showXMinor)).append("mxtics "); sb.append(yesNo(showYMajor)).append("ytics "); sb.append...
nmorel/gwt-jackson
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/stream/impl/NonBufferedJsonReader.java
NonBufferedJsonReader.nextUnquotedValue
@SuppressWarnings("fallthrough") private String nextUnquotedValue() { int i = 0; findNonLiteralCharacter: for (; pos + i < limit; i++) { switch (in.charAt(pos + i)) { case '/': case '\\': case ';': case '#': case '=': checkLenient(); // fall-through cas...
java
@SuppressWarnings("fallthrough") private String nextUnquotedValue() { int i = 0; findNonLiteralCharacter: for (; pos + i < limit; i++) { switch (in.charAt(pos + i)) { case '/': case '\\': case ';': case '#': case '=': checkLenient(); // fall-through cas...
[ "@", "SuppressWarnings", "(", "\"fallthrough\"", ")", "private", "String", "nextUnquotedValue", "(", ")", "{", "int", "i", "=", "0", ";", "findNonLiteralCharacter", ":", "for", "(", ";", "pos", "+", "i", "<", "limit", ";", "i", "++", ")", "{", "switch", ...
Returns an unquoted value as a string.
[ "Returns", "an", "unquoted", "value", "as", "a", "string", "." ]
3fdc4350a27a9b64fc437d5fe516bf9191b74824
https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/stream/impl/NonBufferedJsonReader.java#L979-L1011
train
Returns the next unquoted value.
Of course, here is the Java code you requested: ```java @SuppressWarnings("fallthrough") private String nextUnquotedValue() { int i = 0; findNonLiteralCharacter: for (; pos + i < limit; i++) { switch (in.charAt(pos + i)) { case '/': case '\\': case ';': case '#': ca...
qos-ch/slf4j
slf4j-api/src/main/java/org/slf4j/helpers/BasicMDCAdapter.java
BasicMDCAdapter.clear
public void clear() { Map<String, String> map = inheritableThreadLocal.get(); if (map != null) { map.clear(); inheritableThreadLocal.remove(); } }
java
public void clear() { Map<String, String> map = inheritableThreadLocal.get(); if (map != null) { map.clear(); inheritableThreadLocal.remove(); } }
[ "public", "void", "clear", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "map", "=", "inheritableThreadLocal", ".", "get", "(", ")", ";", "if", "(", "map", "!=", "null", ")", "{", "map", ".", "clear", "(", ")", ";", "inheritableThreadLocal...
Clear all entries in the MDC.
[ "Clear", "all", "entries", "in", "the", "MDC", "." ]
905443f39fadd88a8dd2c467e44affd8cb072a4d
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-api/src/main/java/org/slf4j/helpers/BasicMDCAdapter.java#L106-L112
train
Clear the cache.
Of course, here is the Java code you requested: ```java public void clear() { Map<String, String> map = inheritableThreadLocal.get(); if (map != null) { map.clear(); inheritableThreadLocal.remove(); } } ``` Hope this helps!
james-hu/jabb-core
src/main/java/net/sf/jabb/camel/XmlSocketUtility.java
XmlSocketUtility.stripTopLevelTag
static public String stripTopLevelTag(String xmlString){ return xmlString.substring(xmlString.indexOf('>') + 1, xmlString.lastIndexOf('<')); }
java
static public String stripTopLevelTag(String xmlString){ return xmlString.substring(xmlString.indexOf('>') + 1, xmlString.lastIndexOf('<')); }
[ "static", "public", "String", "stripTopLevelTag", "(", "String", "xmlString", ")", "{", "return", "xmlString", ".", "substring", "(", "xmlString", ".", "indexOf", "(", "'", "'", ")", "+", "1", ",", "xmlString", ".", "lastIndexOf", "(", "'", "'", ")", ")"...
Strips off the top level tag from XML string.<br> 从XML字符串中去掉最上层的Tag。 @param xmlString The XMl string to be processed @return The result string with top level tag removed.
[ "Strips", "off", "the", "top", "level", "tag", "from", "XML", "string", ".", "<br", ">", "从XML字符串中去掉最上层的Tag。" ]
bceed441595c5e5195a7418795f03b69fa7b61e4
https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/camel/XmlSocketUtility.java#L104-L106
train
Strip the top level tag from the given XML string.
Of course, here is the Java code you requested: ```java static public String stripTopLevelTag(String xmlString){ return xmlString.substring(xmlString.indexOf('>') + 1, xmlString.lastIndexOf('<')); } ``` Hope this helps!
cdk/cdk
app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java
Abbreviations.matchExact
private IQueryAtomContainer matchExact(IAtomContainer mol) { final IChemObjectBuilder bldr = mol.getBuilder(); final IQueryAtomContainer qry = new QueryAtomContainer(mol.getBuilder()); final Map<IAtom, IAtom> atmmap = new HashMap<>(); for (IAtom atom : mol.atoms()) { IAtom q...
java
private IQueryAtomContainer matchExact(IAtomContainer mol) { final IChemObjectBuilder bldr = mol.getBuilder(); final IQueryAtomContainer qry = new QueryAtomContainer(mol.getBuilder()); final Map<IAtom, IAtom> atmmap = new HashMap<>(); for (IAtom atom : mol.atoms()) { IAtom q...
[ "private", "IQueryAtomContainer", "matchExact", "(", "IAtomContainer", "mol", ")", "{", "final", "IChemObjectBuilder", "bldr", "=", "mol", ".", "getBuilder", "(", ")", ";", "final", "IQueryAtomContainer", "qry", "=", "new", "QueryAtomContainer", "(", "mol", ".", ...
Internal - create a query atom container that exactly matches the molecule provided. Similar to {@link org.openscience.cdk.isomorphism.matchers.QueryAtomContainerCreator} but we can't access SMARTS query classes from that module (cdk-isomorphism). @param mol molecule @return query container @see org.openscience.cdk.is...
[ "Internal", "-", "create", "a", "query", "atom", "container", "that", "exactly", "matches", "the", "molecule", "provided", ".", "Similar", "to", "{", "@link", "org", ".", "openscience", ".", "cdk", ".", "isomorphism", ".", "matchers", ".", "QueryAtomContainerC...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java#L729-L755
train
Match atom container with exact match.
Of course, here is the Java code you requested: ```java private IQueryAtomContainer matchExact(IAtomContainer mol) { final IChemObjectBuilder bldr = mol.getBuilder(); final IQueryAtomContainer qry = new QueryAtomContainer(mol.getBuilder()); final Map<IAtom, IAtom> atmmap = new HashMap<>(); ...
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java
LocalWeightedHistogramRotRect.createSamplePoints
protected void createSamplePoints(int numSamples) { for( int y = 0; y < numSamples; y++ ) { float regionY = (y/(numSamples-1.0f) - 0.5f); for( int x = 0; x < numSamples; x++ ) { float regionX = (x/(numSamples-1.0f) - 0.5f); samplePts.add( new Point2D_F32(regionX,regionY)); } } }
java
protected void createSamplePoints(int numSamples) { for( int y = 0; y < numSamples; y++ ) { float regionY = (y/(numSamples-1.0f) - 0.5f); for( int x = 0; x < numSamples; x++ ) { float regionX = (x/(numSamples-1.0f) - 0.5f); samplePts.add( new Point2D_F32(regionX,regionY)); } } }
[ "protected", "void", "createSamplePoints", "(", "int", "numSamples", ")", "{", "for", "(", "int", "y", "=", "0", ";", "y", "<", "numSamples", ";", "y", "++", ")", "{", "float", "regionY", "=", "(", "y", "/", "(", "numSamples", "-", "1.0f", ")", "-"...
create the list of points in square coordinates that it will sample. values will range from -0.5 to 0.5 along each axis.
[ "create", "the", "list", "of", "points", "in", "square", "coordinates", "that", "it", "will", "sample", ".", "values", "will", "range", "from", "-", "0", ".", "5", "to", "0", ".", "5", "along", "each", "axis", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/LocalWeightedHistogramRotRect.java#L117-L126
train
Creates the sample points.
Of course, here is the Java code you requested: ```java protected void createSamplePoints(int numSamples) { for( int y = 0; y < numSamples; y++ ) { float regionY = (y/(numSamples-1.0f) - 0.5f); for( int x = 0; x < numSamples; x++ ) { float regionX = (x/(numSamples-1.0f) - 0.5f); samplePts.add( new Po...
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java
FileUtilities.readFileToHashMap
public static LinkedHashMap<String, String> readFileToHashMap( String filePath, String separator, boolean valueFirst ) throws IOException { if (separator == null) { separator = "="; } List<String> lines = readFileToLinesList(filePath); LinkedHashMap<String, String...
java
public static LinkedHashMap<String, String> readFileToHashMap( String filePath, String separator, boolean valueFirst ) throws IOException { if (separator == null) { separator = "="; } List<String> lines = readFileToLinesList(filePath); LinkedHashMap<String, String...
[ "public", "static", "LinkedHashMap", "<", "String", ",", "String", ">", "readFileToHashMap", "(", "String", "filePath", ",", "String", "separator", ",", "boolean", "valueFirst", ")", "throws", "IOException", "{", "if", "(", "separator", "==", "null", ")", "{",...
Method to read a properties file into a {@link LinkedHashMap}. <p/> <p>Empty lines are ignored, as well as lines that do not contain the separator.</p> @param filePath the path to the file to read. @param separator the separator or <code>null</code>. Defaults to '='. @param valueFirst if <code>true</code>, the seco...
[ "Method", "to", "read", "a", "properties", "file", "into", "a", "{", "@link", "LinkedHashMap", "}", ".", "<p", "/", ">", "<p", ">", "Empty", "lines", "are", "ignored", "as", "well", "as", "lines", "that", "do", "not", "contain", "the", "separator", "."...
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L373-L405
train
Read a file to LinkedHashMap.
Of course, here is the Java code you requested: ```java public static LinkedHashMap<String, String> readFileToHashMap( String filePath, String separator, boolean valueFirst ) throws IOException { if (separator == null) { separator = "="; } List<String> lines = readFileTo...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java
AfplibPackageImpl.getMediumOrientation
public EClass getMediumOrientation() { if (mediumOrientationEClass == null) { mediumOrientationEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(362); } return mediumOrientationEClass; }
java
public EClass getMediumOrientation() { if (mediumOrientationEClass == null) { mediumOrientationEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(362); } return mediumOrientationEClass; }
[ "public", "EClass", "getMediumOrientation", "(", ")", "{", "if", "(", "mediumOrientationEClass", "==", "null", ")", "{", "mediumOrientationEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "AfplibPackage", "...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java#L10012-L10017
train
Get the medium orientation.
Of course, here is the Java code you requested: ```java public EClass getMediumOrientation() { if (mediumOrientationEClass == null) { mediumOrientationEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(362); } return mediumOrientationEClass; } ``` Hope this ...
strator-dev/greenpepper
greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/rpc/xmlrpc/GreenPepperXmlRpcServer.java
GreenPepperXmlRpcServer.getSpecificationRepositoriesOfAssociatedProject
public Vector<Object> getSpecificationRepositoriesOfAssociatedProject(Vector<Object> repositoryParams) { try { Repository repository = loadRepository( repositoryParams ); Collection<Repository> repositories = service.getSpecificationRepositoriesOfAssociatedProject(repository...
java
public Vector<Object> getSpecificationRepositoriesOfAssociatedProject(Vector<Object> repositoryParams) { try { Repository repository = loadRepository( repositoryParams ); Collection<Repository> repositories = service.getSpecificationRepositoriesOfAssociatedProject(repository...
[ "public", "Vector", "<", "Object", ">", "getSpecificationRepositoriesOfAssociatedProject", "(", "Vector", "<", "Object", ">", "repositoryParams", ")", "{", "try", "{", "Repository", "repository", "=", "loadRepository", "(", "repositoryParams", ")", ";", "Collection", ...
{@inheritDoc}
[ "{" ]
2a61e6c179b74085babcc559d677490b0cad2d30
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/rpc/xmlrpc/GreenPepperXmlRpcServer.java#L315-L330
train
Retrieve Test Repositories of Associated Project.
Of course, here is the Java code you requested: ```java public Vector<Object> getSpecificationRepositoriesOfAssociatedProject(Vector<Object> repositoryParams) { try { Repository repository = loadRepository( repositoryParams ); Collection<Repository> repositories = service.g...
google/guava
guava/src/com/google/common/collect/Collections2.java
Collections2.isPermutation
private static boolean isPermutation(List<?> first, List<?> second) { if (first.size() != second.size()) { return false; } Multiset<?> firstMultiset = HashMultiset.create(first); Multiset<?> secondMultiset = HashMultiset.create(second); return firstMultiset.equals(secondMultiset); }
java
private static boolean isPermutation(List<?> first, List<?> second) { if (first.size() != second.size()) { return false; } Multiset<?> firstMultiset = HashMultiset.create(first); Multiset<?> secondMultiset = HashMultiset.create(second); return firstMultiset.equals(secondMultiset); }
[ "private", "static", "boolean", "isPermutation", "(", "List", "<", "?", ">", "first", ",", "List", "<", "?", ">", "second", ")", "{", "if", "(", "first", ".", "size", "(", ")", "!=", "second", ".", "size", "(", ")", ")", "{", "return", "false", "...
Returns {@code true} if the second list is a permutation of the first.
[ "Returns", "{" ]
7155d12b70a2406fa84d94d4b8b3bc108e89abfd
https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/guava/src/com/google/common/collect/Collections2.java#L686-L693
valid
Checks if two lists are permutation.
Of course, here is the Java code you requested: ```java private static boolean isPermutation(List<?> first, List<?> second) { if (first.size() != second.size()) { return false; } Multiset<?> firstMultiset = HashMultiset.create(first); Multiset<?> secondMultiset = HashMultiset.create(second); ...
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/StringUtils.java
StringUtils.parseCommandLineArguments
@SuppressWarnings("unchecked") public static Map<String, String> parseCommandLineArguments(String[] args) { return (Map)parseCommandLineArguments(args, false); }
java
@SuppressWarnings("unchecked") public static Map<String, String> parseCommandLineArguments(String[] args) { return (Map)parseCommandLineArguments(args, false); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "Map", "<", "String", ",", "String", ">", "parseCommandLineArguments", "(", "String", "[", "]", "args", ")", "{", "return", "(", "Map", ")", "parseCommandLineArguments", "(", "args", ",", ...
A simpler form of command line argument parsing. Dan thinks this is highly superior to the overly complexified code that comes before it. Parses command line arguments into a Map. Arguments of the form -flag1 arg1 -flag2 -flag3 arg3 will be parsed so that the flag is a key in the Map (including the hyphen) and the opti...
[ "A", "simpler", "form", "of", "command", "line", "argument", "parsing", ".", "Dan", "thinks", "this", "is", "highly", "superior", "to", "the", "overly", "complexified", "code", "that", "comes", "before", "it", ".", "Parses", "command", "line", "arguments", "...
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L993-L996
train
Parse command line arguments.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static Map<String, String> parseCommandLineArguments(String[] args) { return (Map)parseCommandLineArguments(args, false); } ``` Hope this helps!
lambdazen/bitsy
src/main/java/com/lambdazen/bitsy/store/AdjacencyMapForBeans.java
AdjacencyMapForBeans.removeEdgeWithoutCallback
protected void removeEdgeWithoutCallback(EdgeBean eBean) { if (eBean == null) { return; } // Update in and out vertices VertexBean outV = eBean.outVertex; VertexBean inV = eBean.inVertex; outV.outEdges = removeEdgeFromAdjList(outV.outEdges, eBean); // Compac...
java
protected void removeEdgeWithoutCallback(EdgeBean eBean) { if (eBean == null) { return; } // Update in and out vertices VertexBean outV = eBean.outVertex; VertexBean inV = eBean.inVertex; outV.outEdges = removeEdgeFromAdjList(outV.outEdges, eBean); // Compac...
[ "protected", "void", "removeEdgeWithoutCallback", "(", "EdgeBean", "eBean", ")", "{", "if", "(", "eBean", "==", "null", ")", "{", "return", ";", "}", "// Update in and out vertices", "VertexBean", "outV", "=", "eBean", ".", "outVertex", ";", "VertexBean", "inV",...
This method removes the edges without calling edgeRemover.removeEdge()
[ "This", "method", "removes", "the", "edges", "without", "calling", "edgeRemover", ".", "removeEdge", "()" ]
c0dd4b6c9d6dc9987d0168c91417eb04d80bf712
https://github.com/lambdazen/bitsy/blob/c0dd4b6c9d6dc9987d0168c91417eb04d80bf712/src/main/java/com/lambdazen/bitsy/store/AdjacencyMapForBeans.java#L56-L67
train
Remove an edge from the graph without the callback.
Of course, here is the Java code you requested: ```java protected void removeEdgeWithoutCallback(EdgeBean eBean) { if (eBean == null) { return; } // Update in and out vertices VertexBean outV = eBean.outVertex; VertexBean inV = eBean.inVertex; outV.outEdges...
forge/javaee-descriptors
impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm21/AttributesImpl.java
AttributesImpl.getOrCreateEmbeddedId
public EmbeddedId<Attributes<T>> getOrCreateEmbeddedId() { Node node = childNode.getOrCreate("embedded-id"); EmbeddedId<Attributes<T>> embeddedId = new EmbeddedIdImpl<Attributes<T>>(this, "embedded-id", childNode, node); return embeddedId; }
java
public EmbeddedId<Attributes<T>> getOrCreateEmbeddedId() { Node node = childNode.getOrCreate("embedded-id"); EmbeddedId<Attributes<T>> embeddedId = new EmbeddedIdImpl<Attributes<T>>(this, "embedded-id", childNode, node); return embeddedId; }
[ "public", "EmbeddedId", "<", "Attributes", "<", "T", ">", ">", "getOrCreateEmbeddedId", "(", ")", "{", "Node", "node", "=", "childNode", ".", "getOrCreate", "(", "\"embedded-id\"", ")", ";", "EmbeddedId", "<", "Attributes", "<", "T", ">", ">", "embeddedId", ...
If not already created, a new <code>embedded-id</code> element with the given value will be created. Otherwise, the existing <code>embedded-id</code> element will be returned. @return a new or existing instance of <code>EmbeddedId<Attributes<T>></code>
[ "If", "not", "already", "created", "a", "new", "<code", ">", "embedded", "-", "id<", "/", "code", ">", "element", "with", "the", "given", "value", "will", "be", "created", ".", "Otherwise", "the", "existing", "<code", ">", "embedded", "-", "id<", "/", ...
cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed
https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm21/AttributesImpl.java#L157-L162
train
Get the embedded - id attribute.
Of course, here is the Java code you requested: ```java public EmbeddedId<Attributes<T>> getOrCreateEmbeddedId() { Node node = childNode.getOrCreate("embedded-id"); EmbeddedId<Attributes<T>> embeddedId = new EmbeddedIdImpl<Attributes<T>>(this, "embedded-id", childNode, node); return embeddedId; ...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java
HashCodeBuilder.reflectionHashCode
public static int reflectionHashCode(final Object object, final boolean testTransients) { return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, testTransients, null); }
java
public static int reflectionHashCode(final Object object, final boolean testTransients) { return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, testTransients, null); }
[ "public", "static", "int", "reflectionHashCode", "(", "final", "Object", "object", ",", "final", "boolean", "testTransients", ")", "{", "return", "reflectionHashCode", "(", "DEFAULT_INITIAL_VALUE", ",", "DEFAULT_MULTIPLIER_VALUE", ",", "object", ",", "testTransients", ...
<p> Uses reflection to build a valid hash code from the fields of {@code object}. </p> <p> This constructor uses two hard coded choices for the constants needed to build a hash code. </p> <p> It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will throw a security...
[ "<p", ">", "Uses", "reflection", "to", "build", "a", "valid", "hash", "code", "from", "the", "fields", "of", "{", "@code", "object", "}", ".", "<", "/", "p", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java#L380-L383
train
Get the hashCode of the given object.
Of course, here is the Java code you requested: ```java public static int reflectionHashCode(final Object object, final boolean testTransients) { return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, testTransients, null); } ``` Hope this helps!