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
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java
OSessionStoragePerformanceStatistic.getCacheHits
public int getCacheHits(String componentName) { if (componentName == null) return performanceCountersHolder.getCacheHits(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (cHolder != null) return cHolder.getCacheHits(); return -1; }
java
public int getCacheHits(String componentName) { if (componentName == null) return performanceCountersHolder.getCacheHits(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (cHolder != null) return cHolder.getCacheHits(); return -1; }
[ "public", "int", "getCacheHits", "(", "String", "componentName", ")", "{", "if", "(", "componentName", "==", "null", ")", "return", "performanceCountersHolder", ".", "getCacheHits", "(", ")", ";", "final", "PerformanceCountersHolder", "cHolder", "=", "countersByComp...
Percent of cache hits 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 which should be returned. ...
[ "Percent", "of", "cache", "hits", "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", "...
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java#L407-L416
test
Get the cache hits for a given component name
Of course, here is the Java code you requested: ```java public int getCacheHits(String componentName) { if (componentName == null) return performanceCountersHolder.getCacheHits(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (cHolder != null) return cHol...
apache/parquet-mr
parquet-column/src/main/java/org/apache/parquet/schema/Types.java
Types.optional
public static PrimitiveBuilder<PrimitiveType> optional(PrimitiveTypeName type) { return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type) .repetition(Type.Repetition.OPTIONAL); }
java
public static PrimitiveBuilder<PrimitiveType> optional(PrimitiveTypeName type) { return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type) .repetition(Type.Repetition.OPTIONAL); }
[ "public", "static", "PrimitiveBuilder", "<", "PrimitiveType", ">", "optional", "(", "PrimitiveTypeName", "type", ")", "{", "return", "new", "PrimitiveBuilder", "<", "PrimitiveType", ">", "(", "PrimitiveType", ".", "class", ",", "type", ")", ".", "repetition", "(...
Returns a builder to construct an optional {@link PrimitiveType}. @param type a {@link PrimitiveTypeName} for the constructed type @return a {@link PrimitiveBuilder}
[ "Returns", "a", "builder", "to", "construct", "an", "optional", "{", "@link", "PrimitiveType", "}", "." ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-column/src/main/java/org/apache/parquet/schema/Types.java#L1455-L1458
test
Create a new empty SEGMENT.
Of course, here is the Java code you requested: ```java public static PrimitiveBuilder<PrimitiveType> optional(PrimitiveTypeName type) { return new PrimitiveBuilder<PrimitiveType>(PrimitiveType.class, type) .repetition(Type.Repetition.OPTIONAL); } ``` Hope this helps!
RestComm/jain-slee
container/profiles/src/main/java/org/mobicents/slee/container/management/ProfileManagementImpl.java
ProfileManagementImpl.getProfileTable
public ProfileTableImpl getProfileTable(String profileTableName) throws NullPointerException, UnrecognizedProfileTableNameException { if (profileTableName == null) throw new NullPointerException("profile table name is null"); ProfileTableImpl profileTable = null; if (sleeContainer.getCluster().getMobicentsCac...
java
public ProfileTableImpl getProfileTable(String profileTableName) throws NullPointerException, UnrecognizedProfileTableNameException { if (profileTableName == null) throw new NullPointerException("profile table name is null"); ProfileTableImpl profileTable = null; if (sleeContainer.getCluster().getMobicentsCac...
[ "public", "ProfileTableImpl", "getProfileTable", "(", "String", "profileTableName", ")", "throws", "NullPointerException", ",", "UnrecognizedProfileTableNameException", "{", "if", "(", "profileTableName", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"...
/* (non-Javadoc) @see org.mobicents.slee.container.management.ProfileManagement#getProfileTable(java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/management/ProfileManagementImpl.java#L315-L361
test
Get the profile table object for the specified profile table name.
Of course, here is the Java code you requested: ```java public ProfileTableImpl getProfileTable(String profileTableName) throws NullPointerException, UnrecognizedProfileTableNameException { if (profileTableName == null) throw new NullPointerException("profile table name is null"); ProfileTableImpl profileTable...
deeplearning4j/nd4j
nd4j-common/src/main/java/org/nd4j/linalg/util/MathUtils.java
MathUtils.coordSplit
public static List<double[]> coordSplit(List<Double> vector) { if (vector == null) return null; List<double[]> ret = new ArrayList<double[]>(); /* x coordinates */ double[] xVals = new double[vector.size() / 2]; /* y coordinates */ double[] yVals = new double...
java
public static List<double[]> coordSplit(List<Double> vector) { if (vector == null) return null; List<double[]> ret = new ArrayList<double[]>(); /* x coordinates */ double[] xVals = new double[vector.size() / 2]; /* y coordinates */ double[] yVals = new double...
[ "public", "static", "List", "<", "double", "[", "]", ">", "coordSplit", "(", "List", "<", "Double", ">", "vector", ")", "{", "if", "(", "vector", "==", "null", ")", "return", "null", ";", "List", "<", "double", "[", "]", ">", "ret", "=", "new", "...
This returns the coordinate split in a list of coordinates such that the values for ret[0] are the x values and ret[1] are the y values @param vector the vector to split with x and y values Note that the list will be more stable due to the size operator. The array version will have extraneous values if not monitored p...
[ "This", "returns", "the", "coordinate", "split", "in", "a", "list", "of", "coordinates", "such", "that", "the", "values", "for", "ret", "[", "0", "]", "are", "the", "x", "values", "and", "ret", "[", "1", "]", "are", "the", "y", "values" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/MathUtils.java#L658-L682
test
Split a list of double coordinates into two.
Of course, here is the Java code you requested: ```java public static List<double[]> coordSplit(List<Double> vector) { if (vector == null) return null; List<double[]> ret = new ArrayList<double[]>(); /* x coordinates */ double[] xVals = new double[vector.size() / 2]; ...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/grib/Grib2ReportPanel.java
Grib2ReportPanel.doTimeCoord
private void doTimeCoord(Formatter f, MCollection dcm, boolean useIndex) throws IOException { Counters counters = new Counters(); counters.add("template"); counters.add("timeUnit"); counters.add("statType"); counters.add("NumberTimeIntervals"); counters.add("TimeIntervalsDiffer"); counters.a...
java
private void doTimeCoord(Formatter f, MCollection dcm, boolean useIndex) throws IOException { Counters counters = new Counters(); counters.add("template"); counters.add("timeUnit"); counters.add("statType"); counters.add("NumberTimeIntervals"); counters.add("TimeIntervalsDiffer"); counters.a...
[ "private", "void", "doTimeCoord", "(", "Formatter", "f", ",", "MCollection", "dcm", ",", "boolean", "useIndex", ")", "throws", "IOException", "{", "Counters", "counters", "=", "new", "Counters", "(", ")", ";", "counters", ".", "add", "(", "\"template\"", ")"...
/////////////////////////////////////////////////////////////////
[ "/////////////////////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/grib/Grib2ReportPanel.java#L946-L963
test
Do time coordinate.
Of course, here is the Java code you requested: ```java private void doTimeCoord(Formatter f, MCollection dcm, boolean useIndex) throws IOException { Counters counters = new Counters(); counters.add("template"); counters.add("timeUnit"); counters.add("statType"); counters.add("NumberTimeIntervals")...
boonproject/boon
boon/src/main/java/org/boon/collections/FloatList.java
FloatList.atIndex
public float atIndex(int index, float element) { float oldValue = values[index]; values[index] = element; return oldValue; }
java
public float atIndex(int index, float element) { float oldValue = values[index]; values[index] = element; return oldValue; }
[ "public", "float", "atIndex", "(", "int", "index", ",", "float", "element", ")", "{", "float", "oldValue", "=", "values", "[", "index", "]", ";", "values", "[", "index", "]", "=", "element", ";", "return", "oldValue", ";", "}" ]
Set a value in the list. @param index index @param element new value @return old value at this index
[ "Set", "a", "value", "in", "the", "list", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/collections/FloatList.java#L264-L268
test
Sets the value at the given index.
Of course, here is the Java code you requested: ```java public float atIndex(int index, float element) { float oldValue = values[index]; values[index] = element; return oldValue; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/ma2/Index.java
Index.flip
Index flip(int index) { if ((index < 0) || (index >= rank)) throw new IllegalArgumentException(); Index i = (Index) this.clone(); if (shape[index] >= 0) { // !vlen case i.offset += stride[index] * (shape[index] - 1); i.stride[index] = -stride[index]; } i.fastIterator = fa...
java
Index flip(int index) { if ((index < 0) || (index >= rank)) throw new IllegalArgumentException(); Index i = (Index) this.clone(); if (shape[index] >= 0) { // !vlen case i.offset += stride[index] * (shape[index] - 1); i.stride[index] = -stride[index]; } i.fastIterator = fa...
[ "Index", "flip", "(", "int", "index", ")", "{", "if", "(", "(", "index", "<", "0", ")", "||", "(", "index", ">=", "rank", ")", ")", "throw", "new", "IllegalArgumentException", "(", ")", ";", "Index", "i", "=", "(", "Index", ")", "this", ".", "clo...
Create a new Index based on current one, except flip the index so that it runs from shape[index]-1 to 0. Leave rightmost vlen alone. @param index dimension to flip @return new index with flipped dimension
[ "Create", "a", "new", "Index", "based", "on", "current", "one", "except", "flip", "the", "index", "so", "that", "it", "runs", "from", "shape", "[", "index", "]", "-", "1", "to", "0", ".", "Leave", "rightmost", "vlen", "alone", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/Index.java#L191-L203
test
Flips the index.
Of course, here is the Java code you requested: ```java Index flip(int index) { if ((index < 0) || (index >= rank)) throw new IllegalArgumentException(); Index i = (Index) this.clone(); if (shape[index] >= 0) { // !vlen case i.offset += stride[index] * (shape[index] - 1); i.stride...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/Attribute.java
Attribute.getAttributeCount
final int getAttributeCount() { int count = 0; Attribute attribute = this; while (attribute != null) { count += 1; attribute = attribute.nextAttribute; } return count; }
java
final int getAttributeCount() { int count = 0; Attribute attribute = this; while (attribute != null) { count += 1; attribute = attribute.nextAttribute; } return count; }
[ "final", "int", "getAttributeCount", "(", ")", "{", "int", "count", "=", "0", ";", "Attribute", "attribute", "=", "this", ";", "while", "(", "attribute", "!=", "null", ")", "{", "count", "+=", "1", ";", "attribute", "=", "attribute", ".", "nextAttribute"...
Returns the number of attributes of the attribute list that begins with this attribute. @return the number of attributes of the attribute list that begins with this attribute.
[ "Returns", "the", "number", "of", "attributes", "of", "the", "attribute", "list", "that", "begins", "with", "this", "attribute", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Attribute.java#L167-L175
test
Gets the number of attributes in this object.
Of course, here is the Java code you requested: ```java final int getAttributeCount() { int count = 0; Attribute attribute = this; while (attribute != null) { count += 1; attribute = attribute.nextAttribute; } return count; } ``` Hope this helps!
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/WeitereAdresse.java
WeitereAdresse.getTelSonstige
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<TelSonstige> getTelSonstige() { if (telSonstige == null) { telSonstige = new ArrayList<TelSonstige>(); } return this.telSonstige; }
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<TelSonstige> getTelSonstige() { if (telSonstige == null) { telSonstige = new ArrayList<TelSonstige>(); } return this.telSonstige; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:50:55+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "List", "<", "TelSonstige", ">", "getTelSonstige", "(", ")", "{", "if", "(", "telSon...
Gets the value of the telSonstige property. <p> This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for the telSonstige property. <p> For example, ...
[ "Gets", "the", "value", "of", "the", "telSonstige", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/WeitereAdresse.java#L803-L809
test
Gets the value of the telSonstige property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<TelSonstige> getTelSonstige() { if (telSonstige == null) { telSonstige = new ArrayList<TelSonstige>(); } ...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/Codec.java
Codec.getSupportedAudioSampleRates
public java.util.Collection<Integer> getSupportedAudioSampleRates() { java.util.List<Integer> retval = new java.util.LinkedList<Integer>(); int count = getNumSupportedAudioSampleRates(); for(int i=0;i<count;i++) { int rate = getSupportedAudioSampleRate(i); if (rate != 0) re...
java
public java.util.Collection<Integer> getSupportedAudioSampleRates() { java.util.List<Integer> retval = new java.util.LinkedList<Integer>(); int count = getNumSupportedAudioSampleRates(); for(int i=0;i<count;i++) { int rate = getSupportedAudioSampleRate(i); if (rate != 0) re...
[ "public", "java", ".", "util", ".", "Collection", "<", "Integer", ">", "getSupportedAudioSampleRates", "(", ")", "{", "java", ".", "util", ".", "List", "<", "Integer", ">", "retval", "=", "new", "java", ".", "util", ".", "LinkedList", "<", "Integer", ">"...
Returns a list of supported audio sample rates this codec can encode audio in. <p> Not all codecs support reporting this, in which case the returned list will be empty. </p> @return a list
[ "Returns", "a", "list", "of", "supported", "audio", "sample", "rates", "this", "codec", "can", "encode", "audio", "in", "." ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Codec.java#L226-L239
test
Gets the list of supported audio sample rates.
Of course, here is the Java code you requested: ```java public java.util.Collection<Integer> getSupportedAudioSampleRates() { java.util.List<Integer> retval = new java.util.LinkedList<Integer>(); int count = getNumSupportedAudioSampleRates(); for(int i=0;i<count;i++) { int rate = getSup...
robeio/robe
robe-admin/src/main/java/io/robe/admin/resources/UserResource.java
UserResource.create
@RobeService(group = "User", description = "Create as a User resource.") @POST @UnitOfWork public User create(@RobeAuth Credentials credentials, @Valid User model) { return userDao.create(model); }
java
@RobeService(group = "User", description = "Create as a User resource.") @POST @UnitOfWork public User create(@RobeAuth Credentials credentials, @Valid User model) { return userDao.create(model); }
[ "@", "RobeService", "(", "group", "=", "\"User\"", ",", "description", "=", "\"Create as a User resource.\"", ")", "@", "POST", "@", "UnitOfWork", "public", "User", "create", "(", "@", "RobeAuth", "Credentials", "credentials", ",", "@", "Valid", "User", "model",...
Create as a {@link User} resource. @param credentials injected by {@link RobeAuth} annotation for authentication. @param model data of {@link User} @return Create as a {@link User} resource.
[ "Create", "as", "a", "{", "@link", "User", "}", "resource", "." ]
a0a8c7cebd1f70f78cf24a66a002859e937badfe
https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-admin/src/main/java/io/robe/admin/resources/UserResource.java#L80-L85
test
Create a User resource.
Of course, here is the Java code you requested: ```java @RobeService(group = "User", description = "Create as a User resource.") @POST @UnitOfWork public User create(@RobeAuth Credentials credentials, @Valid User model) { return userDao.create(model); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
ImmobiliareIT/src/main/jaxb/org/openestate/io/immobiliare_it/xml/Terrains.java
Terrains.getTerrain
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11") public List<TerrainType> getTerrain() { if (terrain == null) { terrain = new ArrayList<TerrainType>(); } return this.terrain; }
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11") public List<TerrainType> getTerrain() { if (terrain == null) { terrain = new ArrayList<TerrainType>(); } return this.terrain; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:48:12+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "List", "<", "TerrainType", ">", "getTerrain", "(", ")", "{", "if", "(", "terrain", ...
Gets the value of the terrain property. <p> This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for the terrain property. <p> For example, to add a...
[ "Gets", "the", "value", "of", "the", "terrain", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmobiliareIT/src/main/jaxb/org/openestate/io/immobiliare_it/xml/Terrains.java#L80-L86
test
Gets the value of the terrain property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11") public List<TerrainType> getTerrain() { if (terrain == null) { terrain = new ArrayList<TerrainType>(); } retur...
alipay/sofa-bolt
src/main/java/com/alipay/remoting/rpc/RpcClient.java
RpcClient.checkConnection
public boolean checkConnection(String addr) { Url url = this.addressParser.parse(addr); Connection conn = this.connectionManager.get(url.getUniqueKey()); try { this.connectionManager.check(conn); } catch (Exception e) { return false; } return true;...
java
public boolean checkConnection(String addr) { Url url = this.addressParser.parse(addr); Connection conn = this.connectionManager.get(url.getUniqueKey()); try { this.connectionManager.check(conn); } catch (Exception e) { return false; } return true;...
[ "public", "boolean", "checkConnection", "(", "String", "addr", ")", "{", "Url", "url", "=", "this", ".", "addressParser", ".", "parse", "(", "addr", ")", ";", "Connection", "conn", "=", "this", ".", "connectionManager", ".", "get", "(", "url", ".", "getU...
check connection, the address format example - 127.0.0.1:12200?key1=value1&key2=value2 @param addr @throws RemotingException @return true if and only if there is a connection, and the connection is active and writable;else return false
[ "check", "connection", "the", "address", "format", "example", "-", "127", ".", "0", ".", "0", ".", "1", ":", "12200?key1", "=", "value1&key2", "=", "value2" ]
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcClient.java#L794-L803
test
Check connection.
Of course, here is the Java code you requested: ```java public boolean checkConnection(String addr) { Url url = this.addressParser.parse(addr); Connection conn = this.connectionManager.get(url.getUniqueKey()); try { this.connectionManager.check(conn); } catch (Exception e) {...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java
OSelectExecutionPlanner.splitLet
private static void splitLet(QueryPlanningInfo info, OCommandContext ctx) { if (info.perRecordLetClause != null && info.perRecordLetClause.getItems() != null) { Iterator<OLetItem> iterator = info.perRecordLetClause.getItems().iterator(); while (iterator.hasNext()) { OLetItem item = iterator.next...
java
private static void splitLet(QueryPlanningInfo info, OCommandContext ctx) { if (info.perRecordLetClause != null && info.perRecordLetClause.getItems() != null) { Iterator<OLetItem> iterator = info.perRecordLetClause.getItems().iterator(); while (iterator.hasNext()) { OLetItem item = iterator.next...
[ "private", "static", "void", "splitLet", "(", "QueryPlanningInfo", "info", ",", "OCommandContext", "ctx", ")", "{", "if", "(", "info", ".", "perRecordLetClause", "!=", "null", "&&", "info", ".", "perRecordLetClause", ".", "getItems", "(", ")", "!=", "null", ...
splits LET clauses in global (executed once) and local (executed once per record)
[ "splits", "LET", "clauses", "in", "global", "(", "executed", "once", ")", "and", "local", "(", "executed", "once", "per", "record", ")" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java#L715-L729
test
Split let.
Of course, here is the Java code you requested: ```java private static void splitLet(QueryPlanningInfo info, OCommandContext ctx) { if (info.perRecordLetClause != null && info.perRecordLetClause.getItems() != null) { Iterator<OLetItem> iterator = info.perRecordLetClause.getItems().iterator(); while (it...
ArpNetworking/logback-steno
src/main/java/com/arpnetworking/steno/Logger.java
Logger.error
public void error( @Nullable final String event, @Nullable final String message, @Nullable final String dataKey1, @Nullable final Object dataValue1, @Nullable final Throwable throwable) { if (getSlf4jLogger().isErrorEnabled()) { LogLevel.ER...
java
public void error( @Nullable final String event, @Nullable final String message, @Nullable final String dataKey1, @Nullable final Object dataValue1, @Nullable final Throwable throwable) { if (getSlf4jLogger().isErrorEnabled()) { LogLevel.ER...
[ "public", "void", "error", "(", "@", "Nullable", "final", "String", "event", ",", "@", "Nullable", "final", "String", "message", ",", "@", "Nullable", "final", "String", "dataKey1", ",", "@", "Nullable", "final", "Object", "dataValue1", ",", "@", "Nullable",...
Log a message for a canonical event with supporting key-value pairs and a <code>Throwable</code> at the error level. This method is provided only for efficiency over the var-args method above as it avoids an array creation during invocation. @since 1.3.0 @param event The canonical event that occurred. @param message ...
[ "Log", "a", "message", "for", "a", "canonical", "event", "with", "supporting", "key", "-", "value", "pairs", "and", "a", "<code", ">", "Throwable<", "/", "code", ">", "at", "the", "error", "level", ".", "This", "method", "is", "provided", "only", "for", ...
abd5c68ce7d42c39f80ffbad6d162d5fed3a346e
https://github.com/ArpNetworking/logback-steno/blob/abd5c68ce7d42c39f80ffbad6d162d5fed3a346e/src/main/java/com/arpnetworking/steno/Logger.java#L1559-L1573
test
Log an error event.
Of course, here is the Java code you requested: ```java public void error( @Nullable final String event, @Nullable final String message, @Nullable final String dataKey1, @Nullable final Object dataValue1, @Nullable final Throwable throwable) { if (get...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/util/OptionHelper.java
OptionHelper.toBoolean
public static boolean toBoolean(String value, boolean defaultValue) { if (value == null) { return defaultValue; } String trimmedVal = value.trim(); if ("true".equalsIgnoreCase(trimmedVal)) { return true; } if ("false".equalsIgnoreCase(trimmedVal)) { return false; } ...
java
public static boolean toBoolean(String value, boolean defaultValue) { if (value == null) { return defaultValue; } String trimmedVal = value.trim(); if ("true".equalsIgnoreCase(trimmedVal)) { return true; } if ("false".equalsIgnoreCase(trimmedVal)) { return false; } ...
[ "public", "static", "boolean", "toBoolean", "(", "String", "value", ",", "boolean", "defaultValue", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "defaultValue", ";", "}", "String", "trimmedVal", "=", "value", ".", "trim", "(", ")", ";"...
If <code>value</code> is "true", then <code>true</code> is returned. If <code>value</code> is "false", then <code>true</code> is returned. Otherwise, <code>default</code> is returned. <p> Case of value is unimportant. @param value string to be evaluated @param defaultValue default value if value could not be converted ...
[ "If", "<code", ">", "value<", "/", "code", ">", "is", "true", "then", "<code", ">", "true<", "/", "code", ">", "is", "returned", ".", "If", "<code", ">", "value<", "/", "code", ">", "is", "false", "then", "<code", ">", "true<", "/", "code", ">", ...
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/util/OptionHelper.java#L277-L293
test
Convert a String to a boolean value.
Of course, here is the Java code you requested: ```java public static boolean toBoolean(String value, boolean defaultValue) { if (value == null) { return defaultValue; } String trimmedVal = value.trim(); if ("true".equalsIgnoreCase(trimmedVal)) { return true; } if ("false".equals...
apache/parquet-mr
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
ParquetFileWriter.writeMergedMetadataFile
@Deprecated public static void writeMergedMetadataFile(List<Path> files, Path outputPath, Configuration conf) throws IOException { ParquetMetadata merged = mergeMetadataFiles(files, conf); writeMetadataFile(outputPath, merged, outputPath.getFileSystem(conf)); }
java
@Deprecated public static void writeMergedMetadataFile(List<Path> files, Path outputPath, Configuration conf) throws IOException { ParquetMetadata merged = mergeMetadataFiles(files, conf); writeMetadataFile(outputPath, merged, outputPath.getFileSystem(conf)); }
[ "@", "Deprecated", "public", "static", "void", "writeMergedMetadataFile", "(", "List", "<", "Path", ">", "files", ",", "Path", "outputPath", ",", "Configuration", "conf", ")", "throws", "IOException", "{", "ParquetMetadata", "merged", "=", "mergeMetadataFiles", "(...
Given a list of metadata files, merge them into a single metadata file. Requires that the schemas be compatible, and the extraMetaData be exactly equal. This is useful when merging 2 directories of parquet files into a single directory, as long as both directories were written with compatible schemas and equal extraMet...
[ "Given", "a", "list", "of", "metadata", "files", "merge", "them", "into", "a", "single", "metadata", "file", ".", "Requires", "that", "the", "schemas", "be", "compatible", "and", "the", "extraMetaData", "be", "exactly", "equal", ".", "This", "is", "useful", ...
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java#L927-L931
test
Merge the list of files into a single file.
Of course, here is the Java code you requested: ```java @Deprecated public static void writeMergedMetadataFile(List<Path> files, Path outputPath, Configuration conf) throws IOException { ParquetMetadata merged = mergeMetadataFiles(files, conf); writeMetadataFile(outputPath, merged, outputPath.getFileSystem(c...
ReactiveX/RxJava
src/main/java/io/reactivex/Single.java
Single.timeout
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Single<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler) { return timeout0(timeout, unit, scheduler, null); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Single<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler) { return timeout0(timeout, unit, scheduler, null); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Single", "<", "T", ">", "timeout", "(", "long", "timeout", ",", "TimeUnit", "unit", ",", "Scheduler", "scheduler", ")", "{", "return", "timeout0"...
Signals a TimeoutException if the current Single doesn't signal a success value within the specified timeout window. <dl> <dt><b>Scheduler:</b></dt> <dd>{@code timeout} signals the TimeoutException on the {@link Scheduler} you specify.</dd> </dl> @param timeout the timeout amount @param unit the time unit @param schedu...
[ "Signals", "a", "TimeoutException", "if", "the", "current", "Single", "doesn", "t", "signal", "a", "success", "value", "within", "the", "specified", "timeout", "window", ".", "<dl", ">", "<dt", ">", "<b", ">", "Scheduler", ":", "<", "/", "b", ">", "<", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L3793-L3797
test
Timeout method for a single result set.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Single<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler) { return timeout0(timeout, unit, scheduler, null); } ``` Hope this helps!
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/StringUtils.java
StringUtils.decodeBase64
public static byte[] decodeBase64(String data) { byte[] bytes; try { bytes = data.getBytes("UTF-8"); } catch (java.io.UnsupportedEncodingException uee) { bytes = data.getBytes(); } bytes = Base64.decode(bytes, 0, bytes.length, Base64.NO_OPTIONS); ...
java
public static byte[] decodeBase64(String data) { byte[] bytes; try { bytes = data.getBytes("UTF-8"); } catch (java.io.UnsupportedEncodingException uee) { bytes = data.getBytes(); } bytes = Base64.decode(bytes, 0, bytes.length, Base64.NO_OPTIONS); ...
[ "public", "static", "byte", "[", "]", "decodeBase64", "(", "String", "data", ")", "{", "byte", "[", "]", "bytes", ";", "try", "{", "bytes", "=", "data", ".", "getBytes", "(", "\"UTF-8\"", ")", ";", "}", "catch", "(", "java", ".", "io", ".", "Unsupp...
Decodes a base64 String. Unlike Base64.decode() this method does not try to detect and decompress a gzip-compressed input. @param data a base64 encoded String to decode. @return the decoded String.
[ "Decodes", "a", "base64", "String", ".", "Unlike", "Base64", ".", "decode", "()", "this", "method", "does", "not", "try", "to", "detect", "and", "decompress", "a", "gzip", "-", "compressed", "input", "." ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/StringUtils.java#L946-L956
test
Decode base 64.
Of course, here is the Java code you requested: ```java public static byte[] decodeBase64(String data) { byte[] bytes; try { bytes = data.getBytes("UTF-8"); } catch (java.io.UnsupportedEncodingException uee) { bytes = data.getBytes(); } bytes = Base64.de...
objectify/objectify
src/main/java/com/googlecode/objectify/Ref.java
Ref.safe
final public T safe() throws NotFoundException { T t = this.get(); if (t == null) throw new NotFoundException(key()); else return t; }
java
final public T safe() throws NotFoundException { T t = this.get(); if (t == null) throw new NotFoundException(key()); else return t; }
[ "final", "public", "T", "safe", "(", ")", "throws", "NotFoundException", "{", "T", "t", "=", "this", ".", "get", "(", ")", ";", "if", "(", "t", "==", "null", ")", "throw", "new", "NotFoundException", "(", "key", "(", ")", ")", ";", "else", "return"...
Obtain the entity value, throwing an exception if the entity was not found. @return the entity referenced. Never returns null. @throws NotFoundException if the specified entity was not found
[ "Obtain", "the", "entity", "value", "throwing", "an", "exception", "if", "the", "entity", "was", "not", "found", "." ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/Ref.java#L100-L106
test
Returns a reference to the object that was created by this object.
Of course, here is the Java code you requested: ```java final public T safe() throws NotFoundException { T t = this.get(); if (t == null) throw new NotFoundException(key()); else return t; } ``` Hope this helps!
streamsets/datacollector
hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveMetastoreUtil.java
HiveMetastoreUtil.getInternalField
public static boolean getInternalField(Record metadataRecord) throws HiveStageCheckedException{ if (metadataRecord.has(SEP + INTERNAL_FIELD)) { return metadataRecord.get(SEP + INTERNAL_FIELD).getValueAsBoolean(); } throw new HiveStageCheckedException(Errors.HIVE_17, INTERNAL_FIELD, metadataRecord); ...
java
public static boolean getInternalField(Record metadataRecord) throws HiveStageCheckedException{ if (metadataRecord.has(SEP + INTERNAL_FIELD)) { return metadataRecord.get(SEP + INTERNAL_FIELD).getValueAsBoolean(); } throw new HiveStageCheckedException(Errors.HIVE_17, INTERNAL_FIELD, metadataRecord); ...
[ "public", "static", "boolean", "getInternalField", "(", "Record", "metadataRecord", ")", "throws", "HiveStageCheckedException", "{", "if", "(", "metadataRecord", ".", "has", "(", "SEP", "+", "INTERNAL_FIELD", ")", ")", "{", "return", "metadataRecord", ".", "get", ...
Get internal field from the metadata record. @param metadataRecord the metadata record @return internal field value @throws HiveStageCheckedException if the internal field does not exist in the metadata record.
[ "Get", "internal", "field", "from", "the", "metadata", "record", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/HiveMetastoreUtil.java#L441-L446
test
Get the value of the internal field of the given record.
Of course, here is the Java code you requested: ```java public static boolean getInternalField(Record metadataRecord) throws HiveStageCheckedException{ if (metadataRecord.has(SEP + INTERNAL_FIELD)) { return metadataRecord.get(SEP + INTERNAL_FIELD).getValueAsBoolean(); } throw new HiveStageCheckedExce...
oblac/jodd
jodd-bean/src/main/java/jodd/typeconverter/impl/ArrayConverter.java
ArrayConverter.convertValueToArray
protected T[] convertValueToArray(final Object value) { if (value instanceof Collection) { Collection collection = (Collection) value; T[] target = createArray(collection.size()); int i = 0; for (Object element : collection) { target[i] = convertType(element); i++; } return target; } ...
java
protected T[] convertValueToArray(final Object value) { if (value instanceof Collection) { Collection collection = (Collection) value; T[] target = createArray(collection.size()); int i = 0; for (Object element : collection) { target[i] = convertType(element); i++; } return target; } ...
[ "protected", "T", "[", "]", "convertValueToArray", "(", "final", "Object", "value", ")", "{", "if", "(", "value", "instanceof", "Collection", ")", "{", "Collection", "collection", "=", "(", "Collection", ")", "value", ";", "T", "[", "]", "target", "=", "...
Converts non-array value to array. Detects various collection types and iterates them to make conversion and to create target array.
[ "Converts", "non", "-", "array", "value", "to", "array", ".", "Detects", "various", "collection", "types", "and", "iterates", "them", "to", "make", "conversion", "and", "to", "create", "target", "array", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/typeconverter/impl/ArrayConverter.java#L110-L143
test
Converts the value to an array of types.
Of course, here is the Java code you requested: ```java protected T[] convertValueToArray(final Object value) { if (value instanceof Collection) { Collection collection = (Collection) value; T[] target = createArray(collection.size()); int i = 0; for (Object element : collection) { target[i] = conve...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/QueryImpl.java
QueryImpl.translate
protected FilterOperator translate(String operator) { operator = operator.trim(); if (operator.equals("=") || operator.equals("==")) return FilterOperator.EQUAL; else if (operator.equals(">")) return FilterOperator.GREATER_THAN; else if (operator.equals(">=")) return FilterOperator.GREATER_THA...
java
protected FilterOperator translate(String operator) { operator = operator.trim(); if (operator.equals("=") || operator.equals("==")) return FilterOperator.EQUAL; else if (operator.equals(">")) return FilterOperator.GREATER_THAN; else if (operator.equals(">=")) return FilterOperator.GREATER_THA...
[ "protected", "FilterOperator", "translate", "(", "String", "operator", ")", "{", "operator", "=", "operator", ".", "trim", "(", ")", ";", "if", "(", "operator", ".", "equals", "(", "\"=\"", ")", "||", "operator", ".", "equals", "(", "\"==\"", ")", ")", ...
Converts the textual operator (">", "<=", etc) into a FilterOperator. Forgiving about the syntax; != and <> are NOT_EQUAL, = and == are EQUAL.
[ "Converts", "the", "textual", "operator", "(", ">", "<", "=", "etc", ")", "into", "a", "FilterOperator", ".", "Forgiving", "about", "the", "syntax", ";", "!", "=", "and", "<", ">", "are", "NOT_EQUAL", "=", "and", "==", "are", "EQUAL", "." ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/QueryImpl.java#L153-L174
test
Translate a Cloud Datastore filter operator string into a Cloud Datastore filter operator.
Of course, here is the Java code you requested: ```java protected FilterOperator translate(String operator) { operator = operator.trim(); if (operator.equals("=") || operator.equals("==")) return FilterOperator.EQUAL; else if (operator.equals(">")) return FilterOperator.GREATER_THAN; else if (ope...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java
OSessionStoragePerformanceStatistic.getAmountOfPagesReadFromFile
public long getAmountOfPagesReadFromFile(String componentName) { if (componentName == null) return performanceCountersHolder.getAmountOfPagesReadFromFile(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (cHolder != null) return cHolder.getAmountOfPagesRead...
java
public long getAmountOfPagesReadFromFile(String componentName) { if (componentName == null) return performanceCountersHolder.getAmountOfPagesReadFromFile(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (cHolder != null) return cHolder.getAmountOfPagesRead...
[ "public", "long", "getAmountOfPagesReadFromFile", "(", "String", "componentName", ")", "{", "if", "(", "componentName", "==", "null", ")", "return", "performanceCountersHolder", ".", "getAmountOfPagesReadFromFile", "(", ")", ";", "final", "PerformanceCountersHolder", "c...
Amount of pages are read from file 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 which should ...
[ "Amount", "of", "pages", "are", "read", "from", "file", "for", "component", "name", "of", "which", "is", "passed", "as", "method", "argument", ".", "If", "null", "value", "is", "passed", "then", "value", "for", "whole", "system", "will", "be", "returned", ...
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java#L310-L319
test
Get the amount of pages read from a file.
Of course, here is the Java code you requested: ```java public long getAmountOfPagesReadFromFile(String componentName) { if (componentName == null) return performanceCountersHolder.getAmountOfPagesReadFromFile(); final PerformanceCountersHolder cHolder = countersByComponent.get(componentName); if (c...
jkuhnert/ognl
src/main/java/ognl/enhance/ExpressionCompiler.java
ExpressionCompiler.compileExpression
public void compileExpression(OgnlContext context, Node expression, Object root) throws Exception { // System.out.println("Compiling expr class " + expression.getClass().getName() + " and root " + root); if (expression.getAccessor() != null) return; String getBody, s...
java
public void compileExpression(OgnlContext context, Node expression, Object root) throws Exception { // System.out.println("Compiling expr class " + expression.getClass().getName() + " and root " + root); if (expression.getAccessor() != null) return; String getBody, s...
[ "public", "void", "compileExpression", "(", "OgnlContext", "context", ",", "Node", "expression", ",", "Object", "root", ")", "throws", "Exception", "{", "// System.out.println(\"Compiling expr class \" + expression.getClass().getName() + \" and root \" + root);", "if", "("...
/* (non-Javadoc) @see ognl.enhance.OgnlExpressionCompiler#compileExpression(ognl.OgnlContext, ognl.Node, java.lang.Object)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
53d51a30c8c299b750dede779d05cb84beee73c3
https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/enhance/ExpressionCompiler.java#L390-L484
test
Compile an expression.
Of course, here is the Java code you requested: ```java public void compileExpression(OgnlContext context, Node expression, Object root) throws Exception { // System.out.println("Compiling expr class " + expression.getClass().getName() + " and root " + root); if (expression.getAccessor(...
wildfly/wildfly
picketlink/src/main/java/org/wildfly/extension/picketlink/federation/model/parser/AbstractFederationSubsystemReader.java
AbstractFederationSubsystemReader.parseConfig
protected ModelNode parseConfig(XMLExtendedStreamReader reader, ModelElement xmlElement, String key, ModelNode lastNode, List<SimpleAttributeDefinition> attributes, List<ModelNode> addOperations) throws XMLStreamException { if (!reader.getLocalName().equals(xmlElement.getName())) { return nu...
java
protected ModelNode parseConfig(XMLExtendedStreamReader reader, ModelElement xmlElement, String key, ModelNode lastNode, List<SimpleAttributeDefinition> attributes, List<ModelNode> addOperations) throws XMLStreamException { if (!reader.getLocalName().equals(xmlElement.getName())) { return nu...
[ "protected", "ModelNode", "parseConfig", "(", "XMLExtendedStreamReader", "reader", ",", "ModelElement", "xmlElement", ",", "String", "key", ",", "ModelNode", "lastNode", ",", "List", "<", "SimpleAttributeDefinition", ">", "attributes", ",", "List", "<", "ModelNode", ...
Reads a element from the stream considering the parameters. @param reader XMLExtendedStreamReader instance from which the elements are read. @param xmlElement Name of the Model Element to be parsed. @param key Name of the attribute to be used to as the key for the model. @param addOperations List of operations. @param...
[ "Reads", "a", "element", "from", "the", "stream", "considering", "the", "parameters", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/picketlink/src/main/java/org/wildfly/extension/picketlink/federation/model/parser/AbstractFederationSubsystemReader.java#L269-L313
test
Parses the configuration of a single class.
Of course, here is the Java code you requested: ```java protected ModelNode parseConfig(XMLExtendedStreamReader reader, ModelElement xmlElement, String key, ModelNode lastNode, List<SimpleAttributeDefinition> attributes, List<ModelNode> addOperations) throws XMLStreamException { if (!reader.getLocalNam...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/Precondition.java
Precondition.addStateTokenCondition
public void addStateTokenCondition(String resourceURI, String stateToken) throws WebDAVException { Condition condition = new Condition(resourceURI); ConditionTerm term = new ConditionTerm(); term.addConditionFactor(new StateToken(stateToken)); condition.addConditionTerm(term); ad...
java
public void addStateTokenCondition(String resourceURI, String stateToken) throws WebDAVException { Condition condition = new Condition(resourceURI); ConditionTerm term = new ConditionTerm(); term.addConditionFactor(new StateToken(stateToken)); condition.addConditionTerm(term); ad...
[ "public", "void", "addStateTokenCondition", "(", "String", "resourceURI", ",", "String", "stateToken", ")", "throws", "WebDAVException", "{", "Condition", "condition", "=", "new", "Condition", "(", "resourceURI", ")", ";", "ConditionTerm", "term", "=", "new", "Con...
Add a condition created from the given URI and state token. This is a convenience method used primarily to create preconditions for lock tokens that must be provided in the resource context for methods that update the resource. @param resourceURI the URI of the resource the state token applies to. Null implicitly spec...
[ "Add", "a", "condition", "created", "from", "the", "given", "URI", "and", "state", "token", ".", "This", "is", "a", "convenience", "method", "used", "primarily", "to", "create", "preconditions", "for", "lock", "tokens", "that", "must", "be", "provided", "in"...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/Precondition.java#L117-L123
test
Adds a state token condition to the current audit entry.
Of course, here is the Java code you requested: ```java public void addStateTokenCondition(String resourceURI, String stateToken) throws WebDAVException { Condition condition = new Condition(resourceURI); ConditionTerm term = new ConditionTerm(); term.addConditionFactor(new StateToken(stateToke...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/MessageEncryptionHelper.java
MessageEncryptionHelper.desEncrypt
public static byte[] desEncrypt(byte rawKeyData[], byte[] data) throws InvalidKeyException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, NoSuchPaddingException, InvalidKeySpecException { // DES算法要求有一个可信任的随机数源 SecureRandom sr = new SecureRa...
java
public static byte[] desEncrypt(byte rawKeyData[], byte[] data) throws InvalidKeyException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, NoSuchPaddingException, InvalidKeySpecException { // DES算法要求有一个可信任的随机数源 SecureRandom sr = new SecureRa...
[ "public", "static", "byte", "[", "]", "desEncrypt", "(", "byte", "rawKeyData", "[", "]", ",", "byte", "[", "]", "data", ")", "throws", "InvalidKeyException", ",", "NoSuchAlgorithmException", ",", "IllegalBlockSizeException", ",", "BadPaddingException", ",", "NoSuc...
加密方法 <pre> // 1.1 首先要创建一个密匙 // DES算法要求有一个可信任的随机数源 SecureRandom sr = new SecureRandom(); // 为我们选择的DES算法生成一个KeyGenerator对象 KeyGenerator kg = KeyGenerator.getInstance("DES"); kg.init(sr); // 生成密匙 SecretKey key = kg.generateKey(); // 获取密匙数据 byte rawKeyData[] = key.getEncoded(); // byte rawKeyData[] = "sucretsa".get...
[ "加密方法", "<pre", ">", "//", "1", ".", "1", "首先要创建一个密匙", "//", "DES算法要求有一个可信任的随机数源", "SecureRandom", "sr", "=", "new", "SecureRandom", "()", ";", "//", "为我们选择的DES算法生成一个KeyGenerator对象", "KeyGenerator", "kg", "=", "KeyGenerator", ".", "getInstance", "(", "DES", ")",...
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/MessageEncryptionHelper.java#L161-L182
test
DES encrypt data
Of course, here is the Java code you requested: ```java public static byte[] desEncrypt(byte rawKeyData[], byte[] data) throws InvalidKeyException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, NoSuchPaddingException, InvalidKeySpecException { // ...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flowitem/FlowItemClient.java
FlowItemClient.getFluidItemsForView
public FluidItemListing getFluidItemsForView( JobView jobViewParam, int queryLimitParam, int offsetParam, String sortFieldParam, String sortOrderParam) { if(this.serviceTicket != null && jobViewParam != null) { jobViewParam.setS...
java
public FluidItemListing getFluidItemsForView( JobView jobViewParam, int queryLimitParam, int offsetParam, String sortFieldParam, String sortOrderParam) { if(this.serviceTicket != null && jobViewParam != null) { jobViewParam.setS...
[ "public", "FluidItemListing", "getFluidItemsForView", "(", "JobView", "jobViewParam", ",", "int", "queryLimitParam", ",", "int", "offsetParam", ",", "String", "sortFieldParam", ",", "String", "sortOrderParam", ")", "{", "if", "(", "this", ".", "serviceTicket", "!=",...
Retrieves items for the provided JobView. @param jobViewParam The {@link JobView} to retrieve items from. @param queryLimitParam The query limit. @param offsetParam The offset. @param sortFieldParam The sort field. @param sortOrderParam The sort order. @return The Fluid items for the {@code jobViewParam}.
[ "Retrieves", "items", "for", "the", "provided", "JobView", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flowitem/FlowItemClient.java#L116-L143
test
Get Fluid Items for View.
Of course, here is the Java code you requested: ```java public FluidItemListing getFluidItemsForView( JobView jobViewParam, int queryLimitParam, int offsetParam, String sortFieldParam, String sortOrderParam) { if(this.serviceTicket != null && jobV...
kiegroup/droolsjbpm-tools
drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/flow/common/editor/GenericModelEditor.java
GenericModelEditor.createImage
public void createImage(OutputStream stream, int format) { SWTGraphics g = null; GC gc = null; Image image = null; LayerManager layerManager = (LayerManager) getGraphicalViewer().getEditPartRegistry().get(LayerManager.ID); IFigure figure = layerManager.getLayer(LayerC...
java
public void createImage(OutputStream stream, int format) { SWTGraphics g = null; GC gc = null; Image image = null; LayerManager layerManager = (LayerManager) getGraphicalViewer().getEditPartRegistry().get(LayerManager.ID); IFigure figure = layerManager.getLayer(LayerC...
[ "public", "void", "createImage", "(", "OutputStream", "stream", ",", "int", "format", ")", "{", "SWTGraphics", "g", "=", "null", ";", "GC", "gc", "=", "null", ";", "Image", "image", "=", "null", ";", "LayerManager", "layerManager", "=", "(", "LayerManager"...
Writes the content of this editor to the given stream. Possible formats are for example SWT.IMAGE_BMP, IMAGE_GIF, IMAGE_JPEG, IMAGE_PNG. @param stream @param format
[ "Writes", "the", "content", "of", "this", "editor", "to", "the", "given", "stream", ".", "Possible", "formats", "are", "for", "example", "SWT", ".", "IMAGE_BMP", "IMAGE_GIF", "IMAGE_JPEG", "IMAGE_PNG", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/flow/common/editor/GenericModelEditor.java#L374-L404
test
Create an image from the image data.
Of course, here is the Java code you requested: ```java public void createImage(OutputStream stream, int format) { SWTGraphics g = null; GC gc = null; Image image = null; LayerManager layerManager = (LayerManager) getGraphicalViewer().getEditPartRegistry().get(LayerManager.I...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/image/SourcePicture.java
SourcePicture.getSize
public Dimension getSize() { if ( sourcePictureBufferedImage != null ) return new Dimension( sourcePictureBufferedImage.getWidth(), sourcePictureBufferedImage.getHeight()); else return new Dimension(0,0); }
java
public Dimension getSize() { if ( sourcePictureBufferedImage != null ) return new Dimension( sourcePictureBufferedImage.getWidth(), sourcePictureBufferedImage.getHeight()); else return new Dimension(0,0); }
[ "public", "Dimension", "getSize", "(", ")", "{", "if", "(", "sourcePictureBufferedImage", "!=", "null", ")", "return", "new", "Dimension", "(", "sourcePictureBufferedImage", ".", "getWidth", "(", ")", ",", "sourcePictureBufferedImage", ".", "getHeight", "(", ")", ...
return the size of the image or Zero if there is none
[ "return", "the", "size", "of", "the", "image", "or", "Zero", "if", "there", "is", "none" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/image/SourcePicture.java#L338-L344
test
Get the size of the image.
Of course, here is the Java code you requested: ```java public Dimension getSize() { if ( sourcePictureBufferedImage != null ) return new Dimension( sourcePictureBufferedImage.getWidth(), sourcePictureBufferedImage.getHeight()); else return new Dimension(0,0); } ``` Hope this helps!
oblac/jodd
jodd-bean/src/main/java/jodd/bean/BeanProperty.java
BeanProperty.setBean
private void setBean(final Object bean) { this.bean = bean; this.cd = (bean == null ? null : introspector.lookup(bean.getClass())); this.first = false; this.updateProperty = true; }
java
private void setBean(final Object bean) { this.bean = bean; this.cd = (bean == null ? null : introspector.lookup(bean.getClass())); this.first = false; this.updateProperty = true; }
[ "private", "void", "setBean", "(", "final", "Object", "bean", ")", "{", "this", ".", "bean", "=", "bean", ";", "this", ".", "cd", "=", "(", "bean", "==", "null", "?", "null", ":", "introspector", ".", "lookup", "(", "bean", ".", "getClass", "(", ")...
Sets new bean instance.
[ "Sets", "new", "bean", "instance", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/bean/BeanProperty.java#L77-L82
test
Sets the bean.
Of course, here is the Java code you requested: ```java private void setBean(final Object bean) { this.bean = bean; this.cd = (bean == null ? null : introspector.lookup(bean.getClass())); this.first = false; this.updateProperty = true; } ``` Hope this helps!
braintree/braintree_android
Braintree/src/main/java/com/braintreepayments/api/BraintreeFragment.java
BraintreeFragment.addListener
public <T extends BraintreeListener> void addListener(T listener) { if (listener instanceof ConfigurationListener) { mConfigurationListener = (ConfigurationListener) listener; } if (listener instanceof BraintreeCancelListener) { mCancelListener = (BraintreeCancelListener...
java
public <T extends BraintreeListener> void addListener(T listener) { if (listener instanceof ConfigurationListener) { mConfigurationListener = (ConfigurationListener) listener; } if (listener instanceof BraintreeCancelListener) { mCancelListener = (BraintreeCancelListener...
[ "public", "<", "T", "extends", "BraintreeListener", ">", "void", "addListener", "(", "T", "listener", ")", "{", "if", "(", "listener", "instanceof", "ConfigurationListener", ")", "{", "mConfigurationListener", "=", "(", "ConfigurationListener", ")", "listener", ";...
Adds a listener. @param listener the listener to add.
[ "Adds", "a", "listener", "." ]
07b32e6fad73f9fb8432971b0e79fc8c94b11873
https://github.com/braintree/braintree_android/blob/07b32e6fad73f9fb8432971b0e79fc8c94b11873/Braintree/src/main/java/com/braintreepayments/api/BraintreeFragment.java#L391-L429
test
Add a listener to the BraintreeSession.
Of course, here is the Java code you requested: ```java public <T extends BraintreeListener> void addListener(T listener) { if (listener instanceof ConfigurationListener) { mConfigurationListener = (ConfigurationListener) listener; } if (listener instanceof BraintreeCancelListener)...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/ClassReader.java
ClassReader.accept
public void accept( final ClassVisitor classVisitor, final Attribute[] attributePrototypes, final int parsingOptions) { Context context = new Context(); context.attributePrototypes = attributePrototypes; context.parsingOptions = parsingOptions; context.charBuffer = new char[maxStringLe...
java
public void accept( final ClassVisitor classVisitor, final Attribute[] attributePrototypes, final int parsingOptions) { Context context = new Context(); context.attributePrototypes = attributePrototypes; context.parsingOptions = parsingOptions; context.charBuffer = new char[maxStringLe...
[ "public", "void", "accept", "(", "final", "ClassVisitor", "classVisitor", ",", "final", "Attribute", "[", "]", "attributePrototypes", ",", "final", "int", "parsingOptions", ")", "{", "Context", "context", "=", "new", "Context", "(", ")", ";", "context", ".", ...
Makes the given visitor visit the JVMS ClassFile structure passed to the constructor of this {@link ClassReader}. @param classVisitor the visitor that must visit this class. @param attributePrototypes prototypes of the attributes that must be parsed during the visit of the class. Any attribute whose type is not equal ...
[ "Makes", "the", "given", "visitor", "visit", "the", "JVMS", "ClassFile", "structure", "passed", "to", "the", "constructor", "of", "this", "{", "@link", "ClassReader", "}", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassReader.java#L408-L684
test
Accept the class.
Of course, here is the Java code you requested: ```java public void accept( final ClassVisitor classVisitor, final Attribute[] attributePrototypes, final int parsingOptions) { Context context = new Context(); context.attributePrototypes = attributePrototypes; context.parsingOptions = pars...
ReactiveX/RxJava
src/main/java/io/reactivex/Maybe.java
Maybe.compose
@SuppressWarnings("unchecked") @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Maybe<R> compose(MaybeTransformer<? super T, ? extends R> transformer) { return wrap(((MaybeTransformer<T, R>) ObjectHelper.requireNonNull(transformer, "transformer is null")).apply(this)); ...
java
@SuppressWarnings("unchecked") @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Maybe<R> compose(MaybeTransformer<? super T, ? extends R> transformer) { return wrap(((MaybeTransformer<T, R>) ObjectHelper.requireNonNull(transformer, "transformer is null")).apply(this)); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Maybe", "<", "R", ">", "compose", "(", "MaybeTransformer", "<", "?", "super", ...
Transform a Maybe by applying a particular Transformer function to it. <p> This method operates on the Maybe itself whereas {@link #lift} operates on the Maybe's MaybeObservers. <p> If the operator you are creating is designed to act on the individual item emitted by a Maybe, use {@link #lift}. If your operator is desi...
[ "Transform", "a", "Maybe", "by", "applying", "a", "particular", "Transformer", "function", "to", "it", ".", "<p", ">", "This", "method", "operates", "on", "the", "Maybe", "itself", "whereas", "{", "@link", "#lift", "}", "operates", "on", "the", "Maybe", "s...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L2409-L2414
test
Compose a single CAAS object into a single CAAS object.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Maybe<R> compose(MaybeTransformer<? super T, ? extends R> transformer) { return wrap(((MaybeTransformer<T, R>) ObjectHelper.requireNonNu...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/attachment/AttachmentClient.java
AttachmentClient.deleteAttachment
public Attachment deleteAttachment(Attachment attachmentParam) { if(attachmentParam != null && this.serviceTicket != null) { attachmentParam.setServiceTicket(this.serviceTicket); } return new Attachment(this.postJson( attachmentParam, WS.Path.Attachment.V...
java
public Attachment deleteAttachment(Attachment attachmentParam) { if(attachmentParam != null && this.serviceTicket != null) { attachmentParam.setServiceTicket(this.serviceTicket); } return new Attachment(this.postJson( attachmentParam, WS.Path.Attachment.V...
[ "public", "Attachment", "deleteAttachment", "(", "Attachment", "attachmentParam", ")", "{", "if", "(", "attachmentParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", "null", ")", "{", "attachmentParam", ".", "setServiceTicket", "(", "this", ".", "ser...
Delete an existing Attachment. @param attachmentParam The Attachment to delete. @return The deleted Attachment.
[ "Delete", "an", "existing", "Attachment", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/attachment/AttachmentClient.java#L157-L166
test
Delete an attachment.
Of course, here is the Java code you requested: ```java public Attachment deleteAttachment(Attachment attachmentParam) { if(attachmentParam != null && this.serviceTicket != null) { attachmentParam.setServiceTicket(this.serviceTicket); } return new Attachment(this.postJs...
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/entity/HistoryTask.java
HistoryTask.undoTask
public Task undoTask() { Task task = new Task(); task.setOrderId(this.getOrderId());; task.setTaskName(this.getTaskName()); task.setDisplayName(this.getDisplayName()); task.setTaskType(this.getTaskType()); task.setExpireTime(this.getExpireTime()); task.setActionUrl(this.getActionUrl()...
java
public Task undoTask() { Task task = new Task(); task.setOrderId(this.getOrderId());; task.setTaskName(this.getTaskName()); task.setDisplayName(this.getDisplayName()); task.setTaskType(this.getTaskType()); task.setExpireTime(this.getExpireTime()); task.setActionUrl(this.getActionUrl()...
[ "public", "Task", "undoTask", "(", ")", "{", "Task", "task", "=", "new", "Task", "(", ")", ";", "task", ".", "setOrderId", "(", "this", ".", "getOrderId", "(", ")", ")", ";", ";", "task", ".", "setTaskName", "(", "this", ".", "getTaskName", "(", ")...
根据历史任务产生撤回的任务对象 @return 任务对象
[ "根据历史任务产生撤回的任务对象" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/entity/HistoryTask.java#L135-L148
test
Create a new task object that represents this undo operation.
Of course, here is the Java code you requested: ```java public Task undoTask() { Task task = new Task(); task.setOrderId(this.getOrderId());; task.setTaskName(this.getTaskName()); task.setDisplayName(this.getDisplayName()); task.setTaskType(this.getTaskType()); task.setExpireTime(this.get...
oblac/jodd
jodd-core/src/main/java/jodd/util/CsvUtil.java
CsvUtil.toStringArray
public static String[] toStringArray(final String line) { List<String> row = new ArrayList<>(); boolean inQuotedField = false; int fieldStart = 0; final int len = line.length(); for (int i = 0; i < len; i++) { char c = line.charAt(i); if (c == FIELD_SEPARATOR)...
java
public static String[] toStringArray(final String line) { List<String> row = new ArrayList<>(); boolean inQuotedField = false; int fieldStart = 0; final int len = line.length(); for (int i = 0; i < len; i++) { char c = line.charAt(i); if (c == FIELD_SEPARATOR)...
[ "public", "static", "String", "[", "]", "toStringArray", "(", "final", "String", "line", ")", "{", "List", "<", "String", ">", "row", "=", "new", "ArrayList", "<>", "(", ")", ";", "boolean", "inQuotedField", "=", "false", ";", "int", "fieldStart", "=", ...
Converts CSV line to string array.
[ "Converts", "CSV", "line", "to", "string", "array", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/CsvUtil.java#L93-L126
test
Convert a string to an array of strings.
Of course, here is the Java code you requested: ```java public static String[] toStringArray(final String line) { List<String> row = new ArrayList<>(); boolean inQuotedField = false; int fieldStart = 0; final int len = line.length(); for (int i = 0; i < len; i++) { char ...
Unidata/thredds
bufr/src/main/java/ucar/nc2/iosp/bufr/writer/BufrDataProcess.java
BufrDataProcess.scanBufrFile
public int scanBufrFile(String filename, Counter total) throws Exception { int count = 0; try (RandomAccessFile raf = new RandomAccessFile(filename, "r")) { MessageScanner scan = new MessageScanner(raf); while (scan.hasNext()) { Message m = scan.next(); if (m == null) continu...
java
public int scanBufrFile(String filename, Counter total) throws Exception { int count = 0; try (RandomAccessFile raf = new RandomAccessFile(filename, "r")) { MessageScanner scan = new MessageScanner(raf); while (scan.hasNext()) { Message m = scan.next(); if (m == null) continu...
[ "public", "int", "scanBufrFile", "(", "String", "filename", ",", "Counter", "total", ")", "throws", "Exception", "{", "int", "count", "=", "0", ";", "try", "(", "RandomAccessFile", "raf", "=", "new", "RandomAccessFile", "(", "filename", ",", "\"r\"", ")", ...
open the file and extract BUFR messages
[ "open", "the", "file", "and", "extract", "BUFR", "messages" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/bufr/src/main/java/ucar/nc2/iosp/bufr/writer/BufrDataProcess.java#L100-L123
test
Scans the BARF file for messages and adds them to the Counter.
Of course, here is the Java code you requested: ```java public int scanBufrFile(String filename, Counter total) throws Exception { int count = 0; try (RandomAccessFile raf = new RandomAccessFile(filename, "r")) { MessageScanner scan = new MessageScanner(raf); while (scan.hasNext()) { ...
algolia/algoliasearch-client-android
algoliasearch/src/offline/java/com/algolia/search/saas/OfflineClient.java
OfflineClient.hasOfflineData
public boolean hasOfflineData(@NonNull String name) { // TODO: Suboptimal; we should be able to test existence without instantiating a `LocalIndex`. return new LocalIndex(getRootDataDir().getAbsolutePath(), getApplicationID(), name).exists(); }
java
public boolean hasOfflineData(@NonNull String name) { // TODO: Suboptimal; we should be able to test existence without instantiating a `LocalIndex`. return new LocalIndex(getRootDataDir().getAbsolutePath(), getApplicationID(), name).exists(); }
[ "public", "boolean", "hasOfflineData", "(", "@", "NonNull", "String", "name", ")", "{", "// TODO: Suboptimal; we should be able to test existence without instantiating a `LocalIndex`.", "return", "new", "LocalIndex", "(", "getRootDataDir", "(", ")", ".", "getAbsolutePath", "(...
Test if an index has offline data on disk. **Note:** This applies both to {@link MirroredIndex} and {@link OfflineIndex} instances. **Warning:** This method is synchronous! @param name The index's name. @return `true` if data exists on disk for this index, `false` otherwise.
[ "Test", "if", "an", "index", "has", "offline", "data", "on", "disk", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/OfflineClient.java#L268-L271
test
Checks if the data directory contains offline data.
Of course, here is the Java code you requested: ```java public boolean hasOfflineData(@NonNull String name) { // TODO: Suboptimal; we should be able to test existence without instantiating a `LocalIndex`. return new LocalIndex(getRootDataDir().getAbsolutePath(), getApplicationID(), name).exists(); ...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/util/EnvUtil.java
EnvUtil.isAndroidOS
static public boolean isAndroidOS() { String osname = OptionHelper.getSystemProperty("os.name"); String root = OptionHelper.getEnv("ANDROID_ROOT"); String data = OptionHelper.getEnv("ANDROID_DATA"); return osname != null && osname.contains("Linux") && root != null && root.contains("/system") &&...
java
static public boolean isAndroidOS() { String osname = OptionHelper.getSystemProperty("os.name"); String root = OptionHelper.getEnv("ANDROID_ROOT"); String data = OptionHelper.getEnv("ANDROID_DATA"); return osname != null && osname.contains("Linux") && root != null && root.contains("/system") &&...
[ "static", "public", "boolean", "isAndroidOS", "(", ")", "{", "String", "osname", "=", "OptionHelper", ".", "getSystemProperty", "(", "\"os.name\"", ")", ";", "String", "root", "=", "OptionHelper", ".", "getEnv", "(", "\"ANDROID_ROOT\"", ")", ";", "String", "da...
Heuristically determines whether the current OS is Android
[ "Heuristically", "determines", "whether", "the", "current", "OS", "is", "Android" ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/util/EnvUtil.java#L33-L41
test
Checks if the current operating system is Android OS.
Of course, here is the Java code you requested: ```java static public boolean isAndroidOS() { String osname = OptionHelper.getSystemProperty("os.name"); String root = OptionHelper.getEnv("ANDROID_ROOT"); String data = OptionHelper.getEnv("ANDROID_DATA"); return osname != null && osname.contains("Linux...
cosysoft/device
device-api/src/main/java/com/github/cosysoft/device/android/impl/AbstractDevice.java
AbstractDevice.getCrashLog
public String getCrashLog() { String crashLogFileName = null; File crashLogFile = new File(getExternalStoragePath(), crashLogFileName); // the "test" utility doesn't exist on all devices so we'll check the // output of ls. CommandLine directoryListCommand = adbCommand("shell", "ls", crashLo...
java
public String getCrashLog() { String crashLogFileName = null; File crashLogFile = new File(getExternalStoragePath(), crashLogFileName); // the "test" utility doesn't exist on all devices so we'll check the // output of ls. CommandLine directoryListCommand = adbCommand("shell", "ls", crashLo...
[ "public", "String", "getCrashLog", "(", ")", "{", "String", "crashLogFileName", "=", "null", ";", "File", "crashLogFile", "=", "new", "File", "(", "getExternalStoragePath", "(", ")", ",", "crashLogFileName", ")", ";", "// the \"test\" utility doesn't exist on all devi...
Get crash log from AUT @return empty string if there is no crash log on the device, otherwise returns the stack trace caused by the crash of the AUT
[ "Get", "crash", "log", "from", "AUT" ]
d5cd0b713a47aba4d5f3f5d918578336f44ddb9e
https://github.com/cosysoft/device/blob/d5cd0b713a47aba4d5f3f5d918578336f44ddb9e/device-api/src/main/java/com/github/cosysoft/device/android/impl/AbstractDevice.java#L645-L660
test
Get the crash log file
Of course, here is the Java code you requested: ```java public String getCrashLog() { String crashLogFileName = null; File crashLogFile = new File(getExternalStoragePath(), crashLogFileName); // the "test" utility doesn't exist on all devices so we'll check the // output of ls. CommandLine directo...
real-logic/aeron
aeron-cluster/src/main/java/io/aeron/cluster/ClusterMember.java
ClusterMember.removeMember
public static ClusterMember[] removeMember(final ClusterMember[] oldMembers, final int memberId) { return ArrayUtil.remove(oldMembers, findMemberIndex(oldMembers, memberId)); }
java
public static ClusterMember[] removeMember(final ClusterMember[] oldMembers, final int memberId) { return ArrayUtil.remove(oldMembers, findMemberIndex(oldMembers, memberId)); }
[ "public", "static", "ClusterMember", "[", "]", "removeMember", "(", "final", "ClusterMember", "[", "]", "oldMembers", ",", "final", "int", "memberId", ")", "{", "return", "ArrayUtil", ".", "remove", "(", "oldMembers", ",", "findMemberIndex", "(", "oldMembers", ...
Remove a member from an array if found, otherwise return the array unmodified. @param oldMembers to remove a member from. @param memberId of the member to remove. @return a new array with the member removed or the existing array if not found.
[ "Remove", "a", "member", "from", "an", "array", "if", "found", "otherwise", "return", "the", "array", "unmodified", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-cluster/src/main/java/io/aeron/cluster/ClusterMember.java#L1120-L1123
test
Removes the member from the array.
Of course, here is the Java code you requested: ```java public static ClusterMember[] removeMember(final ClusterMember[] oldMembers, final int memberId) { return ArrayUtil.remove(oldMembers, findMemberIndex(oldMembers, memberId)); } ``` Hope this helps!
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/xml/StaxUtils.java
StaxUtils.getXMLStreamReader
public static XMLStreamReader getXMLStreamReader(Source source) { if (source instanceof StAXSource) { return ((StAXSource) source).getXMLStreamReader(); } else if (source instanceof StaxSource) { return ((StaxSource) source).getXMLStreamReader(); } else { thro...
java
public static XMLStreamReader getXMLStreamReader(Source source) { if (source instanceof StAXSource) { return ((StAXSource) source).getXMLStreamReader(); } else if (source instanceof StaxSource) { return ((StaxSource) source).getXMLStreamReader(); } else { thro...
[ "public", "static", "XMLStreamReader", "getXMLStreamReader", "(", "Source", "source", ")", "{", "if", "(", "source", "instanceof", "StAXSource", ")", "{", "return", "(", "(", "StAXSource", ")", "source", ")", ".", "getXMLStreamReader", "(", ")", ";", "}", "e...
Return the {@link javax.xml.stream.XMLStreamReader} for the given StAX Source. @param source a JAXP 1.4 {@link javax.xml.transform.stax.StAXSource} @return the {@link javax.xml.stream.XMLStreamReader} @throws IllegalArgumentException if {@code source} isn't a JAXP 1.4 {@link javax.xml.transform.stax.StAXSource} or cus...
[ "Return", "the", "{", "@link", "javax", ".", "xml", ".", "stream", ".", "XMLStreamReader", "}", "for", "the", "given", "StAX", "Source", "." ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/xml/StaxUtils.java#L99-L107
test
Get an XMLStreamReader from a Source
Of course, here is the Java code you requested: ```java public static XMLStreamReader getXMLStreamReader(Source source) { if (source instanceof StAXSource) { return ((StAXSource) source).getXMLStreamReader(); } else if (source instanceof StaxSource) { return ((StaxSource) source...
spring-projects/spring-security
acl/src/main/java/org/springframework/security/acls/jdbc/AclClassIdUtils.java
AclClassIdUtils.convertToLong
private Long convertToLong(Serializable identifier) { Long idAsLong; if (canConvertFromStringTo(Long.class)) { idAsLong = conversionService.convert(identifier, Long.class); } else { idAsLong = Long.valueOf(identifier.toString()); } return idAsLong; }
java
private Long convertToLong(Serializable identifier) { Long idAsLong; if (canConvertFromStringTo(Long.class)) { idAsLong = conversionService.convert(identifier, Long.class); } else { idAsLong = Long.valueOf(identifier.toString()); } return idAsLong; }
[ "private", "Long", "convertToLong", "(", "Serializable", "identifier", ")", "{", "Long", "idAsLong", ";", "if", "(", "canConvertFromStringTo", "(", "Long", ".", "class", ")", ")", "{", "idAsLong", "=", "conversionService", ".", "convert", "(", "identifier", ",...
Converts to a {@link Long}, attempting to use the {@link ConversionService} if available. @param identifier The identifier @return Long version of the identifier @throws NumberFormatException if the string cannot be parsed to a long. @throws org.springframework.core.convert.ConversionException if a conversion except...
[ "Converts", "to", "a", "{" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/acl/src/main/java/org/springframework/security/acls/jdbc/AclClassIdUtils.java#L119-L127
test
Convert a Serializable identifier to a Long.
Of course, here is the Java code you requested: ```java private Long convertToLong(Serializable identifier) { Long idAsLong; if (canConvertFromStringTo(Long.class)) { idAsLong = conversionService.convert(identifier, Long.class); } else { idAsLong = Long.valueOf(identifier.toString()); } return idAsLong...
Unidata/thredds
cdm/src/main/java/ucar/nc2/Group.java
Group.findGroup
public Group findGroup(String groupShortName) { if (groupShortName == null) return null; // groupShortName = NetcdfFile.makeNameUnescaped(groupShortName); for (Group group : groups) { if (groupShortName.equals(group.getShortName())) return group; } return null; }
java
public Group findGroup(String groupShortName) { if (groupShortName == null) return null; // groupShortName = NetcdfFile.makeNameUnescaped(groupShortName); for (Group group : groups) { if (groupShortName.equals(group.getShortName())) return group; } return null; }
[ "public", "Group", "findGroup", "(", "String", "groupShortName", ")", "{", "if", "(", "groupShortName", "==", "null", ")", "return", "null", ";", "// groupShortName = NetcdfFile.makeNameUnescaped(groupShortName);", "for", "(", "Group", "group", ":", "groups", ")", "...
Retrieve the Group with the specified (short) name. @param groupShortName short name of the nested group you are looking for. @return the Group, or null if not found
[ "Retrieve", "the", "Group", "with", "the", "specified", "(", "short", ")", "name", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/Group.java#L170-L180
test
Find a group by short name.
Of course, here is the Java code you requested: ```java public Group findGroup(String groupShortName) { if (groupShortName == null) return null; // groupShortName = NetcdfFile.makeNameUnescaped(groupShortName); for (Group group : groups) { if (groupShortName.equals(group.getShortName())) ret...
Unidata/thredds
tds/src/main/java/thredds/server/ncss/validation/PointHorizSubsetTypeValidator.java
PointHorizSubsetTypeValidator.isValid
@Override public boolean isValid(NcssPointParamsBean params, ConstraintValidatorContext constraintValidatorContext) { constraintValidatorContext.disableDefaultConstraintViolation(); boolean isValid =true; boolean isStnRequest = params.hasLatLonPoint() && params.hasStations(); boolean isPointRequest = p...
java
@Override public boolean isValid(NcssPointParamsBean params, ConstraintValidatorContext constraintValidatorContext) { constraintValidatorContext.disableDefaultConstraintViolation(); boolean isValid =true; boolean isStnRequest = params.hasLatLonPoint() && params.hasStations(); boolean isPointRequest = p...
[ "@", "Override", "public", "boolean", "isValid", "(", "NcssPointParamsBean", "params", ",", "ConstraintValidatorContext", "constraintValidatorContext", ")", "{", "constraintValidatorContext", ".", "disableDefaultConstraintViolation", "(", ")", ";", "boolean", "isValid", "="...
/* (non-Javadoc) @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/ncss/validation/PointHorizSubsetTypeValidator.java#L30-L71
test
Validate the NcssPointParamsBean.
Of course, here is the Java code you requested: ```java @Override public boolean isValid(NcssPointParamsBean params, ConstraintValidatorContext constraintValidatorContext) { constraintValidatorContext.disableDefaultConstraintViolation(); boolean isValid =true; boolean isStnRequest = params.hasLatLonPoint()...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/converter/ConverterHtmlToSpanned.java
ConverterHtmlToSpanned.handleStartTag
private void handleStartTag(String tag, Attributes attributes) { if (tag.equalsIgnoreCase("br")) { // We don't need to handle this. TagSoup will ensure that there's a </br> for each <br> // so we can safely omit the line breaks when we handle the close tag. } else if (tag.equalsI...
java
private void handleStartTag(String tag, Attributes attributes) { if (tag.equalsIgnoreCase("br")) { // We don't need to handle this. TagSoup will ensure that there's a </br> for each <br> // so we can safely omit the line breaks when we handle the close tag. } else if (tag.equalsI...
[ "private", "void", "handleStartTag", "(", "String", "tag", ",", "Attributes", "attributes", ")", "{", "if", "(", "tag", ".", "equalsIgnoreCase", "(", "\"br\"", ")", ")", "{", "// We don't need to handle this. TagSoup will ensure that there's a </br> for each <br>", "// so...
****************************************** Handle Tags *******************************************
[ "******************************************", "Handle", "Tags", "*******************************************" ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/converter/ConverterHtmlToSpanned.java#L249-L312
test
Handle start tag.
Of course, here is the Java code you requested: ```java private void handleStartTag(String tag, Attributes attributes) { if (tag.equalsIgnoreCase("br")) { // We don't need to handle this. TagSoup will ensure that there's a </br> for each <br> // so we can safely omit the line breaks whe...
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java
ODistributedConfiguration.isExecutionModeSynchronous
public Boolean isExecutionModeSynchronous(final String iClusterName) { Object value = getClusterConfiguration(iClusterName).field(EXECUTION_MODE); if (value == null) { value = configuration.field(EXECUTION_MODE); if (value == null) return null; } if (value.toString().equalsIgnoreCas...
java
public Boolean isExecutionModeSynchronous(final String iClusterName) { Object value = getClusterConfiguration(iClusterName).field(EXECUTION_MODE); if (value == null) { value = configuration.field(EXECUTION_MODE); if (value == null) return null; } if (value.toString().equalsIgnoreCas...
[ "public", "Boolean", "isExecutionModeSynchronous", "(", "final", "String", "iClusterName", ")", "{", "Object", "value", "=", "getClusterConfiguration", "(", "iClusterName", ")", ".", "field", "(", "EXECUTION_MODE", ")", ";", "if", "(", "value", "==", "null", ")"...
Returns the execution mode if synchronous. @param iClusterName Cluster name, or null for * @return true = synchronous, false = asynchronous, null = undefined
[ "Returns", "the", "execution", "mode", "if", "synchronous", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java#L124-L136
test
Checks if execution mode is synchronous.
Of course, here is the Java code you requested: ```java public Boolean isExecutionModeSynchronous(final String iClusterName) { Object value = getClusterConfiguration(iClusterName).field(EXECUTION_MODE); if (value == null) { value = configuration.field(EXECUTION_MODE); if (value == null) ret...
jboss/jboss-common-core
src/main/java/org/jboss/util/StopWatch.java
StopWatch.makeSynchronized
public static StopWatch makeSynchronized(final StopWatch watch) { return new Wrapper(watch) { /** The serialVersionUID */ private static final long serialVersionUID = -6284244000894114817L; public synchronized void start(final boolean reset) { this.watch.st...
java
public static StopWatch makeSynchronized(final StopWatch watch) { return new Wrapper(watch) { /** The serialVersionUID */ private static final long serialVersionUID = -6284244000894114817L; public synchronized void start(final boolean reset) { this.watch.st...
[ "public", "static", "StopWatch", "makeSynchronized", "(", "final", "StopWatch", "watch", ")", "{", "return", "new", "Wrapper", "(", "watch", ")", "{", "/** The serialVersionUID */", "private", "static", "final", "long", "serialVersionUID", "=", "-", "628424400089411...
Return a synchronized stop watch. @param watch StopWatch to synchronize. @return Synchronized stop watch.
[ "Return", "a", "synchronized", "stop", "watch", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/StopWatch.java#L314-L360
test
Make a synchronized StopWatch object.
Of course, here is the Java code you requested: ```java public static StopWatch makeSynchronized(final StopWatch watch) { return new Wrapper(watch) { /** The serialVersionUID */ private static final long serialVersionUID = -6284244000894114817L; public synchronized void ...
rackerlabs/blueflood
blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/ElasticsearchRestHelper.java
ElasticsearchRestHelper.getTokenQueryDslString
private String getTokenQueryDslString(String tenantId, String query) { String[] queryTokens = query.split(Locator.METRIC_TOKEN_SEPARATOR_REGEX); String lastToken = queryTokens[queryTokens.length - 1]; /** * Builds parent part of the query for the given input query glob tokens. ...
java
private String getTokenQueryDslString(String tenantId, String query) { String[] queryTokens = query.split(Locator.METRIC_TOKEN_SEPARATOR_REGEX); String lastToken = queryTokens[queryTokens.length - 1]; /** * Builds parent part of the query for the given input query glob tokens. ...
[ "private", "String", "getTokenQueryDslString", "(", "String", "tenantId", ",", "String", "query", ")", "{", "String", "[", "]", "queryTokens", "=", "query", ".", "split", "(", "Locator", ".", "METRIC_TOKEN_SEPARATOR_REGEX", ")", ";", "String", "lastToken", "=", ...
Builds ES query to grab tokens corresponding to the given query glob. For a given query foo.bar.*, we would like to grab all the tokens with parent as foo.bar Sample ES query for a query glob = foo.bar.*: "query": { "bool" : { "must" : [ { "term": { "tenantId": "<tenantId>" }}, { "term": { "parent": "foo.bar" }} ] ...
[ "Builds", "ES", "query", "to", "grab", "tokens", "corresponding", "to", "the", "given", "query", "glob", ".", "For", "a", "given", "query", "foo", ".", "bar", ".", "*", "we", "would", "like", "to", "grab", "all", "the", "tokens", "with", "parent", "as"...
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-elasticsearch/src/main/java/com/rackspacecloud/blueflood/io/ElasticsearchRestHelper.java#L295-L345
test
Get the token query string for the given tenantId and query string
Of course, here is the Java code you requested: ```java private String getTokenQueryDslString(String tenantId, String query) { String[] queryTokens = query.split(Locator.METRIC_TOKEN_SEPARATOR_REGEX); String lastToken = queryTokens[queryTokens.length - 1]; /** * Builds parent part of ...
RestComm/jain-slee
container/events/src/main/java/org/mobicents/slee/container/event/EventContextImpl.java
EventContextImpl.routedRequiresTransaction
public boolean routedRequiresTransaction() { final EventUnreferencedCallback unreferencedCallback = data.getUnreferencedCallback(); if (unreferencedCallback == null) { return false; } else { return unreferencedCallback.requiresTransaction(); } }
java
public boolean routedRequiresTransaction() { final EventUnreferencedCallback unreferencedCallback = data.getUnreferencedCallback(); if (unreferencedCallback == null) { return false; } else { return unreferencedCallback.requiresTransaction(); } }
[ "public", "boolean", "routedRequiresTransaction", "(", ")", "{", "final", "EventUnreferencedCallback", "unreferencedCallback", "=", "data", ".", "getUnreferencedCallback", "(", ")", ";", "if", "(", "unreferencedCallback", "==", "null", ")", "{", "return", "false", "...
/* (non-Javadoc) @see org.mobicents.slee.container.event.EventContext#unreferencedCallbackRequiresTransaction()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/events/src/main/java/org/mobicents/slee/container/event/EventContextImpl.java#L233-L241
test
Returns true if the event has been routed to a transaction.
Of course, here is the Java code you requested: ```java public boolean routedRequiresTransaction() { final EventUnreferencedCallback unreferencedCallback = data.getUnreferencedCallback(); if (unreferencedCallback == null) { return false; } else { return unreferencedCallback.requiresTransaction(); } } ...
google/guice
core/src/com/google/inject/TypeLiteral.java
TypeLiteral.getFieldType
public TypeLiteral<?> getFieldType(Field field) { checkArgument( field.getDeclaringClass().isAssignableFrom(rawType), "%s is not defined by a supertype of %s", field, type); return resolve(field.getGenericType()); }
java
public TypeLiteral<?> getFieldType(Field field) { checkArgument( field.getDeclaringClass().isAssignableFrom(rawType), "%s is not defined by a supertype of %s", field, type); return resolve(field.getGenericType()); }
[ "public", "TypeLiteral", "<", "?", ">", "getFieldType", "(", "Field", "field", ")", "{", "checkArgument", "(", "field", ".", "getDeclaringClass", "(", ")", ".", "isAssignableFrom", "(", "rawType", ")", ",", "\"%s is not defined by a supertype of %s\"", ",", "field...
Returns the resolved generic type of {@code field}. @param field a field defined by this or any superclass. @since 2.0
[ "Returns", "the", "resolved", "generic", "type", "of", "{", "@code", "field", "}", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/TypeLiteral.java#L249-L256
test
Returns the type of the given field.
Of course, here is the Java code you requested: ```java public TypeLiteral<?> getFieldType(Field field) { checkArgument( field.getDeclaringClass().isAssignableFrom(rawType), "%s is not defined by a supertype of %s", field, type); return resolve(field.getGenericType()); } ``` ...
Unidata/thredds
cdm/src/main/java/thredds/client/catalog/DatasetNode.java
DatasetNode.findDatasetByName
public Dataset findDatasetByName(String name) { for (Dataset ds : getDatasets()) { if (ds.getName().equals(name)) return ds; Dataset result = ds.findDatasetByName(name); if (result != null) return result; } return null; }
java
public Dataset findDatasetByName(String name) { for (Dataset ds : getDatasets()) { if (ds.getName().equals(name)) return ds; Dataset result = ds.findDatasetByName(name); if (result != null) return result; } return null; }
[ "public", "Dataset", "findDatasetByName", "(", "String", "name", ")", "{", "for", "(", "Dataset", "ds", ":", "getDatasets", "(", ")", ")", "{", "if", "(", "ds", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "return", "ds", ";", "D...
Look though all datasets here or under here. do not go into catrefs
[ "Look", "though", "all", "datasets", "here", "or", "under", "here", ".", "do", "not", "go", "into", "catrefs" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/client/catalog/DatasetNode.java#L81-L88
test
Find a dataset by its name.
Of course, here is the Java code you requested: ```java public Dataset findDatasetByName(String name) { for (Dataset ds : getDatasets()) { if (ds.getName().equals(name)) return ds; Dataset result = ds.findDatasetByName(name); if (result != null) return result; } return null; } ``` Hope...
google/openrtb
openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbJsonUtils.java
OpenRtbJsonUtils.startArray
public static void startArray(JsonParser par) throws IOException { JsonToken token = par.getCurrentToken(); if (token == null || token == JsonToken.FIELD_NAME) { token = par.nextToken(); } if (token == JsonToken.START_ARRAY) { par.nextToken(); } else { throw new JsonParseException(...
java
public static void startArray(JsonParser par) throws IOException { JsonToken token = par.getCurrentToken(); if (token == null || token == JsonToken.FIELD_NAME) { token = par.nextToken(); } if (token == JsonToken.START_ARRAY) { par.nextToken(); } else { throw new JsonParseException(...
[ "public", "static", "void", "startArray", "(", "JsonParser", "par", ")", "throws", "IOException", "{", "JsonToken", "token", "=", "par", ".", "getCurrentToken", "(", ")", ";", "if", "(", "token", "==", "null", "||", "token", "==", "JsonToken", ".", "FIELD_...
Starts an Array, skipping the '[' token, and if necessary a field name before it.
[ "Starts", "an", "Array", "skipping", "the", "[", "token", "and", "if", "necessary", "a", "field", "name", "before", "it", "." ]
384ed8dde6bd16ac2faab9afbe5b33367836fdec
https://github.com/google/openrtb/blob/384ed8dde6bd16ac2faab9afbe5b33367836fdec/openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbJsonUtils.java#L68-L78
test
Start an array.
Of course, here is the Java code you requested: ```java public static void startArray(JsonParser par) throws IOException { JsonToken token = par.getCurrentToken(); if (token == null || token == JsonToken.FIELD_NAME) { token = par.nextToken(); } if (token == JsonToken.START_ARRAY) { par.next...
oblac/jodd
jodd-core/src/main/java/jodd/cache/LFUCache.java
LFUCache.pruneCache
@Override protected int pruneCache() { int count = 0; CacheObject<K,V> comin = null; // remove expired items and find cached object with minimal access count Iterator<CacheObject<K,V>> values = cacheMap.values().iterator(); while (values.hasNext()) { CacheObject<K,V> co = values.next(); if (co.i...
java
@Override protected int pruneCache() { int count = 0; CacheObject<K,V> comin = null; // remove expired items and find cached object with minimal access count Iterator<CacheObject<K,V>> values = cacheMap.values().iterator(); while (values.hasNext()) { CacheObject<K,V> co = values.next(); if (co.i...
[ "@", "Override", "protected", "int", "pruneCache", "(", ")", "{", "int", "count", "=", "0", ";", "CacheObject", "<", "K", ",", "V", ">", "comin", "=", "null", ";", "// remove expired items and find cached object with minimal access count", "Iterator", "<", "CacheO...
Prunes expired and, if cache is still full, the LFU element(s) from the cache. On LFU removal, access count is normalized to value which had removed object. Returns the number of removed objects.
[ "Prunes", "expired", "and", "if", "cache", "is", "still", "full", "the", "LFU", "element", "(", "s", ")", "from", "the", "cache", ".", "On", "LFU", "removal", "access", "count", "is", "normalized", "to", "value", "which", "had", "removed", "object", ".",...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/cache/LFUCache.java#L64-L109
test
Prunes all expired objects from the cache.
Of course, here is the Java code you requested: ```java @Override protected int pruneCache() { int count = 0; CacheObject<K,V> comin = null; // remove expired items and find cached object with minimal access count Iterator<CacheObject<K,V>> values = cacheMap.values().iterator(); while (values.hasNext...
fuinorg/srcgen4j-core
src/main/java/org/fuin/srcgen4j/core/velocity/ParameterizedTemplateModel.java
ParameterizedTemplateModel.create
public static ParameterizedTemplateModel create(final File file) { try { final JaxbHelper helper = new JaxbHelper(); final ParameterizedTemplateModel pc = helper.create(file, createJaxbContext()); pc.setFile(file); Contract.requireValid(pc); retu...
java
public static ParameterizedTemplateModel create(final File file) { try { final JaxbHelper helper = new JaxbHelper(); final ParameterizedTemplateModel pc = helper.create(file, createJaxbContext()); pc.setFile(file); Contract.requireValid(pc); retu...
[ "public", "static", "ParameterizedTemplateModel", "create", "(", "final", "File", "file", ")", "{", "try", "{", "final", "JaxbHelper", "helper", "=", "new", "JaxbHelper", "(", ")", ";", "final", "ParameterizedTemplateModel", "pc", "=", "helper", ".", "create", ...
Creates an instance by reading the XML from a file. @param file File to read. @return New instance.
[ "Creates", "an", "instance", "by", "reading", "the", "XML", "from", "a", "file", "." ]
da2bc58370993e6294ddc4eb7e696fe255f979db
https://github.com/fuinorg/srcgen4j-core/blob/da2bc58370993e6294ddc4eb7e696fe255f979db/src/main/java/org/fuin/srcgen4j/core/velocity/ParameterizedTemplateModel.java#L406-L416
test
Creates a ParameterizedTemplateModel from a file.
Of course, here is the Java code you requested: ```java public static ParameterizedTemplateModel create(final File file) { try { final JaxbHelper helper = new JaxbHelper(); final ParameterizedTemplateModel pc = helper.create(file, createJaxbContext()); pc.setFile(file); ...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/tx/GlobalWriteLockWithWriteBehindTxMethod.java
GlobalWriteLockWithWriteBehindTxMethod.requestWriteOperation
public void requestWriteOperation(TxOperation op) { // Check if in a higher transactional mode than none and capture the transaction id if so. TxId txId = null; if (getIsolationLevel().compareTo(IsolationLevel.None) > 0) { // Extract the current transaction id. ...
java
public void requestWriteOperation(TxOperation op) { // Check if in a higher transactional mode than none and capture the transaction id if so. TxId txId = null; if (getIsolationLevel().compareTo(IsolationLevel.None) > 0) { // Extract the current transaction id. ...
[ "public", "void", "requestWriteOperation", "(", "TxOperation", "op", ")", "{", "// Check if in a higher transactional mode than none and capture the transaction id if so.", "TxId", "txId", "=", "null", ";", "if", "(", "getIsolationLevel", "(", ")", ".", "compareTo", "(", ...
Requests an operation that alters the transactional resource. This may be blocked until an appropriate lock can be acquired, delayed until commit time, or actioned upon a copy of the data structure private to a transaction branch. <p/>This stores the requested operation for execution at commit time, unless running in ...
[ "Requests", "an", "operation", "that", "alters", "the", "transactional", "resource", ".", "This", "may", "be", "blocked", "until", "an", "appropriate", "lock", "can", "be", "acquired", "delayed", "until", "commit", "time", "or", "actioned", "upon", "a", "copy"...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/tx/GlobalWriteLockWithWriteBehindTxMethod.java#L163-L190
test
Request a write operation.
Of course, here is the Java code you requested: ```java public void requestWriteOperation(TxOperation op) { // Check if in a higher transactional mode than none and capture the transaction id if so. TxId txId = null; if (getIsolationLevel().compareTo(IsolationLevel.None) > 0) { ...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java
RTreeIndexTableDao.query
@Override public UserCustomCursor query(String where, String[] whereArgs) { StringBuilder query = new StringBuilder(); query.append("select * from ").append(CoreSQLUtils.quoteWrap(getTableName())); if (where != null) { query.append(" where ").append(where); } Str...
java
@Override public UserCustomCursor query(String where, String[] whereArgs) { StringBuilder query = new StringBuilder(); query.append("select * from ").append(CoreSQLUtils.quoteWrap(getTableName())); if (where != null) { query.append(" where ").append(where); } Str...
[ "@", "Override", "public", "UserCustomCursor", "query", "(", "String", "where", ",", "String", "[", "]", "whereArgs", ")", "{", "StringBuilder", "query", "=", "new", "StringBuilder", "(", ")", ";", "query", ".", "append", "(", "\"select * from \"", ")", ".",...
{@inheritDoc}
[ "{" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java#L230-L243
test
Query for a record in the table.
Of course, here is the Java code you requested: ```java @Override public UserCustomCursor query(String where, String[] whereArgs) { StringBuilder query = new StringBuilder(); query.append("select * from ").append(CoreSQLUtils.quoteWrap(getTableName())); if (where != null) { que...
truward/brikar
brikar-common/src/main/java/com/truward/brikar/common/log/LogUtil.java
LogUtil.isValidRequestVector
public static boolean isValidRequestVector(@Nullable String requestVector) { if (requestVector == null || requestVector.isEmpty() || requestVector.length() > MAX_REQUEST_VECTOR_LENGTH) { return false; } // verify, that each character is within the allowed bounds for (int i = 0; i < requestVector....
java
public static boolean isValidRequestVector(@Nullable String requestVector) { if (requestVector == null || requestVector.isEmpty() || requestVector.length() > MAX_REQUEST_VECTOR_LENGTH) { return false; } // verify, that each character is within the allowed bounds for (int i = 0; i < requestVector....
[ "public", "static", "boolean", "isValidRequestVector", "(", "@", "Nullable", "String", "requestVector", ")", "{", "if", "(", "requestVector", "==", "null", "||", "requestVector", ".", "isEmpty", "(", ")", "||", "requestVector", ".", "length", "(", ")", ">", ...
Validates, that passed request vector is valid. This function is used to prevent the potential attacker to send garbage request vectors into the service. If passed request vector is invalid, it should be discarded. @param requestVector Request vector to validate @return True, if passed request vector is valid, false o...
[ "Validates", "that", "passed", "request", "vector", "is", "valid", ".", "This", "function", "is", "used", "to", "prevent", "the", "potential", "attacker", "to", "send", "garbage", "request", "vectors", "into", "the", "service", ".", "If", "passed", "request", ...
9a2f6d0149b281fff0f704f169021187f5f9115f
https://github.com/truward/brikar/blob/9a2f6d0149b281fff0f704f169021187f5f9115f/brikar-common/src/main/java/com/truward/brikar/common/log/LogUtil.java#L145-L159
test
Check if the given request vector is a valid request vector.
Of course, here is the Java code you requested: ```java public static boolean isValidRequestVector(@Nullable String requestVector) { if (requestVector == null || requestVector.isEmpty() || requestVector.length() > MAX_REQUEST_VECTOR_LENGTH) { return false; } // verify, that each character is within ...
zalando-stups/fullstop
fullstop-core/fullstop-processing/src/main/java/org/zalando/stups/fullstop/ExtPropertiesFileConfiguration.java
ExtPropertiesFileConfiguration.validate
@Override public void validate() { LibraryUtils.checkArgumentNotNull(this.getAwsCredentialsProvider(), ERROR_CREDENTIALS_PROVIDER_NULL); LibraryUtils.checkArgumentNotNull(this.getSqsUrl(), "SQS URL is null."); LibraryUtils.checkArgumentNotNull(this.getSqsRegion(), "SQS Region is null."); ...
java
@Override public void validate() { LibraryUtils.checkArgumentNotNull(this.getAwsCredentialsProvider(), ERROR_CREDENTIALS_PROVIDER_NULL); LibraryUtils.checkArgumentNotNull(this.getSqsUrl(), "SQS URL is null."); LibraryUtils.checkArgumentNotNull(this.getSqsRegion(), "SQS Region is null."); ...
[ "@", "Override", "public", "void", "validate", "(", ")", "{", "LibraryUtils", ".", "checkArgumentNotNull", "(", "this", ".", "getAwsCredentialsProvider", "(", ")", ",", "ERROR_CREDENTIALS_PROVIDER_NULL", ")", ";", "LibraryUtils", ".", "checkArgumentNotNull", "(", "t...
{@inheritDoc}
[ "{" ]
42f3bab557380aab0114028b58d745e3000897e8
https://github.com/zalando-stups/fullstop/blob/42f3bab557380aab0114028b58d745e3000897e8/fullstop-core/fullstop-processing/src/main/java/org/zalando/stups/fullstop/ExtPropertiesFileConfiguration.java#L235-L248
test
Validate the attributes of the XSD.
Of course, here is the Java code you requested: ```java @Override public void validate() { LibraryUtils.checkArgumentNotNull(this.getAwsCredentialsProvider(), ERROR_CREDENTIALS_PROVIDER_NULL); LibraryUtils.checkArgumentNotNull(this.getSqsUrl(), "SQS URL is null."); LibraryUtils.checkArgumen...
GoogleCloudPlatform/cloud-sql-jdbc-socket-factory
core/src/main/java/com/google/cloud/sql/core/CoreSocketFactory.java
CoreSocketFactory.listIpTypes
private static List<String> listIpTypes(String cloudSqlIpTypes) { String[] rawTypes = cloudSqlIpTypes.split(","); ArrayList<String> result = new ArrayList<>(rawTypes.length); for (int i = 0; i < rawTypes.length; i++) { if (rawTypes[i].trim().equalsIgnoreCase("PUBLIC")) { result.add(i, "PRIMARY...
java
private static List<String> listIpTypes(String cloudSqlIpTypes) { String[] rawTypes = cloudSqlIpTypes.split(","); ArrayList<String> result = new ArrayList<>(rawTypes.length); for (int i = 0; i < rawTypes.length; i++) { if (rawTypes[i].trim().equalsIgnoreCase("PUBLIC")) { result.add(i, "PRIMARY...
[ "private", "static", "List", "<", "String", ">", "listIpTypes", "(", "String", "cloudSqlIpTypes", ")", "{", "String", "[", "]", "rawTypes", "=", "cloudSqlIpTypes", ".", "split", "(", "\",\"", ")", ";", "ArrayList", "<", "String", ">", "result", "=", "new",...
Converts the string property of IP types to a list by splitting by commas, and upper-casing.
[ "Converts", "the", "string", "property", "of", "IP", "types", "to", "a", "list", "by", "splitting", "by", "commas", "and", "upper", "-", "casing", "." ]
f108b0d5c7332a86075d32b8a648fb1b98288852
https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/blob/f108b0d5c7332a86075d32b8a648fb1b98288852/core/src/main/java/com/google/cloud/sql/core/CoreSocketFactory.java#L280-L291
test
List the IP types in the cloud Sql format
Of course, here is the Java code you requested: ```java private static List<String> listIpTypes(String cloudSqlIpTypes) { String[] rawTypes = cloudSqlIpTypes.split(","); ArrayList<String> result = new ArrayList<>(rawTypes.length); for (int i = 0; i < rawTypes.length; i++) { if (rawTypes[i].trim().equ...
oblac/jodd
jodd-bean/src/main/java/jodd/bean/BeanProperty.java
BeanProperty.updateBean
public void updateBean(final Object bean) { this.setBean(bean); if (this.cd != null && this.cd.isSupplier()) { final Object newBean = ((Supplier)this.bean).get(); setBean(newBean); } }
java
public void updateBean(final Object bean) { this.setBean(bean); if (this.cd != null && this.cd.isSupplier()) { final Object newBean = ((Supplier)this.bean).get(); setBean(newBean); } }
[ "public", "void", "updateBean", "(", "final", "Object", "bean", ")", "{", "this", ".", "setBean", "(", "bean", ")", ";", "if", "(", "this", ".", "cd", "!=", "null", "&&", "this", ".", "cd", ".", "isSupplier", "(", ")", ")", "{", "final", "Object", ...
Updates the bean. Detects special case of suppliers.
[ "Updates", "the", "bean", ".", "Detects", "special", "case", "of", "suppliers", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/bean/BeanProperty.java#L87-L94
test
Update the bean.
Of course, here is the Java code you requested: ```java public void updateBean(final Object bean) { this.setBean(bean); if (this.cd != null && this.cd.isSupplier()) { final Object newBean = ((Supplier)this.bean).get(); setBean(newBean); } } ``` Hope this helps!
wildfly/wildfly
naming/src/main/java/org/jboss/as/naming/deployment/ContextNames.java
ContextNames.contextServiceNameOfModule
public static ServiceName contextServiceNameOfModule(String app, String module) { return MODULE_CONTEXT_SERVICE_NAME.append(app, module); }
java
public static ServiceName contextServiceNameOfModule(String app, String module) { return MODULE_CONTEXT_SERVICE_NAME.append(app, module); }
[ "public", "static", "ServiceName", "contextServiceNameOfModule", "(", "String", "app", ",", "String", "module", ")", "{", "return", "MODULE_CONTEXT_SERVICE_NAME", ".", "append", "(", "app", ",", "module", ")", ";", "}" ]
Get the base service name of a module's JNDI namespace. @param app the application name (must not be {@code null}) @param module the module name (must not be {@code null}) @return the base service name
[ "Get", "the", "base", "service", "name", "of", "a", "module", "s", "JNDI", "namespace", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/deployment/ContextNames.java#L107-L109
test
Returns the service name of the module.
Of course, here is the Java code you requested: ```java public static ServiceName contextServiceNameOfModule(String app, String module) { return MODULE_CONTEXT_SERVICE_NAME.append(app, module); } ``` Hope this helps!
streamsets/datacollector
jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/MultithreadedTableProvider.java
MultithreadedTableProvider.handlePartitioningTurnedOffOrOn
private void handlePartitioningTurnedOffOrOn( SortedSetMultimap<TableContext, TableRuntimeContext> reconstructedPartitions ) { for (TableContext tableContext : reconstructedPartitions.keySet()) { final SortedSet<TableRuntimeContext> partitions = reconstructedPartitions.get(tableContext); final ...
java
private void handlePartitioningTurnedOffOrOn( SortedSetMultimap<TableContext, TableRuntimeContext> reconstructedPartitions ) { for (TableContext tableContext : reconstructedPartitions.keySet()) { final SortedSet<TableRuntimeContext> partitions = reconstructedPartitions.get(tableContext); final ...
[ "private", "void", "handlePartitioningTurnedOffOrOn", "(", "SortedSetMultimap", "<", "TableContext", ",", "TableRuntimeContext", ">", "reconstructedPartitions", ")", "{", "for", "(", "TableContext", "tableContext", ":", "reconstructedPartitions", ".", "keySet", "(", ")", ...
Checks whether any tables have had partitioning turned off or not, and updates the partition map appropriately @param reconstructedPartitions the reconstructed partitions (may be modified)
[ "Checks", "whether", "any", "tables", "have", "had", "partitioning", "turned", "off", "or", "not", "and", "updates", "the", "partition", "map", "appropriately" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/MultithreadedTableProvider.java#L187-L273
test
Handle partitioningTurnedOff or partitioningTurnedOn.
Of course, here is the Java code you requested: ```java private void handlePartitioningTurnedOffOrOn( SortedSetMultimap<TableContext, TableRuntimeContext> reconstructedPartitions ) { for (TableContext tableContext : reconstructedPartitions.keySet()) { final SortedSet<TableRuntimeContext> partitions ...
RestComm/jain-slee
container/components/components/src/main/java/org/mobicents/slee/container/component/ServiceComponentImpl.java
ServiceComponentImpl.getSbbIDs
public Set<SbbID> getSbbIDs(ComponentRepository componentRepository) { Set<SbbID> result = new HashSet<SbbID>(); buildSbbTree(descriptor.getRootSbbID(), result, componentRepository); return result; }
java
public Set<SbbID> getSbbIDs(ComponentRepository componentRepository) { Set<SbbID> result = new HashSet<SbbID>(); buildSbbTree(descriptor.getRootSbbID(), result, componentRepository); return result; }
[ "public", "Set", "<", "SbbID", ">", "getSbbIDs", "(", "ComponentRepository", "componentRepository", ")", "{", "Set", "<", "SbbID", ">", "result", "=", "new", "HashSet", "<", "SbbID", ">", "(", ")", ";", "buildSbbTree", "(", "descriptor", ".", "getRootSbbID",...
Retrieves the set of sbbs used by this service @param componentRepository @return
[ "Retrieves", "the", "set", "of", "sbbs", "used", "by", "this", "service" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/ServiceComponentImpl.java#L191-L196
test
Gets the SbbIDs of the SBBs.
Of course, here is the Java code you requested: ```java public Set<SbbID> getSbbIDs(ComponentRepository componentRepository) { Set<SbbID> result = new HashSet<SbbID>(); buildSbbTree(descriptor.getRootSbbID(), result, componentRepository); return result; } ``` Hope this helps!
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/core/TaskService.java
TaskService.getTaskActors
private String[] getTaskActors(Object actors) { if(actors == null) return null; String[] results; if(actors instanceof String) { //如果值为字符串类型,则使用逗号,分隔 return ((String)actors).split(","); } else if(actors instanceof List){ //jackson会把stirng[]转成arraylist,此处增加arraylist的逻辑判断,by 红豆冰沙2014.11.21...
java
private String[] getTaskActors(Object actors) { if(actors == null) return null; String[] results; if(actors instanceof String) { //如果值为字符串类型,则使用逗号,分隔 return ((String)actors).split(","); } else if(actors instanceof List){ //jackson会把stirng[]转成arraylist,此处增加arraylist的逻辑判断,by 红豆冰沙2014.11.21...
[ "private", "String", "[", "]", "getTaskActors", "(", "Object", "actors", ")", "{", "if", "(", "actors", "==", "null", ")", "return", "null", ";", "String", "[", "]", "results", ";", "if", "(", "actors", "instanceof", "String", ")", "{", "//如果值为字符串类型,则使用逗...
根据taskmodel指定的assignee属性,从args中取值 将取到的值处理为String[]类型。 @param actors 参与者对象 @return 参与者数组
[ "根据taskmodel指定的assignee属性,从args中取值", "将取到的值处理为String", "[]", "类型。" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/core/TaskService.java#L461-L493
test
get task actors
Of course, here is the Java code you requested: ```java private String[] getTaskActors(Object actors) { if(actors == null) return null; String[] results; if(actors instanceof String) { //如果值为字符串类型,则使用逗号,分隔 return ((String)actors).split(","); } else if(actors instanceof List){ //jackson会...
deeplearning4j/nd4j
nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/conf/CudaEnvironment.java
CudaEnvironment.getCurrentDeviceArchitecture
public int getCurrentDeviceArchitecture() { int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread(); if (!arch.containsKey(deviceId)) { int major = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMajor(new CudaPointer(deviceId)); int minor = NativeOpsHold...
java
public int getCurrentDeviceArchitecture() { int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread(); if (!arch.containsKey(deviceId)) { int major = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMajor(new CudaPointer(deviceId)); int minor = NativeOpsHold...
[ "public", "int", "getCurrentDeviceArchitecture", "(", ")", "{", "int", "deviceId", "=", "Nd4j", ".", "getAffinityManager", "(", ")", ".", "getDeviceForCurrentThread", "(", ")", ";", "if", "(", "!", "arch", ".", "containsKey", "(", "deviceId", ")", ")", "{", ...
Get the current device architecture @return the major/minor version of the current device
[ "Get", "the", "current", "device", "architecture" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/conf/CudaEnvironment.java#L48-L59
test
Get the current device architecture
Of course, here is the Java code you requested: ```java public int getCurrentDeviceArchitecture() { int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread(); if (!arch.containsKey(deviceId)) { int major = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMajor(new Cuda...
Unidata/thredds
cdm/src/main/java/thredds/client/catalog/builder/DatasetBuilder.java
DatasetBuilder.addToList
public static void addToList(Map<String, Object> flds, String fldName, Object fldValue) { if (fldValue == null) return; Object prevVal = flds.get(fldName); if (prevVal == null) { flds.put(fldName, fldValue); return; } List prevList; if (prevVal instanceof List) { prevList = (L...
java
public static void addToList(Map<String, Object> flds, String fldName, Object fldValue) { if (fldValue == null) return; Object prevVal = flds.get(fldName); if (prevVal == null) { flds.put(fldName, fldValue); return; } List prevList; if (prevVal instanceof List) { prevList = (L...
[ "public", "static", "void", "addToList", "(", "Map", "<", "String", ",", "Object", ">", "flds", ",", "String", "fldName", ",", "Object", "fldValue", ")", "{", "if", "(", "fldValue", "==", "null", ")", "return", ";", "Object", "prevVal", "=", "flds", "....
Utility routine to keep list of objects small. add fldValue to the fldName list in flds. fldValue may be a list or an object. if no list, just keep the object without creating a list (common case). otherwise add it to the existing list.
[ "Utility", "routine", "to", "keep", "list", "of", "objects", "small", ".", "add", "fldValue", "to", "the", "fldName", "list", "in", "flds", ".", "fldValue", "may", "be", "a", "list", "or", "an", "object", ".", "if", "no", "list", "just", "keep", "the",...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/client/catalog/builder/DatasetBuilder.java#L29-L51
test
Add to list.
Of course, here is the Java code you requested: ```java public static void addToList(Map<String, Object> flds, String fldName, Object fldValue) { if (fldValue == null) return; Object prevVal = flds.get(fldName); if (prevVal == null) { flds.put(fldName, fldValue); return; } List prevLis...
kocakosm/pitaya
src/org/kocakosm/pitaya/util/Parameters.java
Parameters.checkNotNull
public static <T> T checkNotNull(T ref, String msg, Object... args) { if (ref == null) { throw new NullPointerException(format(msg, args)); } return ref; }
java
public static <T> T checkNotNull(T ref, String msg, Object... args) { if (ref == null) { throw new NullPointerException(format(msg, args)); } return ref; }
[ "public", "static", "<", "T", ">", "T", "checkNotNull", "(", "T", "ref", ",", "String", "msg", ",", "Object", "...", "args", ")", "{", "if", "(", "ref", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "format", "(", "msg", ",", ...
Checks that the given reference is not {@code null} and returns it in case of success. @param <T> the type of the given reference. @param ref the reference to test. @param msg the error message format string. @param args the error message arguments. @return the validated (non-{@code null}) reference. @throws NullPoi...
[ "Checks", "that", "the", "given", "reference", "is", "not", "{", "@code", "null", "}", "and", "returns", "it", "in", "case", "of", "success", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/Parameters.java#L58-L64
test
Check that a reference is not null.
Of course, here is the Java code you requested: ```java public static <T> T checkNotNull(T ref, String msg, Object... args) { if (ref == null) { throw new NullPointerException(format(msg, args)); } return ref; } ``` Hope this helps!
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/resource/Resource.java
Resource.toList
public List<Resource> toList() { List<Resource> resourceList = new ArrayList<>(); resourceList.add(this); return resourceList; }
java
public List<Resource> toList() { List<Resource> resourceList = new ArrayList<>(); resourceList.add(this); return resourceList; }
[ "public", "List", "<", "Resource", ">", "toList", "(", ")", "{", "List", "<", "Resource", ">", "resourceList", "=", "new", "ArrayList", "<>", "(", ")", ";", "resourceList", ".", "add", "(", "this", ")", ";", "return", "resourceList", ";", "}" ]
creates a list with this Element in it. @return a list
[ "creates", "a", "list", "with", "this", "Element", "in", "it", "." ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/resource/Resource.java#L169-L173
test
Gets the list of resources.
Of course, here is the Java code you requested: ```java public List<Resource> toList() { List<Resource> resourceList = new ArrayList<>(); resourceList.add(this); return resourceList; } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/internal/utils/URLEncoder.java
URLEncoder.encode
public static URL encode(URL url) { String file = url.getFile(); String ref = url.getRef(); try { return new URL(url.getProtocol(), url.getHost(), url.getPort(), encode(file, ref)); } catch (MalformedURLException e) { Assert.isTrue(false, Policy.bind("assert.inte...
java
public static URL encode(URL url) { String file = url.getFile(); String ref = url.getRef(); try { return new URL(url.getProtocol(), url.getHost(), url.getPort(), encode(file, ref)); } catch (MalformedURLException e) { Assert.isTrue(false, Policy.bind("assert.inte...
[ "public", "static", "URL", "encode", "(", "URL", "url", ")", "{", "String", "file", "=", "url", ".", "getFile", "(", ")", ";", "String", "ref", "=", "url", ".", "getRef", "(", ")", ";", "try", "{", "return", "new", "URL", "(", "url", ".", "getPro...
Encodes the given <code>URL</code> into an <code>ASCII</code> readable <code>URL</code> that is safe for transport. Returns the result. @return the result of encoding the given <code>URL</code> into an <code>ASCII</code> readable <code>URL</code> that is safe for transport
[ "Encodes", "the", "given", "<code", ">", "URL<", "/", "code", ">", "into", "an", "<code", ">", "ASCII<", "/", "code", ">", "readable", "<code", ">", "URL<", "/", "code", ">", "that", "is", "safe", "for", "transport", ".", "Returns", "the", "result", ...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/internal/utils/URLEncoder.java#L110-L121
test
Encode a URL.
Of course, here is the Java code you requested: ```java public static URL encode(URL url) { String file = url.getFile(); String ref = url.getRef(); try { return new URL(url.getProtocol(), url.getHost(), url.getPort(), encode(file, ref)); } catch (MalformedURLException e) { ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/sql/filter/OSQLFilterItemField.java
OSQLFilterItemField.getCollate
public OCollate getCollate(Object doc) { if (collate != null || operationsChain == null || !isFieldChain()) { return collate; } if (!(doc instanceof OIdentifiable)) { return null; } FieldChain chain = getFieldChain(); ODocument lastDoc = ((OIdentifiable) doc).getRecord(); ...
java
public OCollate getCollate(Object doc) { if (collate != null || operationsChain == null || !isFieldChain()) { return collate; } if (!(doc instanceof OIdentifiable)) { return null; } FieldChain chain = getFieldChain(); ODocument lastDoc = ((OIdentifiable) doc).getRecord(); ...
[ "public", "OCollate", "getCollate", "(", "Object", "doc", ")", "{", "if", "(", "collate", "!=", "null", "||", "operationsChain", "==", "null", "||", "!", "isFieldChain", "(", ")", ")", "{", "return", "collate", ";", "}", "if", "(", "!", "(", "doc", "...
get the collate of this expression, based on the fully evaluated field chain starting from the passed object. @param doc the root element (document?) of this field chain @return the collate, null if no collate is defined
[ "get", "the", "collate", "of", "this", "expression", "based", "on", "the", "fully", "evaluated", "field", "chain", "starting", "from", "the", "passed", "object", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/filter/OSQLFilterItemField.java#L237-L268
test
Returns the collate for the given document.
Of course, here is the Java code you requested: ```java public OCollate getCollate(Object doc) { if (collate != null || operationsChain == null || !isFieldChain()) { return collate; } if (!(doc instanceof OIdentifiable)) { return null; } FieldChain chain = getFieldChain(); O...
oblac/jodd
jodd-db/src/main/java/jodd/db/oom/mapper/DefaultResultSetMapper.java
DefaultResultSetMapper.parseObjects
@Override public Object[] parseObjects(final Class... types) { resultColumns.clear(); int totalTypes = types.length; Object[] result = new Object[totalTypes]; boolean[] resultUsage = new boolean[totalTypes]; DbEntityDescriptor[] dbEntityDescriptors = resolveDbEntityDescriptors(types); String[] typesTableN...
java
@Override public Object[] parseObjects(final Class... types) { resultColumns.clear(); int totalTypes = types.length; Object[] result = new Object[totalTypes]; boolean[] resultUsage = new boolean[totalTypes]; DbEntityDescriptor[] dbEntityDescriptors = resolveDbEntityDescriptors(types); String[] typesTableN...
[ "@", "Override", "public", "Object", "[", "]", "parseObjects", "(", "final", "Class", "...", "types", ")", "{", "resultColumns", ".", "clear", "(", ")", ";", "int", "totalTypes", "=", "types", ".", "length", ";", "Object", "[", "]", "result", "=", "new...
{@inheritDoc}
[ "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/mapper/DefaultResultSetMapper.java#L355-L475
test
Parses the object array.
Of course, here is the Java code you requested: ```java @Override public Object[] parseObjects(final Class... types) { resultColumns.clear(); int totalTypes = types.length; Object[] result = new Object[totalTypes]; boolean[] resultUsage = new boolean[totalTypes]; DbEntityDescriptor[] dbEntityDescriptors = ...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.throttleLast
@CheckReturnValue @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.CUSTOM) public final Flowable<T> throttleLast(long intervalDuration, TimeUnit unit, Scheduler scheduler) { return sample(intervalDuration, unit, scheduler); }
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.CUSTOM) public final Flowable<T> throttleLast(long intervalDuration, TimeUnit unit, Scheduler scheduler) { return sample(intervalDuration, unit, scheduler); }
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "ERROR", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Flowable", "<", "T", ">", "throttleLast", "(", "long", "intervalDuration", ",...
Returns a Flowable that emits only the last item emitted by the source Publisher during sequential time windows of a specified duration, where the duration is governed by a specified Scheduler. <p> This differs from {@link #throttleFirst} in that this ticks along at a scheduled interval whereas {@link #throttleFirst} d...
[ "Returns", "a", "Flowable", "that", "emits", "only", "the", "last", "item", "emitted", "by", "the", "source", "Publisher", "during", "sequential", "time", "windows", "of", "a", "specified", "duration", "where", "the", "duration", "is", "governed", "by", "a", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L16021-L16026
test
Throttle the last sequence of tokens.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.ERROR) @SchedulerSupport(SchedulerSupport.CUSTOM) public final Flowable<T> throttleLast(long intervalDuration, TimeUnit unit, Scheduler scheduler) { return sample(intervalDuration, unit, ...
rupertlssmith/lojix
base/base/src/main/com/thesett/util/log4j/LoggingDiagnostic.java
LoggingDiagnostic.currentConfiguration
public static String currentConfiguration() { StringBuffer rtn = new StringBuffer(1024); String loggingConfigClass = System.getProperty("java.util.logging.config.class"); String loggingConfigFile = System.getProperty("java.util.logging.config.file"); boolean configClassOK = false; ...
java
public static String currentConfiguration() { StringBuffer rtn = new StringBuffer(1024); String loggingConfigClass = System.getProperty("java.util.logging.config.class"); String loggingConfigFile = System.getProperty("java.util.logging.config.file"); boolean configClassOK = false; ...
[ "public", "static", "String", "currentConfiguration", "(", ")", "{", "StringBuffer", "rtn", "=", "new", "StringBuffer", "(", "1024", ")", ";", "String", "loggingConfigClass", "=", "System", ".", "getProperty", "(", "\"java.util.logging.config.class\"", ")", ";", "...
Provides a string containing information about the configured logging set up. @return A string containing information about the configured logging set up.
[ "Provides", "a", "string", "containing", "information", "about", "the", "configured", "logging", "set", "up", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/base/src/main/com/thesett/util/log4j/LoggingDiagnostic.java#L40-L109
test
Returns the current configuration string.
Of course, here is the Java code you requested: ```java public static String currentConfiguration() { StringBuffer rtn = new StringBuffer(1024); String loggingConfigClass = System.getProperty("java.util.logging.config.class"); String loggingConfigFile = System.getProperty("java.util.loggin...
google/openrtb
openrtb-core/src/main/java/com/google/openrtb/util/ProtoUtils.java
ProtoUtils.builder
@SuppressWarnings("unchecked") public static <I extends MessageLiteOrBuilder, O extends MessageLite.Builder> O builder( @Nullable I msg) { return msg instanceof MessageLite ? (O) ((MessageLite) msg).toBuilder() : (O) msg; }
java
@SuppressWarnings("unchecked") public static <I extends MessageLiteOrBuilder, O extends MessageLite.Builder> O builder( @Nullable I msg) { return msg instanceof MessageLite ? (O) ((MessageLite) msg).toBuilder() : (O) msg; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "I", "extends", "MessageLiteOrBuilder", ",", "O", "extends", "MessageLite", ".", "Builder", ">", "O", "builder", "(", "@", "Nullable", "I", "msg", ")", "{", "return", "msg", "instan...
Given a message-or-builder, return a builder, invoking toBuilder() if necessary.
[ "Given", "a", "message", "-", "or", "-", "builder", "return", "a", "builder", "invoking", "toBuilder", "()", "if", "necessary", "." ]
384ed8dde6bd16ac2faab9afbe5b33367836fdec
https://github.com/google/openrtb/blob/384ed8dde6bd16ac2faab9afbe5b33367836fdec/openrtb-core/src/main/java/com/google/openrtb/util/ProtoUtils.java#L56-L62
test
Returns a message lite builder for a node ID.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <I extends MessageLiteOrBuilder, O extends MessageLite.Builder> O builder( @Nullable I msg) { return msg instanceof MessageLite ? (O) ((MessageLite) msg).toBuilder() : (O) msg; } ``` Hope...
abmargb/jamppa
src/main/java/org/jivesoftware/whack/util/StringUtils.java
StringUtils.escapeForXML
public static final String escapeForXML(String string) { if (string == null) { return null; } char ch; int i = 0; int last = 0; char[] input = string.toCharArray(); int len = input.length; StringBuffer out = new StringBuffer((int) (len * 1.3));...
java
public static final String escapeForXML(String string) { if (string == null) { return null; } char ch; int i = 0; int last = 0; char[] input = string.toCharArray(); int len = input.length; StringBuffer out = new StringBuffer((int) (len * 1.3));...
[ "public", "static", "final", "String", "escapeForXML", "(", "String", "string", ")", "{", "if", "(", "string", "==", "null", ")", "{", "return", "null", ";", "}", "char", "ch", ";", "int", "i", "=", "0", ";", "int", "last", "=", "0", ";", "char", ...
Escapes all necessary characters in the String so that it can be used in an XML doc. @param string the string to escape. @return the string with appropriate characters escaped.
[ "Escapes", "all", "necessary", "characters", "in", "the", "String", "so", "that", "it", "can", "be", "used", "in", "an", "XML", "doc", "." ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/util/StringUtils.java#L151-L207
test
Escape for XML.
Of course, here is the Java code you requested: ```java public static final String escapeForXML(String string) { if (string == null) { return null; } char ch; int i = 0; int last = 0; char[] input = string.toCharArray(); int len = input.length; ...
rupertlssmith/lojix
lojix/power_model/src/main/com/thesett/aima/attribute/impl/DateRangeType.java
DateRangeType.createInstance
public static Type createInstance(String name, DateOnly from, DateOnly to) { // Ensure that min is less than or equal to max. if ((from != null) && (to != null) && (from.compareTo(to) > 0)) { throw new IllegalArgumentException("'min' must be less than or equal to 'max'."); ...
java
public static Type createInstance(String name, DateOnly from, DateOnly to) { // Ensure that min is less than or equal to max. if ((from != null) && (to != null) && (from.compareTo(to) > 0)) { throw new IllegalArgumentException("'min' must be less than or equal to 'max'."); ...
[ "public", "static", "Type", "createInstance", "(", "String", "name", ",", "DateOnly", "from", ",", "DateOnly", "to", ")", "{", "// Ensure that min is less than or equal to max.", "if", "(", "(", "from", "!=", "null", ")", "&&", "(", "to", "!=", "null", ")", ...
Creates a new date range type with the specified name, if it does not already exist. @param name The name of the date range type to create. @param from The minimum value that an instance of the type can take. @param to The maximum value that an instance of teh type can take. @return A new date range type. @thro...
[ "Creates", "a", "new", "date", "range", "type", "with", "the", "specified", "name", "if", "it", "does", "not", "already", "exist", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/power_model/src/main/com/thesett/aima/attribute/impl/DateRangeType.java#L100-L132
test
Creates a new type with the specified name from and to.
Of course, here is the Java code you requested: ```java public static Type createInstance(String name, DateOnly from, DateOnly to) { // Ensure that min is less than or equal to max. if ((from != null) && (to != null) && (from.compareTo(to) > 0)) { throw new IllegalArgumentExcept...
truward/brikar
brikar-server/src/main/java/com/truward/brikar/server/util/JettyResourceUtil.java
JettyResourceUtil.createResource
public static Resource createResource(String resourcePath) throws IOException { if (resourcePath.startsWith(ResourceUtils.CLASSPATH_URL_PREFIX)) { return Resource.newClassPathResource(resourcePath.substring(ResourceUtils.CLASSPATH_URL_PREFIX.length())); } else if (resourcePath.startsWith(ResourceUtils.FIL...
java
public static Resource createResource(String resourcePath) throws IOException { if (resourcePath.startsWith(ResourceUtils.CLASSPATH_URL_PREFIX)) { return Resource.newClassPathResource(resourcePath.substring(ResourceUtils.CLASSPATH_URL_PREFIX.length())); } else if (resourcePath.startsWith(ResourceUtils.FIL...
[ "public", "static", "Resource", "createResource", "(", "String", "resourcePath", ")", "throws", "IOException", "{", "if", "(", "resourcePath", ".", "startsWith", "(", "ResourceUtils", ".", "CLASSPATH_URL_PREFIX", ")", ")", "{", "return", "Resource", ".", "newClass...
hidden
[ "hidden" ]
9a2f6d0149b281fff0f704f169021187f5f9115f
https://github.com/truward/brikar/blob/9a2f6d0149b281fff0f704f169021187f5f9115f/brikar-server/src/main/java/com/truward/brikar/server/util/JettyResourceUtil.java#L18-L37
test
Create a resource from a path.
Of course, here is the Java code you requested: ```java public static Resource createResource(String resourcePath) throws IOException { if (resourcePath.startsWith(ResourceUtils.CLASSPATH_URL_PREFIX)) { return Resource.newClassPathResource(resourcePath.substring(ResourceUtils.CLASSPATH_URL_PREFIX.length()));...
streamsets/datacollector
basic-lib/src/main/java/com/streamsets/pipeline/lib/http/HttpClientCommon.java
HttpClientCommon.getHttpMethod
public HttpMethod getHttpMethod( HttpMethod httpMethod, String methodExpression, Record record ) throws ELEvalException { if (httpMethod != HttpMethod.EXPRESSION) { return httpMethod; } RecordEL.setRecordInContext(methodVars, record); return HttpMethod.valueOf(methodEval.eval(m...
java
public HttpMethod getHttpMethod( HttpMethod httpMethod, String methodExpression, Record record ) throws ELEvalException { if (httpMethod != HttpMethod.EXPRESSION) { return httpMethod; } RecordEL.setRecordInContext(methodVars, record); return HttpMethod.valueOf(methodEval.eval(m...
[ "public", "HttpMethod", "getHttpMethod", "(", "HttpMethod", "httpMethod", ",", "String", "methodExpression", ",", "Record", "record", ")", "throws", "ELEvalException", "{", "if", "(", "httpMethod", "!=", "HttpMethod", ".", "EXPRESSION", ")", "{", "return", "httpMe...
Determines the HTTP method to use for the next request. It may include an EL expression to evaluate. @param record Current record to set in context. @return the {@link HttpMethod} to use for the request @throws ELEvalException if an expression is supplied that cannot be evaluated
[ "Determines", "the", "HTTP", "method", "to", "use", "for", "the", "next", "request", ".", "It", "may", "include", "an", "EL", "expression", "to", "evaluate", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/basic-lib/src/main/java/com/streamsets/pipeline/lib/http/HttpClientCommon.java#L344-L354
test
Get the HTTP method.
Of course, here is the Java code you requested: ```java public HttpMethod getHttpMethod( HttpMethod httpMethod, String methodExpression, Record record ) throws ELEvalException { if (httpMethod != HttpMethod.EXPRESSION) { return httpMethod; } RecordEL.setRecordInContext(methodVars,...
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/answer/Summary.java
Summary.setVariants
public void setVariants(StringList v) { if (Summary_Type.featOkTst && ((Summary_Type)jcasType).casFeat_variants == null) jcasType.jcas.throwFeatMissing("variants", "edu.cmu.lti.oaqa.type.answer.Summary"); jcasType.ll_cas.ll_setRefValue(addr, ((Summary_Type)jcasType).casFeatCode_variants, jcasType.ll_cas.l...
java
public void setVariants(StringList v) { if (Summary_Type.featOkTst && ((Summary_Type)jcasType).casFeat_variants == null) jcasType.jcas.throwFeatMissing("variants", "edu.cmu.lti.oaqa.type.answer.Summary"); jcasType.ll_cas.ll_setRefValue(addr, ((Summary_Type)jcasType).casFeatCode_variants, jcasType.ll_cas.l...
[ "public", "void", "setVariants", "(", "StringList", "v", ")", "{", "if", "(", "Summary_Type", ".", "featOkTst", "&&", "(", "(", "Summary_Type", ")", "jcasType", ")", ".", "casFeat_variants", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing"...
setter for variants - sets List of alternative answer summaries. @generated @param v value to set into the feature
[ "setter", "for", "variants", "-", "sets", "List", "of", "alternative", "answer", "summaries", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/answer/Summary.java#L130-L133
test
setter for variants - sets
Of course, here is the Java code you requested: ```java public void setVariants(StringList v) { if (Summary_Type.featOkTst && ((Summary_Type)jcasType).casFeat_variants == null) jcasType.jcas.throwFeatMissing("variants", "edu.cmu.lti.oaqa.type.answer.Summary"); jcasType.ll_cas.ll_setRefValue(addr, ((Summa...
deliveredtechnologies/rulebook
rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/RuleBuilder.java
RuleBuilder.then
@SuppressWarnings("unchecked") public ThenRuleBuilder<T, U> then(Consumer<NameValueReferableTypeConvertibleMap<T>> action) { Rule<T, U> rule = _name.map(name -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), name)).orElse(newRule()); if (rule == null) { throw new IllegalStateException("No Rule is instan...
java
@SuppressWarnings("unchecked") public ThenRuleBuilder<T, U> then(Consumer<NameValueReferableTypeConvertibleMap<T>> action) { Rule<T, U> rule = _name.map(name -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), name)).orElse(newRule()); if (rule == null) { throw new IllegalStateException("No Rule is instan...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "ThenRuleBuilder", "<", "T", ",", "U", ">", "then", "(", "Consumer", "<", "NameValueReferableTypeConvertibleMap", "<", "T", ">", ">", "action", ")", "{", "Rule", "<", "T", ",", "U", ">", "rule",...
Adds an action as a Consumer to the Rule. @param action a Consumer action to be added to the Rule that accepts the facts specified for the Rule @return a builder for building rules after a 'then' action is specified
[ "Adds", "an", "action", "as", "a", "Consumer", "to", "the", "Rule", "." ]
253738f6bc1e7804bb8649863e969956075a19ae
https://github.com/deliveredtechnologies/rulebook/blob/253738f6bc1e7804bb8649863e969956075a19ae/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/RuleBuilder.java#L192-L199
test
Create a new ThenRuleBuilder.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public ThenRuleBuilder<T, U> then(Consumer<NameValueReferableTypeConvertibleMap<T>> action) { Rule<T, U> rule = _name.map(name -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), name)).orElse(newRule()); if (rule == null) {...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/core/write/objectmapper/HollowObjectMapper.java
HollowObjectMapper.extractPrimaryKey
public RecordPrimaryKey extractPrimaryKey(Object o) { HollowObjectTypeMapper typeMapper = (HollowObjectTypeMapper) getTypeMapper(o.getClass(), null, null); return new RecordPrimaryKey(typeMapper.getTypeName(), typeMapper.extractPrimaryKey(o)); }
java
public RecordPrimaryKey extractPrimaryKey(Object o) { HollowObjectTypeMapper typeMapper = (HollowObjectTypeMapper) getTypeMapper(o.getClass(), null, null); return new RecordPrimaryKey(typeMapper.getTypeName(), typeMapper.extractPrimaryKey(o)); }
[ "public", "RecordPrimaryKey", "extractPrimaryKey", "(", "Object", "o", ")", "{", "HollowObjectTypeMapper", "typeMapper", "=", "(", "HollowObjectTypeMapper", ")", "getTypeMapper", "(", "o", ".", "getClass", "(", ")", ",", "null", ",", "null", ")", ";", "return", ...
Extracts the primary key from the specified POJO. @param o the POJO @return the primary key @throws IllegalArgumentException if the POJO does not have primary key defined
[ "Extracts", "the", "primary", "key", "from", "the", "specified", "POJO", "." ]
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/write/objectmapper/HollowObjectMapper.java#L93-L96
test
Extract a RecordPrimaryKey from an object.
Of course, here is the Java code you requested: ```java public RecordPrimaryKey extractPrimaryKey(Object o) { HollowObjectTypeMapper typeMapper = (HollowObjectTypeMapper) getTypeMapper(o.getClass(), null, null); return new RecordPrimaryKey(typeMapper.getTypeName(), typeMapper.extractPrimaryKey(o)); ...
cologneintelligence/FitGoodies
fitgoodies-db-jdbc/src/main/java/de/cologneintelligence/fitgoodies/database/dynamic/ResultSetWrapper.java
ResultSetWrapper.getRows
public final Object[] getRows() throws SQLException { List<Object> result = new ArrayList<>(); while (rows.size() > 0) { Object[] copy = rows.remove(0); Object o = createContainerObject(); for (int i = 0; i < columnCount; ++i) { setObjectValue(o, nam...
java
public final Object[] getRows() throws SQLException { List<Object> result = new ArrayList<>(); while (rows.size() > 0) { Object[] copy = rows.remove(0); Object o = createContainerObject(); for (int i = 0; i < columnCount; ++i) { setObjectValue(o, nam...
[ "public", "final", "Object", "[", "]", "getRows", "(", ")", "throws", "SQLException", "{", "List", "<", "Object", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "while", "(", "rows", ".", "size", "(", ")", ">", "0", ")", "{", "Object"...
Generates an array which represents the whole {@code ResultSet}. Each element equates to one row in the {@code ResultSet}. The elements have public fields with the same name as the {@code ResultSet} columns. The {@link ScientificDouble} class is automatically used. They can be read them using reflections. @return arra...
[ "Generates", "an", "array", "which", "represents", "the", "whole", "{", "@code", "ResultSet", "}", ".", "Each", "element", "equates", "to", "one", "row", "in", "the", "{", "@code", "ResultSet", "}", ".", "The", "elements", "have", "public", "fields", "with...
834e42d1f41b4b9226060b1e83a80cc69ea88c7b
https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-db-jdbc/src/main/java/de/cologneintelligence/fitgoodies/database/dynamic/ResultSetWrapper.java#L134-L157
test
Gets the rows of the table as an array of objects.
Of course, here is the Java code you requested: ```java public final Object[] getRows() throws SQLException { List<Object> result = new ArrayList<>(); while (rows.size() > 0) { Object[] copy = rows.remove(0); Object o = createContainerObject(); for (int i = 0; i < ...
sialcasa/mvvmFX
mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/mapping/ModelWrapper.java
ModelWrapper.reload
public void reload() { M wrappedModelInstance = model.get(); if (wrappedModelInstance != null) { fields.forEach(field -> field.reload(wrappedModelInstance)); immutableFields.forEach(field -> field.reload(wrappedModelInstance)); dirtyFlag.set(false); calculateDifferenceFlag(); } }
java
public void reload() { M wrappedModelInstance = model.get(); if (wrappedModelInstance != null) { fields.forEach(field -> field.reload(wrappedModelInstance)); immutableFields.forEach(field -> field.reload(wrappedModelInstance)); dirtyFlag.set(false); calculateDifferenceFlag(); } }
[ "public", "void", "reload", "(", ")", "{", "M", "wrappedModelInstance", "=", "model", ".", "get", "(", ")", ";", "if", "(", "wrappedModelInstance", "!=", "null", ")", "{", "fields", ".", "forEach", "(", "field", "->", "field", ".", "reload", "(", "wrap...
Take the current values from the wrapped model element and put them in the corresponding property fields. <p> If no model element is defined then nothing will happen. <p> <b>Note:</b> This method has no effects on the wrapped model element but will only change the values of the defined property fields.
[ "Take", "the", "current", "values", "from", "the", "wrapped", "model", "element", "and", "put", "them", "in", "the", "corresponding", "property", "fields", ".", "<p", ">", "If", "no", "model", "element", "is", "defined", "then", "nothing", "will", "happen", ...
240566a358a8e01c94c0bbb99228140a69690d02
https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/mapping/ModelWrapper.java#L478-L488
test
Reload the entity.
Of course, here is the Java code you requested: ```java public void reload() { M wrappedModelInstance = model.get(); if (wrappedModelInstance != null) { fields.forEach(field -> field.reload(wrappedModelInstance)); immutableFields.forEach(field -> field.reload(wrappedModelInstance)); dirtyFlag.set(false)...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/core/memory/ByteArrayOrdinalMap.java
ByteArrayOrdinalMap.compact
public void compact(ThreadSafeBitSet usedOrdinals) { long[] populatedReverseKeys = new long[size]; int counter = 0; AtomicLongArray pao = pointersAndOrdinals; for (int i = 0; i < pao.length(); i++) { long key = pao.get(i); if (key != EMPTY_BUCKET_VALUE) { ...
java
public void compact(ThreadSafeBitSet usedOrdinals) { long[] populatedReverseKeys = new long[size]; int counter = 0; AtomicLongArray pao = pointersAndOrdinals; for (int i = 0; i < pao.length(); i++) { long key = pao.get(i); if (key != EMPTY_BUCKET_VALUE) { ...
[ "public", "void", "compact", "(", "ThreadSafeBitSet", "usedOrdinals", ")", "{", "long", "[", "]", "populatedReverseKeys", "=", "new", "long", "[", "size", "]", ";", "int", "counter", "=", "0", ";", "AtomicLongArray", "pao", "=", "pointersAndOrdinals", ";", "...
Reclaim space in the byte array used in the previous cycle, but not referenced in this cycle.<p> <p> This is achieved by shifting all used byte sequences down in the byte array, then updating the key array to reflect the new pointers and exclude the removed entries. This is also where ordinals which are unused are ret...
[ "Reclaim", "space", "in", "the", "byte", "array", "used", "in", "the", "previous", "cycle", "but", "not", "referenced", "in", "this", "cycle", ".", "<p", ">", "<p", ">", "This", "is", "achieved", "by", "shifting", "all", "used", "byte", "sequences", "dow...
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/memory/ByteArrayOrdinalMap.java#L361-L414
test
Compact the set of key values.
Of course, here is the Java code you requested: ```java public void compact(ThreadSafeBitSet usedOrdinals) { long[] populatedReverseKeys = new long[size]; int counter = 0; AtomicLongArray pao = pointersAndOrdinals; for (int i = 0; i < pao.length(); i++) { long key = pao.ge...
deliveredtechnologies/rulebook
rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/RuleBuilder.java
RuleBuilder.given
@SuppressWarnings("unchecked") @SafeVarargs public final GivenRuleBuilder<T, U> given(NameValueReferable... facts) { Rule<T, U> rule = _name.map(name -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), name)).orElse(newRule()); if (rule == null) { throw new IllegalStateException("No Rule is instantiated...
java
@SuppressWarnings("unchecked") @SafeVarargs public final GivenRuleBuilder<T, U> given(NameValueReferable... facts) { Rule<T, U> rule = _name.map(name -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), name)).orElse(newRule()); if (rule == null) { throw new IllegalStateException("No Rule is instantiated...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "SafeVarargs", "public", "final", "GivenRuleBuilder", "<", "T", ",", "U", ">", "given", "(", "NameValueReferable", "...", "facts", ")", "{", "Rule", "<", "T", ",", "U", ">", "rule", "=", "_name", "...
Adds one or more facts to the Rule. @param facts the facts to be added to the Rule @return a builder for building rules after a 'given' statement
[ "Adds", "one", "or", "more", "facts", "to", "the", "Rule", "." ]
253738f6bc1e7804bb8649863e969956075a19ae
https://github.com/deliveredtechnologies/rulebook/blob/253738f6bc1e7804bb8649863e969956075a19ae/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/RuleBuilder.java#L135-L143
test
Creates a new GivenRuleBuilder with the given facts.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @SafeVarargs public final GivenRuleBuilder<T, U> given(NameValueReferable... facts) { Rule<T, U> rule = _name.map(name -> (Rule<T, U>)new AuditableRule<T, U>(newRule(), name)).orElse(newRule()); if (rule == null) { ...
ukwa/jruby-whois
src/main/java/uk/bl/wa/whois/JRubyWhois.java
JRubyWhois.lookup
public WhoisResult lookup(String domain, int timeout) { container.put("domain", domain); container.put("timeout_param", timeout); try { return (WhoisResult) container.runScriptlet( JRubyWhois.class.getResourceAsStream("jruby-whois.rb"), "jruby-...
java
public WhoisResult lookup(String domain, int timeout) { container.put("domain", domain); container.put("timeout_param", timeout); try { return (WhoisResult) container.runScriptlet( JRubyWhois.class.getResourceAsStream("jruby-whois.rb"), "jruby-...
[ "public", "WhoisResult", "lookup", "(", "String", "domain", ",", "int", "timeout", ")", "{", "container", ".", "put", "(", "\"domain\"", ",", "domain", ")", ";", "container", ".", "put", "(", "\"timeout_param\"", ",", "timeout", ")", ";", "try", "{", "re...
Uses the Ruby Whois gem to perform a whois lookup @param domain domain name to lookup @param timeout timeout in seconds @return
[ "Uses", "the", "Ruby", "Whois", "gem", "to", "perform", "a", "whois", "lookup" ]
5fd55e85fbaa9c09df30f792bf73a56adac4de6e
https://github.com/ukwa/jruby-whois/blob/5fd55e85fbaa9c09df30f792bf73a56adac4de6e/src/main/java/uk/bl/wa/whois/JRubyWhois.java#L60-L76
test
Lookup a WhoisResult.
Of course, here is the Java code you requested: ```java public WhoisResult lookup(String domain, int timeout) { container.put("domain", domain); container.put("timeout_param", timeout); try { return (WhoisResult) container.runScriptlet( JRubyWhois.class.getResour...
oblac/jodd
jodd-core/src/main/java/jodd/io/FileUtil.java
FileUtil._copyFile
private static void _copyFile(final File srcFile, final File destFile) throws IOException { if (destFile.exists()) { if (destFile.isDirectory()) { throw new IOException("Destination '" + destFile + "' is a directory"); } } // do copy file FileInputStream input = null; FileOutputStream output = null...
java
private static void _copyFile(final File srcFile, final File destFile) throws IOException { if (destFile.exists()) { if (destFile.isDirectory()) { throw new IOException("Destination '" + destFile + "' is a directory"); } } // do copy file FileInputStream input = null; FileOutputStream output = null...
[ "private", "static", "void", "_copyFile", "(", "final", "File", "srcFile", ",", "final", "File", "destFile", ")", "throws", "IOException", "{", "if", "(", "destFile", ".", "exists", "(", ")", ")", "{", "if", "(", "destFile", ".", "isDirectory", "(", ")",...
Internal file copy when most of the pre-checking has passed. @param srcFile Source {@link File}. @param destFile Destination {@link File}. @throws IOException if cannot copy
[ "Internal", "file", "copy", "when", "most", "of", "the", "pre", "-", "checking", "has", "passed", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L268-L293
test
Copy file.
Of course, here is the Java code you requested: ```java private static void _copyFile(final File srcFile, final File destFile) throws IOException { if (destFile.exists()) { if (destFile.isDirectory()) { throw new IOException("Destination '" + destFile + "' is a directory"); } } // do copy file FileI...
racker/java-service-registry-client
service-registry-examples/src/main/java/com/rackspacecloud/client/service_registry/examples/BarCuratorService.java
BarCuratorService.convert
public static ServiceInstance<BarCuratorService> convert(BarCuratorService bar) throws Exception { ServiceInstanceBuilder<BarCuratorService> builder = ServiceInstance.builder(); // these values are for the most part nonsensical. return builder.payload(bar) .uriSpec(new UriSpec("http:...
java
public static ServiceInstance<BarCuratorService> convert(BarCuratorService bar) throws Exception { ServiceInstanceBuilder<BarCuratorService> builder = ServiceInstance.builder(); // these values are for the most part nonsensical. return builder.payload(bar) .uriSpec(new UriSpec("http:...
[ "public", "static", "ServiceInstance", "<", "BarCuratorService", ">", "convert", "(", "BarCuratorService", "bar", ")", "throws", "Exception", "{", "ServiceInstanceBuilder", "<", "BarCuratorService", ">", "builder", "=", "ServiceInstance", ".", "builder", "(", ")", "...
ServiceInstance<T> instances required by the Curator interfaces.
[ "ServiceInstance<T", ">", "instances", "required", "by", "the", "Curator", "interfaces", "." ]
7addc8f4fced35e90fbb77cf26f9209e5417e20d
https://github.com/racker/java-service-registry-client/blob/7addc8f4fced35e90fbb77cf26f9209e5417e20d/service-registry-examples/src/main/java/com/rackspacecloud/client/service_registry/examples/BarCuratorService.java#L27-L39
test
Convert a bar curator service instance to a ServiceInstance object.
Of course, here is the Java code you requested: ```java public static ServiceInstance<BarCuratorService> convert(BarCuratorService bar) throws Exception { ServiceInstanceBuilder<BarCuratorService> builder = ServiceInstance.builder(); // these values are for the most part nonsensical. return bui...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java
ClassWriter.newMethod
public int newMethod( final String owner, final String name, final String descriptor, final boolean isInterface) { return symbolTable.addConstantMethodref(owner, name, descriptor, isInterface).index; }
java
public int newMethod( final String owner, final String name, final String descriptor, final boolean isInterface) { return symbolTable.addConstantMethodref(owner, name, descriptor, isInterface).index; }
[ "public", "int", "newMethod", "(", "final", "String", "owner", ",", "final", "String", "name", ",", "final", "String", "descriptor", ",", "final", "boolean", "isInterface", ")", "{", "return", "symbolTable", ".", "addConstantMethodref", "(", "owner", ",", "nam...
Adds a method reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. <i>This method is intended for {@link Attribute} sub classes, and is normally not needed by class generators or adapters.</i> @param owner the internal name of the method's owner cl...
[ "Adds", "a", "method", "reference", "to", "the", "constant", "pool", "of", "the", "class", "being", "build", ".", "Does", "nothing", "if", "the", "constant", "pool", "already", "contains", "a", "similar", "item", ".", "<i", ">", "This", "method", "is", "...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java#L911-L914
test
Add a new method reference to a class.
Of course, here is the Java code you requested: ```java public int newMethod( final String owner, final String name, final String descriptor, final boolean isInterface) { return symbolTable.addConstantMethodref(owner, name, descriptor, isInterface).index; } ``` Hope this helps!
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityAspectJAutoProxyRegistrar.java
GlobalMethodSecurityAspectJAutoProxyRegistrar.registerBeanDefinitions
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { BeanDefinition interceptor = registry .getBeanDefinition("methodSecurityInterceptor"); BeanDefinitionBuilder aspect = BeanDefinitionBuilder .rootBeanDefinition("org.springframework.security...
java
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { BeanDefinition interceptor = registry .getBeanDefinition("methodSecurityInterceptor"); BeanDefinitionBuilder aspect = BeanDefinitionBuilder .rootBeanDefinition("org.springframework.security...
[ "public", "void", "registerBeanDefinitions", "(", "AnnotationMetadata", "importingClassMetadata", ",", "BeanDefinitionRegistry", "registry", ")", "{", "BeanDefinition", "interceptor", "=", "registry", ".", "getBeanDefinition", "(", "\"methodSecurityInterceptor\"", ")", ";", ...
Register, escalate, and configure the AspectJ auto proxy creator based on the value of the @{@link EnableGlobalMethodSecurity#proxyTargetClass()} attribute on the importing {@code @Configuration} class.
[ "Register", "escalate", "and", "configure", "the", "AspectJ", "auto", "proxy", "creator", "based", "on", "the", "value", "of", "the" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityAspectJAutoProxyRegistrar.java#L47-L61
test
Register the bean definitions for the given annotation metadata.
Of course, here is the Java code you requested: ```java public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { BeanDefinition interceptor = registry .getBeanDefinition("methodSecurityInterceptor"); BeanDefinitionBuilder aspect = BeanDefinitionBuil...
Unidata/thredds
cdm/src/main/java/ucar/ma2/StructureDataW.java
StructureDataW.setMemberData
public void setMemberData(StructureMembers.Member m, Array data) { if (data == null) throw new IllegalArgumentException("data cant be null"); memberData.put(m, data); }
java
public void setMemberData(StructureMembers.Member m, Array data) { if (data == null) throw new IllegalArgumentException("data cant be null"); memberData.put(m, data); }
[ "public", "void", "setMemberData", "(", "StructureMembers", ".", "Member", "m", ",", "Array", "data", ")", "{", "if", "(", "data", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"data cant be null\"", ")", ";", "memberData", ".", "put", ...
/* Copy constructor. This makes a local copy of all the data in the from StrucureData. @param from copy from here public StructureDataW (StructureData from) { this(from.getStructureMembers()); List<StructureMembers.Member> members = getMembers(); for (StructureMembers.Member m : members) { Array data = from.getArray(m...
[ "/", "*", "Copy", "constructor", ".", "This", "makes", "a", "local", "copy", "of", "all", "the", "data", "in", "the", "from", "StrucureData", ".", "@param", "from", "copy", "from", "here" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/StructureDataW.java#L52-L57
test
Sets the data for a member.
Of course, here is the Java code you requested: ```java public void setMemberData(StructureMembers.Member m, Array data) { if (data == null) throw new IllegalArgumentException("data cant be null"); memberData.put(m, data); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createRollstuhlgerecht
@XmlElementDecl(namespace = "", name = "rollstuhlgerecht") public JAXBElement<Boolean> createRollstuhlgerecht(Boolean value) { return new JAXBElement<Boolean>(_Rollstuhlgerecht_QNAME, Boolean.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "rollstuhlgerecht") public JAXBElement<Boolean> createRollstuhlgerecht(Boolean value) { return new JAXBElement<Boolean>(_Rollstuhlgerecht_QNAME, Boolean.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"rollstuhlgerecht\"", ")", "public", "JAXBElement", "<", "Boolean", ">", "createRollstuhlgerecht", "(", "Boolean", "value", ")", "{", "return", "new", "JAXBElement", "<", "Boolean", ">", ...
Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Boolean", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2697-L2700
test
Create an instance of a class in the process of creating a new object of type Boolean.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "rollstuhlgerecht") public JAXBElement<Boolean> createRollstuhlgerecht(Boolean value) { return new JAXBElement<Boolean>(_Rollstuhlgerecht_QNAME, Boolean.class, null, value); } ``` Hope this helps!
oblac/jodd
jodd-http/src/main/java/jodd/http/HttpRequest.java
HttpRequest.queryString
public String queryString() { if (query == null) { return StringPool.EMPTY; } return HttpUtil.buildQuery(query, queryEncoding); }
java
public String queryString() { if (query == null) { return StringPool.EMPTY; } return HttpUtil.buildQuery(query, queryEncoding); }
[ "public", "String", "queryString", "(", ")", "{", "if", "(", "query", "==", "null", ")", "{", "return", "StringPool", ".", "EMPTY", ";", "}", "return", "HttpUtil", ".", "buildQuery", "(", "query", ",", "queryEncoding", ")", ";", "}" ]
Generates query string. All values are URL encoded.
[ "Generates", "query", "string", ".", "All", "values", "are", "URL", "encoded", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpRequest.java#L477-L482
test
Returns the query string.
Of course, here is the Java code you requested: ```java public String queryString() { if (query == null) { return StringPool.EMPTY; } return HttpUtil.buildQuery(query, queryEncoding); } ``` Hope this helps!
google/guice
core/src/com/google/inject/internal/Initializables.java
Initializables.of
static <T> Initializable<T> of(final T instance) { return new Initializable<T>() { @Override public T get() { return instance; } @Override public String toString() { return String.valueOf(instance); } }; }
java
static <T> Initializable<T> of(final T instance) { return new Initializable<T>() { @Override public T get() { return instance; } @Override public String toString() { return String.valueOf(instance); } }; }
[ "static", "<", "T", ">", "Initializable", "<", "T", ">", "of", "(", "final", "T", "instance", ")", "{", "return", "new", "Initializable", "<", "T", ">", "(", ")", "{", "@", "Override", "public", "T", "get", "(", ")", "{", "return", "instance", ";",...
Returns an initializable for an instance that requires no initialization.
[ "Returns", "an", "initializable", "for", "an", "instance", "that", "requires", "no", "initialization", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/Initializables.java#L23-L35
test
Returns an initialized object that contains the specified instance.
Of course, here is the Java code you requested: ```java static <T> Initializable<T> of(final T instance) { return new Initializable<T>() { @Override public T get() { return instance; } @Override public String toString() { return String.valueOf(instance); } }...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasZcopy
public static void cublasZcopy(int n, Pointer x, int incx, Pointer y, int incy) { cublasZcopyNative(n, x, incx, y, incy); checkResultBLAS(); }
java
public static void cublasZcopy(int n, Pointer x, int incx, Pointer y, int incy) { cublasZcopyNative(n, x, incx, y, incy); checkResultBLAS(); }
[ "public", "static", "void", "cublasZcopy", "(", "int", "n", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "y", ",", "int", "incy", ")", "{", "cublasZcopyNative", "(", "n", ",", "x", ",", "incx", ",", "y", ",", "incy", ")", ";", "checkRes...
<pre> void cublasZcopy (int n, const cuDoubleComplex *x, int incx, cuDoubleComplex *y, int incy) copies the double-complex vector x to the double-complex vector y. For i = 0 to n-1, copies x[lx + i * incx] to y[ly + i * incy], where lx = 1 if incx >= 0, else lx = 1 + (1 - n) * incx, and ly is defined in a similar way ...
[ "<pre", ">", "void", "cublasZcopy", "(", "int", "n", "const", "cuDoubleComplex", "*", "x", "int", "incx", "cuDoubleComplex", "*", "y", "int", "incy", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L1743-L1747
test
CUBLAS - tag copy
Of course, here is the Java code you requested: ```java public static void cublasZcopy(int n, Pointer x, int incx, Pointer y, int incy) { cublasZcopyNative(n, x, incx, y, incy); checkResultBLAS(); } ``` Hope this helps!
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/core/ProcessService.java
ProcessService.cascadeRemove
public void cascadeRemove(String id) { Process entity = access().getProcess(id); List<HistoryOrder> historyOrders = access().getHistoryOrders(null, new QueryFilter().setProcessId(id)); for(HistoryOrder historyOrder : historyOrders) { ServiceContext.getEngine().order().cascadeRemove(historyOrder.getId()); } ...
java
public void cascadeRemove(String id) { Process entity = access().getProcess(id); List<HistoryOrder> historyOrders = access().getHistoryOrders(null, new QueryFilter().setProcessId(id)); for(HistoryOrder historyOrder : historyOrders) { ServiceContext.getEngine().order().cascadeRemove(historyOrder.getId()); } ...
[ "public", "void", "cascadeRemove", "(", "String", "id", ")", "{", "Process", "entity", "=", "access", "(", ")", ".", "getProcess", "(", "id", ")", ";", "List", "<", "HistoryOrder", ">", "historyOrders", "=", "access", "(", ")", ".", "getHistoryOrders", "...
级联删除指定流程定义的所有数据
[ "级联删除指定流程定义的所有数据" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/core/ProcessService.java#L251-L260
test
Remove the process from the database.
Of course, here is the Java code you requested: ```java public void cascadeRemove(String id) { Process entity = access().getProcess(id); List<HistoryOrder> historyOrders = access().getHistoryOrders(null, new QueryFilter().setProcessId(id)); for(HistoryOrder historyOrder : historyOrders) { ServiceContext.getE...
jcodec/jcodec
src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java
BlockInterpolator.getChromaXX
private static void getChromaXX(byte[] pels, int picW, int picH, byte[] blk, int blkOff, int blkStride, int fullX, int fullY, int fracX, int fracY, int blkW, int blkH) { int w00 = fullY * picW + fullX; int w01 = w00 + (fullY < picH - 1 ? picW : 0); int w10 = w00 + (fullX < picW - 1 ?...
java
private static void getChromaXX(byte[] pels, int picW, int picH, byte[] blk, int blkOff, int blkStride, int fullX, int fullY, int fracX, int fracY, int blkW, int blkH) { int w00 = fullY * picW + fullX; int w01 = w00 + (fullY < picH - 1 ? picW : 0); int w10 = w00 + (fullX < picW - 1 ?...
[ "private", "static", "void", "getChromaXX", "(", "byte", "[", "]", "pels", ",", "int", "picW", ",", "int", "picH", ",", "byte", "[", "]", "blk", ",", "int", "blkOff", ",", "int", "blkStride", ",", "int", "fullX", ",", "int", "fullY", ",", "int", "f...
Chroma (X,X)
[ "Chroma", "(", "X", "X", ")" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java#L867-L888
test
getChromaXX - Method to get the chromaXX.
Of course, here is the Java code you requested: ```java private static void getChromaXX(byte[] pels, int picW, int picH, byte[] blk, int blkOff, int blkStride, int fullX, int fullY, int fracX, int fracY, int blkW, int blkH) { int w00 = fullY * picW + fullX; int w01 = w00 + (fullY < picH - 1...