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
streamsets/datacollector
jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/parser/sql/DateTimeColumnHandler.java
DateTimeColumnHandler.getDateTimeStampField
public Field getDateTimeStampField( String column, String columnValue, int columnType, String actualType ) throws StageException { Field.Type type; if (DATE.equalsIgnoreCase(actualType)) { type = Field.Type.DATE; } else if (TIME.equalsIgnoreCase(actualType)) { type = Fi...
java
public Field getDateTimeStampField( String column, String columnValue, int columnType, String actualType ) throws StageException { Field.Type type; if (DATE.equalsIgnoreCase(actualType)) { type = Field.Type.DATE; } else if (TIME.equalsIgnoreCase(actualType)) { type = Fi...
[ "public", "Field", "getDateTimeStampField", "(", "String", "column", ",", "String", "columnValue", ",", "int", "columnType", ",", "String", "actualType", ")", "throws", "StageException", "{", "Field", ".", "Type", "type", ";", "if", "(", "DATE", ".", "equalsIg...
This method returns an {@linkplain Field} that represents a DATE, TIME or TIMESTAMP. It is possible for user to upgrade a field from DATE to TIMESTAMP, and if we read the table schema on startup after this upgrade, we would assume the field should be returned as DATETIME field. But it is possible that the first change ...
[ "This", "method", "returns", "an", "{" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/parser/sql/DateTimeColumnHandler.java#L105-L139
test
Get a DateTimeStamp field from the specified column.
Of course, here is the Java code you requested: ```java public Field getDateTimeStampField( String column, String columnValue, int columnType, String actualType ) throws StageException { Field.Type type; if (DATE.equalsIgnoreCase(actualType)) { type = Field.Type.DATE; } else...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/group/processor/PreProcessorExecutor.java
PreProcessorExecutor.processAndMerge
public String processAndMerge(final List<Resource> resources, final boolean minimize) throws IOException { return processAndMerge(resources, ProcessingCriteria.create(ProcessingType.ALL, minimize)); }
java
public String processAndMerge(final List<Resource> resources, final boolean minimize) throws IOException { return processAndMerge(resources, ProcessingCriteria.create(ProcessingType.ALL, minimize)); }
[ "public", "String", "processAndMerge", "(", "final", "List", "<", "Resource", ">", "resources", ",", "final", "boolean", "minimize", ")", "throws", "IOException", "{", "return", "processAndMerge", "(", "resources", ",", "ProcessingCriteria", ".", "create", "(", ...
Apply preProcessors on resources and merge them after all preProcessors are applied. @param resources what are the resources to merge. @param minimize whether minimize aware processors must be applied or not. @return preProcessed merged content.
[ "Apply", "preProcessors", "on", "resources", "and", "merge", "them", "after", "all", "preProcessors", "are", "applied", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/group/processor/PreProcessorExecutor.java#L75-L78
test
Process and merge a list of resources.
Of course, here is the Java code you requested: ```java public String processAndMerge(final List<Resource> resources, final boolean minimize) throws IOException { return processAndMerge(resources, ProcessingCriteria.create(ProcessingType.ALL, minimize)); } ``` Hope this helps!
jcodec/jcodec
src/main/java/net/sourceforge/jaad/aac/gain/GainControl.java
GainControl.interpolateGain
private float interpolateGain(float alev0, float alev1, int iloc) { final float a0 = (float) (Math.log(alev0)/Math.log(2)); final float a1 = (float) (Math.log(alev1)/Math.log(2)); return (float) Math.pow(2.0f, (((8-iloc)*a0+iloc*a1)/8)); }
java
private float interpolateGain(float alev0, float alev1, int iloc) { final float a0 = (float) (Math.log(alev0)/Math.log(2)); final float a1 = (float) (Math.log(alev1)/Math.log(2)); return (float) Math.pow(2.0f, (((8-iloc)*a0+iloc*a1)/8)); }
[ "private", "float", "interpolateGain", "(", "float", "alev0", ",", "float", "alev1", ",", "int", "iloc", ")", "{", "final", "float", "a0", "=", "(", "float", ")", "(", "Math", ".", "log", "(", "alev0", ")", "/", "Math", ".", "log", "(", "2", ")", ...
calculates a fragment modification function the interpolated gain value between the gain values of two gain change positions is calculated by the formula: f(a,b,j) = 2^(((8-j)log2(a)+j*log2(b))/8)
[ "calculates", "a", "fragment", "modification", "function", "the", "interpolated", "gain", "value", "between", "the", "gain", "values", "of", "two", "gain", "change", "positions", "is", "calculated", "by", "the", "formula", ":", "f", "(", "a", "b", "j", ")", ...
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/net/sourceforge/jaad/aac/gain/GainControl.java#L299-L303
test
Interpolate gain.
Of course, here is the Java code you requested: ```java private float interpolateGain(float alev0, float alev1, int iloc) { final float a0 = (float) (Math.log(alev0)/Math.log(2)); final float a1 = (float) (Math.log(alev1)/Math.log(2)); return (float) Math.pow(2.0f, (((8-iloc)*a0+iloc*a1)/8)); } ``` Hope this h...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java
GempakGridReader.getInstance
public static GempakGridReader getInstance(RandomAccessFile raf, boolean fullCheck) throws IOException { GempakGridReader ggr = new GempakGridReader(raf.getLocation()); ggr.init(raf, fullCheck); return ggr; }
java
public static GempakGridReader getInstance(RandomAccessFile raf, boolean fullCheck) throws IOException { GempakGridReader ggr = new GempakGridReader(raf.getLocation()); ggr.init(raf, fullCheck); return ggr; }
[ "public", "static", "GempakGridReader", "getInstance", "(", "RandomAccessFile", "raf", ",", "boolean", "fullCheck", ")", "throws", "IOException", "{", "GempakGridReader", "ggr", "=", "new", "GempakGridReader", "(", "raf", ".", "getLocation", "(", ")", ")", ";", ...
Initialize the file, read in all the metadata (ala DM_OPEN) @param raf RandomAccessFile to read. @param fullCheck if true, check entire structure @return A GempakGridReader @throws IOException problem reading file
[ "Initialize", "the", "file", "read", "in", "all", "the", "metadata", "(", "ala", "DM_OPEN", ")" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java#L89-L93
test
Get a new instance of the GempakGridReader class.
Of course, here is the Java code you requested: ```java public static GempakGridReader getInstance(RandomAccessFile raf, boolean fullCheck) throws IOException { GempakGridReader ggr = new GempakGridReader(raf.getLocation()); ggr.init(raf, fullCheck); return ggr; } ``` Hope this helps!
Unidata/thredds
udunits/src/main/java/ucar/units/LogarithmicUnit.java
LogarithmicUnit.myRaiseTo
@Override protected Unit myRaiseTo(final int power) throws RaiseException { if (power == 0) { return DerivedUnitImpl.DIMENSIONLESS; } if (power == 1) { return this; } throw new RaiseException(this); }
java
@Override protected Unit myRaiseTo(final int power) throws RaiseException { if (power == 0) { return DerivedUnitImpl.DIMENSIONLESS; } if (power == 1) { return this; } throw new RaiseException(this); }
[ "@", "Override", "protected", "Unit", "myRaiseTo", "(", "final", "int", "power", ")", "throws", "RaiseException", "{", "if", "(", "power", "==", "0", ")", "{", "return", "DerivedUnitImpl", ".", "DIMENSIONLESS", ";", "}", "if", "(", "power", "==", "1", ")...
Raise this unit to a power. @param power The power to raise this unit by. The only meaningful values are 0 and 1. @return The result of raising this unit by the power <code>power</code>. @throws RaiseException Can't raise this unit to {@code power}, which is neither 0 nor 1.
[ "Raise", "this", "unit", "to", "a", "power", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/LogarithmicUnit.java#L194-L203
test
Override this method to provide the correct exception to throw.
Of course, here is the Java code you requested: ```java @Override protected Unit myRaiseTo(final int power) throws RaiseException { if (power == 0) { return DerivedUnitImpl.DIMENSIONLESS; } if (power == 1) { return this; } throw new RaiseException(thi...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/IospHelper.java
IospHelper.readData
static public Object readData(LayoutBB layout, DataType dataType, Object arr) throws java.io.IOException { if (showLayoutTypes) System.out.println("***BB LayoutType=" + layout.getClass().getName()); if (dataType.getPrimitiveClassType() == byte.class || (dataType == DataType.CHAR)) { byte[] pa = (byte...
java
static public Object readData(LayoutBB layout, DataType dataType, Object arr) throws java.io.IOException { if (showLayoutTypes) System.out.println("***BB LayoutType=" + layout.getClass().getName()); if (dataType.getPrimitiveClassType() == byte.class || (dataType == DataType.CHAR)) { byte[] pa = (byte...
[ "static", "public", "Object", "readData", "(", "LayoutBB", "layout", ",", "DataType", "dataType", ",", "Object", "arr", ")", "throws", "java", ".", "io", ".", "IOException", "{", "if", "(", "showLayoutTypes", ")", "System", ".", "out", ".", "println", "(",...
Read data subset from ByteBuffer, place in given primitive array. Reading is controlled by the LayoutBB object. @param layout handles skipping around in the file, privide ByteBuffer to read from @param dataType dataType of the variable @param arr primitive array to read data into @return the primitive array wit...
[ "Read", "data", "subset", "from", "ByteBuffer", "place", "in", "given", "primitive", "array", ".", "Reading", "is", "controlled", "by", "the", "LayoutBB", "object", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/IospHelper.java#L276-L368
test
Reads the data from the specified layout and data type from the specified array.
Of course, here is the Java code you requested: ```java static public Object readData(LayoutBB layout, DataType dataType, Object arr) throws java.io.IOException { if (showLayoutTypes) System.out.println("***BB LayoutType=" + layout.getClass().getName()); if (dataType.getPrimitiveClassType() == byte.class |...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft/FeatureDatasetFactoryManager.java
FeatureDatasetFactoryManager.open
static public FeatureDataset open(FeatureType wantFeatureType, String location, ucar.nc2.util.CancelTask task, Formatter errlog) throws IOException { // special processing for thredds: datasets if (location.startsWith(DataFactory.SCHEME)) { DataFactory.Result result = new DataFactory().openFeatureDat...
java
static public FeatureDataset open(FeatureType wantFeatureType, String location, ucar.nc2.util.CancelTask task, Formatter errlog) throws IOException { // special processing for thredds: datasets if (location.startsWith(DataFactory.SCHEME)) { DataFactory.Result result = new DataFactory().openFeatureDat...
[ "static", "public", "FeatureDataset", "open", "(", "FeatureType", "wantFeatureType", ",", "String", "location", ",", "ucar", ".", "nc2", ".", "util", ".", "CancelTask", "task", ",", "Formatter", "errlog", ")", "throws", "IOException", "{", "// special processing f...
Open a dataset as a FeatureDataset. @param wantFeatureType open this kind of FeatureDataset; may be null, which means search all factories. If datatype is not null, only return correct FeatureDataset (eg PointFeatureDataset for DataType.POINT). @param location URL or file location of the dataset. This may be a ...
[ "Open", "a", "dataset", "as", "a", "FeatureDataset", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/FeatureDatasetFactoryManager.java#L221-L268
test
Opens a feature dataset with the specified feature type and location.
Of course, here is the Java code you requested: ```java static public FeatureDataset open(FeatureType wantFeatureType, String location, ucar.nc2.util.CancelTask task, Formatter errlog) throws IOException { // special processing for thredds: datasets if (location.startsWith(DataFactory.SCHEME)) { Dat...
playframework/playframework
persistence/play-jdbc-evolutions/src/main/java/play/db/evolutions/Evolutions.java
Evolutions.fromMap
public static play.api.db.evolutions.EvolutionsReader fromMap( Map<String, List<Evolution>> evolutions) { return new SimpleEvolutionsReader(evolutions); }
java
public static play.api.db.evolutions.EvolutionsReader fromMap( Map<String, List<Evolution>> evolutions) { return new SimpleEvolutionsReader(evolutions); }
[ "public", "static", "play", ".", "api", ".", "db", ".", "evolutions", ".", "EvolutionsReader", "fromMap", "(", "Map", "<", "String", ",", "List", "<", "Evolution", ">", ">", "evolutions", ")", "{", "return", "new", "SimpleEvolutionsReader", "(", "evolutions"...
Create an evolutions reader based on a simple map of database names to evolutions. @param evolutions The map of database names to evolutions. @return the evolutions reader.
[ "Create", "an", "evolutions", "reader", "based", "on", "a", "simple", "map", "of", "database", "names", "to", "evolutions", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/persistence/play-jdbc-evolutions/src/main/java/play/db/evolutions/Evolutions.java#L56-L59
test
Creates a new EvolutionsReader from a map of evolutions.
Of course, here is the Java code you requested: ```java public static play.api.db.evolutions.EvolutionsReader fromMap( Map<String, List<Evolution>> evolutions) { return new SimpleEvolutionsReader(evolutions); } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java
RouteFieldClient.createFieldDateTimeDateAndTime
public Field createFieldDateTimeDateAndTime(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field.Type.DateTime); routeFieldParam.setTypeMetaData(Field...
java
public Field createFieldDateTimeDateAndTime(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field.Type.DateTime); routeFieldParam.setTypeMetaData(Field...
[ "public", "Field", "createFieldDateTimeDateAndTime", "(", "Field", "routeFieldParam", ")", "{", "if", "(", "routeFieldParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", "null", ")", "{", "routeFieldParam", ".", "setServiceTicket", "(", "this", ".", ...
Create a new Date and time field. @param routeFieldParam Field to Create. @return Created Field.
[ "Create", "a", "new", "Date", "and", "time", "field", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java#L226-L238
test
Create a Field for DateTime and Time.
Of course, here is the Java code you requested: ```java public Field createFieldDateTimeDateAndTime(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field...
RestComm/jain-slee
container/common/src/main/java/org/mobicents/slee/runtime/facilities/TraceFacilityImpl.java
TraceFacilityImpl.getTraceLevel
public Level getTraceLevel(ComponentID componentId) throws NullPointerException, UnrecognizedComponentException, FacilityException { checkComponentID(componentId); return this.traceLevelTable.get(componentId).getLevel(); }
java
public Level getTraceLevel(ComponentID componentId) throws NullPointerException, UnrecognizedComponentException, FacilityException { checkComponentID(componentId); return this.traceLevelTable.get(componentId).getLevel(); }
[ "public", "Level", "getTraceLevel", "(", "ComponentID", "componentId", ")", "throws", "NullPointerException", ",", "UnrecognizedComponentException", ",", "FacilityException", "{", "checkComponentID", "(", "componentId", ")", ";", "return", "this", ".", "traceLevelTable", ...
/* (non-Javadoc) @see javax.slee.facilities.TraceFacility#getTraceLevel(javax.slee.ComponentID)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/runtime/facilities/TraceFacilityImpl.java#L170-L173
test
Returns the trace level for the specified component ID.
Of course, here is the Java code you requested: ```java public Level getTraceLevel(ComponentID componentId) throws NullPointerException, UnrecognizedComponentException, FacilityException { checkComponentID(componentId); return this.traceLevelTable.get(componentId).getLevel(); } ``` Hope this helps!
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/core/SnakerEngineImpl.java
SnakerEngineImpl.executeAndJumpTask
public List<Task> executeAndJumpTask(String taskId, String operator, Map<String, Object> args, String nodeName) { Execution execution = execute(taskId, operator, args); if(execution == null) return Collections.emptyList(); ProcessModel model = execution.getProcess().getModel(); AssertHelper.notNull(model, "当前任务...
java
public List<Task> executeAndJumpTask(String taskId, String operator, Map<String, Object> args, String nodeName) { Execution execution = execute(taskId, operator, args); if(execution == null) return Collections.emptyList(); ProcessModel model = execution.getProcess().getModel(); AssertHelper.notNull(model, "当前任务...
[ "public", "List", "<", "Task", ">", "executeAndJumpTask", "(", "String", "taskId", ",", "String", "operator", ",", "Map", "<", "String", ",", "Object", ">", "args", ",", "String", "nodeName", ")", "{", "Execution", "execution", "=", "execute", "(", "taskId...
根据任务主键ID,操作人ID,参数列表执行任务,并且根据nodeName跳转到任意节点 1、nodeName为null时,则驳回至上一步处理 2、nodeName不为null时,则任意跳转,即动态创建转移
[ "根据任务主键ID,操作人ID,参数列表执行任务,并且根据nodeName跳转到任意节点", "1、nodeName为null时,则驳回至上一步处理", "2、nodeName不为null时,则任意跳转,即动态创建转移" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/core/SnakerEngineImpl.java#L316-L335
test
Execute and jump task.
Of course, here is the Java code you requested: ```java public List<Task> executeAndJumpTask(String taskId, String operator, Map<String, Object> args, String nodeName) { Execution execution = execute(taskId, operator, args); if(execution == null) return Collections.emptyList(); ProcessModel model = execution.get...
kiegroup/droolsjbpm-tools
drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/rete/model/GraphicalVertex.java
GraphicalVertex.setLocation
public void setLocation(Point newLocation) { if ( newLocation == null ) { throw new IllegalArgumentException(); } location.setLocation( newLocation ); firePropertyChange( LOCATION_PROP, null, location ); }
java
public void setLocation(Point newLocation) { if ( newLocation == null ) { throw new IllegalArgumentException(); } location.setLocation( newLocation ); firePropertyChange( LOCATION_PROP, null, location ); }
[ "public", "void", "setLocation", "(", "Point", "newLocation", ")", "{", "if", "(", "newLocation", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "location", ".", "setLocation", "(", "newLocation", ")", ";", "firePrope...
Set the Location of this vertex. @param newLocation a non-null Point instance @throws IllegalArgumentException if the parameter is null
[ "Set", "the", "Location", "of", "this", "vertex", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/rete/model/GraphicalVertex.java#L218-L226
test
Sets the location of the calendar.
Of course, here is the Java code you requested: ```java public void setLocation(Point newLocation) { if ( newLocation == null ) { throw new IllegalArgumentException(); } location.setLocation( newLocation ); firePropertyChange( LOCATION_PROP, null,...
GlenKPeterson/Paguro
src/main/java/org/organicdesign/fp/collections/PersistentHashMap.java
PersistentHashMap.emptyMutable
public static <K,V> MutableHashMap<K,V> emptyMutable(Equator<K> e) { return PersistentHashMap.<K,V>empty(e).mutable(); }
java
public static <K,V> MutableHashMap<K,V> emptyMutable(Equator<K> e) { return PersistentHashMap.<K,V>empty(e).mutable(); }
[ "public", "static", "<", "K", ",", "V", ">", "MutableHashMap", "<", "K", ",", "V", ">", "emptyMutable", "(", "Equator", "<", "K", ">", "e", ")", "{", "return", "PersistentHashMap", ".", "<", "K", ",", "V", ">", "empty", "(", "e", ")", ".", "mutab...
Works around some type inference limitations of Java 8.
[ "Works", "around", "some", "type", "inference", "limitations", "of", "Java", "8", "." ]
eac0d64b2eb9496967334f635cdb270cffb2197b
https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/PersistentHashMap.java#L138-L140
test
Empty mutable map map.
Of course, here is the Java code you requested: ```java public static <K,V> MutableHashMap<K,V> emptyMutable(Equator<K> e) { return PersistentHashMap.<K,V>empty(e).mutable(); } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ResponseBody.java
ResponseBody.addHref
public void addHref(String href) { Assert.isNotNull(href); Assert.isTrue(getLastChild(root, "propstat") == null); //$NON-NLS-1$ addChild(root, "href", encodeHref(href), fgNamesStatus, false); //$NON-NLS-1$ }
java
public void addHref(String href) { Assert.isNotNull(href); Assert.isTrue(getLastChild(root, "propstat") == null); //$NON-NLS-1$ addChild(root, "href", encodeHref(href), fgNamesStatus, false); //$NON-NLS-1$ }
[ "public", "void", "addHref", "(", "String", "href", ")", "{", "Assert", ".", "isNotNull", "(", "href", ")", ";", "Assert", ".", "isTrue", "(", "getLastChild", "(", "root", ",", "\"propstat\"", ")", "==", "null", ")", ";", "//$NON-NLS-1$", "addChild", "("...
Adds the given href to this response. If <code>setHref(String)</code> hasn't been called and no hrefs have been added, this method sets the first href and is thus equivalent to <code>setHref(String)</code>. The href must not be <code>null</code>. This response must not already be in "propstat" form. @param href the hr...
[ "Adds", "the", "given", "href", "to", "this", "response", ".", "If", "<code", ">", "setHref", "(", "String", ")", "<", "/", "code", ">", "hasn", "t", "been", "called", "and", "no", "hrefs", "have", "been", "added", "this", "method", "sets", "the", "f...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ResponseBody.java#L198-L202
test
Add a href to the resource.
Of course, here is the Java code you requested: ```java public void addHref(String href) { Assert.isNotNull(href); Assert.isTrue(getLastChild(root, "propstat") == null); //$NON-NLS-1$ addChild(root, "href", encodeHref(href), fgNamesStatus, false); //$NON-NLS-1$ } ``` Hope this helps!
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/ImmobiliareItWritingExample.java
ImmobiliareItWritingExample.createProperty
protected static Property createProperty() { // create an example real estate for rent Property obj = FACTORY.createFeedPropertiesProperty(); obj.setBuildingStatus(Status.ABITABILE); obj.setCategory(Category.COMMERCIALE); obj.setDateExpiration(Calendar.getInstance()); obj...
java
protected static Property createProperty() { // create an example real estate for rent Property obj = FACTORY.createFeedPropertiesProperty(); obj.setBuildingStatus(Status.ABITABILE); obj.setCategory(Category.COMMERCIALE); obj.setDateExpiration(Calendar.getInstance()); obj...
[ "protected", "static", "Property", "createProperty", "(", ")", "{", "// create an example real estate for rent", "Property", "obj", "=", "FACTORY", ".", "createFeedPropertiesProperty", "(", ")", ";", "obj", ".", "setBuildingStatus", "(", "Status", ".", "ABITABILE", ")...
Create a {@link Property} with some example data. @return created example object
[ "Create", "a", "{", "@link", "Property", "}", "with", "some", "example", "data", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/ImmobiliareItWritingExample.java#L140-L278
test
Creates a new instance of the class containing the properties of the entityId.
Of course, here is the Java code you requested: ```java protected static Property createProperty() { // create an example real estate for rent Property obj = FACTORY.createFeedPropertiesProperty(); obj.setBuildingStatus(Status.ABITABILE); obj.setCategory(Category.COMMERCIALE); o...
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedResponseManagerImpl.java
ODistributedResponseManagerImpl.collectResponse
public boolean collectResponse(final ODistributedResponse response) { final String executorNode = response.getExecutorNodeName(); final String senderNode = response.getSenderNodeName(); response.setDistributedResponseManager(this); synchronousResponsesLock.lock(); try { if (!executorNode.equa...
java
public boolean collectResponse(final ODistributedResponse response) { final String executorNode = response.getExecutorNodeName(); final String senderNode = response.getSenderNodeName(); response.setDistributedResponseManager(this); synchronousResponsesLock.lock(); try { if (!executorNode.equa...
[ "public", "boolean", "collectResponse", "(", "final", "ODistributedResponse", "response", ")", "{", "final", "String", "executorNode", "=", "response", ".", "getExecutorNodeName", "(", ")", ";", "final", "String", "senderNode", "=", "response", ".", "getSenderNodeNa...
Not synchronized, it's called when a message arrives @param response Received response to collect @return True if all the nodes responded, otherwise false
[ "Not", "synchronized", "it", "s", "called", "when", "a", "message", "arrives" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedResponseManagerImpl.java#L107-L193
test
Collect a response from the distributed server.
Of course, here is the Java code you requested: ```java public boolean collectResponse(final ODistributedResponse response) { final String executorNode = response.getExecutorNodeName(); final String senderNode = response.getSenderNodeName(); response.setDistributedResponseManager(this); synchronousRes...
wildfly/wildfly
naming/src/main/java/org/jboss/as/naming/util/NamingUtils.java
NamingUtils.namingException
public static NamingException namingException(final String message, final Throwable cause) { final NamingException exception = new NamingException(message); if (cause != null) exception.initCause(cause); return exception; }
java
public static NamingException namingException(final String message, final Throwable cause) { final NamingException exception = new NamingException(message); if (cause != null) exception.initCause(cause); return exception; }
[ "public", "static", "NamingException", "namingException", "(", "final", "String", "message", ",", "final", "Throwable", "cause", ")", "{", "final", "NamingException", "exception", "=", "new", "NamingException", "(", "message", ")", ";", "if", "(", "cause", "!=",...
Return a general naming exception with a root cause. @param message the message @param cause the exception cause, or {@code null} for none @return the exception
[ "Return", "a", "general", "naming", "exception", "with", "a", "root", "cause", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/util/NamingUtils.java#L149-L153
test
Create a new exception with the specified message and cause.
Of course, here is the Java code you requested: ```java public static NamingException namingException(final String message, final Throwable cause) { final NamingException exception = new NamingException(message); if (cause != null) exception.initCause(cause); return exception; } ``` Hope t...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/configuration/ConfigurationHandler.java
ConfigurationHandler.hasEachCommandInTheList
private boolean hasEachCommandInTheList(final List<ConfigCommand> commandList) { if (commandList != null) { for (ConfigCommand command : commandList) { if (command.getCommandTypeName().equalsIgnoreCase(TieConstants.COMMAND_EACH)) { return true; } } } return false; }
java
private boolean hasEachCommandInTheList(final List<ConfigCommand> commandList) { if (commandList != null) { for (ConfigCommand command : commandList) { if (command.getCommandTypeName().equalsIgnoreCase(TieConstants.COMMAND_EACH)) { return true; } } } return false; }
[ "private", "boolean", "hasEachCommandInTheList", "(", "final", "List", "<", "ConfigCommand", ">", "commandList", ")", "{", "if", "(", "commandList", "!=", "null", ")", "{", "for", "(", "ConfigCommand", "command", ":", "commandList", ")", "{", "if", "(", "com...
check whether contain each command in the list. @param commandList command list. @return true if contain each command.
[ "check", "whether", "contain", "each", "command", "in", "the", "list", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/configuration/ConfigurationHandler.java#L506-L516
test
Checks if the list of commands has each command in the list.
Of course, here is the Java code you requested: ```java private boolean hasEachCommandInTheList(final List<ConfigCommand> commandList) { if (commandList != null) { for (ConfigCommand command : commandList) { if (command.getCommandTypeName().equalsIgnoreCase(TieConstants.COMMAND_EACH)) { return true...
turbomanage/storm-gen
storm-apt/api/src/main/java/com/turbomanage/storm/DatabaseHelper.java
DatabaseHelper.restoreAllTablesFromCsv
public void restoreAllTablesFromCsv(Context ctx, SQLiteDatabase db, String suffix) { for (TableHelper table : getTableHelpers()) { table.restore(db, ctx, suffix); } }
java
public void restoreAllTablesFromCsv(Context ctx, SQLiteDatabase db, String suffix) { for (TableHelper table : getTableHelpers()) { table.restore(db, ctx, suffix); } }
[ "public", "void", "restoreAllTablesFromCsv", "(", "Context", "ctx", ",", "SQLiteDatabase", "db", ",", "String", "suffix", ")", "{", "for", "(", "TableHelper", "table", ":", "getTableHelpers", "(", ")", ")", "{", "table", ".", "restore", "(", "db", ",", "ct...
Restore all tables from CSV files, one per table @param ctx @param db @param suffix Optional filename suffix, none if null
[ "Restore", "all", "tables", "from", "CSV", "files", "one", "per", "table" ]
22caa69439548a074d035745215bce5aff55853d
https://github.com/turbomanage/storm-gen/blob/22caa69439548a074d035745215bce5aff55853d/storm-apt/api/src/main/java/com/turbomanage/storm/DatabaseHelper.java#L216-L220
test
Restore all tables from CSV file.
Of course, here is the Java code you requested: ```java public void restoreAllTablesFromCsv(Context ctx, SQLiteDatabase db, String suffix) { for (TableHelper table : getTableHelpers()) { table.restore(db, ctx, suffix); } } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/coverage2/CoverageRenderer.java
CoverageRenderer.setCoverage
public DataState setCoverage(CoverageCollection coverageDataset, Coverage grid) { this.dataState = new DataState(coverageDataset, grid); this.lastGrid = null; isNewField = true; return this.dataState; }
java
public DataState setCoverage(CoverageCollection coverageDataset, Coverage grid) { this.dataState = new DataState(coverageDataset, grid); this.lastGrid = null; isNewField = true; return this.dataState; }
[ "public", "DataState", "setCoverage", "(", "CoverageCollection", "coverageDataset", ",", "Coverage", "grid", ")", "{", "this", ".", "dataState", "=", "new", "DataState", "(", "coverageDataset", ",", "grid", ")", ";", "this", ".", "lastGrid", "=", "null", ";", ...
/* set the Grid
[ "/", "*", "set", "the", "Grid" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/coverage2/CoverageRenderer.java#L95-L100
test
Sets the coverage data.
Of course, here is the Java code you requested: ```java public DataState setCoverage(CoverageCollection coverageDataset, Coverage grid) { this.dataState = new DataState(coverageDataset, grid); this.lastGrid = null; isNewField = true; return this.dataState; } ``` Hope this helps!
OpenEstate/OpenEstate-IO
IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java
GrundstueckEmpfohleneNutzung.setMehrfamilienhaus
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setMehrfamilienhaus(JAXBElement<Object> value) { this.mehrfamilienhaus = value; }
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setMehrfamilienhaus(JAXBElement<Object> value) { this.mehrfamilienhaus = value; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:52:47+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "void", "setMehrfamilienhaus", "(", "JAXBElement", "<", "Object", ">", "value", ")", "...
Sets the value of the mehrfamilienhaus property. @param value allowed object is {@link JAXBElement }{@code <}{@link Object }{@code >}
[ "Sets", "the", "value", "of", "the", "mehrfamilienhaus", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java#L652-L655
test
Sets the value of the mehrfamilienhaus property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setMehrfamilienhaus(JAXBElement<Object> value) { this.mehrfamilienhaus = value; } ``` Hope this helps!
orientechnologies/orientdb
lucene/src/main/java/com/orientechnologies/lucene/builder/OLuceneDateTools.java
OLuceneDateTools.stringToDate
public static Date stringToDate(String dateString) throws ParseException { try { SimpleDateFormat format = RESOLUTIONS[dateString.length()].format(); return format.parse(dateString); } catch (Exception e) { OLogManager.instance().error(OLuceneDateTools.class, "Exception is suppressed, original...
java
public static Date stringToDate(String dateString) throws ParseException { try { SimpleDateFormat format = RESOLUTIONS[dateString.length()].format(); return format.parse(dateString); } catch (Exception e) { OLogManager.instance().error(OLuceneDateTools.class, "Exception is suppressed, original...
[ "public", "static", "Date", "stringToDate", "(", "String", "dateString", ")", "throws", "ParseException", "{", "try", "{", "SimpleDateFormat", "format", "=", "RESOLUTIONS", "[", "dateString", ".", "length", "(", ")", "]", ".", "format", "(", ")", ";", "retur...
Converts a string produced by <code>timeToString</code> or <code>dateToString</code> back to a time, represented as a Date object. @param dateString the date string to be converted @return the parsed time as a Date object @throws ParseException if <code>dateString</code> is not in the expected format
[ "Converts", "a", "string", "produced", "by", "<code", ">", "timeToString<", "/", "code", ">", "or", "<code", ">", "dateToString<", "/", "code", ">", "back", "to", "a", "time", "represented", "as", "a", "Date", "object", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/lucene/src/main/java/com/orientechnologies/lucene/builder/OLuceneDateTools.java#L62-L72
test
Convert a string to a Date
Of course, here is the Java code you requested: ```java public static Date stringToDate(String dateString) throws ParseException { try { SimpleDateFormat format = RESOLUTIONS[dateString.length()].format(); return format.parse(dateString); } catch (Exception e) { OLogManager.instance().error(O...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createSauna
@XmlElementDecl(namespace = "", name = "sauna") public JAXBElement<Boolean> createSauna(Boolean value) { return new JAXBElement<Boolean>(_Sauna_QNAME, Boolean.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "sauna") public JAXBElement<Boolean> createSauna(Boolean value) { return new JAXBElement<Boolean>(_Sauna_QNAME, Boolean.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"sauna\"", ")", "public", "JAXBElement", "<", "Boolean", ">", "createSauna", "(", "Boolean", "value", ")", "{", "return", "new", "JAXBElement", "<", "Boolean", ">", "(", "_Sauna_QNAME"...
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#L2733-L2736
test
Create an instance of the Sauna JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "sauna") public JAXBElement<Boolean> createSauna(Boolean value) { return new JAXBElement<Boolean>(_Sauna_QNAME, Boolean.class, null, value); } ``` Hope this helps!
cloudbees/extensibility-api
src/main/java/com/cloudbees/sdk/extensibility/ExtensionFinder.java
ExtensionFinder.bind
protected <T> void bind(Class<? extends T> impl, Class<T> extensionPoint) { ExtensionLoaderModule<T> lm = createLoaderModule(extensionPoint); lm.init(impl,extensionPoint); install(lm); }
java
protected <T> void bind(Class<? extends T> impl, Class<T> extensionPoint) { ExtensionLoaderModule<T> lm = createLoaderModule(extensionPoint); lm.init(impl,extensionPoint); install(lm); }
[ "protected", "<", "T", ">", "void", "bind", "(", "Class", "<", "?", "extends", "T", ">", "impl", ",", "Class", "<", "T", ">", "extensionPoint", ")", "{", "ExtensionLoaderModule", "<", "T", ">", "lm", "=", "createLoaderModule", "(", "extensionPoint", ")",...
Allows the subtype to be selective about what to bind.
[ "Allows", "the", "subtype", "to", "be", "selective", "about", "what", "to", "bind", "." ]
10f508fdaaba1eda0fd44f70c457dbea74ffaac7
https://github.com/cloudbees/extensibility-api/blob/10f508fdaaba1eda0fd44f70c457dbea74ffaac7/src/main/java/com/cloudbees/sdk/extensibility/ExtensionFinder.java#L73-L77
test
Binds an extension class to the specified extension point.
Of course, here is the Java code you requested: ```java protected <T> void bind(Class<? extends T> impl, Class<T> extensionPoint) { ExtensionLoaderModule<T> lm = createLoaderModule(extensionPoint); lm.init(impl,extensionPoint); install(lm); } ``` Hope this helps!
spring-projects/spring-security
taglibs/src/main/java/org/springframework/security/taglibs/authz/JspAuthorizeTag.java
JspAuthorizeTag.doEndTag
public int doEndTag() throws JspException { try { if (!authorized && TagLibConfig.isUiSecurityDisabled()) { pageContext.getOut().write(TagLibConfig.getSecuredUiSuffix()); } } catch (IOException e) { throw new JspException(e); } return EVAL_PAGE; }
java
public int doEndTag() throws JspException { try { if (!authorized && TagLibConfig.isUiSecurityDisabled()) { pageContext.getOut().write(TagLibConfig.getSecuredUiSuffix()); } } catch (IOException e) { throw new JspException(e); } return EVAL_PAGE; }
[ "public", "int", "doEndTag", "(", ")", "throws", "JspException", "{", "try", "{", "if", "(", "!", "authorized", "&&", "TagLibConfig", ".", "isUiSecurityDisabled", "(", ")", ")", "{", "pageContext", ".", "getOut", "(", ")", ".", "write", "(", "TagLibConfig"...
Default processing of the end tag returning EVAL_PAGE. @return EVAL_PAGE @see Tag#doEndTag()
[ "Default", "processing", "of", "the", "end", "tag", "returning", "EVAL_PAGE", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/taglibs/src/main/java/org/springframework/security/taglibs/authz/JspAuthorizeTag.java#L100-L111
test
Write the UI suffix to the output stream.
Of course, here is the Java code you requested: ```java public int doEndTag() throws JspException { try { if (!authorized && TagLibConfig.isUiSecurityDisabled()) { pageContext.getOut().write(TagLibConfig.getSecuredUiSuffix()); } } catch (IOException e) { throw new JspException(e); } return EVAL...
ReactiveX/RxJava
src/main/java/io/reactivex/Maybe.java
Maybe.delay
@CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Maybe<T> delay(long delay, TimeUnit unit) { return delay(delay, unit, Schedulers.computation()); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Maybe<T> delay(long delay, TimeUnit unit) { return delay(delay, unit, Schedulers.computation()); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "COMPUTATION", ")", "public", "final", "Maybe", "<", "T", ">", "delay", "(", "long", "delay", ",", "TimeUnit", "unit", ")", "{", "return", "delay", "(", "delay", ",", "unit", "...
Returns a Maybe that signals the events emitted by the source Maybe shifted forward in time by a specified delay. <p> <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delay.png" alt=""> <dl> <dt><b>Scheduler:</b></dt> <dd>This version of {@code delay} operates by defau...
[ "Returns", "a", "Maybe", "that", "signals", "the", "events", "emitted", "by", "the", "source", "Maybe", "shifted", "forward", "in", "time", "by", "a", "specified", "delay", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "310", "src", "=", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L2557-L2561
test
Delay a sequence of tokens to be generated by a CID .
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Maybe<T> delay(long delay, TimeUnit unit) { return delay(delay, unit, Schedulers.computation()); } ``` Hope this helps!
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/component/EJBComponentDescription.java
EJBComponentDescription.addEJBSuspendHandlerDependency
protected void addEJBSuspendHandlerDependency() { getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration componentConfiguration) throws DeploymentUnitP...
java
protected void addEJBSuspendHandlerDependency() { getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration componentConfiguration) throws DeploymentUnitP...
[ "protected", "void", "addEJBSuspendHandlerDependency", "(", ")", "{", "getConfigurators", "(", ")", ".", "add", "(", "new", "ComponentConfigurator", "(", ")", "{", "@", "Override", "public", "void", "configure", "(", "final", "DeploymentPhaseContext", "context", "...
Sets up a {@link ComponentConfigurator} which then sets up the dependency on the EJBSuspendHandlerService service for the {@link EJBComponentCreateService}
[ "Sets", "up", "a", "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/component/EJBComponentDescription.java#L583-L596
test
Add EJBSuspendHandlerDependency to the deployment.
Of course, here is the Java code you requested: ```java protected void addEJBSuspendHandlerDependency() { getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentCon...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/collection/GribCollectionMutable.java
GribCollectionMutable.setOrgDirectory
File setOrgDirectory(String orgDirectory) { this.orgDirectory = orgDirectory; directory = new File(orgDirectory); if (!directory.exists()) { File indexFile = new File(indexFilename); File parent = indexFile.getParentFile(); if (parent.exists()) directory = parent; } return ...
java
File setOrgDirectory(String orgDirectory) { this.orgDirectory = orgDirectory; directory = new File(orgDirectory); if (!directory.exists()) { File indexFile = new File(indexFilename); File parent = indexFile.getParentFile(); if (parent.exists()) directory = parent; } return ...
[ "File", "setOrgDirectory", "(", "String", "orgDirectory", ")", "{", "this", ".", "orgDirectory", "=", "orgDirectory", ";", "directory", "=", "new", "File", "(", "orgDirectory", ")", ";", "if", "(", "!", "directory", ".", "exists", "(", ")", ")", "{", "Fi...
set from GribCollectionBuilderFromIndex.readFromIndex()
[ "set", "from", "GribCollectionBuilderFromIndex", ".", "readFromIndex", "()" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/collection/GribCollectionMutable.java#L213-L223
test
Set the org directory.
Of course, here is the Java code you requested: ```java File setOrgDirectory(String orgDirectory) { this.orgDirectory = orgDirectory; directory = new File(orgDirectory); if (!directory.exists()) { File indexFile = new File(indexFilename); File parent = indexFile.getParentFile(); if (paren...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/DefaultProcessorProvider.java
DefaultProcessorProvider.toPostProcessors
private Map<String, ResourcePostProcessor> toPostProcessors( final Map<String, ResourcePreProcessor> preProcessorsMap) { final Map<String, ResourcePostProcessor> map = new HashMap<String, ResourcePostProcessor>(); for (final Entry<String, ResourcePreProcessor> entry : preProcessorsMap.entrySet()) { ...
java
private Map<String, ResourcePostProcessor> toPostProcessors( final Map<String, ResourcePreProcessor> preProcessorsMap) { final Map<String, ResourcePostProcessor> map = new HashMap<String, ResourcePostProcessor>(); for (final Entry<String, ResourcePreProcessor> entry : preProcessorsMap.entrySet()) { ...
[ "private", "Map", "<", "String", ",", "ResourcePostProcessor", ">", "toPostProcessors", "(", "final", "Map", "<", "String", ",", "ResourcePreProcessor", ">", "preProcessorsMap", ")", "{", "final", "Map", "<", "String", ",", "ResourcePostProcessor", ">", "map", "...
Creates a map of postProcessors form a map of preProcessors. This method will be removed in 1.5.0 release when there will be no differences between pre & post processor interface.
[ "Creates", "a", "map", "of", "postProcessors", "form", "a", "map", "of", "preProcessors", ".", "This", "method", "will", "be", "removed", "in", "1", ".", "5", ".", "0", "release", "when", "there", "will", "be", "no", "differences", "between", "pre", "&",...
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/DefaultProcessorProvider.java#L58-L65
test
To post processors map.
Of course, here is the Java code you requested: ```java private Map<String, ResourcePostProcessor> toPostProcessors( final Map<String, ResourcePreProcessor> preProcessorsMap) { final Map<String, ResourcePostProcessor> map = new HashMap<String, ResourcePostProcessor>(); for (final Entry<String, ResourcePr...
GojaFramework/goja
goja-core/src/main/java/goja/core/Validator.java
Validator.isBlank
public static boolean isBlank(Object value) { if (value instanceof Collection) { return ((Collection) value).isEmpty(); } else if (value instanceof String) { return "".equals(value.toString().trim()); } else { return value == null; } }
java
public static boolean isBlank(Object value) { if (value instanceof Collection) { return ((Collection) value).isEmpty(); } else if (value instanceof String) { return "".equals(value.toString().trim()); } else { return value == null; } }
[ "public", "static", "boolean", "isBlank", "(", "Object", "value", ")", "{", "if", "(", "value", "instanceof", "Collection", ")", "{", "return", "(", "(", "Collection", ")", "value", ")", ".", "isEmpty", "(", ")", ";", "}", "else", "if", "(", "value", ...
Blank @param value value @return boolean
[ "Blank" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/Validator.java#L303-L311
test
Check if the value is blank.
Of course, here is the Java code you requested: ```java public static boolean isBlank(Object value) { if (value instanceof Collection) { return ((Collection) value).isEmpty(); } else if (value instanceof String) { return "".equals(value.toString().trim()); } else { ...
lessthanoptimal/GeoRegression
main/src/georegression/transform/se/SePointOps_F64.java
SePointOps_F64.transform
public static Point3D_F64 transform( Se3_F64 se, Point3D_F64 origPt, Point3D_F64 tranPt ) { if( tranPt == null ) tranPt = new Point3D_F64(); DMatrixRMaj R = se.getR(); Vector3D_F64 T = se.getT(); GeometryMath_F64.mult( R, origPt, tranPt ); GeometryMath_F64.add( tranPt, T, tranPt ); return tranPt; }
java
public static Point3D_F64 transform( Se3_F64 se, Point3D_F64 origPt, Point3D_F64 tranPt ) { if( tranPt == null ) tranPt = new Point3D_F64(); DMatrixRMaj R = se.getR(); Vector3D_F64 T = se.getT(); GeometryMath_F64.mult( R, origPt, tranPt ); GeometryMath_F64.add( tranPt, T, tranPt ); return tranPt; }
[ "public", "static", "Point3D_F64", "transform", "(", "Se3_F64", "se", ",", "Point3D_F64", "origPt", ",", "Point3D_F64", "tranPt", ")", "{", "if", "(", "tranPt", "==", "null", ")", "tranPt", "=", "new", "Point3D_F64", "(", ")", ";", "DMatrixRMaj", "R", "=",...
<p>. Applies the transform specified by SpecialEuclidean to a point.<br> <br> p' = R*p + T </p> <p> Both origPt and tranPt can be the same instance. </p> @param se SpecialEuclidean transform. Not modified. @param origPt Original coordinate of the point. Not modified. @param tranPt Storage for transformed coordinate o...
[ "<p", ">", ".", "Applies", "the", "transform", "specified", "by", "SpecialEuclidean", "to", "a", "point", ".", "<br", ">", "<br", ">", "p", "=", "R", "*", "p", "+", "T", "<", "/", "p", ">", "<p", ">", "Both", "origPt", "and", "tranPt", "can", "be...
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/transform/se/SePointOps_F64.java#L190-L201
test
Transforms the origPt into the tranPt.
Of course, here is the Java code you requested: ```java public static Point3D_F64 transform( Se3_F64 se, Point3D_F64 origPt, Point3D_F64 tranPt ) { if( tranPt == null ) tranPt = new Point3D_F64(); DMatrixRMaj R = se.getR(); Vector3D_F64 T = se.getT(); GeometryMath_F64.mult( R, origPt, tranPt ); Geometry...
real-logic/aeron
aeron-archive/src/main/java/io/aeron/archive/client/ArchiveProxy.java
ArchiveProxy.listRecordingSubscriptions
public boolean listRecordingSubscriptions( final int pseudoIndex, final int subscriptionCount, final String channelFragment, final int streamId, final boolean applyStreamId, final long correlationId, final long controlSessionId) { listRecordingSubscrip...
java
public boolean listRecordingSubscriptions( final int pseudoIndex, final int subscriptionCount, final String channelFragment, final int streamId, final boolean applyStreamId, final long correlationId, final long controlSessionId) { listRecordingSubscrip...
[ "public", "boolean", "listRecordingSubscriptions", "(", "final", "int", "pseudoIndex", ",", "final", "int", "subscriptionCount", ",", "final", "String", "channelFragment", ",", "final", "int", "streamId", ",", "final", "boolean", "applyStreamId", ",", "final", "long...
List registered subscriptions in the archive which have been used to record streams. @param pseudoIndex in the list of active recording subscriptions. @param subscriptionCount for the number of descriptors to be listed. @param channelFragment for a contains match on the stripped channel used with the registere...
[ "List", "registered", "subscriptions", "in", "the", "archive", "which", "have", "been", "used", "to", "record", "streams", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-archive/src/main/java/io/aeron/archive/client/ArchiveProxy.java#L542-L562
test
List recording subscriptions.
Of course, here is the Java code you requested: ```java public boolean listRecordingSubscriptions( final int pseudoIndex, final int subscriptionCount, final String channelFragment, final int streamId, final boolean applyStreamId, final long correlationId, final l...
oblac/jodd
jodd-db/src/main/java/jodd/db/type/URLSqlType.java
URLSqlType.get
@Override public URL get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException { return rs.getURL(index); }
java
@Override public URL get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException { return rs.getURL(index); }
[ "@", "Override", "public", "URL", "get", "(", "final", "ResultSet", "rs", ",", "final", "int", "index", ",", "final", "int", "dbSqlType", ")", "throws", "SQLException", "{", "return", "rs", ".", "getURL", "(", "index", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/type/URLSqlType.java#L38-L41
test
Get a URL from a ResultSet.
Of course, here is the Java code you requested: ```java @Override public URL get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException { return rs.getURL(index); } ``` Hope this helps!
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/ViewConfiguration.java
ViewConfiguration.addViewInterceptor
public void addViewInterceptor(InterceptorFactory interceptorFactory, int priority) { for (Method method : proxyFactory.getCachedMethods()) { addViewInterceptor(method, interceptorFactory, priority); } }
java
public void addViewInterceptor(InterceptorFactory interceptorFactory, int priority) { for (Method method : proxyFactory.getCachedMethods()) { addViewInterceptor(method, interceptorFactory, priority); } }
[ "public", "void", "addViewInterceptor", "(", "InterceptorFactory", "interceptorFactory", ",", "int", "priority", ")", "{", "for", "(", "Method", "method", ":", "proxyFactory", ".", "getCachedMethods", "(", ")", ")", "{", "addViewInterceptor", "(", "method", ",", ...
Adds an interceptor factory to all methods of a view @param interceptorFactory The factory to add @param priority The interceptor order
[ "Adds", "an", "interceptor", "factory", "to", "all", "methods", "of", "a", "view" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ViewConfiguration.java#L118-L122
test
Add view interceptor to all cached methods
Of course, here is the Java code you requested: ```java public void addViewInterceptor(InterceptorFactory interceptorFactory, int priority) { for (Method method : proxyFactory.getCachedMethods()) { addViewInterceptor(method, interceptorFactory, priority); } } ``` Hope this helps!
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/MethodVisitor.java
MethodVisitor.visitLocalVariableAnnotation
public AnnotationVisitor visitLocalVariableAnnotation( final int typeRef, final TypePath typePath, final Label[] start, final Label[] end, final int[] index, final String descriptor, final boolean visible) { if (api < Opcodes.ASM5) { throw new UnsupportedOperationExce...
java
public AnnotationVisitor visitLocalVariableAnnotation( final int typeRef, final TypePath typePath, final Label[] start, final Label[] end, final int[] index, final String descriptor, final boolean visible) { if (api < Opcodes.ASM5) { throw new UnsupportedOperationExce...
[ "public", "AnnotationVisitor", "visitLocalVariableAnnotation", "(", "final", "int", "typeRef", ",", "final", "TypePath", "typePath", ",", "final", "Label", "[", "]", "start", ",", "final", "Label", "[", "]", "end", ",", "final", "int", "[", "]", "index", ","...
Visits an annotation on a local variable type. @param typeRef a reference to the annotated type. The sort of this type reference must be {@link TypeReference#LOCAL_VARIABLE} or {@link TypeReference#RESOURCE_VARIABLE}. See {@link TypeReference}. @param typePath the path to the annotated type argument, wildcard bound, a...
[ "Visits", "an", "annotation", "on", "a", "local", "variable", "type", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/MethodVisitor.java#L727-L743
test
Visits a local variable annotation.
Of course, here is the Java code you requested: ```java public AnnotationVisitor visitLocalVariableAnnotation( final int typeRef, final TypePath typePath, final Label[] start, final Label[] end, final int[] index, final String descriptor, final boolean visible) { if (api <...
oblac/jodd
jodd-core/src/main/java/jodd/buffer/FastLongBuffer.java
FastLongBuffer.append
public FastLongBuffer append(final FastLongBuffer buff) { if (buff.offset == 0) { return this; } append(buff.buffer, 0, buff.offset); return this; }
java
public FastLongBuffer append(final FastLongBuffer buff) { if (buff.offset == 0) { return this; } append(buff.buffer, 0, buff.offset); return this; }
[ "public", "FastLongBuffer", "append", "(", "final", "FastLongBuffer", "buff", ")", "{", "if", "(", "buff", ".", "offset", "==", "0", ")", "{", "return", "this", ";", "}", "append", "(", "buff", ".", "buffer", ",", "0", ",", "buff", ".", "offset", ")"...
Appends another fast buffer to this one.
[ "Appends", "another", "fast", "buffer", "to", "this", "one", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/buffer/FastLongBuffer.java#L104-L110
test
Append the contents of the specified FastLongBuffer to this FastLongBuffer.
Of course, here is the Java code you requested: ```java public FastLongBuffer append(final FastLongBuffer buff) { if (buff.offset == 0) { return this; } append(buff.buffer, 0, buff.offset); return this; } ``` Hope this helps!
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/retrieval/ConceptSearchResult.java
ConceptSearchResult.setConcept
public void setConcept(Concept v) { if (ConceptSearchResult_Type.featOkTst && ((ConceptSearchResult_Type)jcasType).casFeat_concept == null) jcasType.jcas.throwFeatMissing("concept", "edu.cmu.lti.oaqa.type.retrieval.ConceptSearchResult"); jcasType.ll_cas.ll_setRefValue(addr, ((ConceptSearchResult_Type)jcas...
java
public void setConcept(Concept v) { if (ConceptSearchResult_Type.featOkTst && ((ConceptSearchResult_Type)jcasType).casFeat_concept == null) jcasType.jcas.throwFeatMissing("concept", "edu.cmu.lti.oaqa.type.retrieval.ConceptSearchResult"); jcasType.ll_cas.ll_setRefValue(addr, ((ConceptSearchResult_Type)jcas...
[ "public", "void", "setConcept", "(", "Concept", "v", ")", "{", "if", "(", "ConceptSearchResult_Type", ".", "featOkTst", "&&", "(", "(", "ConceptSearchResult_Type", ")", "jcasType", ")", ".", "casFeat_concept", "==", "null", ")", "jcasType", ".", "jcas", ".", ...
setter for concept - sets The relevant concept searched in the ontology. @generated @param v value to set into the feature
[ "setter", "for", "concept", "-", "sets", "The", "relevant", "concept", "searched", "in", "the", "ontology", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/retrieval/ConceptSearchResult.java#L83-L86
test
setter for concept - sets
Of course, here is the Java code you requested: ```java public void setConcept(Concept v) { if (ConceptSearchResult_Type.featOkTst && ((ConceptSearchResult_Type)jcasType).casFeat_concept == null) jcasType.jcas.throwFeatMissing("concept", "edu.cmu.lti.oaqa.type.retrieval.ConceptSearchResult"); jcasType.ll...
boonproject/boon
boon/src/main/java/org/boon/core/reflection/MapObjectConversion.java
MapObjectConversion.toMap
public static Map<String, Object> toMap( final Object object, Set<String> ignore ) { return new MapperComplex(ignore).toMap(object); }
java
public static Map<String, Object> toMap( final Object object, Set<String> ignore ) { return new MapperComplex(ignore).toMap(object); }
[ "public", "static", "Map", "<", "String", ",", "Object", ">", "toMap", "(", "final", "Object", "object", ",", "Set", "<", "String", ">", "ignore", ")", "{", "return", "new", "MapperComplex", "(", "ignore", ")", ".", "toMap", "(", "object", ")", ";", ...
This could be refactored to use core.TypeType class and it would run faster. Converts an object into a map @param object the object that we want to convert @param ignore the map @return map map representation of the object
[ "This", "could", "be", "refactored", "to", "use", "core", ".", "TypeType", "class", "and", "it", "would", "run", "faster", ".", "Converts", "an", "object", "into", "a", "map" ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/core/reflection/MapObjectConversion.java#L246-L250
test
Convert an object to a map.
Of course, here is the Java code you requested: ```java public static Map<String, Object> toMap( final Object object, Set<String> ignore ) { return new MapperComplex(ignore).toMap(object); } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.kie.eclipse.navigator/src/main/java/org/kie/eclipse/navigator/preferences/FieldEditorPropertyPage.java
FieldEditorPropertyPage.setVisible
@Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible && invalidFieldEditor != null) { invalidFieldEditor.setFocus(); } }
java
@Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible && invalidFieldEditor != null) { invalidFieldEditor.setFocus(); } }
[ "@", "Override", "public", "void", "setVisible", "(", "boolean", "visible", ")", "{", "super", ".", "setVisible", "(", "visible", ")", ";", "if", "(", "visible", "&&", "invalidFieldEditor", "!=", "null", ")", "{", "invalidFieldEditor", ".", "setFocus", "(", ...
/* (non-Javadoc) Method declared on IDialog.
[ "/", "*", "(", "non", "-", "Javadoc", ")", "Method", "declared", "on", "IDialog", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse.navigator/src/main/java/org/kie/eclipse/navigator/preferences/FieldEditorPropertyPage.java#L340-L346
test
Override this method to set the visible state of the invalid field editor.
Of course, here is the Java code you requested: ```java @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible && invalidFieldEditor != null) { invalidFieldEditor.setFocus(); } } ``` Hope this helps!
zalando-stups/fullstop
fullstop-aws-support/fullstop-aws-cloudtrail-support/src/main/java/org/zalando/stups/fullstop/events/CloudTrailEventSupport.java
CloudTrailEventSupport.getInstanceIds
public static List<String> getInstanceIds(final CloudTrailEvent event) { final CloudTrailEventData eventData = getEventData(event); final String responseElements = eventData.getResponseElements(); if (isNullOrEmpty(responseElements)) { return newArrayList(); } retu...
java
public static List<String> getInstanceIds(final CloudTrailEvent event) { final CloudTrailEventData eventData = getEventData(event); final String responseElements = eventData.getResponseElements(); if (isNullOrEmpty(responseElements)) { return newArrayList(); } retu...
[ "public", "static", "List", "<", "String", ">", "getInstanceIds", "(", "final", "CloudTrailEvent", "event", ")", "{", "final", "CloudTrailEventData", "eventData", "=", "getEventData", "(", "event", ")", ";", "final", "String", "responseElements", "=", "eventData",...
Extracts list of instanceIds from {@link CloudTrailEvent}s 'responseElements'.
[ "Extracts", "list", "of", "instanceIds", "from", "{" ]
42f3bab557380aab0114028b58d745e3000897e8
https://github.com/zalando-stups/fullstop/blob/42f3bab557380aab0114028b58d745e3000897e8/fullstop-aws-support/fullstop-aws-cloudtrail-support/src/main/java/org/zalando/stups/fullstop/events/CloudTrailEventSupport.java#L59-L69
test
Gets the instance ids from the CloudTrail event.
Of course, here is the Java code you requested: ```java public static List<String> getInstanceIds(final CloudTrailEvent event) { final CloudTrailEventData eventData = getEventData(event); final String responseElements = eventData.getResponseElements(); if (isNullOrEmpty(responseElements)) { ...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/ClassLookupHelper.java
ClassLookupHelper.getClasses
public static Set<Class<?>> getClasses(String packageName, boolean recursive, ClassFileFilter filter) { if (packageName == null || packageName.length() == 0) { throw new IllegalArgumentException("packageName is empty."); } ClassLoader loader = Thread.currentThread().getContextClassL...
java
public static Set<Class<?>> getClasses(String packageName, boolean recursive, ClassFileFilter filter) { if (packageName == null || packageName.length() == 0) { throw new IllegalArgumentException("packageName is empty."); } ClassLoader loader = Thread.currentThread().getContextClassL...
[ "public", "static", "Set", "<", "Class", "<", "?", ">", ">", "getClasses", "(", "String", "packageName", ",", "boolean", "recursive", ",", "ClassFileFilter", "filter", ")", "{", "if", "(", "packageName", "==", "null", "||", "packageName", ".", "length", "(...
从指定 package 中获取所有的 Class @param packageName 包名 @param recursive 是否递归查找 @param filter class 过滤器 @return 所有找到的 Class
[ "从指定", "package", "中获取所有的", "Class" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/ClassLookupHelper.java#L92-L117
test
Gets all classes in a package.
Of course, here is the Java code you requested: ```java public static Set<Class<?>> getClasses(String packageName, boolean recursive, ClassFileFilter filter) { if (packageName == null || packageName.length() == 0) { throw new IllegalArgumentException("packageName is empty."); } Cla...
spring-projects/spring-security
samples/boot/oauth2resourceserver-multitenancy/src/main/java/org/springframework/boot/env/MockWebServerPropertySource.java
MockWebServerPropertySource.getUrl
private String getUrl() { MockWebServer mockWebServer = getSource(); if (!this.started) { intializeMockWebServer(mockWebServer); } String url = mockWebServer.url("").url().toExternalForm(); return url.substring(0, url.length() - 1); }
java
private String getUrl() { MockWebServer mockWebServer = getSource(); if (!this.started) { intializeMockWebServer(mockWebServer); } String url = mockWebServer.url("").url().toExternalForm(); return url.substring(0, url.length() - 1); }
[ "private", "String", "getUrl", "(", ")", "{", "MockWebServer", "mockWebServer", "=", "getSource", "(", ")", ";", "if", "(", "!", "this", ".", "started", ")", "{", "intializeMockWebServer", "(", "mockWebServer", ")", ";", "}", "String", "url", "=", "mockWeb...
Get's the URL (i.e. "http://localhost:123456") @return
[ "Get", "s", "the", "URL", "(", "i", ".", "e", ".", "http", ":", "//", "localhost", ":", "123456", ")" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/samples/boot/oauth2resourceserver-multitenancy/src/main/java/org/springframework/boot/env/MockWebServerPropertySource.java#L126-L133
test
Get the URL of the mock web server.
Of course, here is the Java code you requested: ```java private String getUrl() { MockWebServer mockWebServer = getSource(); if (!this.started) { intializeMockWebServer(mockWebServer); } String url = mockWebServer.url("").url().toExternalForm(); return url.substring(0, url.length() - 1); } ``` Hope this...
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/mathutils/BigFunctions.java
BigFunctions.exp
public static BigDecimal exp (final BigDecimal x, final int scale) { // e^0 = 1 if (x.signum () == 0) { return BigDecimal.ONE; } // If x is negative, return 1/(e^-x). if (x.signum () == -1) { return BigDecimal.ONE.divide (exp (x.negate (), scale), scale, RoundingMode.HALF_EVEN...
java
public static BigDecimal exp (final BigDecimal x, final int scale) { // e^0 = 1 if (x.signum () == 0) { return BigDecimal.ONE; } // If x is negative, return 1/(e^-x). if (x.signum () == -1) { return BigDecimal.ONE.divide (exp (x.negate (), scale), scale, RoundingMode.HALF_EVEN...
[ "public", "static", "BigDecimal", "exp", "(", "final", "BigDecimal", "x", ",", "final", "int", "scale", ")", "{", "// e^0 = 1", "if", "(", "x", ".", "signum", "(", ")", "==", "0", ")", "{", "return", "BigDecimal", ".", "ONE", ";", "}", "// If x is nega...
Compute e^x to a given scale. Break x into its whole and fraction parts and compute (e^(1 + fraction/whole))^whole using Taylor's formula. @param x the value of x @param scale the desired scale of the result @return the result value
[ "Compute", "e^x", "to", "a", "given", "scale", ".", "Break", "x", "into", "its", "whole", "and", "fraction", "parts", "and", "compute", "(", "e^", "(", "1", "+", "fraction", "/", "whole", "))", "^whole", "using", "Taylor", "s", "formula", "." ]
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/mathutils/BigFunctions.java#L146-L190
test
Compute the exponential of x.
Of course, here is the Java code you requested: ```java public static BigDecimal exp (final BigDecimal x, final int scale) { // e^0 = 1 if (x.signum () == 0) { return BigDecimal.ONE; } // If x is negative, return 1/(e^-x). if (x.signum () == -1) { return BigDecimal.ONE.divide...
subchen/jetbrick-all-1x
jetbrick-webmvc/src/main/java/jetbrick/web/mvc/multipart/FileUploaderUtils.java
FileUploaderUtils.asHtml5Request
private static MultipartRequest asHtml5Request(HttpServletRequest request) throws Exception { String originalFilename = request.getHeader("content-disposition"); if (originalFilename == null) { throw new ServletException("The request is not a html5 file upload request."); } o...
java
private static MultipartRequest asHtml5Request(HttpServletRequest request) throws Exception { String originalFilename = request.getHeader("content-disposition"); if (originalFilename == null) { throw new ServletException("The request is not a html5 file upload request."); } o...
[ "private", "static", "MultipartRequest", "asHtml5Request", "(", "HttpServletRequest", "request", ")", "throws", "Exception", "{", "String", "originalFilename", "=", "request", ".", "getHeader", "(", "\"content-disposition\"", ")", ";", "if", "(", "originalFilename", "...
application/octet-stream
[ "application", "/", "octet", "-", "stream" ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-webmvc/src/main/java/jetbrick/web/mvc/multipart/FileUploaderUtils.java#L105-L130
test
As html5 request.
Of course, here is the Java code you requested: ```java private static MultipartRequest asHtml5Request(HttpServletRequest request) throws Exception { String originalFilename = request.getHeader("content-disposition"); if (originalFilename == null) { throw new ServletException("The request i...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib1/Grib1Record.java
Grib1Record.readRawData
public int[] readRawData(RandomAccessFile raf) throws IOException { Grib1Gds gds = getGDS(); Grib1DataReader reader = new Grib1DataReader(pdss.getDecimalScale(), gds.getScanMode(), gds.getNxRaw(), gds.getNyRaw(), gds.getNpts(), dataSection.getStartingPosition()); byte[] bm = (bitmap == null) ? null : bit...
java
public int[] readRawData(RandomAccessFile raf) throws IOException { Grib1Gds gds = getGDS(); Grib1DataReader reader = new Grib1DataReader(pdss.getDecimalScale(), gds.getScanMode(), gds.getNxRaw(), gds.getNyRaw(), gds.getNpts(), dataSection.getStartingPosition()); byte[] bm = (bitmap == null) ? null : bit...
[ "public", "int", "[", "]", "readRawData", "(", "RandomAccessFile", "raf", ")", "throws", "IOException", "{", "Grib1Gds", "gds", "=", "getGDS", "(", ")", ";", "Grib1DataReader", "reader", "=", "new", "Grib1DataReader", "(", "pdss", ".", "getDecimalScale", "(", ...
debugging - do not use
[ "debugging", "-", "do", "not", "use" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib1/Grib1Record.java#L248-L253
test
Read the raw data from the file.
Of course, here is the Java code you requested: ```java public int[] readRawData(RandomAccessFile raf) throws IOException { Grib1Gds gds = getGDS(); Grib1DataReader reader = new Grib1DataReader(pdss.getDecimalScale(), gds.getScanMode(), gds.getNxRaw(), gds.getNyRaw(), gds.getNpts(), dataSection.getStartingPo...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/joran/action/AppenderAction.java
AppenderAction.begin
@SuppressWarnings("unchecked") public void begin(InterpretationContext ec, String localName, Attributes attributes) throws ActionException { // We are just beginning, reset variables appender = null; inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper....
java
@SuppressWarnings("unchecked") public void begin(InterpretationContext ec, String localName, Attributes attributes) throws ActionException { // We are just beginning, reset variables appender = null; inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper....
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "begin", "(", "InterpretationContext", "ec", ",", "String", "localName", ",", "Attributes", "attributes", ")", "throws", "ActionException", "{", "// We are just beginning, reset variables", "appender", ...
Instantiates an appender of the given class and sets its name. The appender thus generated is placed in the {@link InterpretationContext}'s appender bag.
[ "Instantiates", "an", "appender", "of", "the", "given", "class", "and", "sets", "its", "name", "." ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/joran/action/AppenderAction.java#L38-L87
test
Begin processing the appender.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public void begin(InterpretationContext ec, String localName, Attributes attributes) throws ActionException { // We are just beginning, reset variables appender = null; inError = false; String className = at...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.concatMapMaybeDelayError
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper) { return concatMapMaybeDelayError(mapper, true, 2); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper) { return concatMapMaybeDelayError(mapper, true, 2); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Observable", "<", "R", ">", "concatMapMaybeDelayError", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "MaybeSource",...
Maps the upstream items into {@link MaybeSource}s and subscribes to them one after the other terminates, emits their success value if available and delaying all errors till both this {@code Observable} and all inner {@code MaybeSource}s terminate. <p> <img width="640" height="305" src="https://raw.github.com/wiki/React...
[ "Maps", "the", "upstream", "items", "into", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L6936-L6940
test
Concatenates the source MaybeSource to an observable using the provided function.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper) { return concatMapMaybeDelayError(mapper, true, 2); } ``` Hope ...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/ModuleVisitor.java
ModuleVisitor.visitProvide
public void visitProvide(final String service, final String... providers) { if (mv != null) { mv.visitProvide(service, providers); } }
java
public void visitProvide(final String service, final String... providers) { if (mv != null) { mv.visitProvide(service, providers); } }
[ "public", "void", "visitProvide", "(", "final", "String", "service", ",", "final", "String", "...", "providers", ")", "{", "if", "(", "mv", "!=", "null", ")", "{", "mv", ".", "visitProvide", "(", "service", ",", "providers", ")", ";", "}", "}" ]
Visit an implementation of a service. @param service the internal name of the service. @param providers the internal names of the implementations of the service (there is at least one provider).
[ "Visit", "an", "implementation", "of", "a", "service", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ModuleVisitor.java#L159-L163
test
Visit a provide.
Of course, here is the Java code you requested: ```java public void visitProvide(final String service, final String... providers) { if (mv != null) { mv.visitProvide(service, providers); } } ``` Hope this helps!
rest-assured/rest-assured
xml-path/src/main/java/io/restassured/path/xml/config/XmlPathConfig.java
XmlPathConfig.features
public XmlPathConfig features(Map<String, Boolean> features) { Validate.notNull(features, "Features cannot be null"); return new XmlPathConfig(jaxbObjectMapperFactory, defaultParserType, defaultDeserializer, charset, features, declaredNamespaces, properties, validating, namespaceAware, a...
java
public XmlPathConfig features(Map<String, Boolean> features) { Validate.notNull(features, "Features cannot be null"); return new XmlPathConfig(jaxbObjectMapperFactory, defaultParserType, defaultDeserializer, charset, features, declaredNamespaces, properties, validating, namespaceAware, a...
[ "public", "XmlPathConfig", "features", "(", "Map", "<", "String", ",", "Boolean", ">", "features", ")", "{", "Validate", ".", "notNull", "(", "features", ",", "\"Features cannot be null\"", ")", ";", "return", "new", "XmlPathConfig", "(", "jaxbObjectMapperFactory"...
Specify features that will be used when parsing XML. @param features A map containing features that will be used by the underlying {@link groovy.util.XmlSlurper}. @return @see org.xml.sax.XMLReader#setFeature(java.lang.String, boolean)
[ "Specify", "features", "that", "will", "be", "used", "when", "parsing", "XML", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/xml-path/src/main/java/io/restassured/path/xml/config/XmlPathConfig.java#L117-L121
test
Sets features for this path.
Of course, here is the Java code you requested: ```java public XmlPathConfig features(Map<String, Boolean> features) { Validate.notNull(features, "Features cannot be null"); return new XmlPathConfig(jaxbObjectMapperFactory, defaultParserType, defaultDeserializer, charset, features, declaredNamespaces, ...
yunify/qingstor-sdk-java
src/main/java/com/qingstor/sdk/utils/Base64.java
Base64.decode
public static byte[] decode(String encoded) { if (encoded == null) { return null; } char[] base64Data = encoded.toCharArray(); // remove white spaces int len = removeWhiteSpace(base64Data); if (len % FOURBYTE != 0) { return null; // should be di...
java
public static byte[] decode(String encoded) { if (encoded == null) { return null; } char[] base64Data = encoded.toCharArray(); // remove white spaces int len = removeWhiteSpace(base64Data); if (len % FOURBYTE != 0) { return null; // should be di...
[ "public", "static", "byte", "[", "]", "decode", "(", "String", "encoded", ")", "{", "if", "(", "encoded", "==", "null", ")", "{", "return", "null", ";", "}", "char", "[", "]", "base64Data", "=", "encoded", ".", "toCharArray", "(", ")", ";", "// remov...
Decodes Base64 data into octects @param encoded string containing Base64 data @return Array containind decoded data.
[ "Decodes", "Base64", "data", "into", "octects" ]
b44a228a99e60e4d6e5a450b7c05972552ab9962
https://github.com/yunify/qingstor-sdk-java/blob/b44a228a99e60e4d6e5a450b7c05972552ab9962/src/main/java/com/qingstor/sdk/utils/Base64.java#L158-L248
test
Decodes a base64 string into a byte array.
Of course, here is the Java code you requested: ```java public static byte[] decode(String encoded) { if (encoded == null) { return null; } char[] base64Data = encoded.toCharArray(); // remove white spaces int len = removeWhiteSpace(base64Data); if (len % ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/NetcdfFile.java
NetcdfFile.iospDeRegister
static public boolean iospDeRegister(Class iospClass) { for (int i=0;i<registeredProviders.size();i++) { IOServiceProvider spi = registeredProviders.get(i); if (spi.getClass() == iospClass) { registeredProviders.remove(i); return true; } } return false; }
java
static public boolean iospDeRegister(Class iospClass) { for (int i=0;i<registeredProviders.size();i++) { IOServiceProvider spi = registeredProviders.get(i); if (spi.getClass() == iospClass) { registeredProviders.remove(i); return true; } } return false; }
[ "static", "public", "boolean", "iospDeRegister", "(", "Class", "iospClass", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "registeredProviders", ".", "size", "(", ")", ";", "i", "++", ")", "{", "IOServiceProvider", "spi", "=", "registeredPro...
See if a specific IOServiceProvider is registered and if so, remove it. @param iospClass Class for which to search and remove @return true if class was present
[ "See", "if", "a", "specific", "IOServiceProvider", "is", "registered", "and", "if", "so", "remove", "it", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L390-L399
test
De - register an IOServiceProvider.
Of course, here is the Java code you requested: ```java static public boolean iospDeRegister(Class iospClass) { for (int i=0;i<registeredProviders.size();i++) { IOServiceProvider spi = registeredProviders.get(i); if (spi.getClass() == iospClass) { registeredProviders.remove(i); ...
oblac/jodd
jodd-props/src/main/java/jodd/props/Props.java
Props.loadEnvironment
public Props loadEnvironment(final String prefix) { final Map<String, String> environmentMap = System.getenv(); load(environmentMap, prefix); return this; }
java
public Props loadEnvironment(final String prefix) { final Map<String, String> environmentMap = System.getenv(); load(environmentMap, prefix); return this; }
[ "public", "Props", "loadEnvironment", "(", "final", "String", "prefix", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "environmentMap", "=", "System", ".", "getenv", "(", ")", ";", "load", "(", "environmentMap", ",", "prefix", ")", ";", "r...
Loads environment properties with given prefix. If prefix is <code>null</code> it will not be used.
[ "Loads", "environment", "properties", "with", "given", "prefix", ".", "If", "prefix", "is", "<code", ">", "null<", "/", "code", ">", "it", "will", "not", "be", "used", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-props/src/main/java/jodd/props/Props.java#L335-L339
test
Load environment variables from system properties.
Of course, here is the Java code you requested: ```java public Props loadEnvironment(final String prefix) { final Map<String, String> environmentMap = System.getenv(); load(environmentMap, prefix); return this; } ``` Hope this helps!
Unidata/thredds
opendap/src/main/java/opendap/dap/DSequence.java
DSequence.oldDeserialize
private void oldDeserialize(DataInputStream source, ServerVersion sv, StatusUI statusUI) throws IOException, DataReadException { try { for (; ;) { deserializeSingle(source, sv, statusUI); } } catch (EOFEx...
java
private void oldDeserialize(DataInputStream source, ServerVersion sv, StatusUI statusUI) throws IOException, DataReadException { try { for (; ;) { deserializeSingle(source, sv, statusUI); } } catch (EOFEx...
[ "private", "void", "oldDeserialize", "(", "DataInputStream", "source", ",", "ServerVersion", "sv", ",", "StatusUI", "statusUI", ")", "throws", "IOException", ",", "DataReadException", "{", "try", "{", "for", "(", ";", ";", ")", "{", "deserializeSingle", "(", "...
The old deserialize protocol has a number of limitations stemming from its inability to tell when the sequence is finished. It's really only good for a Dataset containing a single sequence, or where the sequence is the last thing in the dataset. To handle this, we just read single instances until we get an IOExceptio...
[ "The", "old", "deserialize", "protocol", "has", "a", "number", "of", "limitations", "stemming", "from", "its", "inability", "to", "tell", "when", "the", "sequence", "is", "finished", ".", "It", "s", "really", "only", "good", "for", "a", "Dataset", "containin...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DSequence.java#L497-L507
test
Deserialize a CTYPE record from a data input stream.
Of course, here is the Java code you requested: ```java private void oldDeserialize(DataInputStream source, ServerVersion sv, StatusUI statusUI) throws IOException, DataReadException { try { for (; ;) { deserializeSingle(source, sv, s...
oblac/jodd
jodd-db/src/main/java/jodd/db/type/ByteArraySqlType.java
ByteArraySqlType.get
@Override public byte[] get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException { return rs.getBytes(index); }
java
@Override public byte[] get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException { return rs.getBytes(index); }
[ "@", "Override", "public", "byte", "[", "]", "get", "(", "final", "ResultSet", "rs", ",", "final", "int", "index", ",", "final", "int", "dbSqlType", ")", "throws", "SQLException", "{", "return", "rs", ".", "getBytes", "(", "index", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/type/ByteArraySqlType.java#L36-L39
test
Get a value from a ResultSet.
Of course, here is the Java code you requested: ```java @Override public byte[] get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException { return rs.getBytes(index); } ``` Hope this helps!
spring-projects/spring-security
core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImpl.java
RoleHierarchyImpl.addReachableRoles
private void addReachableRoles(Set<GrantedAuthority> reachableRoles, GrantedAuthority authority) { for (GrantedAuthority testAuthority : reachableRoles) { String testKey = testAuthority.getAuthority(); if ((testKey != null) && (testKey.equals(authority.getAuthority()))) { return; } } reachableRol...
java
private void addReachableRoles(Set<GrantedAuthority> reachableRoles, GrantedAuthority authority) { for (GrantedAuthority testAuthority : reachableRoles) { String testKey = testAuthority.getAuthority(); if ((testKey != null) && (testKey.equals(authority.getAuthority()))) { return; } } reachableRol...
[ "private", "void", "addReachableRoles", "(", "Set", "<", "GrantedAuthority", ">", "reachableRoles", ",", "GrantedAuthority", "authority", ")", "{", "for", "(", "GrantedAuthority", "testAuthority", ":", "reachableRoles", ")", "{", "String", "testKey", "=", "testAutho...
SEC-863
[ "SEC", "-", "863" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImpl.java#L143-L153
test
Add a role to the list of reachable roles.
Of course, here is the Java code you requested: ```java private void addReachableRoles(Set<GrantedAuthority> reachableRoles, GrantedAuthority authority) { for (GrantedAuthority testAuthority : reachableRoles) { String testKey = testAuthority.getAuthority(); if ((testKey != null) && (testKey.equals(authorit...
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/OpSymbol.java
OpSymbol.getFixity
public Fixity getFixity() { switch (associativity) { case FX: case FY: return Fixity.Pre; case XF: case YF: return Fixity.Post; case XFX: case XFY: case YFX: return Fixity.In; default: ...
java
public Fixity getFixity() { switch (associativity) { case FX: case FY: return Fixity.Pre; case XF: case YF: return Fixity.Post; case XFX: case XFY: case YFX: return Fixity.In; default: ...
[ "public", "Fixity", "getFixity", "(", ")", "{", "switch", "(", "associativity", ")", "{", "case", "FX", ":", "case", "FY", ":", "return", "Fixity", ".", "Pre", ";", "case", "XF", ":", "case", "YF", ":", "return", "Fixity", ".", "Post", ";", "case", ...
Provides the symbols fixity, derived from its associativity. @return The symbols fixity.
[ "Provides", "the", "symbols", "fixity", "derived", "from", "its", "associativity", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/OpSymbol.java#L184-L204
test
Gets the coding of the CRA.
Of course, here is the Java code you requested: ```java public Fixity getFixity() { switch (associativity) { case FX: case FY: return Fixity.Pre; case XF: case YF: return Fixity.Post; case XFX: case XFY: case YFX: ...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilPolygons2D_F64.java
UtilPolygons2D_F64.averageOfClosestPointError
public static double averageOfClosestPointError(Polygon2D_F64 model , Polygon2D_F64 target , int numberOfSamples ) { LineSegment2D_F64 line = new LineSegment2D_F64(); double cornerLocationsB[] = new double[target.size()+1]; double totalLength = 0; for (int i = 0; i < target.size(); i++) { Point2D_F64 b0 = t...
java
public static double averageOfClosestPointError(Polygon2D_F64 model , Polygon2D_F64 target , int numberOfSamples ) { LineSegment2D_F64 line = new LineSegment2D_F64(); double cornerLocationsB[] = new double[target.size()+1]; double totalLength = 0; for (int i = 0; i < target.size(); i++) { Point2D_F64 b0 = t...
[ "public", "static", "double", "averageOfClosestPointError", "(", "Polygon2D_F64", "model", ",", "Polygon2D_F64", "target", ",", "int", "numberOfSamples", ")", "{", "LineSegment2D_F64", "line", "=", "new", "LineSegment2D_F64", "(", ")", ";", "double", "cornerLocationsB...
Compute the error as a function of the distance between the model and target. The target is sampled at regular intervals and for each of these points the closest point on the model is found. The returned metric is the average of difference between paired points. NOTE: A different answer will be returned depending on w...
[ "Compute", "the", "error", "as", "a", "function", "of", "the", "distance", "between", "the", "model", "and", "target", ".", "The", "target", "is", "sampled", "at", "regular", "intervals", "and", "for", "each", "of", "these", "points", "the", "closest", "po...
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPolygons2D_F64.java#L488-L536
test
Calculates the average of the closest point error between two polygons
Of course, here is the Java code you requested: ```java public static double averageOfClosestPointError(Polygon2D_F64 model , Polygon2D_F64 target , int numberOfSamples ) { LineSegment2D_F64 line = new LineSegment2D_F64(); double cornerLocationsB[] = new double[target.size()+1]; double totalLength = 0; for (i...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createStpGarage
@XmlElementDecl(namespace = "", name = "stp_garage") public JAXBElement<Stellplatz> createStpGarage(Stellplatz value) { return new JAXBElement<Stellplatz>(_StpGarage_QNAME, Stellplatz.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "stp_garage") public JAXBElement<Stellplatz> createStpGarage(Stellplatz value) { return new JAXBElement<Stellplatz>(_StpGarage_QNAME, Stellplatz.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"stp_garage\"", ")", "public", "JAXBElement", "<", "Stellplatz", ">", "createStpGarage", "(", "Stellplatz", "value", ")", "{", "return", "new", "JAXBElement", "<", "Stellplatz", ">", "("...
Create an instance of {@link JAXBElement }{@code <}{@link Stellplatz }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Stellplatz", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L1911-L1914
test
Create an instance of a Stellplatz in the CNS namespace.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "stp_garage") public JAXBElement<Stellplatz> createStpGarage(Stellplatz value) { return new JAXBElement<Stellplatz>(_StpGarage_QNAME, Stellplatz.class, null, value); } ``` Hope this helps!
GojaFramework/goja
goja-core/src/main/java/goja/core/Validator.java
Validator.isCurrency
public static boolean isCurrency(String value) { String check = "^(\\d+(?:\\.\\d{1,2})?)$"; return match(check, Pattern.CASE_INSENSITIVE, value); }
java
public static boolean isCurrency(String value) { String check = "^(\\d+(?:\\.\\d{1,2})?)$"; return match(check, Pattern.CASE_INSENSITIVE, value); }
[ "public", "static", "boolean", "isCurrency", "(", "String", "value", ")", "{", "String", "check", "=", "\"^(\\\\d+(?:\\\\.\\\\d{1,2})?)$\"", ";", "return", "match", "(", "check", ",", "Pattern", ".", "CASE_INSENSITIVE", ",", "value", ")", ";", "}" ]
Currency validation @param value value @return boolean
[ "Currency", "validation" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/Validator.java#L183-L186
test
Checks if the value is a currency.
Of course, here is the Java code you requested: ```java public static boolean isCurrency(String value) { String check = "^(\\d+(?:\\.\\d{1,2})?)$"; return match(check, Pattern.CASE_INSENSITIVE, value); } ``` Hope this helps!
oblac/jodd
jodd-json/src/main/java/jodd/json/JsonSerializer.java
JsonSerializer.exclude
public JsonSerializer exclude(final boolean includeParent, final String... excludes) { for (String exclude : excludes) { if (includeParent) { int dotIndex = exclude.lastIndexOf('.'); if (dotIndex != -1) { PathQuery pathQuery = new PathQuery(exclude.substring(0, dotIndex), true); rules.include(pa...
java
public JsonSerializer exclude(final boolean includeParent, final String... excludes) { for (String exclude : excludes) { if (includeParent) { int dotIndex = exclude.lastIndexOf('.'); if (dotIndex != -1) { PathQuery pathQuery = new PathQuery(exclude.substring(0, dotIndex), true); rules.include(pa...
[ "public", "JsonSerializer", "exclude", "(", "final", "boolean", "includeParent", ",", "final", "String", "...", "excludes", ")", "{", "for", "(", "String", "exclude", ":", "excludes", ")", "{", "if", "(", "includeParent", ")", "{", "int", "dotIndex", "=", ...
Adds excludes with optional parent including. When parents are included, for each exclude query its parent will be included. For example, exclude of 'aaa.bb.ccc' would include it's parent: 'aaa.bb'.
[ "Adds", "excludes", "with", "optional", "parent", "including", ".", "When", "parents", "are", "included", "for", "each", "exclude", "query", "its", "parent", "will", "be", "included", ".", "For", "example", "exclude", "of", "aaa", ".", "bb", ".", "ccc", "w...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-json/src/main/java/jodd/json/JsonSerializer.java#L187-L204
test
Exclude the given paths from the result.
Of course, here is the Java code you requested: ```java public JsonSerializer exclude(final boolean includeParent, final String... excludes) { for (String exclude : excludes) { if (includeParent) { int dotIndex = exclude.lastIndexOf('.'); if (dotIndex != -1) { PathQuery pathQuery = new PathQuery(excl...
Unidata/thredds
legacy/src/main/java/thredds/catalog/InvAccessImpl.java
InvAccessImpl.check
boolean check(StringBuilder out, boolean show) { boolean isValid = true; if (log.length() > 0) { isValid = false; out.append( log); } if (getService() == null) { out.append("**InvAccess in (").append(dataset.getFullName()).append("): with urlPath= (").append(urlPath).append(") has no...
java
boolean check(StringBuilder out, boolean show) { boolean isValid = true; if (log.length() > 0) { isValid = false; out.append( log); } if (getService() == null) { out.append("**InvAccess in (").append(dataset.getFullName()).append("): with urlPath= (").append(urlPath).append(") has no...
[ "boolean", "check", "(", "StringBuilder", "out", ",", "boolean", "show", ")", "{", "boolean", "isValid", "=", "true", ";", "if", "(", "log", ".", "length", "(", ")", ">", "0", ")", "{", "isValid", "=", "false", ";", "out", ".", "append", "(", "log"...
////////////////////////////////////////////////////////////////////////////
[ "////////////////////////////////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/InvAccessImpl.java#L131-L152
test
Check if the access is valid
Of course, here is the Java code you requested: ```java boolean check(StringBuilder out, boolean show) { boolean isValid = true; if (log.length() > 0) { isValid = false; out.append( log); } if (getService() == null) { out.append("**InvAccess in (").append(dataset.getFullName()).appe...
ticketmaster-api/sdk-java
discovery/src/main/java/com/ticketmaster/api/discovery/DiscoveryApi.java
DiscoveryApi.urlBuilder
Builder urlBuilder(String path) { Builder builder = baseUrlBuilder().addPathSegment(configuration.getApiPackage()) .addPathSegment(configuration.getApiVersion()).addPathSegment(path); if (configuration.getPathModifier() != DiscoveryApiConfiguration.PathModifier.NONE) { builder.addPath...
java
Builder urlBuilder(String path) { Builder builder = baseUrlBuilder().addPathSegment(configuration.getApiPackage()) .addPathSegment(configuration.getApiVersion()).addPathSegment(path); if (configuration.getPathModifier() != DiscoveryApiConfiguration.PathModifier.NONE) { builder.addPath...
[ "Builder", "urlBuilder", "(", "String", "path", ")", "{", "Builder", "builder", "=", "baseUrlBuilder", "(", ")", ".", "addPathSegment", "(", "configuration", ".", "getApiPackage", "(", ")", ")", ".", "addPathSegment", "(", "configuration", ".", "getApiVersion", ...
Package protected for testing purposess
[ "Package", "protected", "for", "testing", "purposess" ]
ed9a40bb6a95d82707aea07e3d178b385a044391
https://github.com/ticketmaster-api/sdk-java/blob/ed9a40bb6a95d82707aea07e3d178b385a044391/discovery/src/main/java/com/ticketmaster/api/discovery/DiscoveryApi.java#L151-L161
test
Get a URL Builder for the specified path.
Of course, here is the Java code you requested: ```java Builder urlBuilder(String path) { Builder builder = baseUrlBuilder().addPathSegment(configuration.getApiPackage()) .addPathSegment(configuration.getApiVersion()).addPathSegment(path); if (configuration.getPathModifier() != DiscoveryAp...
Unidata/thredds
opendap/src/main/java/opendap/servers/ClauseFactory.java
ClauseFactory.newRelOpClause
public TopLevelClause newRelOpClause(int operator, SubClause lhs, List rhs) throws DAP2ServerSideException { return new RelOpClause(operator, lhs, rhs); }
java
public TopLevelClause newRelOpClause(int operator, SubClause lhs, List rhs) throws DAP2ServerSideException { return new RelOpClause(operator, lhs, rhs); }
[ "public", "TopLevelClause", "newRelOpClause", "(", "int", "operator", ",", "SubClause", "lhs", ",", "List", "rhs", ")", "throws", "DAP2ServerSideException", "{", "return", "new", "RelOpClause", "(", "operator", ",", "lhs", ",", "rhs", ")", ";", "}" ]
Generates a clause which which compares subclauses, using one of the relative operators supported by the Operator class.
[ "Generates", "a", "clause", "which", "which", "compares", "subclauses", "using", "one", "of", "the", "relative", "operators", "supported", "by", "the", "Operator", "class", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/ClauseFactory.java#L84-L92
test
Create a new TopLevelClause object.
Of course, here is the Java code you requested: ```java public TopLevelClause newRelOpClause(int operator, SubClause lhs, List rhs) throws DAP2ServerSideException { return new RelOpClause(operator, lh...
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/core/TaskService.java
TaskService.getTaskActors
private String[] getTaskActors(TaskModel model, Execution execution) { Object assigneeObject = null; AssignmentHandler handler = model.getAssignmentHandlerObject(); if(StringHelper.isNotEmpty(model.getAssignee())) { assigneeObject = execution.getArgs().get(model.getAssignee()); } else if(handler != nul...
java
private String[] getTaskActors(TaskModel model, Execution execution) { Object assigneeObject = null; AssignmentHandler handler = model.getAssignmentHandlerObject(); if(StringHelper.isNotEmpty(model.getAssignee())) { assigneeObject = execution.getArgs().get(model.getAssignee()); } else if(handler != nul...
[ "private", "String", "[", "]", "getTaskActors", "(", "TaskModel", "model", ",", "Execution", "execution", ")", "{", "Object", "assigneeObject", "=", "null", ";", "AssignmentHandler", "handler", "=", "model", ".", "getAssignmentHandlerObject", "(", ")", ";", "if"...
根据Task模型的assignee、assignmentHandler属性以及运行时数据,确定参与者 @param model 模型 @param execution 执行对象 @return 参与者数组
[ "根据Task模型的assignee、assignmentHandler属性以及运行时数据,确定参与者" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/core/TaskService.java#L440-L453
test
Get the actors of the task.
Of course, here is the Java code you requested: ```java private String[] getTaskActors(TaskModel model, Execution execution) { Object assigneeObject = null; AssignmentHandler handler = model.getAssignmentHandlerObject(); if(StringHelper.isNotEmpty(model.getAssignee())) { assigneeObject = execution.getAr...
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.copyEntries
public final void copyEntries(TransactionalBidiTreeMap<K,V> new_map) { K key; V val; int transaction_status; String transaction_id; new_map.setAutoCommit(isAutoCommit()); if (!isAutoCommit()) { // Do committed and deleted first ...
java
public final void copyEntries(TransactionalBidiTreeMap<K,V> new_map) { K key; V val; int transaction_status; String transaction_id; new_map.setAutoCommit(isAutoCommit()); if (!isAutoCommit()) { // Do committed and deleted first ...
[ "public", "final", "void", "copyEntries", "(", "TransactionalBidiTreeMap", "<", "K", ",", "V", ">", "new_map", ")", "{", "K", "key", ";", "V", "val", ";", "int", "transaction_status", ";", "String", "transaction_id", ";", "new_map", ".", "setAutoCommit", "("...
Copy all entries including transaction statuses from this map into the supplied map. Do not use this method unless you know exactly what you are doing. The auto commit flag of the supplied map may be changed as a result of calling this method, check that this is valid first.
[ "Copy", "all", "entries", "including", "transaction", "statuses", "from", "this", "map", "into", "the", "supplied", "map", ".", "Do", "not", "use", "this", "method", "unless", "you", "know", "exactly", "what", "you", "are", "doing", ".", "The", "auto", "co...
1b638be51997eafac4d368c14f62a16624a08d3e
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2480-L2566
test
Copy the entries from this map to the new_map.
Of course, here is the Java code you requested: ```java public final void copyEntries(TransactionalBidiTreeMap<K,V> new_map) { K key; V val; int transaction_status; String transaction_id; new_map.setAutoCommit(isAutoCommit()); if (!isAutoCommit()) ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/serialization/types/OShortSerializer.java
OShortSerializer.serializeInByteBufferObject
@Override public void serializeInByteBufferObject(Short object, ByteBuffer buffer, Object... hints) { buffer.putShort(object); }
java
@Override public void serializeInByteBufferObject(Short object, ByteBuffer buffer, Object... hints) { buffer.putShort(object); }
[ "@", "Override", "public", "void", "serializeInByteBufferObject", "(", "Short", "object", ",", "ByteBuffer", "buffer", ",", "Object", "...", "hints", ")", "{", "buffer", ".", "putShort", "(", "object", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/serialization/types/OShortSerializer.java#L112-L115
test
Serialize in ByteBufferShort object.
Of course, here is the Java code you requested: ```java @Override public void serializeInByteBufferObject(Short object, ByteBuffer buffer, Object... hints) { buffer.putShort(object); } ``` Hope this helps!
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/mathutils/PrimeFactors.java
PrimeFactors.primeSieve
public static boolean [] primeSieve (final int n) { final int halfN = (n + 1) >> 1; final boolean sieve[] = new boolean [n + 1]; // Initialize every integer from 2 onwards to prime. for (int i = 2; i <= n; ++i) sieve[i] = true; int prime = 2; // first prime number // Loop to create th...
java
public static boolean [] primeSieve (final int n) { final int halfN = (n + 1) >> 1; final boolean sieve[] = new boolean [n + 1]; // Initialize every integer from 2 onwards to prime. for (int i = 2; i <= n; ++i) sieve[i] = true; int prime = 2; // first prime number // Loop to create th...
[ "public", "static", "boolean", "[", "]", "primeSieve", "(", "final", "int", "n", ")", "{", "final", "int", "halfN", "=", "(", "n", "+", "1", ")", ">>", "1", ";", "final", "boolean", "sieve", "[", "]", "=", "new", "boolean", "[", "n", "+", "1", ...
Compute the Sieve of Eratosthenes. @param n the size of the sieve @return the sieve as a boolean array (each element is true if the corresponding number is prime, false if the number is composite)
[ "Compute", "the", "Sieve", "of", "Eratosthenes", "." ]
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/mathutils/PrimeFactors.java#L35-L60
test
Returns a boolean array containing all the elements of n that are prime.
Of course, here is the Java code you requested: ```java public static boolean [] primeSieve (final int n) { final int halfN = (n + 1) >> 1; final boolean sieve[] = new boolean [n + 1]; // Initialize every integer from 2 onwards to prime. for (int i = 2; i <= n; ++i) sieve[i] = true; int p...
oblac/jodd
jodd-bean/src/main/java/jodd/introspector/Properties.java
Properties.createPropertyDescriptor
protected PropertyDescriptor createPropertyDescriptor(final String name, final FieldDescriptor fieldDescriptor) { return new PropertyDescriptor(classDescriptor, name, fieldDescriptor); }
java
protected PropertyDescriptor createPropertyDescriptor(final String name, final FieldDescriptor fieldDescriptor) { return new PropertyDescriptor(classDescriptor, name, fieldDescriptor); }
[ "protected", "PropertyDescriptor", "createPropertyDescriptor", "(", "final", "String", "name", ",", "final", "FieldDescriptor", "fieldDescriptor", ")", "{", "return", "new", "PropertyDescriptor", "(", "classDescriptor", ",", "name", ",", "fieldDescriptor", ")", ";", "...
Creates new field-only {@link PropertyDescriptor}. It will be invoked only once.
[ "Creates", "new", "field", "-", "only", "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/introspector/Properties.java#L216-L218
test
Create a property descriptor.
Of course, here is the Java code you requested: ```java protected PropertyDescriptor createPropertyDescriptor(final String name, final FieldDescriptor fieldDescriptor) { return new PropertyDescriptor(classDescriptor, name, fieldDescriptor); } ``` Hope this helps!
RestComm/jain-slee
container/resource/src/main/java/org/mobicents/slee/resource/ResourceAdaptorObjectImpl.java
ResourceAdaptorObjectImpl.unsetResourceAdaptorContext
public void unsetResourceAdaptorContext() throws InvalidStateException { if (doTraceLogs) { logger.trace("unsetResourceAdaptorContext()"); } if (state == ResourceAdaptorObjectState.UNCONFIGURED) { object.unsetResourceAdaptorContext(); state = null; } else { throw new InvalidStateException("ra obje...
java
public void unsetResourceAdaptorContext() throws InvalidStateException { if (doTraceLogs) { logger.trace("unsetResourceAdaptorContext()"); } if (state == ResourceAdaptorObjectState.UNCONFIGURED) { object.unsetResourceAdaptorContext(); state = null; } else { throw new InvalidStateException("ra obje...
[ "public", "void", "unsetResourceAdaptorContext", "(", ")", "throws", "InvalidStateException", "{", "if", "(", "doTraceLogs", ")", "{", "logger", ".", "trace", "(", "\"unsetResourceAdaptorContext()\"", ")", ";", "}", "if", "(", "state", "==", "ResourceAdaptorObjectSt...
Unsets the context of the ra object. @throws InvalidStateException if the ra object is not in UNCONFIGURED state
[ "Unsets", "the", "context", "of", "the", "ra", "object", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/resource/src/main/java/org/mobicents/slee/resource/ResourceAdaptorObjectImpl.java#L329-L341
test
Unsets the resource adaptor context.
Of course, here is the Java code you requested: ```java public void unsetResourceAdaptorContext() throws InvalidStateException { if (doTraceLogs) { logger.trace("unsetResourceAdaptorContext()"); } if (state == ResourceAdaptorObjectState.UNCONFIGURED) { object.unsetResourceAdaptorContext(); state = nul...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3iosp.java
N3iosp.openForWriting
@Override public void openForWriting(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { open(raf, ncfile, cancelTask); }
java
@Override public void openForWriting(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { open(raf, ncfile, cancelTask); }
[ "@", "Override", "public", "void", "openForWriting", "(", "ucar", ".", "unidata", ".", "io", ".", "RandomAccessFile", "raf", ",", "ucar", ".", "nc2", ".", "NetcdfFile", "ncfile", ",", "ucar", ".", "nc2", ".", "util", ".", "CancelTask", "cancelTask", ")", ...
read existing file
[ "read", "existing", "file" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3iosp.java#L397-L401
test
This method is called by the FileOutputFormat class to open a CML file for writing.
Of course, here is the Java code you requested: ```java @Override public void openForWriting(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { open(raf, ncfile, cancelTask); } ``` Hope this helps!
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireMgmt.java
GemFireMgmt.stopLocator
public static void stopLocator(JMX jmx,String locatorName) { try { ObjectName objectName = new ObjectName("GemFire:type=Member,member="+locatorName); //DistributedSystemMXBean distributedSystemMXBean = MemberMXBean bean = jmx.newBean(MemberMXBean.class, objectName); bean.shutDownMember(); } ...
java
public static void stopLocator(JMX jmx,String locatorName) { try { ObjectName objectName = new ObjectName("GemFire:type=Member,member="+locatorName); //DistributedSystemMXBean distributedSystemMXBean = MemberMXBean bean = jmx.newBean(MemberMXBean.class, objectName); bean.shutDownMember(); } ...
[ "public", "static", "void", "stopLocator", "(", "JMX", "jmx", ",", "String", "locatorName", ")", "{", "try", "{", "ObjectName", "objectName", "=", "new", "ObjectName", "(", "\"GemFire:type=Member,member=\"", "+", "locatorName", ")", ";", "//DistributedSystemMXBean d...
--------------------------------------------------------
[ "--------------------------------------------------------" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireMgmt.java#L151-L167
test
Stop the specified member locator
Of course, here is the Java code you requested: ```java public static void stopLocator(JMX jmx,String locatorName) { try { ObjectName objectName = new ObjectName("GemFire:type=Member,member="+locatorName); //DistributedSystemMXBean distributedSystemMXBean = MemberMXBean bean = jmx.newBean(MemberMXB...
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientTransactionalGraph.java
OrientTransactionalGraph.stopTransaction
@SuppressWarnings("deprecation") @Override public void stopTransaction(final Conclusion conclusion) { makeActive(); if (getDatabase().isClosed() || getDatabase().getTransaction() instanceof OTransactionNoTx || getDatabase().getTransaction().getStatus() != TXSTATUS.BEGUN) return; if (Conc...
java
@SuppressWarnings("deprecation") @Override public void stopTransaction(final Conclusion conclusion) { makeActive(); if (getDatabase().isClosed() || getDatabase().getTransaction() instanceof OTransactionNoTx || getDatabase().getTransaction().getStatus() != TXSTATUS.BEGUN) return; if (Conc...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "@", "Override", "public", "void", "stopTransaction", "(", "final", "Conclusion", "conclusion", ")", "{", "makeActive", "(", ")", ";", "if", "(", "getDatabase", "(", ")", ".", "isClosed", "(", ")", "||", ...
Closes a transaction. @param conclusion Can be SUCCESS for commit and FAILURE to rollback.
[ "Closes", "a", "transaction", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientTransactionalGraph.java#L160-L173
test
Stop the transaction.
Of course, here is the Java code you requested: ```java @SuppressWarnings("deprecation") @Override public void stopTransaction(final Conclusion conclusion) { makeActive(); if (getDatabase().isClosed() || getDatabase().getTransaction() instanceof OTransactionNoTx || getDatabase().getTransaction().g...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/provisioning/UserDetailsManagerResourceFactoryBean.java
UserDetailsManagerResourceFactoryBean.fromResourceLocation
public static UserDetailsManagerResourceFactoryBean fromResourceLocation(String resourceLocation) { UserDetailsManagerResourceFactoryBean result = new UserDetailsManagerResourceFactoryBean(); result.setResourceLocation(resourceLocation); return result; }
java
public static UserDetailsManagerResourceFactoryBean fromResourceLocation(String resourceLocation) { UserDetailsManagerResourceFactoryBean result = new UserDetailsManagerResourceFactoryBean(); result.setResourceLocation(resourceLocation); return result; }
[ "public", "static", "UserDetailsManagerResourceFactoryBean", "fromResourceLocation", "(", "String", "resourceLocation", ")", "{", "UserDetailsManagerResourceFactoryBean", "result", "=", "new", "UserDetailsManagerResourceFactoryBean", "(", ")", ";", "result", ".", "setResourceLo...
Create a UserDetailsManagerResourceFactoryBean with the location of a Resource that is a Properties file in the format defined in {@link UserDetailsResourceFactoryBean}. @param resourceLocation the location of the properties file that contains the users (i.e. "classpath:users.properties") @return the UserDetailsManage...
[ "Create", "a", "UserDetailsManagerResourceFactoryBean", "with", "the", "location", "of", "a", "Resource", "that", "is", "a", "Properties", "file", "in", "the", "format", "defined", "in", "{", "@link", "UserDetailsResourceFactoryBean", "}", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/provisioning/UserDetailsManagerResourceFactoryBean.java#L81-L85
test
Creates a new UserDetailsManagerResourceFactoryBean from a resource location.
Of course, here is the Java code you requested: ```java public static UserDetailsManagerResourceFactoryBean fromResourceLocation(String resourceLocation) { UserDetailsManagerResourceFactoryBean result = new UserDetailsManagerResourceFactoryBean(); result.setResourceLocation(resourceLocation); return result; } `...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java
Generator.generateTagHandlerAttributes
private void generateTagHandlerAttributes(TagInfo tagInfo) throws JasperException { if (tagInfo.hasDynamicAttributes()) { out.printil( "private java.util.HashMap _jspx_dynamic_attrs = new java.util.HashMap();"); } // Declare attributes TagAttributeIn...
java
private void generateTagHandlerAttributes(TagInfo tagInfo) throws JasperException { if (tagInfo.hasDynamicAttributes()) { out.printil( "private java.util.HashMap _jspx_dynamic_attrs = new java.util.HashMap();"); } // Declare attributes TagAttributeIn...
[ "private", "void", "generateTagHandlerAttributes", "(", "TagInfo", "tagInfo", ")", "throws", "JasperException", "{", "if", "(", "tagInfo", ".", "hasDynamicAttributes", "(", ")", ")", "{", "out", ".", "printil", "(", "\"private java.util.HashMap _jspx_dynamic_attrs = new...
Generates declarations for tag handler attributes, and defines the getter and setter methods for each.
[ "Generates", "declarations", "for", "tag", "handler", "attributes", "and", "defines", "the", "getter", "and", "setter", "methods", "for", "each", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java#L3647-L3712
test
Generate TagHandlerAttributes method.
Of course, here is the Java code you requested: ```java private void generateTagHandlerAttributes(TagInfo tagInfo) throws JasperException { if (tagInfo.hasDynamicAttributes()) { out.printil( "private java.util.HashMap _jspx_dynamic_attrs = new java.util.HashMap();"); ...
OpenEstate/OpenEstate-IO
IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/BueroPraxisTyp.java
BueroPraxisTyp.getDatenVerkabelung
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public DatenVerkabelungsTyp getDatenVerkabelung() { if (datenVerkabelung == null) { return DatenVerkabelungsTyp.KEINE_ANGABE; } else { return datenVerkabelung; ...
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public DatenVerkabelungsTyp getDatenVerkabelung() { if (datenVerkabelung == null) { return DatenVerkabelungsTyp.KEINE_ANGABE; } else { return datenVerkabelung; ...
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:52:47+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "DatenVerkabelungsTyp", "getDatenVerkabelung", "(", ")", "{", "if", "(", "datenVerkabelung...
Gets the value of the datenVerkabelung property. @return possible object is {@link DatenVerkabelungsTyp }
[ "Gets", "the", "value", "of", "the", "datenVerkabelung", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/BueroPraxisTyp.java#L228-L235
test
Gets the value of the datenVerkabelungsTyp property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public DatenVerkabelungsTyp getDatenVerkabelung() { if (datenVerkabelung == null) { return DatenVerkabelungsTyp.KEINE_ANGABE; ...
algolia/algoliasearch-client-android
algoliasearch/src/offline/java/com/algolia/search/saas/OfflineIndex.java
OfflineIndex.writeTmpJSONFile
private @NonNull File writeTmpJSONFile(@NonNull JSONObject object) throws AlgoliaException { return writeTempFile(object.toString()); }
java
private @NonNull File writeTmpJSONFile(@NonNull JSONObject object) throws AlgoliaException { return writeTempFile(object.toString()); }
[ "private", "@", "NonNull", "File", "writeTmpJSONFile", "(", "@", "NonNull", "JSONObject", "object", ")", "throws", "AlgoliaException", "{", "return", "writeTempFile", "(", "object", ".", "toString", "(", ")", ")", ";", "}" ]
Write a temporary file containing a JSON object. @param object JSON object to write. @return Path to the created file. @throws AlgoliaException
[ "Write", "a", "temporary", "file", "containing", "a", "JSON", "object", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/OfflineIndex.java#L1071-L1073
test
Write a JSON object to a temporary file.
Of course, here is the Java code you requested: ```java private @NonNull File writeTmpJSONFile(@NonNull JSONObject object) throws AlgoliaException { return writeTempFile(object.toString()); } ``` Hope this helps!
GojaFramework/goja
goja-core/src/main/java/goja/core/db/Dao.java
Dao.findOne
public static Record findOne(SqlSelect sqlSelect) { Preconditions.checkNotNull(sqlSelect, "The Query SqlNode is must be not null."); return Db.findFirst(sqlSelect.toString(), sqlSelect.getParams().toArray()); }
java
public static Record findOne(SqlSelect sqlSelect) { Preconditions.checkNotNull(sqlSelect, "The Query SqlNode is must be not null."); return Db.findFirst(sqlSelect.toString(), sqlSelect.getParams().toArray()); }
[ "public", "static", "Record", "findOne", "(", "SqlSelect", "sqlSelect", ")", "{", "Preconditions", ".", "checkNotNull", "(", "sqlSelect", ",", "\"The Query SqlNode is must be not null.\"", ")", ";", "return", "Db", ".", "findFirst", "(", "sqlSelect", ".", "toString"...
Query a data record. @param sqlSelect SqlNode Select @return query result. @see SqlSelect @see FindBy
[ "Query", "a", "data", "record", "." ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/db/Dao.java#L113-L116
test
Find one record.
Of course, here is the Java code you requested: ```java public static Record findOne(SqlSelect sqlSelect) { Preconditions.checkNotNull(sqlSelect, "The Query SqlNode is must be not null."); return Db.findFirst(sqlSelect.toString(), sqlSelect.getParams().toArray()); } ``` Hope this helps!
Yubico/yubico-java-client
jaas/src/main/java/com/yubico/jaas/YubikeyLoginModule.java
YubikeyLoginModule.commit
public boolean commit() throws LoginException { log.trace("In commit()"); for (YubikeyPrincipal p : this.principals) { log.debug("Committing principal {}", p); this.subject.getPrincipals().add(p); } return true; }
java
public boolean commit() throws LoginException { log.trace("In commit()"); for (YubikeyPrincipal p : this.principals) { log.debug("Committing principal {}", p); this.subject.getPrincipals().add(p); } return true; }
[ "public", "boolean", "commit", "(", ")", "throws", "LoginException", "{", "log", ".", "trace", "(", "\"In commit()\"", ")", ";", "for", "(", "YubikeyPrincipal", "p", ":", "this", ".", "principals", ")", "{", "log", ".", "debug", "(", "\"Committing principal ...
/* (non-Javadoc) @see javax.security.auth.spi.LoginModule#commit()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
263b09c6ab0ee54b0dc7d70516989abab981796f
https://github.com/Yubico/yubico-java-client/blob/263b09c6ab0ee54b0dc7d70516989abab981796f/jaas/src/main/java/com/yubico/jaas/YubikeyLoginModule.java#L113-L120
test
Commit the principal list.
Of course, here is the Java code you requested: ```java public boolean commit() throws LoginException { log.trace("In commit()"); for (YubikeyPrincipal p : this.principals) { log.debug("Committing principal {}", p); this.subject.getPrincipals().add(p); } return true; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/projection/TransverseMercator.java
TransverseMercator.latLonToProj
public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) { double toX, toY; double fromLat = latLon.getLatitude(); double fromLon = latLon.getLongitude(); double lon = Math.toRadians(fromLon); double lat = Math.toRadians(fromLa...
java
public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) { double toX, toY; double fromLat = latLon.getLatitude(); double fromLon = latLon.getLongitude(); double lon = Math.toRadians(fromLon); double lat = Math.toRadians(fromLa...
[ "public", "ProjectionPoint", "latLonToProj", "(", "LatLonPoint", "latLon", ",", "ProjectionPointImpl", "result", ")", "{", "double", "toX", ",", "toY", ";", "double", "fromLat", "=", "latLon", ".", "getLatitude", "(", ")", ";", "double", "fromLon", "=", "latLo...
Convert a LatLonPoint to projection coordinates @param latLon convert from these lat, lon coordinates @param result the object to write to @return the given result
[ "Convert", "a", "LatLonPoint", "to", "projection", "coordinates" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/TransverseMercator.java#L339-L360
test
Converts a LatLonPoint object to a ProjectionPoint object.
Of course, here is the Java code you requested: ```java public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result) { double toX, toY; double fromLat = latLon.getLatitude(); double fromLon = latLon.getLongitude(); double lon = Math.to...
turbomanage/storm-gen
storm-apt/api/src/main/java/com/turbomanage/storm/csv/CsvUtils.java
CsvUtils.escapeCsv
public static String escapeCsv(String str) { if (str == null) return ""; if (containsNone(str, CSV_SEARCH_CHARS)) return str; StringWriter out = new StringWriter(); out.write(QUOTE); for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == QUOTE) out.write(QUOTE); out.write...
java
public static String escapeCsv(String str) { if (str == null) return ""; if (containsNone(str, CSV_SEARCH_CHARS)) return str; StringWriter out = new StringWriter(); out.write(QUOTE); for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == QUOTE) out.write(QUOTE); out.write...
[ "public", "static", "String", "escapeCsv", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", ")", "return", "\"\"", ";", "if", "(", "containsNone", "(", "str", ",", "CSV_SEARCH_CHARS", ")", ")", "return", "str", ";", "StringWriter", "out", ...
Returns a {@link String} for a CSV column enclosed in double quotes, if required. see <a href="http://en.wikipedia.org/wiki/Comma-separated_values">Wikipedia</a> and <a href="http://tools.ietf.org/html/rfc4180">RFC 4180</a>. @param str the input String, may be null @return the input String enclosed in double quotes i...
[ "Returns", "a", "{", "@link", "String", "}", "for", "a", "CSV", "column", "enclosed", "in", "double", "quotes", "if", "required", "." ]
22caa69439548a074d035745215bce5aff55853d
https://github.com/turbomanage/storm-gen/blob/22caa69439548a074d035745215bce5aff55853d/storm-apt/api/src/main/java/com/turbomanage/storm/csv/CsvUtils.java#L54-L69
test
Escape a string for use in CSV.
Of course, here is the Java code you requested: ```java public static String escapeCsv(String str) { if (str == null) return ""; if (containsNone(str, CSV_SEARCH_CHARS)) return str; StringWriter out = new StringWriter(); out.write(QUOTE); for (int i = 0; i < str.length(); i++) { char c = str.charAt(...
google/guice
core/src/com/google/inject/internal/MembersInjectorStore.java
MembersInjectorStore.getInjectors
ImmutableList<SingleMemberInjector> getInjectors( Set<InjectionPoint> injectionPoints, Errors errors) { List<SingleMemberInjector> injectors = Lists.newArrayList(); for (InjectionPoint injectionPoint : injectionPoints) { try { Errors errorsForMember = injectionPoint.isOptional() ...
java
ImmutableList<SingleMemberInjector> getInjectors( Set<InjectionPoint> injectionPoints, Errors errors) { List<SingleMemberInjector> injectors = Lists.newArrayList(); for (InjectionPoint injectionPoint : injectionPoints) { try { Errors errorsForMember = injectionPoint.isOptional() ...
[ "ImmutableList", "<", "SingleMemberInjector", ">", "getInjectors", "(", "Set", "<", "InjectionPoint", ">", "injectionPoints", ",", "Errors", "errors", ")", "{", "List", "<", "SingleMemberInjector", ">", "injectors", "=", "Lists", ".", "newArrayList", "(", ")", "...
Returns the injectors for the specified injection points.
[ "Returns", "the", "injectors", "for", "the", "specified", "injection", "points", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/MembersInjectorStore.java#L120-L139
test
Get the injectors for a set of injection points.
Of course, here is the Java code you requested: ```java ImmutableList<SingleMemberInjector> getInjectors( Set<InjectionPoint> injectionPoints, Errors errors) { List<SingleMemberInjector> injectors = Lists.newArrayList(); for (InjectionPoint injectionPoint : injectionPoints) { try { Errors e...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java
CFpointObs.makeMultidimInner
private TableConfig makeMultidimInner(NetcdfDataset ds, TableConfig parentTable, Dimension obsDim, EncodingInfo info, Formatter errlog) throws IOException { Dimension parentDim = ds.findDimension(parentTable.dimName); Table.Type obsTableType = (parentTable.structureType == TableConfig.StructureType.PsuedoSt...
java
private TableConfig makeMultidimInner(NetcdfDataset ds, TableConfig parentTable, Dimension obsDim, EncodingInfo info, Formatter errlog) throws IOException { Dimension parentDim = ds.findDimension(parentTable.dimName); Table.Type obsTableType = (parentTable.structureType == TableConfig.StructureType.PsuedoSt...
[ "private", "TableConfig", "makeMultidimInner", "(", "NetcdfDataset", "ds", ",", "TableConfig", "parentTable", ",", "Dimension", "obsDim", ",", "EncodingInfo", "info", ",", "Formatter", "errlog", ")", "throws", "IOException", "{", "Dimension", "parentDim", "=", "ds",...
the inner table of Structure(outer, inner) and middle table of Structure(outer, middle, inner)
[ "the", "inner", "table", "of", "Structure", "(", "outer", "inner", ")", "and", "middle", "table", "of", "Structure", "(", "outer", "middle", "inner", ")" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java#L1346-L1391
test
Make a multipidim inner table.
Of course, here is the Java code you requested: ```java private TableConfig makeMultidimInner(NetcdfDataset ds, TableConfig parentTable, Dimension obsDim, EncodingInfo info, Formatter errlog) throws IOException { Dimension parentDim = ds.findDimension(parentTable.dimName); Table.Type obsTableType = (parent...
Unidata/thredds
cdm/src/main/java/ucar/ma2/ArrayStructureMA.java
ArrayStructureMA.factoryMA
static public ArrayStructureMA factoryMA(ArrayStructure from) throws IOException { if (from instanceof ArrayStructureMA) return (ArrayStructureMA) from; // To create an ArrayStructureMA that we can iterate over later, we need to know the shape of "from". if (from.getSize() > 0) { ArrayStr...
java
static public ArrayStructureMA factoryMA(ArrayStructure from) throws IOException { if (from instanceof ArrayStructureMA) return (ArrayStructureMA) from; // To create an ArrayStructureMA that we can iterate over later, we need to know the shape of "from". if (from.getSize() > 0) { ArrayStr...
[ "static", "public", "ArrayStructureMA", "factoryMA", "(", "ArrayStructure", "from", ")", "throws", "IOException", "{", "if", "(", "from", "instanceof", "ArrayStructureMA", ")", "return", "(", "ArrayStructureMA", ")", "from", ";", "// To create an ArrayStructureMA that w...
Turn any ArrayStructure into a ArrayStructureMA @param from copy from here. If from is a ArrayStructureMA, return it. @return equivalent ArrayStructureMA @throws java.io.IOException on error reading a sequence
[ "Turn", "any", "ArrayStructure", "into", "a", "ArrayStructureMA" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/ArrayStructureMA.java#L193-L242
test
Creates an ArrayStructureMA object from an existing ArrayStructure.
Of course, here is the Java code you requested: ```java static public ArrayStructureMA factoryMA(ArrayStructure from) throws IOException { if (from instanceof ArrayStructureMA) return (ArrayStructureMA) from; // To create an ArrayStructureMA that we can iterate over later, we need to know the shape ...
real-logic/aeron
aeron-client/src/main/java/io/aeron/status/ChannelEndpointStatus.java
ChannelEndpointStatus.status
public static String status(final long status) { if (INITIALIZING == status) { return "INITIALIZING"; } if (ERRORED == status) { return "ERRORED"; } if (ACTIVE == status) { return "ACTIVE"; } if (C...
java
public static String status(final long status) { if (INITIALIZING == status) { return "INITIALIZING"; } if (ERRORED == status) { return "ERRORED"; } if (ACTIVE == status) { return "ACTIVE"; } if (C...
[ "public", "static", "String", "status", "(", "final", "long", "status", ")", "{", "if", "(", "INITIALIZING", "==", "status", ")", "{", "return", "\"INITIALIZING\"", ";", "}", "if", "(", "ERRORED", "==", "status", ")", "{", "return", "\"ERRORED\"", ";", "...
String representation of the channel status. @param status to be converted. @return representation of the channel status.
[ "String", "representation", "of", "the", "channel", "status", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/status/ChannelEndpointStatus.java#L68-L91
test
Get the status string for a Crazilianian Auftragen.
Of course, here is the Java code you requested: ```java public static String status(final long status) { if (INITIALIZING == status) { return "INITIALIZING"; } if (ERRORED == status) { return "ERRORED"; } if (ACTIVE == status) ...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ResponseBody.java
ResponseBody.setStatus
public void setStatus(String status) { Assert.isNotNull(status); Assert.isTrue(getLastChild(root, "propstat") == null); //$NON-NLS-1$ setChild(root, "status", status, fgNamesStatus, true); //$NON-NLS-1$ }
java
public void setStatus(String status) { Assert.isNotNull(status); Assert.isTrue(getLastChild(root, "propstat") == null); //$NON-NLS-1$ setChild(root, "status", status, fgNamesStatus, true); //$NON-NLS-1$ }
[ "public", "void", "setStatus", "(", "String", "status", ")", "{", "Assert", ".", "isNotNull", "(", "status", ")", ";", "Assert", ".", "isTrue", "(", "getLastChild", "(", "root", ",", "\"propstat\"", ")", "==", "null", ")", ";", "//$NON-NLS-1$", "setChild",...
Sets the status on this response to the given status. The status must not be <code>null</code>. This response must not already be in the "propstat" form. @param status the status for this response
[ "Sets", "the", "status", "on", "this", "response", "to", "the", "given", "status", ".", "The", "status", "must", "not", "be", "<code", ">", "null<", "/", "code", ">", ".", "This", "response", "must", "not", "already", "be", "in", "the", "propstat", "fo...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ResponseBody.java#L488-L492
test
Sets the status of the resource.
Of course, here is the Java code you requested: ```java public void setStatus(String status) { Assert.isNotNull(status); Assert.isTrue(getLastChild(root, "propstat") == null); //$NON-NLS-1$ setChild(root, "status", status, fgNamesStatus, true); //$NON-NLS-1$ } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/vo/license/LicenseRequest.java
LicenseRequest.toJsonObject
@Override public JSONObject toJsonObject() throws JSONException { JSONObject returnVal = super.toJsonObject(); //Machine Name... if(this.getMachineName() != null) { returnVal.put(JSONMapping.MACHINE_NAME, this.getMachineName()); } ...
java
@Override public JSONObject toJsonObject() throws JSONException { JSONObject returnVal = super.toJsonObject(); //Machine Name... if(this.getMachineName() != null) { returnVal.put(JSONMapping.MACHINE_NAME, this.getMachineName()); } ...
[ "@", "Override", "public", "JSONObject", "toJsonObject", "(", ")", "throws", "JSONException", "{", "JSONObject", "returnVal", "=", "super", ".", "toJsonObject", "(", ")", ";", "//Machine Name...", "if", "(", "this", ".", "getMachineName", "(", ")", "!=", "null...
Conversion to {@code JSONObject} from Java Object. @return {@code JSONObject} representation of {@code LicenseRequest} @throws JSONException If there is a problem with the JSON Body. @see ABaseFluidJSONObject#toJsonObject()
[ "Conversion", "to", "{", "@code", "JSONObject", "}", "from", "Java", "Object", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/license/LicenseRequest.java#L125-L173
test
Get the JSONObject representation of the Crazilian Crazilian.
Of course, here is the Java code you requested: ```java @Override public JSONObject toJsonObject() throws JSONException { JSONObject returnVal = super.toJsonObject(); //Machine Name... if(this.getMachineName() != null) { returnVal.put(JSONMapping.MACHINE_NAME, ...
alipay/sofa-bolt
src/main/java/com/alipay/remoting/util/RemotingUtil.java
RemotingUtil.parseLocalPort
public static int parseLocalPort(final Channel channel) { if (null == channel) { return -1; } final InetSocketAddress local = (InetSocketAddress) channel.localAddress(); if (local != null) { return local.getPort(); } return -1; }
java
public static int parseLocalPort(final Channel channel) { if (null == channel) { return -1; } final InetSocketAddress local = (InetSocketAddress) channel.localAddress(); if (local != null) { return local.getPort(); } return -1; }
[ "public", "static", "int", "parseLocalPort", "(", "final", "Channel", "channel", ")", "{", "if", "(", "null", "==", "channel", ")", "{", "return", "-", "1", ";", "}", "final", "InetSocketAddress", "local", "=", "(", "InetSocketAddress", ")", "channel", "."...
Parse the local host port of the channel. @param channel @return int
[ "Parse", "the", "local", "host", "port", "of", "the", "channel", "." ]
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/util/RemotingUtil.java#L137-L146
test
Parse the local port from a channel.
Of course, here is the Java code you requested: ```java public static int parseLocalPort(final Channel channel) { if (null == channel) { return -1; } final InetSocketAddress local = (InetSocketAddress) channel.localAddress(); if (local != null) { return local.get...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractConfigAttributeRequestMatcherRegistry.java
AbstractConfigAttributeRequestMatcherRegistry.createRequestMap
final LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> createRequestMap() { if (unmappedMatchers != null) { throw new IllegalStateException( "An incomplete mapping was found for " + unmappedMatchers + ". Try completing it with something like requestUrls().<something>.hasRole('USER')");...
java
final LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> createRequestMap() { if (unmappedMatchers != null) { throw new IllegalStateException( "An incomplete mapping was found for " + unmappedMatchers + ". Try completing it with something like requestUrls().<something>.hasRole('USER')");...
[ "final", "LinkedHashMap", "<", "RequestMatcher", ",", "Collection", "<", "ConfigAttribute", ">", ">", "createRequestMap", "(", ")", "{", "if", "(", "unmappedMatchers", "!=", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"An incomplete mapping was...
Creates the mapping of {@link RequestMatcher} to {@link Collection} of {@link ConfigAttribute} instances @return the mapping of {@link RequestMatcher} to {@link Collection} of {@link ConfigAttribute} instances. Cannot be null.
[ "Creates", "the", "mapping", "of", "{", "@link", "RequestMatcher", "}", "to", "{", "@link", "Collection", "}", "of", "{", "@link", "ConfigAttribute", "}", "instances" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractConfigAttributeRequestMatcherRegistry.java#L109-L124
test
Returns a LinkedHashMap of request Matcher and config attributes.
Of course, here is the Java code you requested: ```java final LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> createRequestMap() { if (unmappedMatchers != null) { throw new IllegalStateException( "An incomplete mapping was found for " + unmappedMatchers + ". Try completing it with so...
wildfly/wildfly
webservices/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
ASHelper.getRequiredAttachment
public static <A> A getRequiredAttachment(final DeploymentUnit unit, final AttachmentKey<A> key) { final A value = unit.getAttachment(key); if (value == null) { throw new IllegalStateException(); } return value; }
java
public static <A> A getRequiredAttachment(final DeploymentUnit unit, final AttachmentKey<A> key) { final A value = unit.getAttachment(key); if (value == null) { throw new IllegalStateException(); } return value; }
[ "public", "static", "<", "A", ">", "A", "getRequiredAttachment", "(", "final", "DeploymentUnit", "unit", ",", "final", "AttachmentKey", "<", "A", ">", "key", ")", "{", "final", "A", "value", "=", "unit", ".", "getAttachment", "(", "key", ")", ";", "if", ...
Returns required attachment value from deployment unit. @param <A> expected value @param unit deployment unit @param key attachment key @return required attachment @throws IllegalStateException if attachment value is null
[ "Returns", "required", "attachment", "value", "from", "deployment", "unit", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java#L155-L162
test
Gets the required attachment.
Of course, here is the Java code you requested: ```java public static <A> A getRequiredAttachment(final DeploymentUnit unit, final AttachmentKey<A> key) { final A value = unit.getAttachment(key); if (value == null) { throw new IllegalStateException(); } return value; } ...
jcodec/jcodec
src/main/java/org/jcodec/codecs/h264/H264Utils.java
H264Utils.encodeMOVPacketInplace
public static void encodeMOVPacketInplace(ByteBuffer avcFrame) { ByteBuffer dup = avcFrame.duplicate(); ByteBuffer d1 = avcFrame.duplicate(); for (int tot = d1.position();;) { ByteBuffer buf = H264Utils.nextNALUnit(dup); if (buf == null) break; ...
java
public static void encodeMOVPacketInplace(ByteBuffer avcFrame) { ByteBuffer dup = avcFrame.duplicate(); ByteBuffer d1 = avcFrame.duplicate(); for (int tot = d1.position();;) { ByteBuffer buf = H264Utils.nextNALUnit(dup); if (buf == null) break; ...
[ "public", "static", "void", "encodeMOVPacketInplace", "(", "ByteBuffer", "avcFrame", ")", "{", "ByteBuffer", "dup", "=", "avcFrame", ".", "duplicate", "(", ")", ";", "ByteBuffer", "d1", "=", "avcFrame", ".", "duplicate", "(", ")", ";", "for", "(", "int", "...
Encodes AVC frame in ISO BMF format. Takes Annex B format. Scans the packet for each NAL Unit starting with 00 00 00 01 and replaces this 4 byte sequence with 4 byte integer representing this NAL unit length. @param avcFrame AVC frame encoded in Annex B NAL unit format
[ "Encodes", "AVC", "frame", "in", "ISO", "BMF", "format", ".", "Takes", "Annex", "B", "format", "." ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/H264Utils.java#L259-L272
test
Encode a MovPacket in place.
Of course, here is the Java code you requested: ```java public static void encodeMOVPacketInplace(ByteBuffer avcFrame) { ByteBuffer dup = avcFrame.duplicate(); ByteBuffer d1 = avcFrame.duplicate(); for (int tot = d1.position();;) { ByteBuffer buf = H264Utils.nextNALUnit(dup); ...
playframework/playframework
core/play/src/main/java/play/core/cookie/encoding/ServerCookieDecoder.java
ServerCookieDecoder.decode
public Set<Cookie> decode(String header) { if (header == null) { throw new NullPointerException("header"); } final int headerLen = header.length(); if (headerLen == 0) { return Collections.emptySet(); } Set<Cookie> cookies = new TreeSet<Cookie>(); int i = 0; boolean rfc29...
java
public Set<Cookie> decode(String header) { if (header == null) { throw new NullPointerException("header"); } final int headerLen = header.length(); if (headerLen == 0) { return Collections.emptySet(); } Set<Cookie> cookies = new TreeSet<Cookie>(); int i = 0; boolean rfc29...
[ "public", "Set", "<", "Cookie", ">", "decode", "(", "String", "header", ")", "{", "if", "(", "header", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"header\"", ")", ";", "}", "final", "int", "headerLen", "=", "header", ".", "l...
Decodes the specified Set-Cookie HTTP header value into a {@link Cookie}. @param header the Set-Cookie header. @return the decoded {@link Cookie}
[ "Decodes", "the", "specified", "Set", "-", "Cookie", "HTTP", "header", "value", "into", "a", "{", "@link", "Cookie", "}", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/core/cookie/encoding/ServerCookieDecoder.java#L62-L160
test
Decodes the given header string into a set of cookies.
Of course, here is the Java code you requested: ```java public Set<Cookie> decode(String header) { if (header == null) { throw new NullPointerException("header"); } final int headerLen = header.length(); if (headerLen == 0) { return Collections.emptySet(); } Set<Cookie> cookies = ...
fuinorg/srcgen4j-core
src/main/java/org/fuin/srcgen4j/core/velocity/Argument.java
Argument.init
public final void init(final Map<String, String> vars) { value = Utils4J.replaceVars(getValue(), vars); }
java
public final void init(final Map<String, String> vars) { value = Utils4J.replaceVars(getValue(), vars); }
[ "public", "final", "void", "init", "(", "final", "Map", "<", "String", ",", "String", ">", "vars", ")", "{", "value", "=", "Utils4J", ".", "replaceVars", "(", "getValue", "(", ")", ",", "vars", ")", ";", "}" ]
Replaces variables (if defined) in the value. @param vars Variables to use.
[ "Replaces", "variables", "(", "if", "defined", ")", "in", "the", "value", "." ]
da2bc58370993e6294ddc4eb7e696fe255f979db
https://github.com/fuinorg/srcgen4j-core/blob/da2bc58370993e6294ddc4eb7e696fe255f979db/src/main/java/org/fuin/srcgen4j/core/velocity/Argument.java#L125-L127
test
Initializes the base class with the given vars.
Of course, here is the Java code you requested: ```java public final void init(final Map<String, String> vars) { value = Utils4J.replaceVars(getValue(), vars); } ``` Hope this helps!
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerImpl.java
TimerImpl.setTimerState
protected void setTimerState(TimerState state, Thread thread) { assert ((state == TimerState.IN_TIMEOUT || state == TimerState.RETRY_TIMEOUT) && thread != null) || thread == null : "Invalid to set timer state " + state + " with executing Thread " + thread; this.timerState = state; this.executing...
java
protected void setTimerState(TimerState state, Thread thread) { assert ((state == TimerState.IN_TIMEOUT || state == TimerState.RETRY_TIMEOUT) && thread != null) || thread == null : "Invalid to set timer state " + state + " with executing Thread " + thread; this.timerState = state; this.executing...
[ "protected", "void", "setTimerState", "(", "TimerState", "state", ",", "Thread", "thread", ")", "{", "assert", "(", "(", "state", "==", "TimerState", ".", "IN_TIMEOUT", "||", "state", "==", "TimerState", ".", "RETRY_TIMEOUT", ")", "&&", "thread", "!=", "null...
Sets the state and timer task executing thread of this timer @param state The state of this timer @param thread The executing thread which is processing the timeout task
[ "Sets", "the", "state", "and", "timer", "task", "executing", "thread", "of", "this", "timer" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerImpl.java#L498-L502
test
Sets the timer state and the thread.
Of course, here is the Java code you requested: ```java protected void setTimerState(TimerState state, Thread thread) { assert ((state == TimerState.IN_TIMEOUT || state == TimerState.RETRY_TIMEOUT) && thread != null) || thread == null : "Invalid to set timer state " + state + " with executing Thread " + thread...
wildfly/wildfly
jpa/subsystem/src/main/java/org/jboss/as/jpa/persistenceprovider/PersistenceProviderResolverImpl.java
PersistenceProviderResolverImpl.getPersistenceProviders
@Override public List<PersistenceProvider> getPersistenceProviders() { List<PersistenceProvider> providersCopy = new ArrayList<>(providers.size()); /** * Add the application specified providers first so they are found before the global providers */ synchronized(persistence...
java
@Override public List<PersistenceProvider> getPersistenceProviders() { List<PersistenceProvider> providersCopy = new ArrayList<>(providers.size()); /** * Add the application specified providers first so they are found before the global providers */ synchronized(persistence...
[ "@", "Override", "public", "List", "<", "PersistenceProvider", ">", "getPersistenceProviders", "(", ")", "{", "List", "<", "PersistenceProvider", ">", "providersCopy", "=", "new", "ArrayList", "<>", "(", "providers", ".", "size", "(", ")", ")", ";", "/**\n ...
Return a new instance of each persistence provider class @return
[ "Return", "a", "new", "instance", "of", "each", "persistence", "provider", "class" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/subsystem/src/main/java/org/jboss/as/jpa/persistenceprovider/PersistenceProviderResolverImpl.java#L66-L109
test
Get the list of persistence providers.
Of course, here is the Java code you requested: ```java @Override public List<PersistenceProvider> getPersistenceProviders() { List<PersistenceProvider> providersCopy = new ArrayList<>(providers.size()); /** * Add the application specified providers first so they are found before the glob...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/matcher/RestAssuredMatchers.java
RestAssuredMatchers.containsPath
public static ResponseAwareMatcher<Response> containsPath(final String path) { return response -> containsString(response.<String>path(path)); }
java
public static ResponseAwareMatcher<Response> containsPath(final String path) { return response -> containsString(response.<String>path(path)); }
[ "public", "static", "ResponseAwareMatcher", "<", "Response", ">", "containsPath", "(", "final", "String", "path", ")", "{", "return", "response", "->", "containsString", "(", "response", ".", "<", "String", ">", "path", "(", "path", ")", ")", ";", "}" ]
Creates a {@link ResponseAwareMatcher} that extracts the given path from the response and wraps it in a {@link org.hamcrest.Matchers#equalTo(Object)} matcher. This is useful if you have a resource that e.g. returns the given JSON: <pre> { "userId" : "my-id", "href" : "http://localhost:8080/my-id" } </pre> you can then ...
[ "Creates", "a", "{", "@link", "ResponseAwareMatcher", "}", "that", "extracts", "the", "given", "path", "from", "the", "response", "and", "wraps", "it", "in", "a", "{", "@link", "org", ".", "hamcrest", ".", "Matchers#equalTo", "(", "Object", ")", "}", "matc...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/matcher/RestAssuredMatchers.java#L217-L219
test
Create a matcher that matches responses that contain a path.
Of course, here is the Java code you requested: ```java public static ResponseAwareMatcher<Response> containsPath(final String path) { return response -> containsString(response.<String>path(path)); } ``` Hope this helps!
ZacSweers/barber
api/src/main/java/io/sweers/barber/WeakHashSet.java
WeakHashSet.processQueue
private void processQueue() { WeakElement wv = null; while ((wv = (WeakElement) this.queue.poll()) != null) { super.remove(wv); } }
java
private void processQueue() { WeakElement wv = null; while ((wv = (WeakElement) this.queue.poll()) != null) { super.remove(wv); } }
[ "private", "void", "processQueue", "(", ")", "{", "WeakElement", "wv", "=", "null", ";", "while", "(", "(", "wv", "=", "(", "WeakElement", ")", "this", ".", "queue", ".", "poll", "(", ")", ")", "!=", "null", ")", "{", "super", ".", "remove", "(", ...
Removes all garbage collected values with their keys from the map. Since we don't know how much the ReferenceQueue.poll() operation costs, we should call it only in the add() method.
[ "Removes", "all", "garbage", "collected", "values", "with", "their", "keys", "from", "the", "map", ".", "Since", "we", "don", "t", "know", "how", "much", "the", "ReferenceQueue", ".", "poll", "()", "operation", "costs", "we", "should", "call", "it", "only"...
05c0fb10af855ea3d41b717f0b451ee18b23ce5b
https://github.com/ZacSweers/barber/blob/05c0fb10af855ea3d41b717f0b451ee18b23ce5b/api/src/main/java/io/sweers/barber/WeakHashSet.java#L135-L141
test
Process the queue of weak elements.
Of course, here is the Java code you requested: ```java private void processQueue() { WeakElement wv = null; while ((wv = (WeakElement) this.queue.poll()) != null) { super.remove(wv); } } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/Activator.java
Activator.logError
public static void logError(final String message, final Throwable thr) { getDefault().getLog().log(error(message, thr)); }
java
public static void logError(final String message, final Throwable thr) { getDefault().getLog().log(error(message, thr)); }
[ "public", "static", "void", "logError", "(", "final", "String", "message", ",", "final", "Throwable", "thr", ")", "{", "getDefault", "(", ")", ".", "getLog", "(", ")", ".", "log", "(", "error", "(", "message", ",", "thr", ")", ")", ";", "}" ]
Utility method to log errors in the Egit plugin. @param message User comprehensible message @param thr The exception through which we noticed the error
[ "Utility", "method", "to", "log", "errors", "in", "the", "Egit", "plugin", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse/src/main/java/org/kie/eclipse/Activator.java#L104-L106
test
Logs an error message and the given exception.
Of course, here is the Java code you requested: ```java public static void logError(final String message, final Throwable thr) { getDefault().getLog().log(error(message, thr)); } ``` Hope this helps!
stanfy/enroscar
io/src/main/java/com/stanfy/enroscar/io/PoolableBufferedInputStream.java
PoolableBufferedInputStream.skip
@Override public synchronized long skip(final long amount) throws IOException { // Use local refs since buf and in may be invalidated by an // unsynchronized close() final byte[] localBuf = buf; final InputStream localIn = in; if (localBuf == null) { throw new IOException("Stream is c...
java
@Override public synchronized long skip(final long amount) throws IOException { // Use local refs since buf and in may be invalidated by an // unsynchronized close() final byte[] localBuf = buf; final InputStream localIn = in; if (localBuf == null) { throw new IOException("Stream is c...
[ "@", "Override", "public", "synchronized", "long", "skip", "(", "final", "long", "amount", ")", "throws", "IOException", "{", "// Use local refs since buf and in may be invalidated by an\r", "// unsynchronized close()\r", "final", "byte", "[", "]", "localBuf", "=", "buf",...
Skips {@code amount} number of bytes in this stream. Subsequent {@code read()}'s will not return these bytes unless {@code reset()} is used. @param amount the number of bytes to skip. {@code skip} does nothing and returns 0 if {@code amount} is less than zero. @return the number of bytes actually skipped. @throws IOEx...
[ "Skips", "{", "@code", "amount", "}", "number", "of", "bytes", "in", "this", "stream", ".", "Subsequent", "{", "@code", "read", "()", "}", "s", "will", "not", "return", "these", "bytes", "unless", "{", "@code", "reset", "()", "}", "is", "used", "." ]
0e64f3c309d62e359b55ddcba10e3cc592f5e083
https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/io/src/main/java/com/stanfy/enroscar/io/PoolableBufferedInputStream.java#L348-L385
test
Reads the specified number of bytes from the underlying stream.
Of course, here is the Java code you requested: ```java @Override public synchronized long skip(final long amount) throws IOException { // Use local refs since buf and in may be invalidated by an // unsynchronized close() final byte[] localBuf = buf; final InputStream localIn = in; if (loca...
dschulten/hydra-java
spring-hateoas-ext/src/main/java/de/escalon/hypermedia/affordance/Affordance.java
Affordance.hasUnsatisfiedRequiredVariables
@JsonIgnore public boolean hasUnsatisfiedRequiredVariables() { for (ActionDescriptor actionDescriptor : actionDescriptors) { Map<String, ActionInputParameter> requiredParameters = actionDescriptor.getRequiredParameters(); for (ActionInputParameter annotatedParame...
java
@JsonIgnore public boolean hasUnsatisfiedRequiredVariables() { for (ActionDescriptor actionDescriptor : actionDescriptors) { Map<String, ActionInputParameter> requiredParameters = actionDescriptor.getRequiredParameters(); for (ActionInputParameter annotatedParame...
[ "@", "JsonIgnore", "public", "boolean", "hasUnsatisfiedRequiredVariables", "(", ")", "{", "for", "(", "ActionDescriptor", "actionDescriptor", ":", "actionDescriptors", ")", "{", "Map", "<", "String", ",", "ActionInputParameter", ">", "requiredParameters", "=", "action...
Determines if the affordance has unsatisfied required variables. This allows to decide if the affordance can also be treated as a plain Link without template variables if the caller omits all optional variables. Serializers can use this to render it as a resource with optional search features. @return true if the affo...
[ "Determines", "if", "the", "affordance", "has", "unsatisfied", "required", "variables", ".", "This", "allows", "to", "decide", "if", "the", "affordance", "can", "also", "be", "treated", "as", "a", "plain", "Link", "without", "template", "variables", "if", "the...
21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a
https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/affordance/Affordance.java#L624-L637
test
Checks if any of the required parameters are missing values.
Of course, here is the Java code you requested: ```java @JsonIgnore public boolean hasUnsatisfiedRequiredVariables() { for (ActionDescriptor actionDescriptor : actionDescriptors) { Map<String, ActionInputParameter> requiredParameters = actionDescriptor.getRequiredParameters...
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/Scanner.java
Scanner.match
protected final boolean match(final char[] target, final int ndx) { if (ndx + target.length >= total) { return false; } int j = ndx; for (int i = 0; i < target.length; i++, j++) { if (input[j] != target[i]) { return false; } } return true; }
java
protected final boolean match(final char[] target, final int ndx) { if (ndx + target.length >= total) { return false; } int j = ndx; for (int i = 0; i < target.length; i++, j++) { if (input[j] != target[i]) { return false; } } return true; }
[ "protected", "final", "boolean", "match", "(", "final", "char", "[", "]", "target", ",", "final", "int", "ndx", ")", "{", "if", "(", "ndx", "+", "target", ".", "length", ">=", "total", ")", "{", "return", "false", ";", "}", "int", "j", "=", "ndx", ...
Matches char buffer with content on given location.
[ "Matches", "char", "buffer", "with", "content", "on", "given", "location", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/Scanner.java#L88-L102
test
Checks if the target char array matches the input char array.
Of course, here is the Java code you requested: ```java protected final boolean match(final char[] target, final int ndx) { if (ndx + target.length >= total) { return false; } int j = ndx; for (int i = 0; i < target.length; i++, j++) { if (input[j] != target[i]) { return false; } } return t...