repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
google/guice
core/src/com/google/inject/spi/Message.java
Message.writeReplace
private Object writeReplace() throws ObjectStreamException { Object[] sourcesAsStrings = sources.toArray(); for (int i = 0; i < sourcesAsStrings.length; i++) { sourcesAsStrings[i] = Errors.convert(sourcesAsStrings[i]).toString(); } return new Message(ImmutableList.copyOf(sourcesAsStrings), message...
java
private Object writeReplace() throws ObjectStreamException { Object[] sourcesAsStrings = sources.toArray(); for (int i = 0; i < sourcesAsStrings.length; i++) { sourcesAsStrings[i] = Errors.convert(sourcesAsStrings[i]).toString(); } return new Message(ImmutableList.copyOf(sourcesAsStrings), message...
[ "private", "Object", "writeReplace", "(", ")", "throws", "ObjectStreamException", "{", "Object", "[", "]", "sourcesAsStrings", "=", "sources", ".", "toArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "sourcesAsStrings", ".", "length"...
When serialized, we eagerly convert sources to strings. This hurts our formatting, but it guarantees that the receiving end will be able to read the message.
[ "When", "serialized", "we", "eagerly", "convert", "sources", "to", "strings", ".", "This", "hurts", "our", "formatting", "but", "it", "guarantees", "that", "the", "receiving", "end", "will", "be", "able", "to", "read", "the", "message", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/spi/Message.java#L131-L137
test
Write replace.
Of course, here is the Java code you requested: ```java private Object writeReplace() throws ObjectStreamException { Object[] sourcesAsStrings = sources.toArray(); for (int i = 0; i < sourcesAsStrings.length; i++) { sourcesAsStrings[i] = Errors.convert(sourcesAsStrings[i]).toString(); } return ne...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java
FeatureStyleExtension.getIcon
public IconRow getIcon(FeatureRow featureRow, GeometryType geometryType) { return getIcon(featureRow.getTable().getTableName(), featureRow.getId(), geometryType); }
java
public IconRow getIcon(FeatureRow featureRow, GeometryType geometryType) { return getIcon(featureRow.getTable().getTableName(), featureRow.getId(), geometryType); }
[ "public", "IconRow", "getIcon", "(", "FeatureRow", "featureRow", ",", "GeometryType", "geometryType", ")", "{", "return", "getIcon", "(", "featureRow", ".", "getTable", "(", ")", ".", "getTableName", "(", ")", ",", "featureRow", ".", "getId", "(", ")", ",", ...
Get the icon of the feature row with the provided geometry type, searching in order: feature geometry type icon, feature default icon, table geometry type icon, table default icon @param featureRow feature row @param geometryType geometry type @return icon row
[ "Get", "the", "icon", "of", "the", "feature", "row", "with", "the", "provided", "geometry", "type", "searching", "in", "order", ":", "feature", "geometry", "type", "icon", "feature", "default", "icon", "table", "geometry", "type", "icon", "table", "default", ...
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java#L588-L591
test
Get the icon for a feature row
Of course, here is the Java code you requested: ```java public IconRow getIcon(FeatureRow featureRow, GeometryType geometryType) { return getIcon(featureRow.getTable().getTableName(), featureRow.getId(), geometryType); } ``` Hope this helps!
streamsets/datacollector
commonlib/src/main/java/com/streamsets/pipeline/lib/io/FileLine.java
FileLine.getText
public String getText() { if (line == null) { line = new String(buffer, offsetInChunk, length, charset); } return line; }
java
public String getText() { if (line == null) { line = new String(buffer, offsetInChunk, length, charset); } return line; }
[ "public", "String", "getText", "(", ")", "{", "if", "(", "line", "==", "null", ")", "{", "line", "=", "new", "String", "(", "buffer", ",", "offsetInChunk", ",", "length", ",", "charset", ")", ";", "}", "return", "line", ";", "}" ]
Returns the text of the line. @return the text of the line.
[ "Returns", "the", "text", "of", "the", "line", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/commonlib/src/main/java/com/streamsets/pipeline/lib/io/FileLine.java#L57-L62
test
Get the text of the file.
Of course, here is the Java code you requested: ```java public String getText() { if (line == null) { line = new String(buffer, offsetInChunk, length, charset); } return line; } ``` Hope this helps!
arnohaase/a-foundation
a-foundation/src/main/java/com/ajjpj/afoundation/io/AJsonSerHelper.java
AJsonSerHelper.buildString
public static <E extends Throwable> String buildString (AStatement1<AJsonSerHelper, E> code) throws E { final ByteArrayOutputStream baos = new ByteArrayOutputStream (); code.apply (new AJsonSerHelper (baos)); return new String (baos.toByteArray (), UTF_8); }
java
public static <E extends Throwable> String buildString (AStatement1<AJsonSerHelper, E> code) throws E { final ByteArrayOutputStream baos = new ByteArrayOutputStream (); code.apply (new AJsonSerHelper (baos)); return new String (baos.toByteArray (), UTF_8); }
[ "public", "static", "<", "E", "extends", "Throwable", ">", "String", "buildString", "(", "AStatement1", "<", "AJsonSerHelper", ",", "E", ">", "code", ")", "throws", "E", "{", "final", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", "...
This is a convenience method for building simple JSON strings. It passes an AJsonSerHelper to a callback and builds a string based on what the callback does with it.
[ "This", "is", "a", "convenience", "method", "for", "building", "simple", "JSON", "strings", ".", "It", "passes", "an", "AJsonSerHelper", "to", "a", "callback", "and", "builds", "a", "string", "based", "on", "what", "the", "callback", "does", "with", "it", ...
f3eef2ca89d67775f202a4c28140230a6229291e
https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/io/AJsonSerHelper.java#L190-L194
test
Build a string from a statement.
Of course, here is the Java code you requested: ```java public static <E extends Throwable> String buildString (AStatement1<AJsonSerHelper, E> code) throws E { final ByteArrayOutputStream baos = new ByteArrayOutputStream (); code.apply (new AJsonSerHelper (baos)); return new String (baos.toByte...
phax/ph-genericode
src/main/java/com/helger/genericode/builder/GenericodeValidator.java
GenericodeValidator.gc10ColumnSet
@Nonnull public static GenericodeValidator <com.helger.genericode.v10.ColumnSetDocument> gc10ColumnSet () { return new GenericodeValidator<> (EGenericodeDocumentType.GC10_COLUMN_SET); }
java
@Nonnull public static GenericodeValidator <com.helger.genericode.v10.ColumnSetDocument> gc10ColumnSet () { return new GenericodeValidator<> (EGenericodeDocumentType.GC10_COLUMN_SET); }
[ "@", "Nonnull", "public", "static", "GenericodeValidator", "<", "com", ".", "helger", ".", "genericode", ".", "v10", ".", "ColumnSetDocument", ">", "gc10ColumnSet", "(", ")", "{", "return", "new", "GenericodeValidator", "<>", "(", "EGenericodeDocumentType", ".", ...
Create a validator builder for com.helger.genericode.v10.ColumnSetDocument. @return The builder and never <code>null</code>
[ "Create", "a", "validator", "builder", "for", "com", ".", "helger", ".", "genericode", ".", "v10", ".", "ColumnSetDocument", "." ]
76ef5bb0744af42bd3decd41c2bf0829c87ae71d
https://github.com/phax/ph-genericode/blob/76ef5bb0744af42bd3decd41c2bf0829c87ae71d/src/main/java/com/helger/genericode/builder/GenericodeValidator.java#L101-L105
test
Create a new validation for the CGC10 column set.
Of course, here is the Java code you requested: ```java @Nonnull public static GenericodeValidator <com.helger.genericode.v10.ColumnSetDocument> gc10ColumnSet () { return new GenericodeValidator<> (EGenericodeDocumentType.GC10_COLUMN_SET); } ``` Hope this helps!
streamsets/datacollector
kinetica_6_2-lib/src/main/java/com/streamsets/pipeline/stage/kinetica/KineticaHelper.java
KineticaHelper.createBulkInserter
private BulkInserter<IndexedRecord> createBulkInserter(GPUdb gpudb, Type type, KineticaConfigBean conf) throws GPUdbException { KineticaBulkInserterUtils kineticaBulkInserterUtils = new KineticaBulkInserterUtils(gpudb, type, conf); return kineticaBulkInserterUtils.createBulkInserter(); }
java
private BulkInserter<IndexedRecord> createBulkInserter(GPUdb gpudb, Type type, KineticaConfigBean conf) throws GPUdbException { KineticaBulkInserterUtils kineticaBulkInserterUtils = new KineticaBulkInserterUtils(gpudb, type, conf); return kineticaBulkInserterUtils.createBulkInserter(); }
[ "private", "BulkInserter", "<", "IndexedRecord", ">", "createBulkInserter", "(", "GPUdb", "gpudb", ",", "Type", "type", ",", "KineticaConfigBean", "conf", ")", "throws", "GPUdbException", "{", "KineticaBulkInserterUtils", "kineticaBulkInserterUtils", "=", "new", "Kineti...
Create a BulkInserter
[ "Create", "a", "BulkInserter" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/kinetica_6_2-lib/src/main/java/com/streamsets/pipeline/stage/kinetica/KineticaHelper.java#L104-L108
test
Create bulk inference
Of course, here is the Java code you requested: ```java private BulkInserter<IndexedRecord> createBulkInserter(GPUdb gpudb, Type type, KineticaConfigBean conf) throws GPUdbException { KineticaBulkInserterUtils kineticaBulkInserterUtils = new KineticaBulkInserterUtils(gpudb, type, conf); return kineticaBu...
jboss/jboss-common-core
src/main/java/org/jboss/util/xml/catalog/Resolver.java
Resolver.resolveAllSystemReverse
public Vector resolveAllSystemReverse(String systemId) throws MalformedURLException, IOException { Vector resolved = new Vector(); // If there's a SYSTEM entry in this catalog, use it if (systemId != null) { Vector localResolved = resolveLocalSystemReverse(systemId); resolved = appendVector(resolved, loc...
java
public Vector resolveAllSystemReverse(String systemId) throws MalformedURLException, IOException { Vector resolved = new Vector(); // If there's a SYSTEM entry in this catalog, use it if (systemId != null) { Vector localResolved = resolveLocalSystemReverse(systemId); resolved = appendVector(resolved, loc...
[ "public", "Vector", "resolveAllSystemReverse", "(", "String", "systemId", ")", "throws", "MalformedURLException", ",", "IOException", "{", "Vector", "resolved", "=", "new", "Vector", "(", ")", ";", "// If there's a SYSTEM entry in this catalog, use it", "if", "(", "syst...
Find the URNs for a given system identifier in all catalogs. @param systemId The system ID to locate. @throws MalformedURLException @throws IOException @return A vector of URNs that map to the systemId.
[ "Find", "the", "URNs", "for", "a", "given", "system", "identifier", "in", "all", "catalogs", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Resolver.java#L431-L448
test
Resolves all system reverse catalogs.
Of course, here is the Java code you requested: ```java public Vector resolveAllSystemReverse(String systemId) throws MalformedURLException, IOException { Vector resolved = new Vector(); // If there's a SYSTEM entry in this catalog, use it if (systemId != null) { Vector localResolved = resolveLocalSystemReve...
google/guice
core/src/com/google/inject/internal/ProvisionListenerCallbackStore.java
ProvisionListenerCallbackStore.create
private <T> ProvisionListenerStackCallback<T> create(Binding<T> binding) { List<ProvisionListener> listeners = null; for (ProvisionListenerBinding provisionBinding : listenerBindings) { if (provisionBinding.getBindingMatcher().matches(binding)) { if (listeners == null) { listeners = List...
java
private <T> ProvisionListenerStackCallback<T> create(Binding<T> binding) { List<ProvisionListener> listeners = null; for (ProvisionListenerBinding provisionBinding : listenerBindings) { if (provisionBinding.getBindingMatcher().matches(binding)) { if (listeners == null) { listeners = List...
[ "private", "<", "T", ">", "ProvisionListenerStackCallback", "<", "T", ">", "create", "(", "Binding", "<", "T", ">", "binding", ")", "{", "List", "<", "ProvisionListener", ">", "listeners", "=", "null", ";", "for", "(", "ProvisionListenerBinding", "provisionBin...
Creates a new {@link ProvisionListenerStackCallback} with the correct listeners for the key.
[ "Creates", "a", "new", "{" ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/ProvisionListenerCallbackStore.java#L95-L111
test
Create a new instance of the ProvisionListenerStackCallback class.
Of course, here is the Java code you requested: ```java private <T> ProvisionListenerStackCallback<T> create(Binding<T> binding) { List<ProvisionListener> listeners = null; for (ProvisionListenerBinding provisionBinding : listenerBindings) { if (provisionBinding.getBindingMatcher().matches(binding)) { ...
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/vo/sqlutil/sqlnative/NativeSQLQuery.java
NativeSQLQuery.addSqlInput
@XmlTransient public void addSqlInput(SQLColumn sqlInputToAddParam){ if(this.sqlInputs == null){ this.sqlInputs = new ArrayList<>(); } if(sqlInputToAddParam == null){ return; } this.sqlInputs.add(sqlInputToAddParam); }
java
@XmlTransient public void addSqlInput(SQLColumn sqlInputToAddParam){ if(this.sqlInputs == null){ this.sqlInputs = new ArrayList<>(); } if(sqlInputToAddParam == null){ return; } this.sqlInputs.add(sqlInputToAddParam); }
[ "@", "XmlTransient", "public", "void", "addSqlInput", "(", "SQLColumn", "sqlInputToAddParam", ")", "{", "if", "(", "this", ".", "sqlInputs", "==", "null", ")", "{", "this", ".", "sqlInputs", "=", "new", "ArrayList", "<>", "(", ")", ";", "}", "if", "(", ...
Add a SQL input parameter. If the sql inputs is {@code null}, a new instance of {@code ArrayList} will be created prior to adding the parameter. @param sqlInputToAddParam The SQL Input to add. @see SQLColumn
[ "Add", "a", "SQL", "input", "parameter", ".", "If", "the", "sql", "inputs", "is", "{", "@code", "null", "}", "a", "new", "instance", "of", "{", "@code", "ArrayList", "}", "will", "be", "created", "prior", "to", "adding", "the", "parameter", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/sqlutil/sqlnative/NativeSQLQuery.java#L267-L278
test
Add a SQLInput to the SQL table.
Of course, here is the Java code you requested: ```java @XmlTransient public void addSqlInput(SQLColumn sqlInputToAddParam){ if(this.sqlInputs == null){ this.sqlInputs = new ArrayList<>(); } if(sqlInputToAddParam == null){ return; } this.sqlInputs.a...
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/projection/LatLonProjection.java
LatLonProjection.latLonToProj
public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex) { int cnt = from[0].length; double[] toX = to[INDEX_X]; double[] toY = to[INDEX_Y]; double[] fromLat = from[latIndex]; double[] fromLon = from[lonIndex]; double lat,...
java
public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex) { int cnt = from[0].length; double[] toX = to[INDEX_X]; double[] toY = to[INDEX_Y]; double[] fromLat = from[latIndex]; double[] fromLon = from[lonIndex]; double lat,...
[ "public", "double", "[", "]", "[", "]", "latLonToProj", "(", "double", "[", "]", "[", "]", "from", ",", "double", "[", "]", "[", "]", "to", ",", "int", "latIndex", ",", "int", "lonIndex", ")", "{", "int", "cnt", "=", "from", "[", "0", "]", ".",...
Convert lat/lon coordinates to projection coordinates. @param from array of lat/lon coordinates: from[2][n], where (from[latIndex][i], from[lonIndex][i]) is the (lat,lon) coordinate of the ith point @param to resulting array of projection coordinates: to[2][n] where (to[0][i], to[1][i]) is the (x,y) coordina...
[ "Convert", "lat", "/", "lon", "coordinates", "to", "projection", "coordinates", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/LatLonProjection.java#L248-L263
test
Converts a list of latitude and longitude coordinates from the array of latitude and longitude coordinates to the array of longitude coordinates.
Of course, here is the Java code you requested: ```java public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex) { int cnt = from[0].length; double[] toX = to[INDEX_X]; double[] toY = to[INDEX_Y]; double[] fromLat = from[latIndex];...
haducloc/appslandia-common
src/main/java/com/appslandia/common/jdbc/StatementImpl.java
StatementImpl.executeLargeUpdate
@Override public long executeLargeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException { return this.stat.executeLargeUpdate(sql, columnIndexes); }
java
@Override public long executeLargeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException { return this.stat.executeLargeUpdate(sql, columnIndexes); }
[ "@", "Override", "public", "long", "executeLargeUpdate", "(", "java", ".", "lang", ".", "String", "sql", ",", "int", "[", "]", "columnIndexes", ")", "throws", "java", ".", "sql", ".", "SQLException", "{", "return", "this", ".", "stat", ".", "executeLargeUp...
java.sql.Statement
[ "java", ".", "sql", ".", "Statement" ]
41dc9b0e1dd4fa86a9ad03627f70cbee61e74061
https://github.com/haducloc/appslandia-common/blob/41dc9b0e1dd4fa86a9ad03627f70cbee61e74061/src/main/java/com/appslandia/common/jdbc/StatementImpl.java#L1243-L1246
test
Override this method to implement the standard SQL Statement interface.
Of course, here is the Java code you requested: ```java @Override public long executeLargeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException { return this.stat.executeLargeUpdate(sql, columnIndexes); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/internal/observers/BasicFuseableObserver.java
BasicFuseableObserver.onSubscribe
@SuppressWarnings("unchecked") @Override public final void onSubscribe(Disposable d) { if (DisposableHelper.validate(this.upstream, d)) { this.upstream = d; if (d instanceof QueueDisposable) { this.qd = (QueueDisposable<T>)d; } if (before...
java
@SuppressWarnings("unchecked") @Override public final void onSubscribe(Disposable d) { if (DisposableHelper.validate(this.upstream, d)) { this.upstream = d; if (d instanceof QueueDisposable) { this.qd = (QueueDisposable<T>)d; } if (before...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "final", "void", "onSubscribe", "(", "Disposable", "d", ")", "{", "if", "(", "DisposableHelper", ".", "validate", "(", "this", ".", "upstream", ",", "d", ")", ")", "{", "this", ...
final: fixed protocol steps to support fuseable and non-fuseable upstream
[ "final", ":", "fixed", "protocol", "steps", "to", "support", "fuseable", "and", "non", "-", "fuseable", "upstream" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/observers/BasicFuseableObserver.java#L54-L72
test
On subscribe.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public final void onSubscribe(Disposable d) { if (DisposableHelper.validate(this.upstream, d)) { this.upstream = d; if (d instanceof QueueDisposable) { this.qd = (Qu...
orientechnologies/orientdb
distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ODatabaseDocumentDistributed.java
ODatabaseDocumentDistributed.commit2pc
public boolean commit2pc(ODistributedRequestId transactionId, boolean local) { getStorageDistributed().resetLastValidBackup(); ODistributedDatabase localDistributedDatabase = getStorageDistributed().getLocalDistributedDatabase(); ONewDistributedTxContextImpl txContext = (ONewDistributedTxContextImpl) local...
java
public boolean commit2pc(ODistributedRequestId transactionId, boolean local) { getStorageDistributed().resetLastValidBackup(); ODistributedDatabase localDistributedDatabase = getStorageDistributed().getLocalDistributedDatabase(); ONewDistributedTxContextImpl txContext = (ONewDistributedTxContextImpl) local...
[ "public", "boolean", "commit2pc", "(", "ODistributedRequestId", "transactionId", ",", "boolean", "local", ")", "{", "getStorageDistributed", "(", ")", ".", "resetLastValidBackup", "(", ")", ";", "ODistributedDatabase", "localDistributedDatabase", "=", "getStorageDistribut...
@param transactionId @return null returned means that commit failed
[ "@param", "transactionId" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ODatabaseDocumentDistributed.java#L670-L747
test
Commit the transaction with the given transactionId.
Of course, here is the Java code you requested: ```java public boolean commit2pc(ODistributedRequestId transactionId, boolean local) { getStorageDistributed().resetLastValidBackup(); ODistributedDatabase localDistributedDatabase = getStorageDistributed().getLocalDistributedDatabase(); ONewDistributedTxCon...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/Type.java
Type.getMethodType
public static Type getMethodType(final Type returnType, final Type... argumentTypes) { return getType(getMethodDescriptor(returnType, argumentTypes)); }
java
public static Type getMethodType(final Type returnType, final Type... argumentTypes) { return getType(getMethodDescriptor(returnType, argumentTypes)); }
[ "public", "static", "Type", "getMethodType", "(", "final", "Type", "returnType", ",", "final", "Type", "...", "argumentTypes", ")", "{", "return", "getType", "(", "getMethodDescriptor", "(", "returnType", ",", "argumentTypes", ")", ")", ";", "}" ]
Returns the method {@link Type} corresponding to the given argument and return types. @param returnType the return type of the method. @param argumentTypes the argument types of the method. @return the method {@link Type} corresponding to the given argument and return types.
[ "Returns", "the", "method", "{", "@link", "Type", "}", "corresponding", "to", "the", "given", "argument", "and", "return", "types", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Type.java#L274-L276
test
Gets the method type.
Of course, here is the Java code you requested: ```java public static Type getMethodType(final Type returnType, final Type... argumentTypes) { return getType(getMethodDescriptor(returnType, argumentTypes)); } ``` Hope this helps!
Unidata/thredds
dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java
CDMUtil.createSlices
static public List<Slice> createSlices(List<Range> rangelist) throws dap4.core.util.DapException { List<Slice> slices = new ArrayList<Slice>(rangelist.size()); for(int i = 0; i < rangelist.size(); i++) { Range r = rangelist.get(i); // r does not store last ...
java
static public List<Slice> createSlices(List<Range> rangelist) throws dap4.core.util.DapException { List<Slice> slices = new ArrayList<Slice>(rangelist.size()); for(int i = 0; i < rangelist.size(); i++) { Range r = rangelist.get(i); // r does not store last ...
[ "static", "public", "List", "<", "Slice", ">", "createSlices", "(", "List", "<", "Range", ">", "rangelist", ")", "throws", "dap4", ".", "core", ".", "util", ".", "DapException", "{", "List", "<", "Slice", ">", "slices", "=", "new", "ArrayList", "<", "S...
Convert a list of ucar.ma2.Range to a list of Slice More or less the inverst of create CDMRanges @param rangelist the set of ucar.ma2.Range @result the equivalent list of Slice
[ "Convert", "a", "list", "of", "ucar", ".", "ma2", ".", "Range", "to", "a", "list", "of", "Slice", "More", "or", "less", "the", "inverst", "of", "create", "CDMRanges" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java#L43-L59
test
Creates a list of slices from a list of ranges.
Of course, here is the Java code you requested: ```java static public List<Slice> createSlices(List<Range> rangelist) throws dap4.core.util.DapException { List<Slice> slices = new ArrayList<Slice>(rangelist.size()); for(int i = 0; i < rangelist.size(); i++) { Range r = r...
Unidata/thredds
legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java
NetcdfFileWriteable.deleteGlobalAttribute
public Attribute deleteGlobalAttribute(String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(attName); if (null == att) return null; rootGroup.remove(att); return att; }
java
public Attribute deleteGlobalAttribute(String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(attName); if (null == att) return null; rootGroup.remove(att); return att; }
[ "public", "Attribute", "deleteGlobalAttribute", "(", "String", "attName", ")", "{", "if", "(", "!", "defineMode", ")", "throw", "new", "UnsupportedOperationException", "(", "\"not in define mode\"", ")", ";", "Attribute", "att", "=", "findGlobalAttribute", "(", "att...
Delete a global Attribute. Must be in define mode. @param attName existing Attribute has this name @return deleted Attribute, or null if not found
[ "Delete", "a", "global", "Attribute", ".", "Must", "be", "in", "define", "mode", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java#L330-L337
test
Delete a global attribute.
Of course, here is the Java code you requested: ```java public Attribute deleteGlobalAttribute(String attName) { if (!defineMode) throw new UnsupportedOperationException("not in define mode"); Attribute att = findGlobalAttribute(attName); if (null == att) return null; rootGroup.remove(att); return...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java
GridHorizCoordSys.addGaussianLatAxis
private double[] addGaussianLatAxis(NetcdfFile ncfile, String name, String units, String desc, String standard_name, AxisType axis) { double np = gds.getDouble(GridDefRecord.NUMBERPARALLELS); if (Double.isNaN(np)) np = gds.getDouble("Np"); if (Double.isNaN(np)) t...
java
private double[] addGaussianLatAxis(NetcdfFile ncfile, String name, String units, String desc, String standard_name, AxisType axis) { double np = gds.getDouble(GridDefRecord.NUMBERPARALLELS); if (Double.isNaN(np)) np = gds.getDouble("Np"); if (Double.isNaN(np)) t...
[ "private", "double", "[", "]", "addGaussianLatAxis", "(", "NetcdfFile", "ncfile", ",", "String", "name", ",", "String", "units", ",", "String", "desc", ",", "String", "standard_name", ",", "AxisType", "axis", ")", "{", "double", "np", "=", "gds", ".", "get...
Add a gaussian lat axis @param ncfile netCDF file to add to @param name name of the axis @param units units @param desc description @param standard_name standard name @param axis axis type @return the values
[ "Add", "a", "gaussian", "lat", "axis" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java#L375-L450
test
Add Gaussian Lat Axis to the variable
Of course, here is the Java code you requested: ```java private double[] addGaussianLatAxis(NetcdfFile ncfile, String name, String units, String desc, String standard_name, AxisType axis) { double np = gds.getDouble(GridDefRecord.NUMBERPARALLELS); if (Double.isNaN(np)) np...
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/mathutils/RegressionLine.java
RegressionLine._validateCoefficients
private void _validateCoefficients () { if (m_bCoefsValid) return; if (m_nDataPoints >= 2) { final float xBar = (float) m_dSumX / m_nDataPoints; final float yBar = (float) m_dSumY / m_nDataPoints; m_fA1 = (float) ((m_nDataPoints * m_dSumXY - m_dSumX * m_dSumY) / (m_nDataPoints * ...
java
private void _validateCoefficients () { if (m_bCoefsValid) return; if (m_nDataPoints >= 2) { final float xBar = (float) m_dSumX / m_nDataPoints; final float yBar = (float) m_dSumY / m_nDataPoints; m_fA1 = (float) ((m_nDataPoints * m_dSumXY - m_dSumX * m_dSumY) / (m_nDataPoints * ...
[ "private", "void", "_validateCoefficients", "(", ")", "{", "if", "(", "m_bCoefsValid", ")", "return", ";", "if", "(", "m_nDataPoints", ">=", "2", ")", "{", "final", "float", "xBar", "=", "(", "float", ")", "m_dSumX", "/", "m_nDataPoints", ";", "final", "...
Validate the coefficients.
[ "Validate", "the", "coefficients", "." ]
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/mathutils/RegressionLine.java#L181-L200
test
Validate the coefficients.
Of course, here is the Java code you requested: ```java private void _validateCoefficients () { if (m_bCoefsValid) return; if (m_nDataPoints >= 2) { final float xBar = (float) m_dSumX / m_nDataPoints; final float yBar = (float) m_dSumY / m_nDataPoints; m_fA1 = (float) ((m_nDataP...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.window
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<Observable<T>> window(long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, int bufferSize) { ObjectHelper.verifyPositive(timespan, "timespan"); ObjectHelper.verifyPositive(timeskip, "timeskip"); ...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<Observable<T>> window(long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, int bufferSize) { ObjectHelper.verifyPositive(timespan, "timespan"); ObjectHelper.verifyPositive(timeskip, "timeskip"); ...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Observable", "<", "Observable", "<", "T", ">", ">", "window", "(", "long", "timespan", ",", "long", "timeskip", ",", "TimeUnit", "unit", ",", "...
Returns an Observable that emits windows of items it collects from the source ObservableSource. The resulting ObservableSource starts a new window periodically, as determined by the {@code timeskip} argument. It emits each window after a fixed timespan, specified by the {@code timespan} argument. When the source Observ...
[ "Returns", "an", "Observable", "that", "emits", "windows", "of", "items", "it", "collects", "from", "the", "source", "ObservableSource", ".", "The", "resulting", "ObservableSource", "starts", "a", "new", "window", "periodically", "as", "determined", "by", "the", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L14642-L14651
test
Window an observable sequence of items in the source stream.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<Observable<T>> window(long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, int bufferSize) { ObjectHelper.verifyPositive(timespan, "timespan"); ...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/ferry/Buffer.java
Buffer.put
public void put(byte[] src, int srcPos, int destPos, int length) { java.util.concurrent.atomic.AtomicReference<JNIReference> ref = new java.util.concurrent.atomic.AtomicReference<JNIReference>(); java.nio.ByteBuffer buffer = this.getByteBuffer(0, this.getBufferSize(), ref); try { ...
java
public void put(byte[] src, int srcPos, int destPos, int length) { java.util.concurrent.atomic.AtomicReference<JNIReference> ref = new java.util.concurrent.atomic.AtomicReference<JNIReference>(); java.nio.ByteBuffer buffer = this.getByteBuffer(0, this.getBufferSize(), ref); try { ...
[ "public", "void", "put", "(", "byte", "[", "]", "src", ",", "int", "srcPos", ",", "int", "destPos", ",", "int", "length", ")", "{", "java", ".", "util", ".", "concurrent", ".", "atomic", ".", "AtomicReference", "<", "JNIReference", ">", "ref", "=", "...
Absolute bulk put method. <p> This method transfers bytes into this buffer from the given source array. If there are more bytes to be copied from the array than there is space remaining at the specified destination offset, then no bytes are transferred and a java.nio.BufferOverflowException is thrown. </p> <p> This met...
[ "Absolute", "bulk", "put", "method", ".", "<p", ">", "This", "method", "transfers", "bytes", "into", "this", "buffer", "from", "the", "given", "source", "array", ".", "If", "there", "are", "more", "bytes", "to", "be", "copied", "from", "the", "array", "t...
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/Buffer.java#L191-L214
test
Put a byte array into the buffer.
Of course, here is the Java code you requested: ```java public void put(byte[] src, int srcPos, int destPos, int length) { java.util.concurrent.atomic.AtomicReference<JNIReference> ref = new java.util.concurrent.atomic.AtomicReference<JNIReference>(); java.nio.ByteBuffer buffer = this.getByteBuffer(0, ...
google/guice
core/src/com/google/inject/internal/BytecodeGen.java
BytecodeGen.newFastClassForMember
public static net.sf.cglib.reflect.FastClass newFastClassForMember(Member member) { return newFastClassForMember(member.getDeclaringClass(), member); }
java
public static net.sf.cglib.reflect.FastClass newFastClassForMember(Member member) { return newFastClassForMember(member.getDeclaringClass(), member); }
[ "public", "static", "net", ".", "sf", ".", "cglib", ".", "reflect", ".", "FastClass", "newFastClassForMember", "(", "Member", "member", ")", "{", "return", "newFastClassForMember", "(", "member", ".", "getDeclaringClass", "(", ")", ",", "member", ")", ";", "...
Returns a FastClass proxy for invoking the given member or {@code null} if access rules disallow it. @see #newFastClassForMember(Class, Member) for a full description
[ "Returns", "a", "FastClass", "proxy", "for", "invoking", "the", "given", "member", "or", "{", "@code", "null", "}", "if", "access", "rules", "disallow", "it", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/BytecodeGen.java#L206-L208
test
Create a FastClass object for a given member.
Of course, here is the Java code you requested: ```java public static net.sf.cglib.reflect.FastClass newFastClassForMember(Member member) { return newFastClassForMember(member.getDeclaringClass(), member); } ``` Hope this helps!
oblac/jodd
jodd-proxetta/src/main/java/jodd/proxetta/asm/ProxyAspectData.java
ProxyAspectData.getCachedAdviceClassReader
private ClassReader getCachedAdviceClassReader(final Class<? extends ProxyAdvice> advice) { if (adviceClassReaderCache == null) { adviceClassReaderCache = TypeCache.createDefault(); } ClassReader adviceReader = adviceClassReaderCache.get(advice); if (adviceReader == null) { adviceReader = createAdviceClas...
java
private ClassReader getCachedAdviceClassReader(final Class<? extends ProxyAdvice> advice) { if (adviceClassReaderCache == null) { adviceClassReaderCache = TypeCache.createDefault(); } ClassReader adviceReader = adviceClassReaderCache.get(advice); if (adviceReader == null) { adviceReader = createAdviceClas...
[ "private", "ClassReader", "getCachedAdviceClassReader", "(", "final", "Class", "<", "?", "extends", "ProxyAdvice", ">", "advice", ")", "{", "if", "(", "adviceClassReaderCache", "==", "null", ")", "{", "adviceClassReaderCache", "=", "TypeCache", ".", "createDefault",...
Returns class reader for advice.
[ "Returns", "class", "reader", "for", "advice", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/asm/ProxyAspectData.java#L119-L129
test
Gets the cached advice class reader.
Of course, here is the Java code you requested: ```java private ClassReader getCachedAdviceClassReader(final Class<? extends ProxyAdvice> advice) { if (adviceClassReaderCache == null) { adviceClassReaderCache = TypeCache.createDefault(); } ClassReader adviceReader = adviceClassReaderCache.get(advice); if (a...
GlenKPeterson/Paguro
src/main/java/org/organicdesign/fp/type/RuntimeTypes.java
RuntimeTypes.registerClasses
public static ImList<Class> registerClasses(Class... cs) { if (cs == null) { throw new IllegalArgumentException("Can't register a null type array"); } if (cs.length == 0) { throw new IllegalArgumentException("Can't register a zero-length type array"); } fo...
java
public static ImList<Class> registerClasses(Class... cs) { if (cs == null) { throw new IllegalArgumentException("Can't register a null type array"); } if (cs.length == 0) { throw new IllegalArgumentException("Can't register a zero-length type array"); } fo...
[ "public", "static", "ImList", "<", "Class", ">", "registerClasses", "(", "Class", "...", "cs", ")", "{", "if", "(", "cs", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Can't register a null type array\"", ")", ";", "}", "if", "(...
Use this to prevent duplicate runtime types. @param cs an immutable vector of classes to register
[ "Use", "this", "to", "prevent", "duplicate", "runtime", "types", "." ]
eac0d64b2eb9496967334f635cdb270cffb2197b
https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/type/RuntimeTypes.java#L43-L68
test
Register a list of classes.
Of course, here is the Java code you requested: ```java public static ImList<Class> registerClasses(Class... cs) { if (cs == null) { throw new IllegalArgumentException("Can't register a null type array"); } if (cs.length == 0) { throw new IllegalArgumentException("Can't ...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java
GeoPackageManagerImpl.createAtPath
@Override public boolean createAtPath(String database, File path) { // Create the absolute file path File file = new File(path, database + "." + GeoPackageConstants.GEOPACKAGE_EXTENSION); // Create the GeoPackage boolean created = createFile(database, file); return created...
java
@Override public boolean createAtPath(String database, File path) { // Create the absolute file path File file = new File(path, database + "." + GeoPackageConstants.GEOPACKAGE_EXTENSION); // Create the GeoPackage boolean created = createFile(database, file); return created...
[ "@", "Override", "public", "boolean", "createAtPath", "(", "String", "database", ",", "File", "path", ")", "{", "// Create the absolute file path", "File", "file", "=", "new", "File", "(", "path", ",", "database", "+", "\".\"", "+", "GeoPackageConstants", ".", ...
{@inheritDoc}
[ "{" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java#L504-L514
test
Create the GeoPackage at the path
Of course, here is the Java code you requested: ```java @Override public boolean createAtPath(String database, File path) { // Create the absolute file path File file = new File(path, database + "." + GeoPackageConstants.GEOPACKAGE_EXTENSION); // Create the GeoPackage boolean crea...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java
BaseLevel2.hpr2
@Override public void hpr2(char order, char Uplo, IComplexNumber alpha, IComplexNDArray X, IComplexNDArray Y, IComplexNDArray Ap) { // FIXME: int cast if (X.data().dataType() == DataBuffer.Type.DOUBLE) zhpr2(order, Uplo, (int) Ap.rows(), alpha.asDouble(), X, X.major...
java
@Override public void hpr2(char order, char Uplo, IComplexNumber alpha, IComplexNDArray X, IComplexNDArray Y, IComplexNDArray Ap) { // FIXME: int cast if (X.data().dataType() == DataBuffer.Type.DOUBLE) zhpr2(order, Uplo, (int) Ap.rows(), alpha.asDouble(), X, X.major...
[ "@", "Override", "public", "void", "hpr2", "(", "char", "order", ",", "char", "Uplo", ",", "IComplexNumber", "alpha", ",", "IComplexNDArray", "X", ",", "IComplexNDArray", "Y", ",", "IComplexNDArray", "Ap", ")", "{", "// FIXME: int cast", "if", "(", "X", ".",...
hpr2 performs a rank-2 update of an n-by-n packed Hermitian matrix a: a := alpha*x*conjg(y') + conjg(alpha)*y*conjg(x') + a. @param order @param Uplo @param alpha @param X @param Y @param Ap
[ "hpr2", "performs", "a", "rank", "-", "2", "update", "of", "an", "n", "-", "by", "-", "n", "packed", "Hermitian", "matrix", "a", ":", "a", ":", "=", "alpha", "*", "x", "*", "conjg", "(", "y", ")", "+", "conjg", "(", "alpha", ")", "*", "y", "*...
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java#L336-L347
test
HPR 2 implementation.
Of course, here is the Java code you requested: ```java @Override public void hpr2(char order, char Uplo, IComplexNumber alpha, IComplexNDArray X, IComplexNDArray Y, IComplexNDArray Ap) { // FIXME: int cast if (X.data().dataType() == DataBuffer.Type.DOUBLE) zhpr2(o...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
NetcdfDataset.initNetcdfFileCache
static public synchronized void initNetcdfFileCache( int minElementsInMemory, int maxElementsInMemory, int hardLimit, int period) { netcdfFileCache = new ucar.nc2.util.cache.FileCache( "NetcdfFileCache ", minElementsInMemory, maxElementsInMemory, hardLimit, period); }
java
static public synchronized void initNetcdfFileCache( int minElementsInMemory, int maxElementsInMemory, int hardLimit, int period) { netcdfFileCache = new ucar.nc2.util.cache.FileCache( "NetcdfFileCache ", minElementsInMemory, maxElementsInMemory, hardLimit, period); }
[ "static", "public", "synchronized", "void", "initNetcdfFileCache", "(", "int", "minElementsInMemory", ",", "int", "maxElementsInMemory", ",", "int", "hardLimit", ",", "int", "period", ")", "{", "netcdfFileCache", "=", "new", "ucar", ".", "nc2", ".", "util", ".",...
Enable file caching. call this before calling acquireFile(). When application terminates, call NetcdfDataset.shutdown(). @param minElementsInMemory keep this number in the cache @param maxElementsInMemory trigger a cleanup if it goes over this number. @param hardLimit if > 0, never allow more than this many ...
[ "Enable", "file", "caching", ".", "call", "this", "before", "calling", "acquireFile", "()", ".", "When", "application", "terminates", "call", "NetcdfDataset", ".", "shutdown", "()", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java#L272-L276
test
This method initializes the NetCDFFileCache.
Of course, here is the Java code you requested: ```java static public synchronized void initNetcdfFileCache( int minElementsInMemory, int maxElementsInMemory, int hardLimit, int period) { netcdfFileCache = new ucar.nc2.util.cache.FileCache( "NetcdfFileCache ", minElementsInMemory, maxElements...
boonproject/boon
boon/src/main/java/org/boon/collections/IntList.java
IntList.add
public IntList add(int integer) { if (end + 1 >= values.length) { values = grow(values); } values[end] = integer; end++; return this; }
java
public IntList add(int integer) { if (end + 1 >= values.length) { values = grow(values); } values[end] = integer; end++; return this; }
[ "public", "IntList", "add", "(", "int", "integer", ")", "{", "if", "(", "end", "+", "1", ">=", "values", ".", "length", ")", "{", "values", "=", "grow", "(", "values", ")", ";", "}", "values", "[", "end", "]", "=", "integer", ";", "end", "++", ...
Add a new value to the list but don't employ a wrapper. @param integer new value @return was able to add.
[ "Add", "a", "new", "value", "to", "the", "list", "but", "don", "t", "employ", "a", "wrapper", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/collections/IntList.java#L187-L194
test
Adds an integer to the set of CIDCTYPE values.
Of course, here is the Java code you requested: ```java public IntList add(int integer) { if (end + 1 >= values.length) { values = grow(values); } values[end] = integer; end++; return this; } ``` Hope this helps!
Unidata/thredds
opendap/src/main/java/opendap/servers/ClauseFactory.java
ClauseFactory.newBoolFunctionClause
public TopLevelClause newBoolFunctionClause(String functionName, List children) throws DAP2ServerSideException, NoSuchFunctionException { BoolFunction function = functionLibrary.getBoolFunction(functionName); if (fu...
java
public TopLevelClause newBoolFunctionClause(String functionName, List children) throws DAP2ServerSideException, NoSuchFunctionException { BoolFunction function = functionLibrary.getBoolFunction(functionName); if (fu...
[ "public", "TopLevelClause", "newBoolFunctionClause", "(", "String", "functionName", ",", "List", "children", ")", "throws", "DAP2ServerSideException", ",", "NoSuchFunctionException", "{", "BoolFunction", "function", "=", "functionLibrary", ".", "getBoolFunction", "(", "fu...
Generates a clause which invokes a function that returns a boolean value. @see BoolFunctionClause
[ "Generates", "a", "clause", "which", "invokes", "a", "function", "that", "returns", "a", "boolean", "value", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/ClauseFactory.java#L100-L122
test
Create a new TopLevelClause object from a string function name and a list of children
Of course, here is the Java code you requested: ```java public TopLevelClause newBoolFunctionClause(String functionName, List children) throws DAP2ServerSideException, NoSuchFunctionException { BoolFunction function = func...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/gempak/GempakStationFileIOSP.java
GempakStationFileIOSP.addGlobalAttributes
protected void addGlobalAttributes() { // global stuff ncfile.addAttribute(null, new Attribute(CDM.CONVENTIONS, getConventions())); String fileType = "GEMPAK " + gemreader.getFileType(); ncfile.addAttribute(null, new Attribute("file_format", fileType)); ncfile.addAttribute(null, new Attribute("...
java
protected void addGlobalAttributes() { // global stuff ncfile.addAttribute(null, new Attribute(CDM.CONVENTIONS, getConventions())); String fileType = "GEMPAK " + gemreader.getFileType(); ncfile.addAttribute(null, new Attribute("file_format", fileType)); ncfile.addAttribute(null, new Attribute("...
[ "protected", "void", "addGlobalAttributes", "(", ")", "{", "// global stuff\r", "ncfile", ".", "addAttribute", "(", "null", ",", "new", "Attribute", "(", "CDM", ".", "CONVENTIONS", ",", "getConventions", "(", ")", ")", ")", ";", "String", "fileType", "=", "\...
Add on global attributes for all types
[ "Add", "on", "global", "attributes", "for", "all", "types" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakStationFileIOSP.java#L268-L275
test
Add the global attributes to the NetCDF file.
Of course, here is the Java code you requested: ```java protected void addGlobalAttributes() { // global stuff ncfile.addAttribute(null, new Attribute(CDM.CONVENTIONS, getConventions())); String fileType = "GEMPAK " + gemreader.getFileType(); ncfile.addAttribute(null, new Attribute("file_format", f...
Unidata/thredds
cdm/src/main/java/ucar/nc2/util/IO.java
IO.writeToFile
static public void writeToFile(String contents, File file) throws IOException { try (FileOutputStream fout = new FileOutputStream(file)) { OutputStreamWriter fw = new OutputStreamWriter(fout, CDM.utf8Charset); UnsynchronizedBufferedWriter writer = new UnsynchronizedBufferedWriter(fw); writer.w...
java
static public void writeToFile(String contents, File file) throws IOException { try (FileOutputStream fout = new FileOutputStream(file)) { OutputStreamWriter fw = new OutputStreamWriter(fout, CDM.utf8Charset); UnsynchronizedBufferedWriter writer = new UnsynchronizedBufferedWriter(fw); writer.w...
[ "static", "public", "void", "writeToFile", "(", "String", "contents", ",", "File", "file", ")", "throws", "IOException", "{", "try", "(", "FileOutputStream", "fout", "=", "new", "FileOutputStream", "(", "file", ")", ")", "{", "OutputStreamWriter", "fw", "=", ...
Write String contents to a file, using UTF-8 encoding. @param contents String holding the contents @param file write to this file (overwrite if exists) @throws java.io.IOException on io error
[ "Write", "String", "contents", "to", "a", "file", "using", "UTF", "-", "8", "encoding", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/IO.java#L482-L489
test
Write the contents of a sequence of GUIDs to a file.
Of course, here is the Java code you requested: ```java static public void writeToFile(String contents, File file) throws IOException { try (FileOutputStream fout = new FileOutputStream(file)) { OutputStreamWriter fw = new OutputStreamWriter(fout, CDM.utf8Charset); UnsynchronizedBufferedWriter write...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/core/read/filter/HollowFilterConfig.java
HollowFilterConfig.addFieldRecursive
public void addFieldRecursive(String type, String objectField, Collection<HollowSchema> schemas) { addFieldRecursive(type, objectField, mapSchemas(schemas)); }
java
public void addFieldRecursive(String type, String objectField, Collection<HollowSchema> schemas) { addFieldRecursive(type, objectField, mapSchemas(schemas)); }
[ "public", "void", "addFieldRecursive", "(", "String", "type", ",", "String", "objectField", ",", "Collection", "<", "HollowSchema", ">", "schemas", ")", "{", "addFieldRecursive", "(", "type", ",", "objectField", ",", "mapSchemas", "(", "schemas", ")", ")", ";"...
Add an individual field from an OBJECT schema, plus recursively add any directly or transitively referenced types. This field will be either excluded or included, depending on whether this is an exclude or include filter, respectively. @param type The OBJECT type from the data model @param objectField The field in the...
[ "Add", "an", "individual", "field", "from", "an", "OBJECT", "schema", "plus", "recursively", "add", "any", "directly", "or", "transitively", "referenced", "types", ".", "This", "field", "will", "be", "either", "excluded", "or", "included", "depending", "on", "...
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/read/filter/HollowFilterConfig.java#L157-L159
test
Add a field to the Hollow object.
Of course, here is the Java code you requested: ```java public void addFieldRecursive(String type, String objectField, Collection<HollowSchema> schemas) { addFieldRecursive(type, objectField, mapSchemas(schemas)); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/projection/AlbersEqualArea.java
AlbersEqualArea.latLonToProj
public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex) { int cnt = from[0].length; double[] fromLatA = from[latIndex]; double[] fromLonA = from[lonIndex]; double[] resultXA = to[INDEX_X]; double[] resultYA = to[INDEX_Y]; ...
java
public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex) { int cnt = from[0].length; double[] fromLatA = from[latIndex]; double[] fromLonA = from[lonIndex]; double[] resultXA = to[INDEX_X]; double[] resultYA = to[INDEX_Y]; ...
[ "public", "double", "[", "]", "[", "]", "latLonToProj", "(", "double", "[", "]", "[", "]", "from", ",", "double", "[", "]", "[", "]", "to", ",", "int", "latIndex", ",", "int", "lonIndex", ")", "{", "int", "cnt", "=", "from", "[", "0", "]", ".",...
Convert lat/lon coordinates to projection coordinates. @param from array of lat/lon coordinates: from[2][n], where from[0][i], from[1][i] is the (lat,lon) coordinate of the ith point @param to resulting array of projection coordinates, where to[0][i], to[1][i] is the (x,y) coordinate of the ith point @param ...
[ "Convert", "lat", "/", "lon", "coordinates", "to", "projection", "coordinates", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/AlbersEqualArea.java#L614-L639
test
Converts a pair of latitude and longitude coordinates from the source to the target.
Of course, here is the Java code you requested: ```java public double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex) { int cnt = from[0].length; double[] fromLatA = from[latIndex]; double[] fromLonA = from[lonIndex]; double[] resultXA ...
rupertlssmith/lojix
lojix/power_model/src/main/com/thesett/aima/attribute/time/BitHackUtils.java
BitHackUtils.intLogBase10
public static int intLogBase10(long value) { return (value >= 1000000000000000000L) ? 18 : ((value >= 100000000000000000L) ? 17 : ((value >= 10000000000000000L) ? 16 : ((value >= 1000000000000000L) ...
java
public static int intLogBase10(long value) { return (value >= 1000000000000000000L) ? 18 : ((value >= 100000000000000000L) ? 17 : ((value >= 10000000000000000L) ? 16 : ((value >= 1000000000000000L) ...
[ "public", "static", "int", "intLogBase10", "(", "long", "value", ")", "{", "return", "(", "value", ">=", "1000000000000000000L", ")", "?", "18", ":", "(", "(", "value", ">=", "100000000000000000L", ")", "?", "17", ":", "(", "(", "value", ">=", "100000000...
Calcalates the log base 10 of an integer. This method favours shorter numbers. @param value The value to calculate for. @return Log base 10 of the input value.
[ "Calcalates", "the", "log", "base", "10", "of", "an", "integer", ".", "This", "method", "favours", "shorter", "numbers", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/power_model/src/main/com/thesett/aima/attribute/time/BitHackUtils.java#L237-L274
test
This method is used to log a value for a field.
Of course, here is the Java code you requested: ```java public static int intLogBase10(long value) { return (value >= 1000000000000000000L) ? 18 : ((value >= 100000000000000000L) ? 17 : ((value >= 10000000000000000L) ? 16 ...
oblac/jodd
jodd-db/src/main/java/jodd/db/oom/DbEntityManager.java
DbEntityManager.removeEntity
public <E> DbEntityDescriptor<E> removeEntity(final Class<E> type) { DbEntityDescriptor<E> ded = descriptorsMap.remove(type); if (ded == null) { ded = createDbEntityDescriptor(type); } entityNamesMap.remove(ded.getEntityName()); tableNamesMap.remove(ded.getTableName()); return ded; }
java
public <E> DbEntityDescriptor<E> removeEntity(final Class<E> type) { DbEntityDescriptor<E> ded = descriptorsMap.remove(type); if (ded == null) { ded = createDbEntityDescriptor(type); } entityNamesMap.remove(ded.getEntityName()); tableNamesMap.remove(ded.getTableName()); return ded; }
[ "public", "<", "E", ">", "DbEntityDescriptor", "<", "E", ">", "removeEntity", "(", "final", "Class", "<", "E", ">", "type", ")", "{", "DbEntityDescriptor", "<", "E", ">", "ded", "=", "descriptorsMap", ".", "remove", "(", "type", ")", ";", "if", "(", ...
Removes entity and returns removed descriptor.
[ "Removes", "entity", "and", "returns", "removed", "descriptor", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/DbEntityManager.java#L179-L187
test
Removes an entity from the registry.
Of course, here is the Java code you requested: ```java public <E> DbEntityDescriptor<E> removeEntity(final Class<E> type) { DbEntityDescriptor<E> ded = descriptorsMap.remove(type); if (ded == null) { ded = createDbEntityDescriptor(type); } entityNamesMap.remove(ded.getEntityName()); tableNamesMap.remove(...
vibur/vibur-dbcp
src/main/java/org/vibur/dbcp/proxy/AbstractInvocationHandler.java
AbstractInvocationHandler.restrictedInvoke
Object restrictedInvoke(T proxy, Method method, Object[] args) throws SQLException { return targetInvoke(method, args); }
java
Object restrictedInvoke(T proxy, Method method, Object[] args) throws SQLException { return targetInvoke(method, args); }
[ "Object", "restrictedInvoke", "(", "T", "proxy", ",", "Method", "method", ",", "Object", "[", "]", "args", ")", "throws", "SQLException", "{", "return", "targetInvoke", "(", "method", ",", "args", ")", ";", "}" ]
Handles all restricted method invocations that occur after (and if) we have passed through the {@link #restrictedAccessEntry}. This method will be overridden in the {@code AbstractInvocationHandler} subclasses, and will be the place to implement the specific to these subclasses logic for restricted method invocations h...
[ "Handles", "all", "restricted", "method", "invocations", "that", "occur", "after", "(", "and", "if", ")", "we", "have", "passed", "through", "the", "{", "@link", "#restrictedAccessEntry", "}", ".", "This", "method", "will", "be", "overridden", "in", "the", "...
9f3f0a2b41f1a76a4e408446e9e444db7ad8f1c2
https://github.com/vibur/vibur-dbcp/blob/9f3f0a2b41f1a76a4e408446e9e444db7ad8f1c2/src/main/java/org/vibur/dbcp/proxy/AbstractInvocationHandler.java#L148-L150
test
Override this method to allow the caller to modify the result set of a managed method.
Of course, here is the Java code you requested: ```java Object restrictedInvoke(T proxy, Method method, Object[] args) throws SQLException { return targetInvoke(method, args); } ``` Hope this helps!
playframework/playframework
core/play/src/main/java/play/Logger.java
Logger.warn
@Deprecated public static void warn(String message, Object... args) { logger.warn(message, args); }
java
@Deprecated public static void warn(String message, Object... args) { logger.warn(message, args); }
[ "@", "Deprecated", "public", "static", "void", "warn", "(", "String", "message", ",", "Object", "...", "args", ")", "{", "logger", ".", "warn", "(", "message", ",", "args", ")", ";", "}" ]
Log a message with the WARN level. @param message message to log @param args The arguments to apply to the message string @deprecated Deprecated as of 2.7.0. Create an instance of {@link ALogger} via {@link #of(String)} / {@link #of(Class)} and use the same-named method. Or use SLF4J directly.
[ "Log", "a", "message", "with", "the", "WARN", "level", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/Logger.java#L365-L368
test
Log a warning message.
Of course, here is the Java code you requested: ```java @Deprecated public static void warn(String message, Object... args) { logger.warn(message, args); } ``` Hope this helps!
mbeiter/jaas
common/src/main/java/org/beiter/michael/authn/jaas/common/messageq/MessageQFactory.java
MessageQFactory.getInstance
public static MessageQ getInstance(final String className, final CommonProperties properties) throws FactoryException { Validate.notBlank(className, "The validated character sequence 'className' is null or empty"); Validate.notNull(properties, "The validated object 'properties' is null"); ...
java
public static MessageQ getInstance(final String className, final CommonProperties properties) throws FactoryException { Validate.notBlank(className, "The validated character sequence 'className' is null or empty"); Validate.notNull(properties, "The validated object 'properties' is null"); ...
[ "public", "static", "MessageQ", "getInstance", "(", "final", "String", "className", ",", "final", "CommonProperties", "properties", ")", "throws", "FactoryException", "{", "Validate", ".", "notBlank", "(", "className", ",", "\"The validated character sequence 'className' ...
Return a new, fully initialized instance of a {@link MessageQ} class to use for JAAS event messageing. <p> Classes implementing the {@link MessageQ} interface <b>must</b> be thread safe. @param className The name of a class that implements the Message interface @param properties The properties to initialize the insta...
[ "Return", "a", "new", "fully", "initialized", "instance", "of", "a", "{", "@link", "MessageQ", "}", "class", "to", "use", "for", "JAAS", "event", "messageing", ".", "<p", ">", "Classes", "implementing", "the", "{", "@link", "MessageQ", "}", "interface", "<...
540e78af91c73291fa0e57b0df352f4a22950772
https://github.com/mbeiter/jaas/blob/540e78af91c73291fa0e57b0df352f4a22950772/common/src/main/java/org/beiter/michael/authn/jaas/common/messageq/MessageQFactory.java#L77-L117
test
Gets the MessageQ object from the provided class name.
Of course, here is the Java code you requested: ```java public static MessageQ getInstance(final String className, final CommonProperties properties) throws FactoryException { Validate.notBlank(className, "The validated character sequence 'className' is null or empty"); Validate.notNull(pr...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.switchMap
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> switchMap(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int bufferSize) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize");...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> switchMap(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int bufferSize) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize");...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Observable", "<", "R", ">", "switchMap", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "ObservableSource", "<", ...
Returns a new ObservableSource by applying a function that you supply to each item emitted by the source ObservableSource that returns an ObservableSource, and then emitting the items emitted by the most recently emitted of these ObservableSources. <p> The resulting ObservableSource completes if both the upstream Obser...
[ "Returns", "a", "new", "ObservableSource", "by", "applying", "a", "function", "that", "you", "supply", "to", "each", "item", "emitted", "by", "the", "source", "ObservableSource", "that", "returns", "an", "ObservableSource", "and", "then", "emitting", "the", "ite...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L12420-L12434
test
Switches the source Observable to an observable source using the specified mapping function.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> switchMap(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int bufferSize) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ...
Unidata/thredds
opendap/src/main/java/opendap/dap/DSequence.java
DSequence.writeMarker
protected void writeMarker(DataOutputStream sink, byte marker) throws IOException { //for(int i=0; i<4; i++) sink.writeByte(marker); sink.writeByte((byte) 0); sink.writeByte((byte) 0); sink.writeByte((byte) 0); }
java
protected void writeMarker(DataOutputStream sink, byte marker) throws IOException { //for(int i=0; i<4; i++) sink.writeByte(marker); sink.writeByte((byte) 0); sink.writeByte((byte) 0); sink.writeByte((byte) 0); }
[ "protected", "void", "writeMarker", "(", "DataOutputStream", "sink", ",", "byte", "marker", ")", "throws", "IOException", "{", "//for(int i=0; i<4; i++)\r", "sink", ".", "writeByte", "(", "marker", ")", ";", "sink", ".", "writeByte", "(", "(", "byte", ")", "0"...
Writes a marker byte to the output stream.
[ "Writes", "a", "marker", "byte", "to", "the", "output", "stream", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DSequence.java#L557-L563
test
Write the marker of the record.
Of course, here is the Java code you requested: ```java protected void writeMarker(DataOutputStream sink, byte marker) throws IOException { //for(int i=0; i<4; i++) sink.writeByte(marker); sink.writeByte((byte) 0); sink.writeByte((byte) 0); sink.writeByte((byte) 0); } ...
streamsets/datacollector
container/src/main/java/com/streamsets/datacollector/cli/sch/SchAdmin.java
SchAdmin.logout
private static void logout(String dpmBaseURL, String userAuthToken) { Response response = null; try { response = ClientBuilder.newClient() .target(dpmBaseURL + "/security/_logout") .register(new CsrfProtectionFilter("CSRF")) .request() .header(SSOConstants.X_USER_AU...
java
private static void logout(String dpmBaseURL, String userAuthToken) { Response response = null; try { response = ClientBuilder.newClient() .target(dpmBaseURL + "/security/_logout") .register(new CsrfProtectionFilter("CSRF")) .request() .header(SSOConstants.X_USER_AU...
[ "private", "static", "void", "logout", "(", "String", "dpmBaseURL", ",", "String", "userAuthToken", ")", "{", "Response", "response", "=", "null", ";", "try", "{", "response", "=", "ClientBuilder", ".", "newClient", "(", ")", ".", "target", "(", "dpmBaseURL"...
Logout given token.
[ "Logout", "given", "token", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/cli/sch/SchAdmin.java#L278-L293
test
Logout the user
Of course, here is the Java code you requested: ```java private static void logout(String dpmBaseURL, String userAuthToken) { Response response = null; try { response = ClientBuilder.newClient() .target(dpmBaseURL + "/security/_logout") .register(new CsrfProtectionFilter("CSRF")) ...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/Handler.java
Handler.removeRange
static Handler removeRange(final Handler firstHandler, final Label start, final Label end) { if (firstHandler == null) { return null; } else { firstHandler.nextHandler = removeRange(firstHandler.nextHandler, start, end); } int handlerStart = firstHandler.startPc.bytecodeOffset; int handl...
java
static Handler removeRange(final Handler firstHandler, final Label start, final Label end) { if (firstHandler == null) { return null; } else { firstHandler.nextHandler = removeRange(firstHandler.nextHandler, start, end); } int handlerStart = firstHandler.startPc.bytecodeOffset; int handl...
[ "static", "Handler", "removeRange", "(", "final", "Handler", "firstHandler", ",", "final", "Label", "start", ",", "final", "Label", "end", ")", "{", "if", "(", "firstHandler", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "firstHandler",...
Removes the range between start and end from the Handler list that begins with the given element. @param firstHandler the beginning of a Handler list. May be {@literal null}. @param start the start of the range to be removed. @param end the end of the range to be removed. Maybe {@literal null}. @return the exception h...
[ "Removes", "the", "range", "between", "start", "and", "end", "from", "the", "Handler", "list", "that", "begins", "with", "the", "given", "element", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Handler.java#L119-L150
test
Remove a range of handlers from the first handler.
Of course, here is the Java code you requested: ```java static Handler removeRange(final Handler firstHandler, final Label start, final Label end) { if (firstHandler == null) { return null; } else { firstHandler.nextHandler = removeRange(firstHandler.nextHandler, start, end); } int handlerS...
streamsets/datacollector
container-common/src/main/java/com/streamsets/datacollector/security/SdcSecurityManager.java
SdcSecurityManager.setExceptions
private void setExceptions(Configuration configuration) { this.exceptions.clear(); this.stageLibExceptions.clear(); // Load general exceptions for(String path : configuration.get(PROPERTY_EXCEPTIONS, "").split(",")) { this.exceptions.add(replaceVariables(path)); } // Load Stage library s...
java
private void setExceptions(Configuration configuration) { this.exceptions.clear(); this.stageLibExceptions.clear(); // Load general exceptions for(String path : configuration.get(PROPERTY_EXCEPTIONS, "").split(",")) { this.exceptions.add(replaceVariables(path)); } // Load Stage library s...
[ "private", "void", "setExceptions", "(", "Configuration", "configuration", ")", "{", "this", ".", "exceptions", ".", "clear", "(", ")", ";", "this", ".", "stageLibExceptions", ".", "clear", "(", ")", ";", "// Load general exceptions", "for", "(", "String", "pa...
This method should be called only once and before any stages are loaded.
[ "This", "method", "should", "be", "called", "only", "once", "and", "before", "any", "stages", "are", "loaded", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container-common/src/main/java/com/streamsets/datacollector/security/SdcSecurityManager.java#L78-L97
test
Sets the exceptions and stageLibExceptions from the given configuration.
Of course, here is the Java code you requested: ```java private void setExceptions(Configuration configuration) { this.exceptions.clear(); this.stageLibExceptions.clear(); // Load general exceptions for(String path : configuration.get(PROPERTY_EXCEPTIONS, "").split(",")) { this.exceptions.add(re...
algolia/algoliasearch-client-android
algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java
MirroredIndex.getObjectAsync
@Override public Request getObjectAsync(final @NonNull String objectID, final @Nullable Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions, @NonNull CompletionHandler completionHandler) { if (!mirrored) { return super.getObjectAsync(objectID, attributesToRetrieve, r...
java
@Override public Request getObjectAsync(final @NonNull String objectID, final @Nullable Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions, @NonNull CompletionHandler completionHandler) { if (!mirrored) { return super.getObjectAsync(objectID, attributesToRetrieve, r...
[ "@", "Override", "public", "Request", "getObjectAsync", "(", "final", "@", "NonNull", "String", "objectID", ",", "final", "@", "Nullable", "Collection", "<", "String", ">", "attributesToRetrieve", ",", "@", "Nullable", "RequestOptions", "requestOptions", ",", "@",...
Get an individual object from the online API, falling back to the local mirror in case of error (when enabled). @param objectID Identifier of the object to retrieve. @param attributesToRetrieve Attributes to retrieve. If `null` or if at least one item is `*`, all retrievable attributes will be retrieved. @param reques...
[ "Get", "an", "individual", "object", "from", "the", "online", "API", "falling", "back", "to", "the", "local", "mirror", "in", "case", "of", "error", "(", "when", "enabled", ")", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java#L1286-L1293
test
Asynchronously retrieves a single object from the database.
Of course, here is the Java code you requested: ```java @Override public Request getObjectAsync(final @NonNull String objectID, final @Nullable Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions, @NonNull CompletionHandler completionHandler) { if (!mirrored) { retu...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/FunctionProperties.java
FunctionProperties.asFlatProperties
public int asFlatProperties(FlatBufferBuilder bufferBuilder) { int iname = bufferBuilder.createString(name); int ii = FlatProperties.createIVector(bufferBuilder, Ints.toArray(i)); int il = FlatProperties.createLVector(bufferBuilder, Longs.toArray(l)); int id = FlatProperties.createDVecto...
java
public int asFlatProperties(FlatBufferBuilder bufferBuilder) { int iname = bufferBuilder.createString(name); int ii = FlatProperties.createIVector(bufferBuilder, Ints.toArray(i)); int il = FlatProperties.createLVector(bufferBuilder, Longs.toArray(l)); int id = FlatProperties.createDVecto...
[ "public", "int", "asFlatProperties", "(", "FlatBufferBuilder", "bufferBuilder", ")", "{", "int", "iname", "=", "bufferBuilder", ".", "createString", "(", "name", ")", ";", "int", "ii", "=", "FlatProperties", ".", "createIVector", "(", "bufferBuilder", ",", "Ints...
This method converts this FunctionProperties instance to FlatBuffers representation @param bufferBuilder @return
[ "This", "method", "converts", "this", "FunctionProperties", "instance", "to", "FlatBuffers", "representation" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/FunctionProperties.java#L34-L50
test
As FlatProperties.
Of course, here is the Java code you requested: ```java public int asFlatProperties(FlatBufferBuilder bufferBuilder) { int iname = bufferBuilder.createString(name); int ii = FlatProperties.createIVector(bufferBuilder, Ints.toArray(i)); int il = FlatProperties.createLVector(bufferBuilder, Longs....
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.concat
@SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public static <T> Flowable<T> concat(Publisher<? extends Publisher<? extends T>> sources, int prefetch) { return fromPublisher(sources).concatMap(...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public static <T> Flowable<T> concat(Publisher<? extends Publisher<? extends T>> sources, int prefetch) { return fromPublisher(sources).concatMap(...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "static...
Returns a Flowable that emits the items emitted by each of the Publishers emitted by the source Publisher, one after the other, without interleaving them. <p> <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt=""> <dl> <dt><b>Backpressure:</b></dt> <dd>Th...
[ "Returns", "a", "Flowable", "that", "emits", "the", "items", "emitted", "by", "each", "of", "the", "Publishers", "emitted", "by", "the", "source", "Publisher", "one", "after", "the", "other", "without", "interleaving", "them", ".", "<p", ">", "<img", "width"...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L1242-L1248
test
Concatenates two Publisher objects.
Of course, here is the Java code you requested: ```java @SuppressWarnings({ "unchecked", "rawtypes" }) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public static <T> Flowable<T> concat(Publisher<? extends Publisher<? extends T>> sources, int pre...
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMCompiledQuery.java
WAMCompiledQuery.emmitCode
public void emmitCode(ByteBuffer buffer, WAMMachine machine, WAMCallPoint callPoint) throws LinkageException { // Ensure that the size of the instruction listing does not exceed max int (highly unlikely). if (sizeof() > Integer.MAX_VALUE) { throw new IllegalStateException("The in...
java
public void emmitCode(ByteBuffer buffer, WAMMachine machine, WAMCallPoint callPoint) throws LinkageException { // Ensure that the size of the instruction listing does not exceed max int (highly unlikely). if (sizeof() > Integer.MAX_VALUE) { throw new IllegalStateException("The in...
[ "public", "void", "emmitCode", "(", "ByteBuffer", "buffer", ",", "WAMMachine", "machine", ",", "WAMCallPoint", "callPoint", ")", "throws", "LinkageException", "{", "// Ensure that the size of the instruction listing does not exceed max int (highly unlikely).", "if", "(", "sizeo...
Emmits the binary byte code for the clause into a machine, writing into the specified byte array. The state of this clause is changed to 'Linked' to indicate that it has been linked into a binary machine. @param buffer The code buffer to write to. @param machine The binary machine to resolve call-points against...
[ "Emmits", "the", "binary", "byte", "code", "for", "the", "clause", "into", "a", "machine", "writing", "into", "the", "specified", "byte", "array", ".", "The", "state", "of", "this", "clause", "is", "changed", "to", "Linked", "to", "indicate", "that", "it",...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMCompiledQuery.java#L246-L270
test
Emmit the code of the class.
Of course, here is the Java code you requested: ```java public void emmitCode(ByteBuffer buffer, WAMMachine machine, WAMCallPoint callPoint) throws LinkageException { // Ensure that the size of the instruction listing does not exceed max int (highly unlikely). if (sizeof() > Integer.MAX_VALUE) ...
stanfy/enroscar
images/src/main/java/com/stanfy/enroscar/images/ImageRequestsBuilder.java
ImageRequestsBuilder.add
public ImageRequestsBuilder add(final String url, final float relativeSize) { requests.add(new ImageRequest(manager, url, relativeSize)); return this; }
java
public ImageRequestsBuilder add(final String url, final float relativeSize) { requests.add(new ImageRequest(manager, url, relativeSize)); return this; }
[ "public", "ImageRequestsBuilder", "add", "(", "final", "String", "url", ",", "final", "float", "relativeSize", ")", "{", "requests", ".", "add", "(", "new", "ImageRequest", "(", "manager", ",", "url", ",", "relativeSize", ")", ")", ";", "return", "this", "...
Plan an image on loading. @param url image URL @param relativeSize max allowed image size relatively to the screen size @return this for chaining
[ "Plan", "an", "image", "on", "loading", "." ]
0e64f3c309d62e359b55ddcba10e3cc592f5e083
https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/images/src/main/java/com/stanfy/enroscar/images/ImageRequestsBuilder.java#L89-L92
test
Add an image request to the requests.
Of course, here is the Java code you requested: ```java public ImageRequestsBuilder add(final String url, final float relativeSize) { requests.add(new ImageRequest(manager, url, relativeSize)); return this; } ``` Hope this helps!
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java
OSessionStoragePerformanceStatistic.getReadSpeedFromFileInPages
public long getReadSpeedFromFileInPages(String componentName) { if (componentName == null) return performanceCountersHolder.getReadSpeedFromFileInPages(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (cHolder != null) return cHolder.getReadSpeedFromFileIn...
java
public long getReadSpeedFromFileInPages(String componentName) { if (componentName == null) return performanceCountersHolder.getReadSpeedFromFileInPages(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (cHolder != null) return cHolder.getReadSpeedFromFileIn...
[ "public", "long", "getReadSpeedFromFileInPages", "(", "String", "componentName", ")", "{", "if", "(", "componentName", "==", "null", ")", "return", "performanceCountersHolder", ".", "getReadSpeedFromFileInPages", "(", ")", ";", "final", "PerformanceCountersHolder", "cHo...
Read speed of data from file system in pages for component name of which is passed as method argument. If null value is passed then value for whole system will be returned. If data for component with passed in name does not exist then <code>-1</code> will be returned. @param componentName Name of component data of whi...
[ "Read", "speed", "of", "data", "from", "file", "system", "in", "pages", "for", "component", "name", "of", "which", "is", "passed", "as", "method", "argument", ".", "If", "null", "value", "is", "passed", "then", "value", "for", "whole", "system", "will", ...
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java#L256-L265
test
Get the read speed from a file in pages
Of course, here is the Java code you requested: ```java public long getReadSpeedFromFileInPages(String componentName) { if (componentName == null) return performanceCountersHolder.getReadSpeedFromFileInPages(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (cHo...
boonproject/boon
boon/src/main/java/org/boon/validation/RecursiveDescentPropertyValidator.java
RecursiveDescentPropertyValidator.applyValidationMetaDataPropertiesToValidator
private void applyValidationMetaDataPropertiesToValidator( ValidatorMetaData metaData, FieldValidator validator ) { Map<String, Object> properties = metaData.getProperties(); ifPropertyBlankRemove( properties, "detailMessage" ); ifPropertyBlankRemove( properties, "summaryMessage" ); ...
java
private void applyValidationMetaDataPropertiesToValidator( ValidatorMetaData metaData, FieldValidator validator ) { Map<String, Object> properties = metaData.getProperties(); ifPropertyBlankRemove( properties, "detailMessage" ); ifPropertyBlankRemove( properties, "summaryMessage" ); ...
[ "private", "void", "applyValidationMetaDataPropertiesToValidator", "(", "ValidatorMetaData", "metaData", ",", "FieldValidator", "validator", ")", "{", "Map", "<", "String", ",", "Object", ">", "properties", "=", "metaData", ".", "getProperties", "(", ")", ";", "ifPr...
This method applies the properties from the validationMetaData to the validator uses Spring's BeanWrapperImpl. @param metaData validation meta data @param validator field validator
[ "This", "method", "applies", "the", "properties", "from", "the", "validationMetaData", "to", "the", "validator", "uses", "Spring", "s", "BeanWrapperImpl", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/validation/RecursiveDescentPropertyValidator.java#L254-L262
test
Apply validation meta data properties to the validator.
Of course, here is the Java code you requested: ```java private void applyValidationMetaDataPropertiesToValidator( ValidatorMetaData metaData, FieldValidator validator ) { Map<String, Object> properties = metaData.getProperties(); ifPropertyBlankRemove( properties, "detailMessage" ); ...
ReactiveX/RxJava
src/main/java/io/reactivex/Completable.java
Completable.mergeArray
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable mergeArray(CompletableSource... sources) { ObjectHelper.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return complete(); } else if (sources.lengt...
java
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable mergeArray(CompletableSource... sources) { ObjectHelper.requireNonNull(sources, "sources is null"); if (sources.length == 0) { return complete(); } else if (sources.lengt...
[ "@", "CheckReturnValue", "@", "NonNull", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "static", "Completable", "mergeArray", "(", "CompletableSource", "...", "sources", ")", "{", "ObjectHelper", ".", "requireNonNull", "(", "sources",...
Returns a Completable instance that subscribes to all sources at once and completes only when all source Completables complete or one of them emits an error. <p> <img width="640" height="270" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.mergeArray.png" alt=""> <dl> <dt><b>Scheduler:...
[ "Returns", "a", "Completable", "instance", "that", "subscribes", "to", "all", "sources", "at", "once", "and", "completes", "only", "when", "all", "source", "Completables", "complete", "or", "one", "of", "them", "emits", "an", "error", ".", "<p", ">", "<img",...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L640-L652
test
Merge array of CompletableSources into one single Completable.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static Completable mergeArray(CompletableSource... sources) { ObjectHelper.requireNonNull(sources, "sources is null"); if (sources.length == 0) { re...
wro4j/wro4j
wro4j-extensions/src/main/java/ro/isdc/wro/extensions/script/RhinoScriptBuilder.java
RhinoScriptBuilder.createContext
private ScriptableObject createContext(final ScriptableObject initialScope) { final Context context = getContext(); context.setOptimizationLevel(-1); // TODO redirect errors from System.err to LOG.error() context.setErrorReporter(new ToolErrorReporter(false)); context.setLanguageVersion(Context...
java
private ScriptableObject createContext(final ScriptableObject initialScope) { final Context context = getContext(); context.setOptimizationLevel(-1); // TODO redirect errors from System.err to LOG.error() context.setErrorReporter(new ToolErrorReporter(false)); context.setLanguageVersion(Context...
[ "private", "ScriptableObject", "createContext", "(", "final", "ScriptableObject", "initialScope", ")", "{", "final", "Context", "context", "=", "getContext", "(", ")", ";", "context", ".", "setOptimizationLevel", "(", "-", "1", ")", ";", "// TODO redirect errors fro...
Initialize the context.
[ "Initialize", "the", "context", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/script/RhinoScriptBuilder.java#L64-L81
test
Create a context object.
Of course, here is the Java code you requested: ```java private ScriptableObject createContext(final ScriptableObject initialScope) { final Context context = getContext(); context.setOptimizationLevel(-1); // TODO redirect errors from System.err to LOG.error() context.setErrorReporter(new ToolError...
streamsets/datacollector
omniture-lib/src/main/java/com/streamsets/pipeline/stage/origin/omniture/OmniturePollingConsumer.java
OmniturePollingConsumer.getReport
public void getReport(int reportId) throws InterruptedException, ExecutionException, TimeoutException, IOException, StageException { int waitTime = 1000; Response response = null; while (!stop) { final AsyncInvoker asyncInvoker = getResource.request() .header(WSSE_HEADER, OmnitureAuthU...
java
public void getReport(int reportId) throws InterruptedException, ExecutionException, TimeoutException, IOException, StageException { int waitTime = 1000; Response response = null; while (!stop) { final AsyncInvoker asyncInvoker = getResource.request() .header(WSSE_HEADER, OmnitureAuthU...
[ "public", "void", "getReport", "(", "int", "reportId", ")", "throws", "InterruptedException", ",", "ExecutionException", ",", "TimeoutException", ",", "IOException", ",", "StageException", "{", "int", "waitTime", "=", "1000", ";", "Response", "response", "=", "nul...
Posts a request to the Omniture API to get a report back. Reports may take a while to generate, so this will loop on the Report.Get request, and ignore any errors indicating that the report is not yet ready. @param reportId ID of report to get @throws InterruptedException @throws ExecutionException @throws TimeoutExcep...
[ "Posts", "a", "request", "to", "the", "Omniture", "API", "to", "get", "a", "report", "back", ".", "Reports", "may", "take", "a", "while", "to", "generate", "so", "this", "will", "loop", "on", "the", "Report", ".", "Get", "request", "and", "ignore", "an...
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/omniture-lib/src/main/java/com/streamsets/pipeline/stage/origin/omniture/OmniturePollingConsumer.java#L187-L224
test
Get a report from the server.
Of course, here is the Java code you requested: ```java public void getReport(int reportId) throws InterruptedException, ExecutionException, TimeoutException, IOException, StageException { int waitTime = 1000; Response response = null; while (!stop) { final AsyncInvoker asyncInvoker = getResour...
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/drafts/Draft.java
Draft.translateHandshakeHttpServer
private static HandshakeBuilder translateHandshakeHttpServer(String[] firstLineTokens, String line) throws InvalidHandshakeException { // translating/parsing the request from the CLIENT if (!"GET".equalsIgnoreCase(firstLineTokens[0])) { throw new InvalidHandshakeException( String.format("Invalid request method r...
java
private static HandshakeBuilder translateHandshakeHttpServer(String[] firstLineTokens, String line) throws InvalidHandshakeException { // translating/parsing the request from the CLIENT if (!"GET".equalsIgnoreCase(firstLineTokens[0])) { throw new InvalidHandshakeException( String.format("Invalid request method r...
[ "private", "static", "HandshakeBuilder", "translateHandshakeHttpServer", "(", "String", "[", "]", "firstLineTokens", ",", "String", "line", ")", "throws", "InvalidHandshakeException", "{", "// translating/parsing the request from the CLIENT", "if", "(", "!", "\"GET\"", ".",...
Checking the handshake for the role as server @return a handshake @param firstLineTokens the token of the first line split as as an string array @param line the whole line
[ "Checking", "the", "handshake", "for", "the", "role", "as", "server" ]
73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9
https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/drafts/Draft.java#L128-L139
test
Translate the handshake HTTP server response.
Of course, here is the Java code you requested: ```java private static HandshakeBuilder translateHandshakeHttpServer(String[] firstLineTokens, String line) throws InvalidHandshakeException { // translating/parsing the request from the CLIENT if (!"GET".equalsIgnoreCase(firstLineTokens[0])) { throw new InvalidHa...
grzesiek-galezowski/AutoFixtureGenerator
src/main/java/autofixture/publicinterface/thirdpartysupport/AnyVavr.java
AnyVavr.mapBetween
@NonNull public static <T, V> Map<T, V> mapBetween(final Class<T> keyClass, final Class<V> valueClass) { assertIsNotParameterized(keyClass, "generic key types are not allowed for this method."); assertIsNotParameterized(valueClass, "generic value types are not allowed for this method."); return hashMapBet...
java
@NonNull public static <T, V> Map<T, V> mapBetween(final Class<T> keyClass, final Class<V> valueClass) { assertIsNotParameterized(keyClass, "generic key types are not allowed for this method."); assertIsNotParameterized(valueClass, "generic value types are not allowed for this method."); return hashMapBet...
[ "@", "NonNull", "public", "static", "<", "T", ",", "V", ">", "Map", "<", "T", ",", "V", ">", "mapBetween", "(", "final", "Class", "<", "T", ">", "keyClass", ",", "final", "Class", "<", "V", ">", "valueClass", ")", "{", "assertIsNotParameterized", "("...
///////////////////////////// maps
[ "/////////////////////////////", "maps" ]
a5e1146ec5109e6505f8aff604a20461ec86a57d
https://github.com/grzesiek-galezowski/AutoFixtureGenerator/blob/a5e1146ec5109e6505f8aff604a20461ec86a57d/src/main/java/autofixture/publicinterface/thirdpartysupport/AnyVavr.java#L180-L185
test
Returns a map of the given key type and value type.
Of course, here is the Java code you requested: ```java @NonNull public static <T, V> Map<T, V> mapBetween(final Class<T> keyClass, final Class<V> valueClass) { assertIsNotParameterized(keyClass, "generic key types are not allowed for this method."); assertIsNotParameterized(valueClass, "generic value types ...
oblac/jodd
jodd-http/src/main/java/jodd/http/HttpRequest.java
HttpRequest.trace
public static HttpRequest trace(final String destination) { return new HttpRequest() .method(HttpMethod.TRACE) .set(destination); }
java
public static HttpRequest trace(final String destination) { return new HttpRequest() .method(HttpMethod.TRACE) .set(destination); }
[ "public", "static", "HttpRequest", "trace", "(", "final", "String", "destination", ")", "{", "return", "new", "HttpRequest", "(", ")", ".", "method", "(", "HttpMethod", ".", "TRACE", ")", ".", "set", "(", "destination", ")", ";", "}" ]
Builds a TRACE request.
[ "Builds", "a", "TRACE", "request", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpRequest.java#L275-L279
test
Creates a new HTTP TRACE request with the specified destination.
Of course, here is the Java code you requested: ```java public static HttpRequest trace(final String destination) { return new HttpRequest() .method(HttpMethod.TRACE) .set(destination); } ``` Hope this helps!
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/collection/GribCollectionWriter.java
GribCollectionWriter.writeGdsProto
static GribCollectionProto.Gds writeGdsProto(byte[] rawGds, int predefinedGridDefinition) { GribCollectionProto.Gds.Builder b = GribCollectionProto.Gds.newBuilder(); if (predefinedGridDefinition >= 0) b.setPredefinedGridDefinition(predefinedGridDefinition); else { b.setGds(ByteString.copyFrom(r...
java
static GribCollectionProto.Gds writeGdsProto(byte[] rawGds, int predefinedGridDefinition) { GribCollectionProto.Gds.Builder b = GribCollectionProto.Gds.newBuilder(); if (predefinedGridDefinition >= 0) b.setPredefinedGridDefinition(predefinedGridDefinition); else { b.setGds(ByteString.copyFrom(r...
[ "static", "GribCollectionProto", ".", "Gds", "writeGdsProto", "(", "byte", "[", "]", "rawGds", ",", "int", "predefinedGridDefinition", ")", "{", "GribCollectionProto", ".", "Gds", ".", "Builder", "b", "=", "GribCollectionProto", ".", "Gds", ".", "newBuilder", "(...
/* message Gds { bytes gds = 1; // raw gds: Grib1SectionGridDefinition or Grib2SectionGridDefinition uint32 predefinedGridDefinition = 2; // only grib1; instead of gds raw bytes; need center, subcenter to interpret }
[ "/", "*", "message", "Gds", "{", "bytes", "gds", "=", "1", ";", "//", "raw", "gds", ":", "Grib1SectionGridDefinition", "or", "Grib2SectionGridDefinition", "uint32", "predefinedGridDefinition", "=", "2", ";", "//", "only", "grib1", ";", "instead", "of", "gds", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/collection/GribCollectionWriter.java#L48-L58
test
Write a Gds object from rawGds
Of course, here is the Java code you requested: ```java static GribCollectionProto.Gds writeGdsProto(byte[] rawGds, int predefinedGridDefinition) { GribCollectionProto.Gds.Builder b = GribCollectionProto.Gds.newBuilder(); if (predefinedGridDefinition >= 0) b.setPredefinedGridDefinition(predefinedGridDef...
wildfly/wildfly
jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java
PersistenceUnitServiceHandler.getOrCreateResource
private static Resource getOrCreateResource(final Resource parent, final PathElement element) { synchronized (parent) { if (parent.hasChild(element)) { return parent.requireChild(element); } else { final Resource resource = Resource.Factory.create(); ...
java
private static Resource getOrCreateResource(final Resource parent, final PathElement element) { synchronized (parent) { if (parent.hasChild(element)) { return parent.requireChild(element); } else { final Resource resource = Resource.Factory.create(); ...
[ "private", "static", "Resource", "getOrCreateResource", "(", "final", "Resource", "parent", ",", "final", "PathElement", "element", ")", "{", "synchronized", "(", "parent", ")", "{", "if", "(", "parent", ".", "hasChild", "(", "element", ")", ")", "{", "retur...
TODO this is a temporary hack into internals until DeploymentUnit exposes a proper Resource-based API
[ "TODO", "this", "is", "a", "temporary", "hack", "into", "internals", "until", "DeploymentUnit", "exposes", "a", "proper", "Resource", "-", "based", "API" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java#L1134-L1144
test
Gets or creates a resource.
Of course, here is the Java code you requested: ```java private static Resource getOrCreateResource(final Resource parent, final PathElement element) { synchronized (parent) { if (parent.hasChild(element)) { return parent.requireChild(element); } else { f...
streamsets/datacollector
commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java
ProtobufTypeUtil.protobufToSdcField
public static Field protobufToSdcField( Record record, String fieldPath, Descriptors.Descriptor descriptor, Map<String, Set<Descriptors.FieldDescriptor>> messageTypeToExtensionMap, Object message ) throws DataParserException { LinkedHashMap<String, Field> sdcRecordMapFieldValue = new...
java
public static Field protobufToSdcField( Record record, String fieldPath, Descriptors.Descriptor descriptor, Map<String, Set<Descriptors.FieldDescriptor>> messageTypeToExtensionMap, Object message ) throws DataParserException { LinkedHashMap<String, Field> sdcRecordMapFieldValue = new...
[ "public", "static", "Field", "protobufToSdcField", "(", "Record", "record", ",", "String", "fieldPath", ",", "Descriptors", ".", "Descriptor", "descriptor", ",", "Map", "<", "String", ",", "Set", "<", "Descriptors", ".", "FieldDescriptor", ">", ">", "messageType...
Converts a protobuf message to an SDC Record Field. @param record SDC Record to add field to @param fieldPath location in record where to insert field. @param descriptor protobuf descriptor instance @param messageTypeToExtensionMap protobuf extensions map @param messag...
[ "Converts", "a", "protobuf", "message", "to", "an", "SDC", "Record", "Field", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java#L288-L346
test
Convert a proto message to a sdc field.
Of course, here is the Java code you requested: ```java public static Field protobufToSdcField( Record record, String fieldPath, Descriptors.Descriptor descriptor, Map<String, Set<Descriptors.FieldDescriptor>> messageTypeToExtensionMap, Object message ) throws DataParserException { ...
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/conclusions/classes/ClassConclusionInsertionVisitor.java
ClassConclusionInsertionVisitor.defaultVisit
@Override protected Boolean defaultVisit(ClassConclusion conclusion) { Context context = get(); boolean result = context.addConclusion(conclusion); if (LOGGER_.isTraceEnabled()) { LOGGER_.trace("{}: inserting {}: {}", context, conclusion, result ? "success" : "failure"); } return result; }
java
@Override protected Boolean defaultVisit(ClassConclusion conclusion) { Context context = get(); boolean result = context.addConclusion(conclusion); if (LOGGER_.isTraceEnabled()) { LOGGER_.trace("{}: inserting {}: {}", context, conclusion, result ? "success" : "failure"); } return result; }
[ "@", "Override", "protected", "Boolean", "defaultVisit", "(", "ClassConclusion", "conclusion", ")", "{", "Context", "context", "=", "get", "(", ")", ";", "boolean", "result", "=", "context", ".", "addConclusion", "(", "conclusion", ")", ";", "if", "(", "LOGG...
logging is switched off
[ "logging", "is", "switched", "off" ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/conclusions/classes/ClassConclusionInsertionVisitor.java#L74-L83
test
Override the default visitor to insert a CDNENTENTENTENTENTENT.
Of course, here is the Java code you requested: ```java @Override protected Boolean defaultVisit(ClassConclusion conclusion) { Context context = get(); boolean result = context.addConclusion(conclusion); if (LOGGER_.isTraceEnabled()) { LOGGER_.trace("{}: inserting {}: {}", context, conclusion, result ? ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft2/coverage/HorizCoordSys.java
HorizCoordSys.subset
public Optional<HorizCoordSys> subset(SubsetParams params) { LatLonRect llbb = (LatLonRect) params.get(SubsetParams.latlonBB); ProjectionRect projbb = (ProjectionRect) params.get(SubsetParams.projBB); LatLonPoint latlon = (LatLonPoint) params.get(SubsetParams.latlonPoint); Integer horizStride = (Integer...
java
public Optional<HorizCoordSys> subset(SubsetParams params) { LatLonRect llbb = (LatLonRect) params.get(SubsetParams.latlonBB); ProjectionRect projbb = (ProjectionRect) params.get(SubsetParams.projBB); LatLonPoint latlon = (LatLonPoint) params.get(SubsetParams.latlonPoint); Integer horizStride = (Integer...
[ "public", "Optional", "<", "HorizCoordSys", ">", "subset", "(", "SubsetParams", "params", ")", "{", "LatLonRect", "llbb", "=", "(", "LatLonRect", ")", "params", ".", "get", "(", "SubsetParams", ".", "latlonBB", ")", ";", "ProjectionRect", "projbb", "=", "(",...
///////////////////////////////////////////////////////////////////////////////////
[ "///////////////////////////////////////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/coverage/HorizCoordSys.java#L134-L264
test
Get the subset of the horiz coords
Of course, here is the Java code you requested: ```java public Optional<HorizCoordSys> subset(SubsetParams params) { LatLonRect llbb = (LatLonRect) params.get(SubsetParams.latlonBB); ProjectionRect projbb = (ProjectionRect) params.get(SubsetParams.projBB); LatLonPoint latlon = (LatLonPoint) params.get(Subs...
jboss/jboss-common-core
src/main/java/org/jboss/util/collection/WeakTypeCache.java
WeakTypeCache.get
public T get(String name, ClassLoader cl) throws ClassNotFoundException { if (name == null) throw new IllegalArgumentException("Null name"); if (cl == null) throw new IllegalArgumentException("Null classloader"); Class<?> clazz = cl.loadClass(name); return get(clazz); }
java
public T get(String name, ClassLoader cl) throws ClassNotFoundException { if (name == null) throw new IllegalArgumentException("Null name"); if (cl == null) throw new IllegalArgumentException("Null classloader"); Class<?> clazz = cl.loadClass(name); return get(clazz); }
[ "public", "T", "get", "(", "String", "name", ",", "ClassLoader", "cl", ")", "throws", "ClassNotFoundException", "{", "if", "(", "name", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Null name\"", ")", ";", "if", "(", "cl", "==", "n...
Get the information for a class @param name the name @param cl the classloader @return the info @throws ClassNotFoundException when the class cannot be found
[ "Get", "the", "information", "for", "a", "class" ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/collection/WeakTypeCache.java#L83-L92
test
Get a single object from the object table using the specified class loader.
Of course, here is the Java code you requested: ```java public T get(String name, ClassLoader cl) throws ClassNotFoundException { if (name == null) throw new IllegalArgumentException("Null name"); if (cl == null) throw new IllegalArgumentException("Null classloader"); Class<?> c...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.count
@CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) public final Single<Long> count() { return RxJavaPlugins.onAssembly(new FlowableCountSingle<T>(this)); }
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) public final Single<Long> count() { return RxJavaPlugins.onAssembly(new FlowableCountSingle<T>(this)); }
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "UNBOUNDED_IN", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Single", "<", "Long", ">", "count", "(", ")", "{", "return", "RxJavaPl...
Returns a Single that counts the total number of items emitted by the source Publisher and emits this count as a 64-bit Long. <p> <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/longCount.png" alt=""> <dl> <dt><b>Backpressure:</b></dt> <dd>The operator honors backpres...
[ "Returns", "a", "Single", "that", "counts", "the", "total", "number", "of", "items", "emitted", "by", "the", "source", "Publisher", "and", "emits", "this", "count", "as", "a", "64", "-", "bit", "Long", ".", "<p", ">", "<img", "width", "=", "640", "heig...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L8179-L8184
test
Count the number of tokens in a sequence of tokens.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @SchedulerSupport(SchedulerSupport.NONE) public final Single<Long> count() { return RxJavaPlugins.onAssembly(new FlowableCountSingle<T>(this)); } ``` Hope this helps!
jboss/jboss-common-core
src/main/java/org/jboss/util/xml/catalog/CatalogManager.java
CatalogManager.getCatalog
public Catalog getCatalog() { Catalog catalog = staticCatalog; if (useStaticCatalog == null) { useStaticCatalog = new Boolean(getUseStaticCatalog()); } if (catalog == null || !useStaticCatalog.booleanValue()) { catalog = getPrivateCatalog(); if (useStaticCatalog.booleanValue()) { st...
java
public Catalog getCatalog() { Catalog catalog = staticCatalog; if (useStaticCatalog == null) { useStaticCatalog = new Boolean(getUseStaticCatalog()); } if (catalog == null || !useStaticCatalog.booleanValue()) { catalog = getPrivateCatalog(); if (useStaticCatalog.booleanValue()) { st...
[ "public", "Catalog", "getCatalog", "(", ")", "{", "Catalog", "catalog", "=", "staticCatalog", ";", "if", "(", "useStaticCatalog", "==", "null", ")", "{", "useStaticCatalog", "=", "new", "Boolean", "(", "getUseStaticCatalog", "(", ")", ")", ";", "}", "if", ...
@return a catalog instance. If this manager uses static catalogs, the same static catalog will always be returned. Otherwise a new catalog will be returned.
[ "@return", "a", "catalog", "instance", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/CatalogManager.java#L712-L727
test
Get the catalog.
Of course, here is the Java code you requested: ```java public Catalog getCatalog() { Catalog catalog = staticCatalog; if (useStaticCatalog == null) { useStaticCatalog = new Boolean(getUseStaticCatalog()); } if (catalog == null || !useStaticCatalog.booleanValue()) { catalog = getPrivateCa...
fabric8io/fabric8-maven-plugin
core/src/main/java/io/fabric8/maven/core/util/AsciiDocParser.java
AsciiDocParser.skipUntilColumns
private void skipUntilColumns(final BufferedReader tableContent) throws IOException { String line; while ((line = tableContent.readLine()) != null) { if(line.trim().isEmpty()){ break; } } }
java
private void skipUntilColumns(final BufferedReader tableContent) throws IOException { String line; while ((line = tableContent.readLine()) != null) { if(line.trim().isEmpty()){ break; } } }
[ "private", "void", "skipUntilColumns", "(", "final", "BufferedReader", "tableContent", ")", "throws", "IOException", "{", "String", "line", ";", "while", "(", "(", "line", "=", "tableContent", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "if", "...
Moves buffer until it finds the first content column (skipping headers). @param tableContent
[ "Moves", "buffer", "until", "it", "finds", "the", "first", "content", "column", "(", "skipping", "headers", ")", "." ]
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/util/AsciiDocParser.java#L148-L155
test
Skip until the first empty line.
Of course, here is the Java code you requested: ```java private void skipUntilColumns(final BufferedReader tableContent) throws IOException { String line; while ((line = tableContent.readLine()) != null) { if(line.trim().isEmpty()){ break; } } } ``` ...
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/ComponentConfiguration.java
ComponentConfiguration.addComponentInterceptor
public void addComponentInterceptor(Method method, InterceptorFactory factory, int priority) { addComponentInterceptors(method, Collections.singletonList(factory), priority); }
java
public void addComponentInterceptor(Method method, InterceptorFactory factory, int priority) { addComponentInterceptors(method, Collections.singletonList(factory), priority); }
[ "public", "void", "addComponentInterceptor", "(", "Method", "method", ",", "InterceptorFactory", "factory", ",", "int", "priority", ")", "{", "addComponentInterceptors", "(", "method", ",", "Collections", ".", "singletonList", "(", "factory", ")", ",", "priority", ...
Adds an interceptor factory to a given method. The method parameter *must* be retrived from either the {@link org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex} or from {@link #getDefinedComponentMethods()}, as the methods are stored in an identity hash map @param method The method to add the intercep...
[ "Adds", "an", "interceptor", "factory", "to", "a", "given", "method", ".", "The", "method", "parameter", "*", "must", "*", "be", "retrived", "from", "either", "the", "{", "@link", "org", ".", "jboss", ".", "as", ".", "server", ".", "deployment", ".", "...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ComponentConfiguration.java#L217-L219
test
Add an interceptor to the application.
Of course, here is the Java code you requested: ```java public void addComponentInterceptor(Method method, InterceptorFactory factory, int priority) { addComponentInterceptors(method, Collections.singletonList(factory), priority); } ``` Hope this helps!
PistoiaHELM/HELMNotationParser
src/main/java/org/helm/notation2/parser/notation/HELM2Notation.java
HELM2Notation.annotationToHELM2
public String annotationToHELM2() { if (!(annotationSection.isEmpty())) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < annotationSection.size(); i++) { sb.append(annotationSection.get(i).toHELM2() + "|"); } sb.setLength(sb.length() - 1); return sb.toStri...
java
public String annotationToHELM2() { if (!(annotationSection.isEmpty())) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < annotationSection.size(); i++) { sb.append(annotationSection.get(i).toHELM2() + "|"); } sb.setLength(sb.length() - 1); return sb.toStri...
[ "public", "String", "annotationToHELM2", "(", ")", "{", "if", "(", "!", "(", "annotationSection", ".", "isEmpty", "(", ")", ")", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", ...
method to generate a valid HELM2 string for the fourth section @return valid HELM2 String
[ "method", "to", "generate", "a", "valid", "HELM2", "string", "for", "the", "fourth", "section" ]
685d7ab7886e9b5cc15fb904025fe6eee703f8f6
https://github.com/PistoiaHELM/HELMNotationParser/blob/685d7ab7886e9b5cc15fb904025fe6eee703f8f6/src/main/java/org/helm/notation2/parser/notation/HELM2Notation.java#L312-L323
test
Converts a list of annotation objects to HELM2 format.
Of course, here is the Java code you requested: ```java public String annotationToHELM2() { if (!(annotationSection.isEmpty())) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < annotationSection.size(); i++) { sb.append(annotationSection.get(i).toHELM2() + "|"); } ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/NCdumpW.java
NCdumpW.main
public static void main(String[] args) { if (args.length == 0) { System.out.println(usage); return; } StringBuilder sbuff = new StringBuilder(); for (String arg : args) { sbuff.append(arg); sbuff.append(" "); } try { Writer writer = new BufferedWriter(new OutputSt...
java
public static void main(String[] args) { if (args.length == 0) { System.out.println(usage); return; } StringBuilder sbuff = new StringBuilder(); for (String arg : args) { sbuff.append(arg); sbuff.append(" "); } try { Writer writer = new BufferedWriter(new OutputSt...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "==", "0", ")", "{", "System", ".", "out", ".", "println", "(", "usage", ")", ";", "return", ";", "}", "StringBuilder", "sbuff", "=", ...
Main program. <p><strong>ucar.nc2.NCdumpW filename [-cdl | -ncml] [-c | -vall] [-v varName1;varName2;..] [-v varName(0:1,:,12)] </strong> <p>where: <ul> <li> filename : path of any CDM readable file <li> cdl or ncml: output format is CDL or NcML <li> -vall : dump all variable data <li> -c : dump coordinate variable dat...
[ "Main", "program", ".", "<p", ">", "<strong", ">", "ucar", ".", "nc2", ".", "NCdumpW", "filename", "[", "-", "cdl", "|", "-", "ncml", "]", "[", "-", "c", "|", "-", "vall", "]", "[", "-", "v", "varName1", ";", "varName2", ";", "..", "]", "[", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NCdumpW.java#L691-L710
test
This method is the main method of the NCdumpW class.
Of course, here is the Java code you requested: ```java public static void main(String[] args) { if (args.length == 0) { System.out.println(usage); return; } StringBuilder sbuff = new StringBuilder(); for (String arg : args) { sbuff.append(arg); sbuff.append(" "); } tr...
oblac/jodd
jodd-core/src/main/java/jodd/system/SystemUtil.java
SystemUtil.getLong
public static long getLong(final String name, final long defaultValue) { String value = get(name); if (value == null) { return defaultValue; } value = value.trim().toLowerCase(); try { return Long.parseLong(value); } catch (NumberFormatException nfex) { return defaultValue; } }
java
public static long getLong(final String name, final long defaultValue) { String value = get(name); if (value == null) { return defaultValue; } value = value.trim().toLowerCase(); try { return Long.parseLong(value); } catch (NumberFormatException nfex) { return defaultValue; } }
[ "public", "static", "long", "getLong", "(", "final", "String", "name", ",", "final", "long", "defaultValue", ")", "{", "String", "value", "=", "get", "(", "name", ")", ";", "if", "(", "value", "==", "null", ")", "{", "return", "defaultValue", ";", "}",...
Returns system property as a long.
[ "Returns", "system", "property", "as", "a", "long", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/system/SystemUtil.java#L112-L125
test
Gets the long value for the specified name.
Of course, here is the Java code you requested: ```java public static long getLong(final String name, final long defaultValue) { String value = get(name); if (value == null) { return defaultValue; } value = value.trim().toLowerCase(); try { return Long.parseLong(value); } catch (NumberFormatExcept...
jboss/jboss-common-core
src/main/java/org/jboss/util/xml/catalog/helpers/BootstrapResolver.java
BootstrapResolver.resolveEntity
public InputSource resolveEntity (String publicId, String systemId) { String resolved = null; if (systemId != null && systemMap.containsKey(systemId)) { resolved = (String) systemMap.get(systemId); } else if (publicId != null && publicMap.containsKey(publicId)) { resolved = (String) publicMap.g...
java
public InputSource resolveEntity (String publicId, String systemId) { String resolved = null; if (systemId != null && systemMap.containsKey(systemId)) { resolved = (String) systemMap.get(systemId); } else if (publicId != null && publicMap.containsKey(publicId)) { resolved = (String) publicMap.g...
[ "public", "InputSource", "resolveEntity", "(", "String", "publicId", ",", "String", "systemId", ")", "{", "String", "resolved", "=", "null", ";", "if", "(", "systemId", "!=", "null", "&&", "systemMap", ".", "containsKey", "(", "systemId", ")", ")", "{", "r...
SAX resolveEntity API.
[ "SAX", "resolveEntity", "API", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/helpers/BootstrapResolver.java#L96-L133
test
Resolves an entity.
Of course, here is the Java code you requested: ```java public InputSource resolveEntity (String publicId, String systemId) { String resolved = null; if (systemId != null && systemMap.containsKey(systemId)) { resolved = (String) systemMap.get(systemId); } else if (publicId != null && publicMap.conta...
myabc/markdownj
core/src/main/java/org/markdownj/TextEditor.java
TextEditor.replaceAll
public TextEditor replaceAll(Pattern pattern, Replacement replacement) { Matcher m = pattern.matcher(text); int lastIndex = 0; StringBuilder sb = new StringBuilder(); while (m.find()) { sb.append(text.subSequence(lastIndex, m.start())); sb.append(replacement.repla...
java
public TextEditor replaceAll(Pattern pattern, Replacement replacement) { Matcher m = pattern.matcher(text); int lastIndex = 0; StringBuilder sb = new StringBuilder(); while (m.find()) { sb.append(text.subSequence(lastIndex, m.start())); sb.append(replacement.repla...
[ "public", "TextEditor", "replaceAll", "(", "Pattern", "pattern", ",", "Replacement", "replacement", ")", "{", "Matcher", "m", "=", "pattern", ".", "matcher", "(", "text", ")", ";", "int", "lastIndex", "=", "0", ";", "StringBuilder", "sb", "=", "new", "Stri...
Replace all occurrences of the Pattern. The Replacement object's replace() method is called on each match, and it provides a replacement, which is placed literally (i.e., without interpreting $1, $2 etc.) @param pattern @param replacement @return
[ "Replace", "all", "occurrences", "of", "the", "Pattern", ".", "The", "Replacement", "object", "s", "replace", "()", "method", "is", "called", "on", "each", "match", "and", "it", "provides", "a", "replacement", "which", "is", "placed", "literally", "(", "i", ...
f8ed00caeb69fc602aa2209812d953c26c2a4263
https://github.com/myabc/markdownj/blob/f8ed00caeb69fc602aa2209812d953c26c2a4263/core/src/main/java/org/markdownj/TextEditor.java#L117-L129
test
Replaces all occurrences of the specified pattern with the specified replacement.
Of course, here is the Java code you requested: ```java public TextEditor replaceAll(Pattern pattern, Replacement replacement) { Matcher m = pattern.matcher(text); int lastIndex = 0; StringBuilder sb = new StringBuilder(); while (m.find()) { sb.append(text.subSequence(lastIn...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/config/XmlConfig.java
XmlConfig.property
public XmlConfig property(String name, Object value) { Validate.notEmpty(name, "Name cannot be empty"); Map<String, Object> newProperties = new HashMap<String, Object>(properties); newProperties.put(name, value); return new XmlConfig(features, declaredNamespaces, newProperties, validatin...
java
public XmlConfig property(String name, Object value) { Validate.notEmpty(name, "Name cannot be empty"); Map<String, Object> newProperties = new HashMap<String, Object>(properties); newProperties.put(name, value); return new XmlConfig(features, declaredNamespaces, newProperties, validatin...
[ "public", "XmlConfig", "property", "(", "String", "name", ",", "Object", "value", ")", "{", "Validate", ".", "notEmpty", "(", "name", ",", "\"Name cannot be empty\"", ")", ";", "Map", "<", "String", ",", "Object", ">", "newProperties", "=", "new", "HashMap",...
Set a value of a property. @param name The property name. @param value The requested value of the feature (true or false). @return A new XmlConfig instance @see org.xml.sax.XMLReader#setFeature(java.lang.String, boolean)
[ "Set", "a", "value", "of", "a", "property", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/config/XmlConfig.java#L124-L129
test
Sets a property.
Of course, here is the Java code you requested: ```java public XmlConfig property(String name, Object value) { Validate.notEmpty(name, "Name cannot be empty"); Map<String, Object> newProperties = new HashMap<String, Object>(properties); newProperties.put(name, value); return new XmlConf...
playframework/playframework
transport/server/play-server/src/main/java/play/server/Server.java
Server.forRouter
public static Server forRouter(Function<BuiltInComponents, Router> block) { return forRouter(Mode.TEST, 0, block); }
java
public static Server forRouter(Function<BuiltInComponents, Router> block) { return forRouter(Mode.TEST, 0, block); }
[ "public", "static", "Server", "forRouter", "(", "Function", "<", "BuiltInComponents", ",", "Router", ">", "block", ")", "{", "return", "forRouter", "(", "Mode", ".", "TEST", ",", "0", ",", "block", ")", ";", "}" ]
Create a server for the given router. <p>The server will be running on a randomly selected ephemeral port, which can be checked using the httpPort property. <p>The server will be running in TEST mode. @param block The block that creates the router. @return The running server.
[ "Create", "a", "server", "for", "the", "given", "router", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/transport/server/play-server/src/main/java/play/server/Server.java#L90-L92
test
Create a new server for a test mode.
Of course, here is the Java code you requested: ```java public static Server forRouter(Function<BuiltInComponents, Router> block) { return forRouter(Mode.TEST, 0, block); } ``` Hope this helps!
jboss/jboss-common-core
src/main/java/org/jboss/util/Objects.java
Objects.copy
public static Object copy(final Serializable obj) throws IOException, ClassNotFoundException { ObjectOutputStream out = null; ObjectInputStream in = null; Object copy = null; try { // write the object ByteArrayOutputStream baos = new ByteArrayOutputStream(); ...
java
public static Object copy(final Serializable obj) throws IOException, ClassNotFoundException { ObjectOutputStream out = null; ObjectInputStream in = null; Object copy = null; try { // write the object ByteArrayOutputStream baos = new ByteArrayOutputStream(); ...
[ "public", "static", "Object", "copy", "(", "final", "Serializable", "obj", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "ObjectOutputStream", "out", "=", "null", ";", "ObjectInputStream", "in", "=", "null", ";", "Object", "copy", "=", "null"...
Copy an serializable object deeply. @param obj Object to copy. @return Copied object. @throws IOException @throws ClassNotFoundException
[ "Copy", "an", "serializable", "object", "deeply", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/Objects.java#L93-L119
test
Copy the object.
Of course, here is the Java code you requested: ```java public static Object copy(final Serializable obj) throws IOException, ClassNotFoundException { ObjectOutputStream out = null; ObjectInputStream in = null; Object copy = null; try { // write the object Byte...
sialcasa/mvvmFX
mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/mapping/ModelWrapper.java
ModelWrapper.copyValuesTo
public void copyValuesTo(M model) { Objects.requireNonNull(model); fields.forEach(field -> field.commit(model)); }
java
public void copyValuesTo(M model) { Objects.requireNonNull(model); fields.forEach(field -> field.commit(model)); }
[ "public", "void", "copyValuesTo", "(", "M", "model", ")", "{", "Objects", ".", "requireNonNull", "(", "model", ")", ";", "fields", ".", "forEach", "(", "field", "->", "field", ".", "commit", "(", "model", ")", ")", ";", "}" ]
This method can be used to copy all values of this {@link ModelWrapper} instance to the model instance provided as argument. Existing values in the provided model instance will be overwritten. <p> This method doesn't change the state of this modelWrapper or the wrapped model instance. @param model a non-null instance ...
[ "This", "method", "can", "be", "used", "to", "copy", "all", "values", "of", "this", "{", "@link", "ModelWrapper", "}", "instance", "to", "the", "model", "instance", "provided", "as", "argument", ".", "Existing", "values", "in", "the", "provided", "model", ...
240566a358a8e01c94c0bbb99228140a69690d02
https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/mapping/ModelWrapper.java#L500-L503
test
Copies the values of this entity to the given model.
Of course, here is the Java code you requested: ```java public void copyValuesTo(M model) { Objects.requireNonNull(model); fields.forEach(field -> field.commit(model)); } ``` Hope this helps!
rupertlssmith/lojix
base/common/src/main/com/thesett/common/io/DistributedInputStreamImpl.java
DistributedInputStreamImpl.read
public ByteBlock read(byte[] b, int off, int len) throws IOException { int count = source.read(b, off, len); return new ByteBlock(b, count); }
java
public ByteBlock read(byte[] b, int off, int len) throws IOException { int count = source.read(b, off, len); return new ByteBlock(b, count); }
[ "public", "ByteBlock", "read", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "int", "count", "=", "source", ".", "read", "(", "b", ",", "off", ",", "len", ")", ";", "return", "new", "ByteBlock"...
Reads up to len bytes of data from the input stream into an array of bytes. @param b The byte array to store the results of the read into. @param off The start offset in array b at which the data is written. @param len The maximum number of bytes to read. @return The same results as stored in parameter b but wra...
[ "Reads", "up", "to", "len", "bytes", "of", "data", "from", "the", "input", "stream", "into", "an", "array", "of", "bytes", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/io/DistributedInputStreamImpl.java#L156-L161
test
Read a block of bytes from the underlying stream.
Of course, here is the Java code you requested: ```java public ByteBlock read(byte[] b, int off, int len) throws IOException { int count = source.read(b, off, len); return new ByteBlock(b, count); } ``` Hope this helps!
oblac/jodd
jodd-petite/src/main/java/jodd/petite/resolver/PropertyResolver.java
PropertyResolver.resolve
public PropertyInjectionPoint[] resolve(Class type, final boolean autowire) { final List<PropertyInjectionPoint> list = new ArrayList<>(); final Set<String> usedPropertyNames = new HashSet<>(); // lookup fields while (type != Object.class) { final ClassDescriptor cd = ClassIntrospector.get().lookup(type); ...
java
public PropertyInjectionPoint[] resolve(Class type, final boolean autowire) { final List<PropertyInjectionPoint> list = new ArrayList<>(); final Set<String> usedPropertyNames = new HashSet<>(); // lookup fields while (type != Object.class) { final ClassDescriptor cd = ClassIntrospector.get().lookup(type); ...
[ "public", "PropertyInjectionPoint", "[", "]", "resolve", "(", "Class", "type", ",", "final", "boolean", "autowire", ")", "{", "final", "List", "<", "PropertyInjectionPoint", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "final", "Set", "<", "S...
Resolves all properties for given type.
[ "Resolves", "all", "properties", "for", "given", "type", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/resolver/PropertyResolver.java#L55-L108
test
Resolves the given type to the BeanInjectionPoints.
Of course, here is the Java code you requested: ```java public PropertyInjectionPoint[] resolve(Class type, final boolean autowire) { final List<PropertyInjectionPoint> list = new ArrayList<>(); final Set<String> usedPropertyNames = new HashSet<>(); // lookup fields while (type != Object.class) { final Cl...
HalBuilder/halbuilder-core
src/main/java/com/theoryinpractise/halbuilder5/ResourceRepresentation.java
ResourceRepresentation.withValue
public <R> ResourceRepresentation<R> withValue(R newValue) { return new ResourceRepresentation<>( Option.none(), links, rels, namespaceManager, newValue, resources); }
java
public <R> ResourceRepresentation<R> withValue(R newValue) { return new ResourceRepresentation<>( Option.none(), links, rels, namespaceManager, newValue, resources); }
[ "public", "<", "R", ">", "ResourceRepresentation", "<", "R", ">", "withValue", "(", "R", "newValue", ")", "{", "return", "new", "ResourceRepresentation", "<>", "(", "Option", ".", "none", "(", ")", ",", "links", ",", "rels", ",", "namespaceManager", ",", ...
Replace the value of this resource with a new value, optionally of a new type. @param newValue The new value for this resource @param <R> The type of the new value @return The new resource
[ "Replace", "the", "value", "of", "this", "resource", "with", "a", "new", "value", "optionally", "of", "a", "new", "type", "." ]
73a277d844ec9616722f655dc34f8174b06b1327
https://github.com/HalBuilder/halbuilder-core/blob/73a277d844ec9616722f655dc34f8174b06b1327/src/main/java/com/theoryinpractise/halbuilder5/ResourceRepresentation.java#L285-L288
test
Returns a new resource representation with the specified value.
Of course, here is the Java code you requested: ```java public <R> ResourceRepresentation<R> withValue(R newValue) { return new ResourceRepresentation<>( Option.none(), links, rels, namespaceManager, newValue, resources); } ``` Hope this helps!
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/collection/GribCollectionWriter.java
GribCollectionWriter.convertAxisType
public static GribCollectionProto.GribAxisType convertAxisType(Coordinate.Type type) { switch (type) { case runtime: return GribCollectionProto.GribAxisType.runtime; case time: return GribCollectionProto.GribAxisType.time; case time2D: return GribCollectionProto.GribAxisTyp...
java
public static GribCollectionProto.GribAxisType convertAxisType(Coordinate.Type type) { switch (type) { case runtime: return GribCollectionProto.GribAxisType.runtime; case time: return GribCollectionProto.GribAxisType.time; case time2D: return GribCollectionProto.GribAxisTyp...
[ "public", "static", "GribCollectionProto", ".", "GribAxisType", "convertAxisType", "(", "Coordinate", ".", "Type", "type", ")", "{", "switch", "(", "type", ")", "{", "case", "runtime", ":", "return", "GribCollectionProto", ".", "GribAxisType", ".", "runtime", ";...
/* not currently used protected GribCollectionProto.FcConfig writeConfig(FeatureCollectionConfig config) throws IOException { GribCollectionProto.FcConfig.Builder b = GribCollectionProto.FcConfig.newBuilder(); b.setName(config.collectionName); b.setCollectionSpec(config.spec); b.setPartitionType(config.ptype.toString(...
[ "/", "*", "not", "currently", "used" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/collection/GribCollectionWriter.java#L278-L294
test
Convert the Grib axis type to GribAxisType
Of course, here is the Java code you requested: ```java public static GribCollectionProto.GribAxisType convertAxisType(Coordinate.Type type) { switch (type) { case runtime: return GribCollectionProto.GribAxisType.runtime; case time: return GribCollectionProto.GribAxisType.time; ca...
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/ImmobiliareItWritingExample.java
ImmobiliareItWritingExample.main
@SuppressWarnings("Duplicates") public static void main(String[] args) { // init logging PropertyConfigurator.configure( ImmobiliareItWritingExample.class.getResource(PACKAGE + "/log4j.properties")); // create a Feed object with some example data // this object corre...
java
@SuppressWarnings("Duplicates") public static void main(String[] args) { // init logging PropertyConfigurator.configure( ImmobiliareItWritingExample.class.getResource(PACKAGE + "/log4j.properties")); // create a Feed object with some example data // this object corre...
[ "@", "SuppressWarnings", "(", "\"Duplicates\"", ")", "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "// init logging", "PropertyConfigurator", ".", "configure", "(", "ImmobiliareItWritingExample", ".", "class", ".", "getResource", "...
Start the example application. @param args command line arguments
[ "Start", "the", "example", "application", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/ImmobiliareItWritingExample.java#L91-L133
test
Main method to run the application.
Of course, here is the Java code you requested: ```java @SuppressWarnings("Duplicates") public static void main(String[] args) { // init logging PropertyConfigurator.configure( ImmobiliareItWritingExample.class.getResource(PACKAGE + "/log4j.properties")); // create a Feed o...
wildfly/wildfly
pojo/src/main/java/org/jboss/as/pojo/descriptor/AbstractConfigVisitorNode.java
AbstractConfigVisitorNode.getComponentType
static Type getComponentType(ParameterizedType type, int index) { Type[] tp = type.getActualTypeArguments(); if (index + 1 > tp.length) return null; return tp[index]; }
java
static Type getComponentType(ParameterizedType type, int index) { Type[] tp = type.getActualTypeArguments(); if (index + 1 > tp.length) return null; return tp[index]; }
[ "static", "Type", "getComponentType", "(", "ParameterizedType", "type", ",", "int", "index", ")", "{", "Type", "[", "]", "tp", "=", "type", ".", "getActualTypeArguments", "(", ")", ";", "if", "(", "index", "+", "1", ">", "tp", ".", "length", ")", "retu...
Get component type. @param type the type @param index the component index @return component's class or null if cannot be determined
[ "Get", "component", "type", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/pojo/src/main/java/org/jboss/as/pojo/descriptor/AbstractConfigVisitorNode.java#L119-L125
test
Get the type of a class based on the index.
Of course, here is the Java code you requested: ```java static Type getComponentType(ParameterizedType type, int index) { Type[] tp = type.getActualTypeArguments(); if (index + 1 > tp.length) return null; return tp[index]; } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java
BaseComplexNDArray.subiColumnVector
@Override public IComplexNDArray subiColumnVector(INDArray columnVector) { for (int i = 0; i < columns(); i++) { getColumn(i).subi(columnVector.getScalar(i)); } return this; }
java
@Override public IComplexNDArray subiColumnVector(INDArray columnVector) { for (int i = 0; i < columns(); i++) { getColumn(i).subi(columnVector.getScalar(i)); } return this; }
[ "@", "Override", "public", "IComplexNDArray", "subiColumnVector", "(", "INDArray", "columnVector", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "columns", "(", ")", ";", "i", "++", ")", "{", "getColumn", "(", "i", ")", ".", "subi", "(",...
In place addition of a column vector @param columnVector the column vector to add @return the result of the addition
[ "In", "place", "addition", "of", "a", "column", "vector" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java#L2323-L2329
test
Subi column vector.
Of course, here is the Java code you requested: ```java @Override public IComplexNDArray subiColumnVector(INDArray columnVector) { for (int i = 0; i < columns(); i++) { getColumn(i).subi(columnVector.getScalar(i)); } return this; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java
RandomAccessFile.writeDouble
public final void writeDouble(double[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeDouble(pa[start + i]); } }
java
public final void writeDouble(double[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeDouble(pa[start + i]); } }
[ "public", "final", "void", "writeDouble", "(", "double", "[", "]", "pa", ",", "int", "start", ",", "int", "n", ")", "throws", "IOException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n", ";", "i", "++", ")", "{", "writeDouble", "(", ...
Write an array of doubles @param pa write from this array @param start starting with this element in the array @param n write this number of elements @throws IOException on read error
[ "Write", "an", "array", "of", "doubles" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java#L1716-L1720
test
Write a double array to the stream.
Of course, here is the Java code you requested: ```java public final void writeDouble(double[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeDouble(pa[start + i]); } } ``` Hope this helps!
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/www/DigestAuthUtils.java
DigestAuthUtils.splitEachArrayElementAndCreateMap
static Map<String, String> splitEachArrayElementAndCreateMap(String[] array, String delimiter, String removeCharacters) { if ((array == null) || (array.length == 0)) { return null; } Map<String, String> map = new HashMap<>(); for (String s : array) { String postRemove; if (removeCharacters == nul...
java
static Map<String, String> splitEachArrayElementAndCreateMap(String[] array, String delimiter, String removeCharacters) { if ((array == null) || (array.length == 0)) { return null; } Map<String, String> map = new HashMap<>(); for (String s : array) { String postRemove; if (removeCharacters == nul...
[ "static", "Map", "<", "String", ",", "String", ">", "splitEachArrayElementAndCreateMap", "(", "String", "[", "]", "array", ",", "String", "delimiter", ",", "String", "removeCharacters", ")", "{", "if", "(", "(", "array", "==", "null", ")", "||", "(", "arra...
Takes an array of <code>String</code>s, and for each element removes any instances of <code>removeCharacter</code>, and splits the element based on the <code>delimiter</code>. A <code>Map</code> is then generated, with the left of the delimiter providing the key, and the right of the delimiter providing the value. <p> ...
[ "Takes", "an", "array", "of", "<code", ">", "String<", "/", "code", ">", "s", "and", "for", "each", "element", "removes", "any", "instances", "of", "<code", ">", "removeCharacter<", "/", "code", ">", "and", "splits", "the", "element", "based", "on", "the...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/www/DigestAuthUtils.java#L155-L183
test
Split each element of the array into two maps.
Of course, here is the Java code you requested: ```java static Map<String, String> splitEachArrayElementAndCreateMap(String[] array, String delimiter, String removeCharacters) { if ((array == null) || (array.length == 0)) { return null; } Map<String, String> map = new HashMap<>(); for (String s : array...
spring-projects/spring-security
cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java
CasAuthenticationFilter.successfulAuthentication
@Override protected final void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { boolean continueFilterChain = proxyTicketRequest( serviceTicketRequest(request, response), request); if (!...
java
@Override protected final void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { boolean continueFilterChain = proxyTicketRequest( serviceTicketRequest(request, response), request); if (!...
[ "@", "Override", "protected", "final", "void", "successfulAuthentication", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "FilterChain", "chain", ",", "Authentication", "authResult", ")", "throws", "IOException", ",", "ServletException"...
========================================================================================================
[ "========================================================================================================" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/cas/src/main/java/org/springframework/security/cas/web/CasAuthenticationFilter.java#L215-L240
test
Called by the authentication service to inform the user that the authentication was successful.
Of course, here is the Java code you requested: ```java @Override protected final void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { boolean continueFilterChain = proxyTicketRequest( s...
google/guice
core/src/com/google/inject/internal/AbstractBindingProcessor.java
AbstractBindingProcessor.isOkayDuplicate
private boolean isOkayDuplicate(BindingImpl<?> original, BindingImpl<?> binding, State state) { if (original instanceof ExposedBindingImpl) { ExposedBindingImpl exposed = (ExposedBindingImpl) original; InjectorImpl exposedFrom = (InjectorImpl) exposed.getPrivateElements().getInjector(); return (ex...
java
private boolean isOkayDuplicate(BindingImpl<?> original, BindingImpl<?> binding, State state) { if (original instanceof ExposedBindingImpl) { ExposedBindingImpl exposed = (ExposedBindingImpl) original; InjectorImpl exposedFrom = (InjectorImpl) exposed.getPrivateElements().getInjector(); return (ex...
[ "private", "boolean", "isOkayDuplicate", "(", "BindingImpl", "<", "?", ">", "original", ",", "BindingImpl", "<", "?", ">", "binding", ",", "State", "state", ")", "{", "if", "(", "original", "instanceof", "ExposedBindingImpl", ")", "{", "ExposedBindingImpl", "e...
We tolerate duplicate bindings if one exposes the other or if the two bindings are considered duplicates (see {@link Bindings#areDuplicates(BindingImpl, BindingImpl)}. @param original the binding in the parent injector (candidate for an exposing binding) @param binding the binding to check (candidate for the exposed b...
[ "We", "tolerate", "duplicate", "bindings", "if", "one", "exposes", "the", "other", "or", "if", "the", "two", "bindings", "are", "considered", "duplicates", "(", "see", "{", "@link", "Bindings#areDuplicates", "(", "BindingImpl", "BindingImpl", ")", "}", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/AbstractBindingProcessor.java#L111-L126
test
Checks if the original and binding are okay duplicated.
Of course, here is the Java code you requested: ```java private boolean isOkayDuplicate(BindingImpl<?> original, BindingImpl<?> binding, State state) { if (original instanceof ExposedBindingImpl) { ExposedBindingImpl exposed = (ExposedBindingImpl) original; InjectorImpl exposedFrom = (InjectorImpl) exp...
turbomanage/storm-gen
storm-apt/api/src/main/java/com/turbomanage/storm/TableHelper.java
TableHelper.onUpgrade
protected void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) { db.execSQL(upgradeSql(oldVersion, newVersion)); }
java
protected void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) { db.execSQL(upgradeSql(oldVersion, newVersion)); }
[ "protected", "void", "onUpgrade", "(", "final", "SQLiteDatabase", "db", ",", "final", "int", "oldVersion", ",", "final", "int", "newVersion", ")", "{", "db", ".", "execSQL", "(", "upgradeSql", "(", "oldVersion", ",", "newVersion", ")", ")", ";", "}" ]
Upgrades the table that represents the associated entity. This will typically be an ALTER TABLE statement. @param db @param oldVersion @param newVersion
[ "Upgrades", "the", "table", "that", "represents", "the", "associated", "entity", ".", "This", "will", "typically", "be", "an", "ALTER", "TABLE", "statement", "." ]
22caa69439548a074d035745215bce5aff55853d
https://github.com/turbomanage/storm-gen/blob/22caa69439548a074d035745215bce5aff55853d/storm-apt/api/src/main/java/com/turbomanage/storm/TableHelper.java#L196-L199
test
On upgrade.
Of course, here is the Java code you requested: ```java protected void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) { db.execSQL(upgradeSql(oldVersion, newVersion)); } ``` Hope this helps!
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/ConfigurationUtility.java
ConfigurationUtility.buildCellCommentFromalias
private static void buildCellCommentFromalias(List<TieCommandAlias> tieCommandAliasList, Cell cell) { String value = CellUtility.getCellValueWithoutFormat(cell); if ((value!=null)&&(!value.isEmpty())) { for (TieCommandAlias alias : tieCommandAliasList) { Matcher matcher = alias.getPattern().matcher(value...
java
private static void buildCellCommentFromalias(List<TieCommandAlias> tieCommandAliasList, Cell cell) { String value = CellUtility.getCellValueWithoutFormat(cell); if ((value!=null)&&(!value.isEmpty())) { for (TieCommandAlias alias : tieCommandAliasList) { Matcher matcher = alias.getPattern().matcher(value...
[ "private", "static", "void", "buildCellCommentFromalias", "(", "List", "<", "TieCommandAlias", ">", "tieCommandAliasList", ",", "Cell", "cell", ")", "{", "String", "value", "=", "CellUtility", ".", "getCellValueWithoutFormat", "(", "cell", ")", ";", "if", "(", "...
Builds the cell comment fromalias. @param tieCommandAliasList the tie command alias list @param cell the cell
[ "Builds", "the", "cell", "comment", "fromalias", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ConfigurationUtility.java#L780-L793
test
Build cell comment from cell alias list
Of course, here is the Java code you requested: ```java private static void buildCellCommentFromalias(List<TieCommandAlias> tieCommandAliasList, Cell cell) { String value = CellUtility.getCellValueWithoutFormat(cell); if ((value!=null)&&(!value.isEmpty())) { for (TieCommandAlias alias : tieCommandAliasList) ...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/header/writers/HpkpHeaderWriter.java
HpkpHeaderWriter.setReportUri
public void setReportUri(String reportUri) { try { this.reportUri = new URI(reportUri); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } updateHpkpHeaderValue(); }
java
public void setReportUri(String reportUri) { try { this.reportUri = new URI(reportUri); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } updateHpkpHeaderValue(); }
[ "public", "void", "setReportUri", "(", "String", "reportUri", ")", "{", "try", "{", "this", ".", "reportUri", "=", "new", "URI", "(", "reportUri", ")", ";", "}", "catch", "(", "URISyntaxException", "e", ")", "{", "throw", "new", "IllegalArgumentException", ...
<p> Sets the URI to which the browser should report pin validation failures. </p> <p> See <a href="https://tools.ietf.org/html/rfc7469#section-2.1.4">Section 2.1.4</a> for additional details. </p> <p> To get a header like Public-Key-Pins-Report-Only: max-age=5184000; pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF...
[ "<p", ">", "Sets", "the", "URI", "to", "which", "the", "browser", "should", "report", "pin", "validation", "failures", ".", "<", "/", "p", ">" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/header/writers/HpkpHeaderWriter.java#L414-L421
test
Sets the report URI.
Of course, here is the Java code you requested: ```java public void setReportUri(String reportUri) { try { this.reportUri = new URI(reportUri); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } updateHpkpHeaderValue(); } ``` Hope this helps!
streamsets/datacollector
container/src/main/java/com/streamsets/datacollector/runner/RunnerPool.java
RunnerPool.validateNotDestroyed
private void validateNotDestroyed() throws PipelineRuntimeException { if(destroyed.get()) { throw new PipelineRuntimeException(ContainerError.CONTAINER_0803, queue.size(), runtimeStats.getTotalRunners()); } }
java
private void validateNotDestroyed() throws PipelineRuntimeException { if(destroyed.get()) { throw new PipelineRuntimeException(ContainerError.CONTAINER_0803, queue.size(), runtimeStats.getTotalRunners()); } }
[ "private", "void", "validateNotDestroyed", "(", ")", "throws", "PipelineRuntimeException", "{", "if", "(", "destroyed", ".", "get", "(", ")", ")", "{", "throw", "new", "PipelineRuntimeException", "(", "ContainerError", ".", "CONTAINER_0803", ",", "queue", ".", "...
Throw an exception if the runner was already destroyed. @throws PipelineRuntimeException
[ "Throw", "an", "exception", "if", "the", "runner", "was", "already", "destroyed", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/runner/RunnerPool.java#L174-L178
test
Validate that the pipeline is not destroyed.
Of course, here is the Java code you requested: ```java private void validateNotDestroyed() throws PipelineRuntimeException { if(destroyed.get()) { throw new PipelineRuntimeException(ContainerError.CONTAINER_0803, queue.size(), runtimeStats.getTotalRunners()); } } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/widget/BAMutil.java
BAMutil.getIcon
public static ImageIcon getIcon( String name, boolean errMsg) { ImageIcon ii = Resource.getIcon(defaultResourcePath+name+".gif", errMsg); if (ii == null) Resource.getIcon(defaultResourcePath+name+".png", errMsg); return ii; }
java
public static ImageIcon getIcon( String name, boolean errMsg) { ImageIcon ii = Resource.getIcon(defaultResourcePath+name+".gif", errMsg); if (ii == null) Resource.getIcon(defaultResourcePath+name+".png", errMsg); return ii; }
[ "public", "static", "ImageIcon", "getIcon", "(", "String", "name", ",", "boolean", "errMsg", ")", "{", "ImageIcon", "ii", "=", "Resource", ".", "getIcon", "(", "defaultResourcePath", "+", "name", "+", "\".gif\"", ",", "errMsg", ")", ";", "if", "(", "ii", ...
Get the named Icon from the default resource (jar file). @param name name of the Icon ( will look for <name>.gif) @param errMsg true= print error message if not found @return the Icon or null if not found
[ "Get", "the", "named", "Icon", "from", "the", "default", "resource", "(", "jar", "file", ")", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/widget/BAMutil.java#L75-L79
test
Get image icon from name. gif or name. png
Of course, here is the Java code you requested: ```java public static ImageIcon getIcon( String name, boolean errMsg) { ImageIcon ii = Resource.getIcon(defaultResourcePath+name+".gif", errMsg); if (ii == null) Resource.getIcon(defaultResourcePath+name+".png", errMsg); return ii; } ``` Hope this helps!
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/core/memory/encoding/VarInt.java
VarInt.writeVLong
public static void writeVLong(ByteDataBuffer buf, long value) { if(value < 0) buf.write((byte)0x81); if(value > 0xFFFFFFFFFFFFFFL || value < 0) buf.write((byte)(0x80 | ((value >>> 56) & 0x7FL))); if(value > 0x1FFFFFFFFFFFFL || value < 0) buf.write((byte)(0x80 ...
java
public static void writeVLong(ByteDataBuffer buf, long value) { if(value < 0) buf.write((byte)0x81); if(value > 0xFFFFFFFFFFFFFFL || value < 0) buf.write((byte)(0x80 | ((value >>> 56) & 0x7FL))); if(value > 0x1FFFFFFFFFFFFL || value < 0) buf.write((byte)(0x80 ...
[ "public", "static", "void", "writeVLong", "(", "ByteDataBuffer", "buf", ",", "long", "value", ")", "{", "if", "(", "value", "<", "0", ")", "buf", ".", "write", "(", "(", "byte", ")", "0x81", ")", ";", "if", "(", "value", ">", "0xFFFFFFFFFFFFFF", "L",...
Encode the specified long as a variable length integer into the supplied {@link ByteDataBuffer} @param buf the buffer to write to @param value the long value
[ "Encode", "the", "specified", "long", "as", "a", "variable", "length", "integer", "into", "the", "supplied", "{", "@link", "ByteDataBuffer", "}" ]
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/memory/encoding/VarInt.java#L49-L61
test
Write a long value to the byte buffer.
Of course, here is the Java code you requested: ```java public static void writeVLong(ByteDataBuffer buf, long value) { if(value < 0) buf.write((byte)0x81); if(value > 0xFFFFFFFFFFFFFFL || value < 0) buf.write((byte)(0x80 | ((value >>> 56) & 0x7FL))); if(value >...
Unidata/thredds
cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java
NetcdfFileWriter.write
public void write(Variable v, Array values) throws java.io.IOException, InvalidRangeException { if (ncfile != v.getNetcdfFile()) throw new IllegalArgumentException("Variable is not owned by this writer."); write(v, new int[values.getRank()], values); }
java
public void write(Variable v, Array values) throws java.io.IOException, InvalidRangeException { if (ncfile != v.getNetcdfFile()) throw new IllegalArgumentException("Variable is not owned by this writer."); write(v, new int[values.getRank()], values); }
[ "public", "void", "write", "(", "Variable", "v", ",", "Array", "values", ")", "throws", "java", ".", "io", ".", "IOException", ",", "InvalidRangeException", "{", "if", "(", "ncfile", "!=", "v", ".", "getNetcdfFile", "(", ")", ")", "throw", "new", "Illega...
Write data to the named variable, origin assumed to be 0. Must not be in define mode. @param v variable to write to @param values write this array; must be same type and rank as Variable @throws IOException if I/O error @throws ucar.ma2.InvalidRangeException if values Array has illegal shape
[ "Write", "data", "to", "the", "named", "variable", "origin", "assumed", "to", "be", "0", ".", "Must", "not", "be", "in", "define", "mode", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFileWriter.java#L995-L1000
test
Write a sequence of bytes from an array of bytes to the NCML file.
Of course, here is the Java code you requested: ```java public void write(Variable v, Array values) throws java.io.IOException, InvalidRangeException { if (ncfile != v.getNetcdfFile()) throw new IllegalArgumentException("Variable is not owned by this writer."); write(v, new int[values.getRank()], va...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/internal/authentication/Parser.java
Parser.nextQuotedString
public String nextQuotedString() throws ParserException { int start = pos; match('"'); checkPosition(); while (s.charAt(pos) != '"') { ++pos; checkPosition(); } match('"'); return s.substring(start, pos); }
java
public String nextQuotedString() throws ParserException { int start = pos; match('"'); checkPosition(); while (s.charAt(pos) != '"') { ++pos; checkPosition(); } match('"'); return s.substring(start, pos); }
[ "public", "String", "nextQuotedString", "(", ")", "throws", "ParserException", "{", "int", "start", "=", "pos", ";", "match", "(", "'", "'", ")", ";", "checkPosition", "(", ")", ";", "while", "(", "s", ".", "charAt", "(", "pos", ")", "!=", "'", "'", ...
Returns the next quoted string is s (quotes included). Throws a <code>ParserException</code> if the next substring in s is not a quoted string. @return the next quoted string in s (quotes included) @throws ParserException
[ "Returns", "the", "next", "quoted", "string", "is", "s", "(", "quotes", "included", ")", ".", "Throws", "a", "<code", ">", "ParserException<", "/", "code", ">", "if", "the", "next", "substring", "in", "s", "is", "not", "a", "quoted", "string", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/internal/authentication/Parser.java#L72-L84
test
Get the next quoted string.
Of course, here is the Java code you requested: ```java public String nextQuotedString() throws ParserException { int start = pos; match('"'); checkPosition(); while (s.charAt(pos) != '"') { ++pos; checkPosition(); } match('"'); return s...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java
ABaseClientWS.postJson
protected JSONObject postJson( ABaseFluidJSONObject baseDomainParam, String postfixUrlParam) { //No need to check connection... return this.postJson(false, baseDomainParam, postfixUrlParam); }
java
protected JSONObject postJson( ABaseFluidJSONObject baseDomainParam, String postfixUrlParam) { //No need to check connection... return this.postJson(false, baseDomainParam, postfixUrlParam); }
[ "protected", "JSONObject", "postJson", "(", "ABaseFluidJSONObject", "baseDomainParam", ",", "String", "postfixUrlParam", ")", "{", "//No need to check connection...", "return", "this", ".", "postJson", "(", "false", ",", "baseDomainParam", ",", "postfixUrlParam", ")", "...
Performs an HTTP-POST request with {@code postfixUrlParam}. @param baseDomainParam The base domain to convert to JSON and POST to {@code this} endpoint. @param postfixUrlParam URL mapping after the Base endpoint. @return Return body as JSON. @see JSONObject @see ABaseFluidJSONObject
[ "Performs", "an", "HTTP", "-", "POST", "request", "with", "{", "@code", "postfixUrlParam", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java#L407-L413
test
Post a JSON object to the server.
Of course, here is the Java code you requested: ```java protected JSONObject postJson( ABaseFluidJSONObject baseDomainParam, String postfixUrlParam) { //No need to check connection... return this.postJson(false, baseDomainParam, postfixUrlParam); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/unidata/util/StringUtil2.java
StringUtil2.remove
static public String remove(String s, String sub) { int len = sub.length(); int pos; while (0 <= (pos = s.indexOf(sub))) { s = s.substring(0, pos) + s.substring(pos + len); } return s; }
java
static public String remove(String s, String sub) { int len = sub.length(); int pos; while (0 <= (pos = s.indexOf(sub))) { s = s.substring(0, pos) + s.substring(pos + len); } return s; }
[ "static", "public", "String", "remove", "(", "String", "s", ",", "String", "sub", ")", "{", "int", "len", "=", "sub", ".", "length", "(", ")", ";", "int", "pos", ";", "while", "(", "0", "<=", "(", "pos", "=", "s", ".", "indexOf", "(", "sub", ")...
Remove all occurrences of the substring sub in the string s. @param s operate on this string @param sub remove all occurrences of this substring. @return result with substrings removed
[ "Remove", "all", "occurrences", "of", "the", "substring", "sub", "in", "the", "string", "s", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/util/StringUtil2.java#L281-L288
test
Removes the first occurrence of sub from s.
Of course, here is the Java code you requested: ```java static public String remove(String s, String sub) { int len = sub.length(); int pos; while (0 <= (pos = s.indexOf(sub))) { s = s.substring(0, pos) + s.substring(pos + len); } return s; } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.useRelaxedHTTPSValidation
public static void useRelaxedHTTPSValidation(String protocol) { config = RestAssured.config().sslConfig(SSLConfig.sslConfig().relaxedHTTPSValidation(protocol)); }
java
public static void useRelaxedHTTPSValidation(String protocol) { config = RestAssured.config().sslConfig(SSLConfig.sslConfig().relaxedHTTPSValidation(protocol)); }
[ "public", "static", "void", "useRelaxedHTTPSValidation", "(", "String", "protocol", ")", "{", "config", "=", "RestAssured", ".", "config", "(", ")", ".", "sslConfig", "(", "SSLConfig", ".", "sslConfig", "(", ")", ".", "relaxedHTTPSValidation", "(", "protocol", ...
Use relaxed HTTP validation with a specific protocol. This means that you'll trust all hosts regardless if the SSL certificate is invalid. By using this method you don't need to specify a keystore (see {@link #keyStore(String, String)} or trust store (see {@link #trustStore(java.security.KeyStore)}. <p> This is just a ...
[ "Use", "relaxed", "HTTP", "validation", "with", "a", "specific", "protocol", ".", "This", "means", "that", "you", "ll", "trust", "all", "hosts", "regardless", "if", "the", "SSL", "certificate", "is", "invalid", ".", "By", "using", "this", "method", "you", ...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L1507-L1509
test
Use the specified protocol as the SSL validation protocol.
Of course, here is the Java code you requested: ```java public static void useRelaxedHTTPSValidation(String protocol) { config = RestAssured.config().sslConfig(SSLConfig.sslConfig().relaxedHTTPSValidation(protocol)); } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseNDArrayProxy.java
BaseNDArrayProxy.read
protected void read(ObjectInputStream s) throws IOException, ClassNotFoundException { data = Nd4j.createBuffer(length, false); data.read(s); }
java
protected void read(ObjectInputStream s) throws IOException, ClassNotFoundException { data = Nd4j.createBuffer(length, false); data.read(s); }
[ "protected", "void", "read", "(", "ObjectInputStream", "s", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "data", "=", "Nd4j", ".", "createBuffer", "(", "length", ",", "false", ")", ";", "data", ".", "read", "(", "s", ")", ";", "}" ]
Custom deserialization for Java serialization
[ "Custom", "deserialization", "for", "Java", "serialization" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseNDArrayProxy.java#L73-L76
test
Read the data from the input stream
Of course, here is the Java code you requested: ```java protected void read(ObjectInputStream s) throws IOException, ClassNotFoundException { data = Nd4j.createBuffer(length, false); data.read(s); } ``` Hope this helps!
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/converter/ConverterHtmlToSpanned.java
ConverterHtmlToSpanned.getHtmlColor
@SuppressLint("DefaultLocale") private static int getHtmlColor(String color) { Integer i = COLORS.get(color.toLowerCase()); if (i != null) { return i; } else { try { return convertValueToInt(color, -1); } catch (NumberFormatException nfe) {...
java
@SuppressLint("DefaultLocale") private static int getHtmlColor(String color) { Integer i = COLORS.get(color.toLowerCase()); if (i != null) { return i; } else { try { return convertValueToInt(color, -1); } catch (NumberFormatException nfe) {...
[ "@", "SuppressLint", "(", "\"DefaultLocale\"", ")", "private", "static", "int", "getHtmlColor", "(", "String", "color", ")", "{", "Integer", "i", "=", "COLORS", ".", "get", "(", "color", ".", "toLowerCase", "(", ")", ")", ";", "if", "(", "i", "!=", "nu...
Converts an HTML color (named or numeric) to an integer RGB value. @param color Non-null color string. @return A color value, or {@code -1} if the color string could not be interpreted.
[ "Converts", "an", "HTML", "color", "(", "named", "or", "numeric", ")", "to", "an", "integer", "RGB", "value", "." ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/converter/ConverterHtmlToSpanned.java#L916-L928
test
Get the HTML color from a string.
Of course, here is the Java code you requested: ```java @SuppressLint("DefaultLocale") private static int getHtmlColor(String color) { Integer i = COLORS.get(color.toLowerCase()); if (i != null) { return i; } else { try { return convertValueToInt(colo...
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java
src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java
StdDraw.save
public static void save(String filename) { if (filename == null) throw new NullPointerException(); File file = new File(filename); String suffix = filename.substring(filename.lastIndexOf('.') + 1); if (suffix.toLowerCase().equals("png")) { try { ImageIO.write(onscreenImag...
java
public static void save(String filename) { if (filename == null) throw new NullPointerException(); File file = new File(filename); String suffix = filename.substring(filename.lastIndexOf('.') + 1); if (suffix.toLowerCase().equals("png")) { try { ImageIO.write(onscreenImag...
[ "public", "static", "void", "save", "(", "String", "filename", ")", "{", "if", "(", "filename", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "File", "file", "=", "new", "File", "(", "filename", ")", ";", "String", "suffix", ...
Saves the drawing to using the specified filename. The supported image formats are JPEG and PNG; the filename suffix must be <tt>.jpg</tt> or <tt>.png</tt>. @param filename the name of the file with one of the required suffixes
[ "Saves", "the", "drawing", "to", "using", "the", "specified", "filename", ".", "The", "supported", "image", "formats", "are", "JPEG", "and", "PNG", ";", "the", "filename", "suffix", "must", "be", "<tt", ">", ".", "jpg<", "/", "tt", ">", "or", "<tt", ">...
516fee15e537ecdb3f4dcbe3695c5cfde7e930da
https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java#L901-L940
test
Save the image to a file.
Of course, here is the Java code you requested: ```java public static void save(String filename) { if (filename == null) throw new NullPointerException(); File file = new File(filename); String suffix = filename.substring(filename.lastIndexOf('.') + 1); if (suffix.toLowerCase().equals("png")) ...
wro4j/wro4j
wro4j-extensions/src/main/java/ro/isdc/wro/extensions/model/factory/SmartWroModelFactory.java
SmartWroModelFactory.createAutoDetectedStream
private InputStream createAutoDetectedStream(final String defaultFileName) throws IOException { try { Validate.notNull(wroFile, "Cannot call this method if wroFile is null!"); if (autoDetectWroFile) { final File file = new File(wroFile.getParentFile(), defaultFileName); LOG.d...
java
private InputStream createAutoDetectedStream(final String defaultFileName) throws IOException { try { Validate.notNull(wroFile, "Cannot call this method if wroFile is null!"); if (autoDetectWroFile) { final File file = new File(wroFile.getParentFile(), defaultFileName); LOG.d...
[ "private", "InputStream", "createAutoDetectedStream", "(", "final", "String", "defaultFileName", ")", "throws", "IOException", "{", "try", "{", "Validate", ".", "notNull", "(", "wroFile", ",", "\"Cannot call this method if wroFile is null!\"", ")", ";", "if", "(", "au...
Handles the resource model auto detection.
[ "Handles", "the", "resource", "model", "auto", "detection", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/model/factory/SmartWroModelFactory.java#L158-L177
test
Creates an InputStream for a single file with the specified name.
Of course, here is the Java code you requested: ```java private InputStream createAutoDetectedStream(final String defaultFileName) throws IOException { try { Validate.notNull(wroFile, "Cannot call this method if wroFile is null!"); if (autoDetectWroFile) { final File file = new File(...