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
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/util/command/CommandUtil.java
CommandUtil.executeCommand
public CommandResult executeCommand(String objectCommandParam) throws Exception { if (objectCommandParam == null) { return new CommandResult(333, new String[] { "No Object Command provided. 'null' not allowed." }); } return this.executeCommand(new String[] { objectCommandParam }); }
java
public CommandResult executeCommand(String objectCommandParam) throws Exception { if (objectCommandParam == null) { return new CommandResult(333, new String[] { "No Object Command provided. 'null' not allowed." }); } return this.executeCommand(new String[] { objectCommandParam }); }
[ "public", "CommandResult", "executeCommand", "(", "String", "objectCommandParam", ")", "throws", "Exception", "{", "if", "(", "objectCommandParam", "==", "null", ")", "{", "return", "new", "CommandResult", "(", "333", ",", "new", "String", "[", "]", "{", "\"No...
Executes the {@code objectCommandParam} and returns the result. @param objectCommandParam The command to execute. @return The result of the execution. @see CommandUtil#executeCommand(String...) @throws Exception If anything goes wrong during execution.
[ "Executes", "the", "{", "@code", "objectCommandParam", "}", "and", "returns", "the", "result", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/command/CommandUtil.java#L186-L193
test
Execute an object command.
Of course, here is the Java code you requested: ```java public CommandResult executeCommand(String objectCommandParam) throws Exception { if (objectCommandParam == null) { return new CommandResult(333, new String[] { "No Object Command provided. 'null' not allowed." }); } return this.executeCommand(new ...
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientBaseGraph.java
OrientBaseGraph.reuse
public OrientBaseGraph reuse(final ODatabaseDocumentInternal iDatabase) { ODatabaseRecordThreadLocal.instance().set(iDatabase); this.url = iDatabase.getURL(); database = iDatabase; makeActive(); return this; }
java
public OrientBaseGraph reuse(final ODatabaseDocumentInternal iDatabase) { ODatabaseRecordThreadLocal.instance().set(iDatabase); this.url = iDatabase.getURL(); database = iDatabase; makeActive(); return this; }
[ "public", "OrientBaseGraph", "reuse", "(", "final", "ODatabaseDocumentInternal", "iDatabase", ")", "{", "ODatabaseRecordThreadLocal", ".", "instance", "(", ")", ".", "set", "(", "iDatabase", ")", ";", "this", ".", "url", "=", "iDatabase", ".", "getURL", "(", "...
Reuses the underlying database avoiding to create and open it every time. @param iDatabase Underlying database object
[ "Reuses", "the", "underlying", "database", "avoiding", "to", "create", "and", "open", "it", "every", "time", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientBaseGraph.java#L1143-L1151
test
Reuse the database.
Of course, here is the Java code you requested: ```java public OrientBaseGraph reuse(final ODatabaseDocumentInternal iDatabase) { ODatabaseRecordThreadLocal.instance().set(iDatabase); this.url = iDatabase.getURL(); database = iDatabase; makeActive(); return this; } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/io/ZipUtil.java
ZipUtil.addToZip
public static void addToZip(final ZipOutputStream zos, final File file, String path, final String comment, final boolean recursive) throws IOException { if (!file.exists()) { throw new FileNotFoundException(file.toString()); } if (path == null) { path = file.getName(); } while (path.length() != 0 && p...
java
public static void addToZip(final ZipOutputStream zos, final File file, String path, final String comment, final boolean recursive) throws IOException { if (!file.exists()) { throw new FileNotFoundException(file.toString()); } if (path == null) { path = file.getName(); } while (path.length() != 0 && p...
[ "public", "static", "void", "addToZip", "(", "final", "ZipOutputStream", "zos", ",", "final", "File", "file", ",", "String", "path", ",", "final", "String", "comment", ",", "final", "boolean", "recursive", ")", "throws", "IOException", "{", "if", "(", "!", ...
Adds single entry to ZIP output stream. @param zos zip output stream @param file file or folder to add @param path relative path of file entry; if <code>null</code> files name will be used instead @param comment optional comment @param recursive when set to <code>true</code> content of added folders will be added, too
[ "Adds", "single", "entry", "to", "ZIP", "output", "stream", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/ZipUtil.java#L280-L342
test
Adds a file to a zip output stream.
Of course, here is the Java code you requested: ```java public static void addToZip(final ZipOutputStream zos, final File file, String path, final String comment, final boolean recursive) throws IOException { if (!file.exists()) { throw new FileNotFoundException(file.toString()); } if (path == null) { pat...
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/retrieval/Document.java
Document.setSectionLabels
public void setSectionLabels(int i, String v) { if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sectionLabels == null) jcasType.jcas.throwFeatMissing("sectionLabels", "edu.cmu.lti.oaqa.type.retrieval.Document"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Docume...
java
public void setSectionLabels(int i, String v) { if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sectionLabels == null) jcasType.jcas.throwFeatMissing("sectionLabels", "edu.cmu.lti.oaqa.type.retrieval.Document"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Docume...
[ "public", "void", "setSectionLabels", "(", "int", "i", ",", "String", "v", ")", "{", "if", "(", "Document_Type", ".", "featOkTst", "&&", "(", "(", "Document_Type", ")", "jcasType", ")", ".", "casFeat_sectionLabels", "==", "null", ")", "jcasType", ".", "jca...
indexed setter for sectionLabels - sets an indexed value - Section labels in the document, e.g. sections.0, sections1, etc. @generated @param i index in the array to set @param v value to set into the array
[ "indexed", "setter", "for", "sectionLabels", "-", "sets", "an", "indexed", "value", "-", "Section", "labels", "in", "the", "document", "e", ".", "g", ".", "sections", ".", "0", "sections1", "etc", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/retrieval/Document.java#L192-L196
test
indexed setter for sectionLabels - sets an indexed value -
Of course, here is the Java code you requested: ```java public void setSectionLabels(int i, String v) { if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sectionLabels == null) jcasType.jcas.throwFeatMissing("sectionLabels", "edu.cmu.lti.oaqa.type.retrieval.Document"); jcasType.jcas.check...
jbundle/util
jbackup/src/main/java/org/jbundle/jbackup/destination/FilesystemDestinationPropertyView.java
FilesystemDestinationPropertyView.controlsToProperties
public void controlsToProperties() { super.controlsToProperties(); String strPathname = m_tfRootPathname.getText(); m_properties.setProperty(DEST_ROOT_PATHNAME_PARAM, strPathname); }
java
public void controlsToProperties() { super.controlsToProperties(); String strPathname = m_tfRootPathname.getText(); m_properties.setProperty(DEST_ROOT_PATHNAME_PARAM, strPathname); }
[ "public", "void", "controlsToProperties", "(", ")", "{", "super", ".", "controlsToProperties", "(", ")", ";", "String", "strPathname", "=", "m_tfRootPathname", ".", "getText", "(", ")", ";", "m_properties", ".", "setProperty", "(", "DEST_ROOT_PATHNAME_PARAM", ",",...
/* Set the properties to the current control values.
[ "/", "*", "Set", "the", "properties", "to", "the", "current", "control", "values", "." ]
5af0f2292f56f29f70cbc26d0bfa72f89ae31be0
https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/destination/FilesystemDestinationPropertyView.java#L76-L81
test
Set the properties of the target object to the target object.
Of course, here is the Java code you requested: ```java public void controlsToProperties() { super.controlsToProperties(); String strPathname = m_tfRootPathname.getText(); m_properties.setProperty(DEST_ROOT_PATHNAME_PARAM, strPathname); } ``` Hope this helps!
wildfly/wildfly
system-jmx/src/main/java/org/jboss/system/ServiceMBeanSupport.java
ServiceMBeanSupport.preRegister
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { this.server = server; serviceName = getObjectName(server, name); return serviceName; }
java
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { this.server = server; serviceName = getObjectName(server, name); return serviceName; }
[ "public", "ObjectName", "preRegister", "(", "MBeanServer", "server", ",", "ObjectName", "name", ")", "throws", "Exception", "{", "this", ".", "server", "=", "server", ";", "serviceName", "=", "getObjectName", "(", "server", ",", "name", ")", ";", "return", "...
Callback method of {@link javax.management.MBeanRegistration} before the MBean is registered at the JMX Agent. <p> <b>Attention</b>: Always call this method when you overwrite it in a subclass because it saves the Object Name of the MBean. @param server Reference to the JMX Agent this MBean is registered on @param na...
[ "Callback", "method", "of", "{", "@link", "javax", ".", "management", ".", "MBeanRegistration", "}", "before", "the", "MBean", "is", "registered", "at", "the", "JMX", "Agent", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/system-jmx/src/main/java/org/jboss/system/ServiceMBeanSupport.java#L356-L362
test
This method is called before the MBeanServer is registered.
Of course, here is the Java code you requested: ```java public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { this.server = server; serviceName = getObjectName(server, name); return serviceName; } ``` Hope this helps!
rupertlssmith/lojix
base/base/src/main/com/thesett/util/log4j/LoggingDiagnostic.java
LoggingDiagnostic.listHandlers
private static StringBuffer listHandlers(Handler[] handlers, StringBuffer buffer) { for (Handler handler : handlers) { Class<? extends Handler> handlerClass = handler.getClass(); Formatter formatter = handler.getFormatter(); buffer.append("Handler:").append(handl...
java
private static StringBuffer listHandlers(Handler[] handlers, StringBuffer buffer) { for (Handler handler : handlers) { Class<? extends Handler> handlerClass = handler.getClass(); Formatter formatter = handler.getFormatter(); buffer.append("Handler:").append(handl...
[ "private", "static", "StringBuffer", "listHandlers", "(", "Handler", "[", "]", "handlers", ",", "StringBuffer", "buffer", ")", "{", "for", "(", "Handler", "handler", ":", "handlers", ")", "{", "Class", "<", "?", "extends", "Handler", ">", "handlerClass", "="...
Lists information about logging handlers. @param handlers The handlers. @param buffer A string buffer to build up the listing in. @return The string buffer to build up the listing in.
[ "Lists", "information", "about", "logging", "handlers", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/base/src/main/com/thesett/util/log4j/LoggingDiagnostic.java#L119-L136
test
List handlers.
Of course, here is the Java code you requested: ```java private static StringBuffer listHandlers(Handler[] handlers, StringBuffer buffer) { for (Handler handler : handlers) { Class<? extends Handler> handlerClass = handler.getClass(); Formatter formatter = handler.getFormatt...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/properties/ContextualProperties.java
ContextualProperties.getProperty
public String getProperty(Object base, String modifier, String key) { return getProperty(base.getClass().getName(), modifier, key); }
java
public String getProperty(Object base, String modifier, String key) { return getProperty(base.getClass().getName(), modifier, key); }
[ "public", "String", "getProperty", "(", "Object", "base", ",", "String", "modifier", ",", "String", "key", ")", "{", "return", "getProperty", "(", "base", ".", "getClass", "(", ")", ".", "getName", "(", ")", ",", "modifier", ",", "key", ")", ";", "}" ]
Looks up a property value relative to the environment, base class and modifier. The default environment will be checked for a matching property if defaults are being used. @param base An object of the class to retrieve properties relative to. @param modifier The modifier (which may stand for a method of the clas...
[ "Looks", "up", "a", "property", "value", "relative", "to", "the", "environment", "base", "class", "and", "modifier", ".", "The", "default", "environment", "will", "be", "checked", "for", "a", "matching", "property", "if", "defaults", "are", "being", "used", ...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/properties/ContextualProperties.java#L255-L258
test
Get a property from a base object.
Of course, here is the Java code you requested: ```java public String getProperty(Object base, String modifier, String key) { return getProperty(base.getClass().getName(), modifier, key); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.concatMapIterable
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <U> Observable<U> concatMapIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper, int prefetch) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch");...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <U> Observable<U> concatMapIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper, int prefetch) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefetch, "prefetch");...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "U", ">", "Observable", "<", "U", ">", "concatMapIterable", "(", "final", "Function", "<", "?", "super", "T", ",", "?", "extends", "Iterable"...
Returns an Observable that concatenate each item emitted by the source ObservableSource with the values in an Iterable corresponding to that item that is generated by a selector. <p> <img width="640" height="275" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concatMapIterable.o.png" alt=""> <dl...
[ "Returns", "an", "Observable", "that", "concatenate", "each", "item", "emitted", "by", "the", "source", "ObservableSource", "with", "the", "values", "in", "an", "Iterable", "corresponding", "to", "that", "item", "that", "is", "generated", "by", "a", "selector", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L6850-L6856
test
Concatenates the source observable with the results of applying the supplied function to each element of the source observable.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <U> Observable<U> concatMapIterable(final Function<? super T, ? extends Iterable<? extends U>> mapper, int prefetch) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ...
oblac/jodd
jodd-bean/src/main/java/jodd/typeconverter/Converter.java
Converter.toDoubleValue
public double toDoubleValue(final Object value, final double defaultValue) { final Double result = toDouble(value); if (result == null) { return defaultValue; } return result.doubleValue(); }
java
public double toDoubleValue(final Object value, final double defaultValue) { final Double result = toDouble(value); if (result == null) { return defaultValue; } return result.doubleValue(); }
[ "public", "double", "toDoubleValue", "(", "final", "Object", "value", ",", "final", "double", "defaultValue", ")", "{", "final", "Double", "result", "=", "toDouble", "(", "value", ")", ";", "if", "(", "result", "==", "null", ")", "{", "return", "defaultVal...
Converts value to <code>double</code>. Returns default value when conversion result is <code>null</code>.
[ "Converts", "value", "to", "<code", ">", "double<", "/", "code", ">", ".", "Returns", "default", "value", "when", "conversion", "result", "is", "<code", ">", "null<", "/", "code", ">", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/typeconverter/Converter.java#L235-L241
test
Converts value into double.
Of course, here is the Java code you requested: ```java public double toDoubleValue(final Object value, final double defaultValue) { final Double result = toDouble(value); if (result == null) { return defaultValue; } return result.doubleValue(); } ``` Hope this helps!
tiefaces/TieFaces
src/org/tiefaces/components/websheet/chart/ChartHelper.java
ChartHelper.getChartIdFromParent
private String getChartIdFromParent(final XSSFChart chart, final String sheetName) { if (chart.getParent() != null) { for (RelationPart rp : chart.getParent().getRelationParts()) { if (rp.getDocumentPart() == chart) { return sheetName + "!" + rp.getRelationship().getId(); } } } retu...
java
private String getChartIdFromParent(final XSSFChart chart, final String sheetName) { if (chart.getParent() != null) { for (RelationPart rp : chart.getParent().getRelationParts()) { if (rp.getDocumentPart() == chart) { return sheetName + "!" + rp.getRelationship().getId(); } } } retu...
[ "private", "String", "getChartIdFromParent", "(", "final", "XSSFChart", "chart", ",", "final", "String", "sheetName", ")", "{", "if", "(", "chart", ".", "getParent", "(", ")", "!=", "null", ")", "{", "for", "(", "RelationPart", "rp", ":", "chart", ".", "...
Gets the chart id from parent. @param chart the chart @param sheetName the sheet name @return the chart id from parent
[ "Gets", "the", "chart", "id", "from", "parent", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/chart/ChartHelper.java#L689-L699
test
Gets the chart id from the parent of the chart.
Of course, here is the Java code you requested: ```java private String getChartIdFromParent(final XSSFChart chart, final String sheetName) { if (chart.getParent() != null) { for (RelationPart rp : chart.getParent().getRelationParts()) { if (rp.getDocumentPart() == chart) { return sheetName + "!" ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft2/coverage/remote/CdmrfWriter.java
CdmrfWriter.encodeDataResponse
public CdmrFeatureProto.CoverageDataResponse encodeDataResponse(Iterable<CoverageCoordAxis> axes, Iterable<CoverageCoordSys> coordSys, Iterable<CoverageTransform> transforms, List<GeoReferencedArray> arrays, boolean deflate) { CdmrFeatureProto.CoverageDataResponse.Builder builder = CdmrFeatureProto.Coverag...
java
public CdmrFeatureProto.CoverageDataResponse encodeDataResponse(Iterable<CoverageCoordAxis> axes, Iterable<CoverageCoordSys> coordSys, Iterable<CoverageTransform> transforms, List<GeoReferencedArray> arrays, boolean deflate) { CdmrFeatureProto.CoverageDataResponse.Builder builder = CdmrFeatureProto.Coverag...
[ "public", "CdmrFeatureProto", ".", "CoverageDataResponse", "encodeDataResponse", "(", "Iterable", "<", "CoverageCoordAxis", ">", "axes", ",", "Iterable", "<", "CoverageCoordSys", ">", "coordSys", ",", "Iterable", "<", "CoverageTransform", ">", "transforms", ",", "List...
/* message GeoReferencedArray { required string gridName = 1; // full escaped name. required DataType dataType = 2; optional bool bigend = 3 [default = true]; optional uint32 version = 4 [default = 0]; optional Compress compress = 5 [default = NONE]; optional uint32 uncompressedSize = 6; repeated uint32 shape...
[ "/", "*", "message", "GeoReferencedArray", "{", "required", "string", "gridName", "=", "1", ";", "//", "full", "escaped", "name", ".", "required", "DataType", "dataType", "=", "2", ";", "optional", "bool", "bigend", "=", "3", "[", "default", "=", "true", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/coverage/remote/CdmrfWriter.java#L390-L404
test
Encode a CoverageDataResponse object
Of course, here is the Java code you requested: ```java public CdmrFeatureProto.CoverageDataResponse encodeDataResponse(Iterable<CoverageCoordAxis> axes, Iterable<CoverageCoordSys> coordSys, Iterable<CoverageTransform> transforms, List<GeoReferencedArray> arrays, boolean deflate) { CdmrFeatureProto.Covera...
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/WisItWritingExample.java
WisItWritingExample.createOBJEKT
protected static ObjectType createOBJEKT() { // create an example real estate ObjectType obj = FACTORY.createObjectType(); obj.setABSTELLPLATZ(RandomUtils.nextInt(0, 2) == 1); obj.setAUFANFRAGE(RandomUtils.nextInt(0, 2) == 1); obj.setAUFZUG(RandomUtils.nextInt(0, 2) == 1); ...
java
protected static ObjectType createOBJEKT() { // create an example real estate ObjectType obj = FACTORY.createObjectType(); obj.setABSTELLPLATZ(RandomUtils.nextInt(0, 2) == 1); obj.setAUFANFRAGE(RandomUtils.nextInt(0, 2) == 1); obj.setAUFZUG(RandomUtils.nextInt(0, 2) == 1); ...
[ "protected", "static", "ObjectType", "createOBJEKT", "(", ")", "{", "// create an example real estate", "ObjectType", "obj", "=", "FACTORY", ".", "createObjectType", "(", ")", ";", "obj", ".", "setABSTELLPLATZ", "(", "RandomUtils", ".", "nextInt", "(", "0", ",", ...
Create an {@link ObjectType} with some example data. @return created example object
[ "Create", "an", "{", "@link", "ObjectType", "}", "with", "some", "example", "data", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/WisItWritingExample.java#L121-L174
test
Create an object of type TYPEOBJEKT
Of course, here is the Java code you requested: ```java protected static ObjectType createOBJEKT() { // create an example real estate ObjectType obj = FACTORY.createObjectType(); obj.setABSTELLPLATZ(RandomUtils.nextInt(0, 2) == 1); obj.setAUFANFRAGE(RandomUtils.nextInt(0, 2) == 1); ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis2D.java
CoordinateAxis2D.connectLon
static private double connectLon(double connect, double val) { if (Double.isNaN(connect)) return val; if (Double.isNaN(val)) return val; double diff = val - connect; if (Math.abs(diff) < MAX_JUMP) return val; // common case fast // we have to add or subtract 360 double result = diff > 0 ...
java
static private double connectLon(double connect, double val) { if (Double.isNaN(connect)) return val; if (Double.isNaN(val)) return val; double diff = val - connect; if (Math.abs(diff) < MAX_JUMP) return val; // common case fast // we have to add or subtract 360 double result = diff > 0 ...
[ "static", "private", "double", "connectLon", "(", "double", "connect", ",", "double", "val", ")", "{", "if", "(", "Double", ".", "isNaN", "(", "connect", ")", ")", "return", "val", ";", "if", "(", "Double", ".", "isNaN", "(", "val", ")", ")", "return...
larger than you would ever expect
[ "larger", "than", "you", "would", "ever", "expect" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/CoordinateAxis2D.java#L118-L130
test
This is a helper method for the common case of the algorithm. It is used to determine if the lon value is greater than or equal to the connect value.
Of course, here is the Java code you requested: ```java static private double connectLon(double connect, double val) { if (Double.isNaN(connect)) return val; if (Double.isNaN(val)) return val; double diff = val - connect; if (Math.abs(diff) < MAX_JUMP) return val; // common case fast // we h...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java
GeometryMetadataDataSource.createOrUpdate
public boolean createOrUpdate(GeometryMetadata metadata) { boolean success = false; if (exists(metadata)) { success = update(metadata); } else { create(metadata); success = true; } return success; }
java
public boolean createOrUpdate(GeometryMetadata metadata) { boolean success = false; if (exists(metadata)) { success = update(metadata); } else { create(metadata); success = true; } return success; }
[ "public", "boolean", "createOrUpdate", "(", "GeometryMetadata", "metadata", ")", "{", "boolean", "success", "=", "false", ";", "if", "(", "exists", "(", "metadata", ")", ")", "{", "success", "=", "update", "(", "metadata", ")", ";", "}", "else", "{", "cr...
Create the geometry metadata or update if it already exists @param metadata geometry metadata @return created flag
[ "Create", "the", "geometry", "metadata", "or", "update", "if", "it", "already", "exists" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java#L256-L268
test
Create or update the GeometryMetadata object.
Of course, here is the Java code you requested: ```java public boolean createOrUpdate(GeometryMetadata metadata) { boolean success = false; if (exists(metadata)) { success = update(metadata); } else { create(metadata); success = true; } ret...
apache/parquet-mr
parquet-common/src/main/java/org/apache/parquet/bytes/LittleEndianDataInputStream.java
LittleEndianDataInputStream.readLong
public final long readLong() throws IOException { // TODO: see perf question above in readInt readFully(readBuffer, 0, 8); return (((long)readBuffer[7] << 56) + ((long)(readBuffer[6] & 255) << 48) + ((long)(readBuffer[5] & 255) << 40) + ((long)(readBuffer[4] & 255) << 32) + (...
java
public final long readLong() throws IOException { // TODO: see perf question above in readInt readFully(readBuffer, 0, 8); return (((long)readBuffer[7] << 56) + ((long)(readBuffer[6] & 255) << 48) + ((long)(readBuffer[5] & 255) << 40) + ((long)(readBuffer[4] & 255) << 32) + (...
[ "public", "final", "long", "readLong", "(", ")", "throws", "IOException", "{", "// TODO: see perf question above in readInt", "readFully", "(", "readBuffer", ",", "0", ",", "8", ")", ";", "return", "(", "(", "(", "long", ")", "readBuffer", "[", "7", "]", "<<...
Bytes for this operation are read from the contained input stream. @return the next eight bytes of this input stream, interpreted as a <code>long</code>. @exception EOFException if this input stream reaches the end before reading eight bytes. @exception IOException the stream has been closed and the contained...
[ "Bytes", "for", "this", "operation", "are", "read", "from", "the", "contained", "input", "stream", "." ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-common/src/main/java/org/apache/parquet/bytes/LittleEndianDataInputStream.java#L372-L383
test
Read a long from the underlying stream.
Of course, here is the Java code you requested: ```java public final long readLong() throws IOException { // TODO: see perf question above in readInt readFully(readBuffer, 0, 8); return (((long)readBuffer[7] << 56) + ((long)(readBuffer[6] & 255) << 48) + ((long)(readBuffer[5] & 255) << 40) ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLRevoke.java
OCommandExecutorSQLRevoke.execute
public Object execute(final Map<Object, Object> iArgs) { if (role == null) throw new OCommandExecutionException("Cannot execute the command because it has not yet been parsed"); role.revoke(resource, privilege); role.save(); return role; }
java
public Object execute(final Map<Object, Object> iArgs) { if (role == null) throw new OCommandExecutionException("Cannot execute the command because it has not yet been parsed"); role.revoke(resource, privilege); role.save(); return role; }
[ "public", "Object", "execute", "(", "final", "Map", "<", "Object", ",", "Object", ">", "iArgs", ")", "{", "if", "(", "role", "==", "null", ")", "throw", "new", "OCommandExecutionException", "(", "\"Cannot execute the command because it has not yet been parsed\"", ")...
Execute the command.
[ "Execute", "the", "command", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLRevoke.java#L102-L110
test
Execute the COPY UNIQUE UNIQUE.
Of course, here is the Java code you requested: ```java public Object execute(final Map<Object, Object> iArgs) { if (role == null) throw new OCommandExecutionException("Cannot execute the command because it has not yet been parsed"); role.revoke(resource, privilege); role.save(); return ...
playframework/playframework
core/play/src/main/java/play/libs/crypto/DefaultCookieSigner.java
DefaultCookieSigner.sign
@Override public String sign(String message, byte[] key) { return signer.sign(message, key); }
java
@Override public String sign(String message, byte[] key) { return signer.sign(message, key); }
[ "@", "Override", "public", "String", "sign", "(", "String", "message", ",", "byte", "[", "]", "key", ")", "{", "return", "signer", ".", "sign", "(", "message", ",", "key", ")", ";", "}" ]
Signs the given String using the given key. <br> @param message The message to sign. @param key The private key to sign with. @return A hexadecimal encoded signature.
[ "Signs", "the", "given", "String", "using", "the", "given", "key", ".", "<br", ">" ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/libs/crypto/DefaultCookieSigner.java#L39-L42
test
Sign a message using the specified key.
Of course, here is the Java code you requested: ```java @Override public String sign(String message, byte[] key) { return signer.sign(message, key); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createPostfach
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "postfach") public JAXBElement<String> createPostfach(String value) { return new JAXBElement<String>(_Postfach_QNAME, String.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "postfach") public JAXBElement<String> createPostfach(String value) { return new JAXBElement<String>(_Postfach_QNAME, String.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"postfach\"", ")", "public", "JAXBElement", "<", "String", ">", "createPostfach", "(", "String", "value", ")", "{", "return", "new", "JAXBElement", "<", "String", ">",...
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "String", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L973-L976
test
Create an instance of the postfach property.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "postfach") public JAXBElement<String> createPostfach(String value) { return new JAXBElement<String>(_Postfach_QNAME, String.class, null, value); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createAnzahlZimmer
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "anzahl_zimmer") @XmlJavaTypeAdapter(Adapter7 .class) public JAXBElement<BigDecimal> createAnzahlZimmer(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlZimmer_QNAME, BigDecimal.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "anzahl_zimmer") @XmlJavaTypeAdapter(Adapter7 .class) public JAXBElement<BigDecimal> createAnzahlZimmer(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlZimmer_QNAME, BigDecimal.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"anzahl_zimmer\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter7", ".", "class", ")", "public", "JAXBElement", "<", "BigDecimal", ">", "createAnzahlZimmer", "(", "BigDeci...
Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "BigDecimal", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L1585-L1589
test
Create an instance of an AnzahlZimmer in the Adapter7.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "anzahl_zimmer") @XmlJavaTypeAdapter(Adapter7 .class) public JAXBElement<BigDecimal> createAnzahlZimmer(BigDecimal value) { return new JAXBElement<BigDecimal>(_AnzahlZimmer_QNAME, BigDeci...
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java
TimerServiceImpl.createSingleActionTimer
@Override public Timer createSingleActionTimer(Date expiration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException { assertTimerServiceState(); if (expiration == null) { throw EJB3_TIMER_LOGGER.expirationIsNull(); } i...
java
@Override public Timer createSingleActionTimer(Date expiration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException { assertTimerServiceState(); if (expiration == null) { throw EJB3_TIMER_LOGGER.expirationIsNull(); } i...
[ "@", "Override", "public", "Timer", "createSingleActionTimer", "(", "Date", "expiration", ",", "TimerConfig", "timerConfig", ")", "throws", "IllegalArgumentException", ",", "IllegalStateException", ",", "EJBException", "{", "assertTimerServiceState", "(", ")", ";", "if"...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java#L295-L306
test
Create a single action timer.
Of course, here is the Java code you requested: ```java @Override public Timer createSingleActionTimer(Date expiration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException { assertTimerServiceState(); if (expiration == null) { throw ...
GojaFramework/goja
goja-core/src/main/java/goja/core/kits/lang/CharKit.java
CharKit.indexOfChars
public static int indexOfChars(String string, char[] chars, int startindex) { int stringLen = string.length(); for (int i = startindex; i < stringLen; i++) { char c = string.charAt(i); for (char aChar : chars) { if (c == aChar) { return i; ...
java
public static int indexOfChars(String string, char[] chars, int startindex) { int stringLen = string.length(); for (int i = startindex; i < stringLen; i++) { char c = string.charAt(i); for (char aChar : chars) { if (c == aChar) { return i; ...
[ "public", "static", "int", "indexOfChars", "(", "String", "string", ",", "char", "[", "]", "chars", ",", "int", "startindex", ")", "{", "int", "stringLen", "=", "string", ".", "length", "(", ")", ";", "for", "(", "int", "i", "=", "startindex", ";", "...
Returns the very first index of any char from provided string, starting from specified index offset. Returns index of founded char, or <code>-1</code> if nothing found.
[ "Returns", "the", "very", "first", "index", "of", "any", "char", "from", "provided", "string", "starting", "from", "specified", "index", "offset", ".", "Returns", "index", "of", "founded", "char", "or", "<code", ">", "-", "1<", "/", "code", ">", "if", "n...
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/lang/CharKit.java#L415-L426
test
Gets the index of the first occurrence of a character in a String.
Of course, here is the Java code you requested: ```java public static int indexOfChars(String string, char[] chars, int startindex) { int stringLen = string.length(); for (int i = startindex; i < stringLen; i++) { char c = string.charAt(i); for (char aChar : chars) { ...
oblac/jodd
jodd-json/src/main/java/jodd/json/JsonParser.java
JsonParser.parseUnicode
protected char parseUnicode() { int i0 = CharUtil.hex2int(input[ndx++]); int i1 = CharUtil.hex2int(input[ndx++]); int i2 = CharUtil.hex2int(input[ndx++]); int i3 = CharUtil.hex2int(input[ndx]); return (char) ((i0 << 12) + (i1 << 8) + (i2 << 4) + i3); }
java
protected char parseUnicode() { int i0 = CharUtil.hex2int(input[ndx++]); int i1 = CharUtil.hex2int(input[ndx++]); int i2 = CharUtil.hex2int(input[ndx++]); int i3 = CharUtil.hex2int(input[ndx]); return (char) ((i0 << 12) + (i1 << 8) + (i2 << 4) + i3); }
[ "protected", "char", "parseUnicode", "(", ")", "{", "int", "i0", "=", "CharUtil", ".", "hex2int", "(", "input", "[", "ndx", "++", "]", ")", ";", "int", "i1", "=", "CharUtil", ".", "hex2int", "(", "input", "[", "ndx", "++", "]", ")", ";", "int", "...
Parses 4 characters and returns unicode character.
[ "Parses", "4", "characters", "and", "returns", "unicode", "character", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-json/src/main/java/jodd/json/JsonParser.java#L792-L799
test
Parse a Unicode character.
Of course, here is the Java code you requested: ```java protected char parseUnicode() { int i0 = CharUtil.hex2int(input[ndx++]); int i1 = CharUtil.hex2int(input[ndx++]); int i2 = CharUtil.hex2int(input[ndx++]); int i3 = CharUtil.hex2int(input[ndx]); return (char) ((i0 << 12) + (i1 << 8) + (i2 << 4) + i3); ...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/resource/support/AbstractConfigurableMultipleStrategy.java
AbstractConfigurableMultipleStrategy.createItemsAsString
public static String createItemsAsString(final String... items) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < items.length; i++) { sb.append(items[i]); if (i < items.length - 1) { sb.append(TOKEN_DELIMITER); } } return sb.toString(); }
java
public static String createItemsAsString(final String... items) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < items.length; i++) { sb.append(items[i]); if (i < items.length - 1) { sb.append(TOKEN_DELIMITER); } } return sb.toString(); }
[ "public", "static", "String", "createItemsAsString", "(", "final", "String", "...", "items", ")", "{", "final", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "items", ".", "length", ";...
Creates a comma separated list of items. @VisibleForTesting
[ "Creates", "a", "comma", "separated", "list", "of", "items", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/support/AbstractConfigurableMultipleStrategy.java#L34-L43
test
Create items as string.
Of course, here is the Java code you requested: ```java public static String createItemsAsString(final String... items) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < items.length; i++) { sb.append(items[i]); if (i < items.length - 1) { sb.append(TOKEN_DELIMITER); }...
jboss/jboss-common-core
src/main/java/org/jboss/util/propertyeditor/PropertyEditors.java
PropertyEditors.registerEditor
public static void registerEditor(final String typeName, final String editorTypeName) throws ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class<?> type = loader.loadClass(typeName); Class<?> editorType = loa...
java
public static void registerEditor(final String typeName, final String editorTypeName) throws ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class<?> type = loader.loadClass(typeName); Class<?> editorType = loa...
[ "public", "static", "void", "registerEditor", "(", "final", "String", "typeName", ",", "final", "String", "editorTypeName", ")", "throws", "ClassNotFoundException", "{", "ClassLoader", "loader", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoa...
Register an editor class to be used to editor values of a given target class. @param typeName The classname of the objetcs to be edited. @param editorTypeName The class of the editor. @throws ClassNotFoundException when the class could not be found
[ "Register", "an", "editor", "class", "to", "be", "used", "to", "editor", "values", "of", "a", "given", "target", "class", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/propertyeditor/PropertyEditors.java#L219-L228
test
Register an editor for a type.
Of course, here is the Java code you requested: ```java public static void registerEditor(final String typeName, final String editorTypeName) throws ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class<?> type = lo...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/CommandLineParser.java
CommandLineParser.parseCommandLine
public Properties parseCommandLine(String[] args) throws IllegalArgumentException { Properties options = new Properties(); // Used to keep count of the current 'free' argument. int free = 1; // Used to indicate that the most recently parsed option is expecting arguments. bo...
java
public Properties parseCommandLine(String[] args) throws IllegalArgumentException { Properties options = new Properties(); // Used to keep count of the current 'free' argument. int free = 1; // Used to indicate that the most recently parsed option is expecting arguments. bo...
[ "public", "Properties", "parseCommandLine", "(", "String", "[", "]", "args", ")", "throws", "IllegalArgumentException", "{", "Properties", "options", "=", "new", "Properties", "(", ")", ";", "// Used to keep count of the current 'free' argument.", "int", "free", "=", ...
Parses a set of command line arguments into a set of properties, keyed by the argument flag. The free arguments are keyed by integers as strings starting at "1" and then "2", ... and so on. <p/>See the class level comment for a description of the parsing rules. @param args The command line arguments. @return The ar...
[ "Parses", "a", "set", "of", "command", "line", "arguments", "into", "a", "set", "of", "properties", "keyed", "by", "the", "argument", "flag", ".", "The", "free", "arguments", "are", "keyed", "by", "integers", "as", "strings", "starting", "at", "1", "and", ...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/CommandLineParser.java#L313-L561
test
Parses the command line arguments and returns a Properties object containing the options.
Of course, here is the Java code you requested: ```java public Properties parseCommandLine(String[] args) throws IllegalArgumentException { Properties options = new Properties(); // Used to keep count of the current 'free' argument. int free = 1; // Used to indicate that the most ...
rockagen/commons-lib
src/main/java/com/rockagen/commons/util/ClassUtil.java
ClassUtil.getDeclaredMethods
public static Method[] getDeclaredMethods(Class<?> clazz, boolean recursively) { List<Method> methods = new LinkedList<Method>(); Method[] declaredMethods = clazz.getDeclaredMethods(); Collections.addAll(methods, declaredMethods); Class<?> superClass = clazz.getSuperclass(); if (superClass != null && rec...
java
public static Method[] getDeclaredMethods(Class<?> clazz, boolean recursively) { List<Method> methods = new LinkedList<Method>(); Method[] declaredMethods = clazz.getDeclaredMethods(); Collections.addAll(methods, declaredMethods); Class<?> superClass = clazz.getSuperclass(); if (superClass != null && rec...
[ "public", "static", "Method", "[", "]", "getDeclaredMethods", "(", "Class", "<", "?", ">", "clazz", ",", "boolean", "recursively", ")", "{", "List", "<", "Method", ">", "methods", "=", "new", "LinkedList", "<", "Method", ">", "(", ")", ";", "Method", "...
obtain methods list of specified class If recursively is true, obtain methods from all class hierarchy @param clazz class where fields are searching @param recursively param @return array of methods
[ "obtain", "methods", "list", "of", "specified", "class", "If", "recursively", "is", "true", "obtain", "methods", "from", "all", "class", "hierarchy" ]
f37141cf40be79d130db804c39ce61690541d5f1
https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/util/ClassUtil.java#L212-L227
test
Returns an array of all methods declared in the given class including those declared in the super class.
Of course, here is the Java code you requested: ```java public static Method[] getDeclaredMethods(Class<?> clazz, boolean recursively) { List<Method> methods = new LinkedList<Method>(); Method[] declaredMethods = clazz.getDeclaredMethods(); Collections.addAll(methods, declaredMethods); Class<?> superClass ...
Unidata/thredds
opendap/src/main/java/opendap/servers/SDGrid.java
SDGrid.printDecl
public void printDecl(PrintWriter os, String space, boolean print_semi, boolean constrained) { // BEWARE! Since printDecl()is (multiple) overloaded in BaseType // and all of the different signatures of printDecl() in BaseType // lead to one signature, we must be careful to override that ...
java
public void printDecl(PrintWriter os, String space, boolean print_semi, boolean constrained) { // BEWARE! Since printDecl()is (multiple) overloaded in BaseType // and all of the different signatures of printDecl() in BaseType // lead to one signature, we must be careful to override that ...
[ "public", "void", "printDecl", "(", "PrintWriter", "os", ",", "String", "space", ",", "boolean", "print_semi", ",", "boolean", "constrained", ")", "{", "// BEWARE! Since printDecl()is (multiple) overloaded in BaseType", "// and all of the different signatures of printDecl() in Ba...
Write the variable's declaration in a C-style syntax. This function is used to create textual representation of the Data Descriptor Structure (DDS). See <em>The OPeNDAP User Manual</em> for information about this structure. @param os The <code>PrintWriter</code> on which to print the declaration. @param space...
[ "Write", "the", "variable", "s", "declaration", "in", "a", "C", "-", "style", "syntax", ".", "This", "function", "is", "used", "to", "create", "textual", "representation", "of", "the", "Data", "Descriptor", "Structure", "(", "DDS", ")", ".", "See", "<em", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/SDGrid.java#L97-L163
test
Print the declaration of the N object.
Of course, here is the Java code you requested: ```java public void printDecl(PrintWriter os, String space, boolean print_semi, boolean constrained) { // BEWARE! Since printDecl()is (multiple) overloaded in BaseType // and all of the different signatures of printDecl() in BaseType // lead to o...
amedia/meteo
meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java
ObjectFactory.createLocationTypeStateOfTheSea
@XmlElementDecl(namespace = "", name = "stateOfTheSea", scope = LocationType.class) public JAXBElement<LocationType.StateOfTheSea> createLocationTypeStateOfTheSea(LocationType.StateOfTheSea value) { return new JAXBElement<LocationType.StateOfTheSea>(_LocationTypeStateOfTheSea_QNAME, LocationType.StateOfTheS...
java
@XmlElementDecl(namespace = "", name = "stateOfTheSea", scope = LocationType.class) public JAXBElement<LocationType.StateOfTheSea> createLocationTypeStateOfTheSea(LocationType.StateOfTheSea value) { return new JAXBElement<LocationType.StateOfTheSea>(_LocationTypeStateOfTheSea_QNAME, LocationType.StateOfTheS...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"stateOfTheSea\"", ",", "scope", "=", "LocationType", ".", "class", ")", "public", "JAXBElement", "<", "LocationType", ".", "StateOfTheSea", ">", "createLocationTypeStateOfTheSea", "(", "Loc...
Create an instance of {@link JAXBElement }{@code <}{@link LocationType.StateOfTheSea }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "LocationType", ".", "StateOfTheSea", "}", "{", "@code", ">", "}}" ]
cbb59e1c2f889d15c24f3625d1769b543d4af595
https://github.com/amedia/meteo/blob/cbb59e1c2f889d15c24f3625d1769b543d4af595/meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java#L312-L315
test
Create an instance of a LocationType. StateOfTheSea
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "stateOfTheSea", scope = LocationType.class) public JAXBElement<LocationType.StateOfTheSea> createLocationTypeStateOfTheSea(LocationType.StateOfTheSea value) { return new JAXBElement<LocationType.StateOfTheSea>(_...
spring-projects/spring-security
core/src/main/java/org/springframework/security/core/authority/mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java
MapBasedAttributes2GrantedAuthoritiesMapper.getGrantedAuthorityCollection
private Collection<GrantedAuthority> getGrantedAuthorityCollection(Object value) { Collection<GrantedAuthority> result = new ArrayList<>(); addGrantedAuthorityCollection(result, value); return result; }
java
private Collection<GrantedAuthority> getGrantedAuthorityCollection(Object value) { Collection<GrantedAuthority> result = new ArrayList<>(); addGrantedAuthorityCollection(result, value); return result; }
[ "private", "Collection", "<", "GrantedAuthority", ">", "getGrantedAuthorityCollection", "(", "Object", "value", ")", "{", "Collection", "<", "GrantedAuthority", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "addGrantedAuthorityCollection", "(", "resul...
Convert the given value to a collection of Granted Authorities @param value The value to convert to a GrantedAuthority Collection @return Collection containing the GrantedAuthority Collection
[ "Convert", "the", "given", "value", "to", "a", "collection", "of", "Granted", "Authorities" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/core/authority/mapping/MapBasedAttributes2GrantedAuthoritiesMapper.java#L109-L113
test
Gets the granted authority collection.
Of course, here is the Java code you requested: ```java private Collection<GrantedAuthority> getGrantedAuthorityCollection(Object value) { Collection<GrantedAuthority> result = new ArrayList<>(); addGrantedAuthorityCollection(result, value); return result; } ``` Hope this helps!
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/ASCIIByteBufferString.java
ASCIIByteBufferString.computeStringValue
private void computeStringValue() { char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = (char) data.get(i + offset); } stringValue = new String(chars); }
java
private void computeStringValue() { char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = (char) data.get(i + offset); } stringValue = new String(chars); }
[ "private", "void", "computeStringValue", "(", ")", "{", "char", "[", "]", "chars", "=", "new", "char", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "chars", "[", "i", "]", "=", ...
Computes and caches in the {@link #stringValue} field, a representation of this string as a default Java String.
[ "Computes", "and", "caches", "in", "the", "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/ASCIIByteBufferString.java#L208-L218
test
Compute the string value.
Of course, here is the Java code you requested: ```java private void computeStringValue() { char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = (char) data.get(i + offset); } stringValue = new String(chars); } ``` Hope this helps...
OpenEstate/OpenEstate-IO
Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java
TrovitUtils.printBooleanValue
public static String printBooleanValue(Boolean value) { if (value == null) throw new IllegalArgumentException("Can't print empty boolean value!"); return DatatypeConverter.printBoolean(value); }
java
public static String printBooleanValue(Boolean value) { if (value == null) throw new IllegalArgumentException("Can't print empty boolean value!"); return DatatypeConverter.printBoolean(value); }
[ "public", "static", "String", "printBooleanValue", "(", "Boolean", "value", ")", "{", "if", "(", "value", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Can't print empty boolean value!\"", ")", ";", "return", "DatatypeConverter", ".", "print...
Write a {@link Boolean} value into XML output. @param value value to write @return XML string @throws IllegalArgumentException if a validation error occurred
[ "Write", "a", "{", "@link", "Boolean", "}", "value", "into", "XML", "output", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java#L550-L555
test
Print a boolean value.
Of course, here is the Java code you requested: ```java public static String printBooleanValue(Boolean value) { if (value == null) throw new IllegalArgumentException("Can't print empty boolean value!"); return DatatypeConverter.printBoolean(value); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/Variable.java
Variable.setDataType
public void setDataType(DataType dataType) { if (immutable) throw new IllegalStateException("Cant modify"); this.dataType = dataType; this.elementSize = getDataType().getSize(); /* why is this needed ?? EnumTypedef etd = getEnumTypedef(); if (etd != null) { DataType etdtype = etd.getBaseT...
java
public void setDataType(DataType dataType) { if (immutable) throw new IllegalStateException("Cant modify"); this.dataType = dataType; this.elementSize = getDataType().getSize(); /* why is this needed ?? EnumTypedef etd = getEnumTypedef(); if (etd != null) { DataType etdtype = etd.getBaseT...
[ "public", "void", "setDataType", "(", "DataType", "dataType", ")", "{", "if", "(", "immutable", ")", "throw", "new", "IllegalStateException", "(", "\"Cant modify\"", ")", ";", "this", ".", "dataType", "=", "dataType", ";", "this", ".", "elementSize", "=", "g...
Set the data type @param dataType set to this value
[ "Set", "the", "data", "type" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/Variable.java#L1190-L1212
test
Sets the data type.
Of course, here is the Java code you requested: ```java public void setDataType(DataType dataType) { if (immutable) throw new IllegalStateException("Cant modify"); this.dataType = dataType; this.elementSize = getDataType().getSize(); /* why is this needed ?? EnumTypedef etd = getEnumTypedef(); ...
RestComm/jain-slee
container/usage/src/main/java/org/mobicents/slee/runtime/usage/local/UsageMBeanLocalData.java
UsageMBeanLocalData.remove
public boolean remove() { final Map<String,UsageParamSetLocalData> notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap.get(notificationSource); if (notificationSourceUsageParamSets != null) { return notificationSourceUsageParamSets.remove(usageParameterSetName) != null; } else { return...
java
public boolean remove() { final Map<String,UsageParamSetLocalData> notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap.get(notificationSource); if (notificationSourceUsageParamSets != null) { return notificationSourceUsageParamSets.remove(usageParameterSetName) != null; } else { return...
[ "public", "boolean", "remove", "(", ")", "{", "final", "Map", "<", "String", ",", "UsageParamSetLocalData", ">", "notificationSourceUsageParamSets", "=", "notificationSourceUsageParamSetsMap", ".", "get", "(", "notificationSource", ")", ";", "if", "(", "notificationSo...
/* (non-Javadoc) @see org.mobicents.slee.runtime.usage.UsageMBeanData#remove()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/usage/src/main/java/org/mobicents/slee/runtime/usage/local/UsageMBeanLocalData.java#L137-L145
test
Removes the usage parameter set from the notification source.
Of course, here is the Java code you requested: ```java public boolean remove() { final Map<String,UsageParamSetLocalData> notificationSourceUsageParamSets = notificationSourceUsageParamSetsMap.get(notificationSource); if (notificationSourceUsageParamSets != null) { return notificationSourceUsageParamSets.remov...
apache/parquet-mr
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
ParquetFileWriter.startColumn
public void startColumn(ColumnDescriptor descriptor, long valueCount, CompressionCodecName compressionCodecName) throws IOException { state = state.startColumn(); encodingStatsBuilder.clear(); currentEncodings = new HashSet<Encoding>(); currentChunkPat...
java
public void startColumn(ColumnDescriptor descriptor, long valueCount, CompressionCodecName compressionCodecName) throws IOException { state = state.startColumn(); encodingStatsBuilder.clear(); currentEncodings = new HashSet<Encoding>(); currentChunkPat...
[ "public", "void", "startColumn", "(", "ColumnDescriptor", "descriptor", ",", "long", "valueCount", ",", "CompressionCodecName", "compressionCodecName", ")", "throws", "IOException", "{", "state", "=", "state", ".", "startColumn", "(", ")", ";", "encodingStatsBuilder",...
start a column inside a block @param descriptor the column descriptor @param valueCount the value count in this column @param compressionCodecName a compression codec name @throws IOException if there is an error while writing
[ "start", "a", "column", "inside", "a", "block" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java#L351-L370
test
Start a new column.
Of course, here is the Java code you requested: ```java public void startColumn(ColumnDescriptor descriptor, long valueCount, CompressionCodecName compressionCodecName) throws IOException { state = state.startColumn(); encodingStatsBuilder.clear(); curren...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.distinctUntilChanged
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> distinctUntilChanged() { return distinctUntilChanged(Functions.identity()); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> distinctUntilChanged() { return distinctUntilChanged(Functions.identity()); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Observable", "<", "T", ">", "distinctUntilChanged", "(", ")", "{", "return", "distinctUntilChanged", "(", "Functions", ".", "identity", "(", ")", ")"...
Returns an Observable that emits all items emitted by the source ObservableSource that are distinct from their immediate predecessors based on {@link Object#equals(Object)} comparison. <p> <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/distinctUntilChanged.png" alt="...
[ "Returns", "an", "Observable", "that", "emits", "all", "items", "emitted", "by", "the", "source", "ObservableSource", "that", "are", "distinct", "from", "their", "immediate", "predecessors", "based", "on", "{", "@link", "Object#equals", "(", "Object", ")", "}", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L7914-L7918
test
Get the distinct elements of the class loader.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> distinctUntilChanged() { return distinctUntilChanged(Functions.identity()); } ``` Hope this helps!
robeio/robe
robe-assets/src/main/java/io/robe/assets/file/FileAsset.java
FileAsset.loadAssetToCache
private void loadAssetToCache() { try { cache = com.google.common.io.Files.toByteArray(asset); lastModified = asset.lastModified(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
java
private void loadAssetToCache() { try { cache = com.google.common.io.Files.toByteArray(asset); lastModified = asset.lastModified(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
[ "private", "void", "loadAssetToCache", "(", ")", "{", "try", "{", "cache", "=", "com", ".", "google", ".", "common", ".", "io", ".", "Files", ".", "toByteArray", "(", "asset", ")", ";", "lastModified", "=", "asset", ".", "lastModified", "(", ")", ";", ...
Writes http to a cache (byte array)
[ "Writes", "http", "to", "a", "cache", "(", "byte", "array", ")" ]
a0a8c7cebd1f70f78cf24a66a002859e937badfe
https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-assets/src/main/java/io/robe/assets/file/FileAsset.java#L87-L95
test
Load the asset to cache.
Of course, here is the Java code you requested: ```java private void loadAssetToCache() { try { cache = com.google.common.io.Files.toByteArray(asset); lastModified = asset.lastModified(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeExcep...
groupon/Novie
novie-core/src/main/java/com/groupon/novie/utils/SchemaDefinitionImpl.java
SchemaDefinitionImpl.getMeasuresByName
@Override public Optional<AbstractSqlColumn> getMeasuresByName(String informationName) { for (AbstractSqlColumn column : factTable.getMeasuresColumn().values()) { if (column.getBusinessName().equalsIgnoreCase(informationName)) { return Optional.of(column); } }...
java
@Override public Optional<AbstractSqlColumn> getMeasuresByName(String informationName) { for (AbstractSqlColumn column : factTable.getMeasuresColumn().values()) { if (column.getBusinessName().equalsIgnoreCase(informationName)) { return Optional.of(column); } }...
[ "@", "Override", "public", "Optional", "<", "AbstractSqlColumn", ">", "getMeasuresByName", "(", "String", "informationName", ")", "{", "for", "(", "AbstractSqlColumn", "column", ":", "factTable", ".", "getMeasuresColumn", "(", ")", ".", "values", "(", ")", ")", ...
{@inheritDoc SchemaDefinition} {@link SchemaDefinition#getMeasuresByName(String)}
[ "{" ]
dc0a96652499c8abfc2b990b864a378d794a5234
https://github.com/groupon/Novie/blob/dc0a96652499c8abfc2b990b864a378d794a5234/novie-core/src/main/java/com/groupon/novie/utils/SchemaDefinitionImpl.java#L195-L203
test
Gets the measures by name.
Of course, here is the Java code you requested: ```java @Override public Optional<AbstractSqlColumn> getMeasuresByName(String informationName) { for (AbstractSqlColumn column : factTable.getMeasuresColumn().values()) { if (column.getBusinessName().equalsIgnoreCase(informationName)) { ...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/algs/TangentLinesTwoEllipses_F64.java
TangentLinesTwoEllipses_F64.initialize
boolean initialize(EllipseRotated_F64 ellipseA, EllipseRotated_F64 ellipseB, Point2D_F64 tangentA0, Point2D_F64 tangentA1, Point2D_F64 tangentA2, Point2D_F64 tangentA3, Point2D_F64 tangentB0, Point2D_F64 tangentB1, Point2D_F64 tangentB2, Point2D_F64 tangentB3) { centerLine.set(ellipse...
java
boolean initialize(EllipseRotated_F64 ellipseA, EllipseRotated_F64 ellipseB, Point2D_F64 tangentA0, Point2D_F64 tangentA1, Point2D_F64 tangentA2, Point2D_F64 tangentA3, Point2D_F64 tangentB0, Point2D_F64 tangentB1, Point2D_F64 tangentB2, Point2D_F64 tangentB3) { centerLine.set(ellipse...
[ "boolean", "initialize", "(", "EllipseRotated_F64", "ellipseA", ",", "EllipseRotated_F64", "ellipseB", ",", "Point2D_F64", "tangentA0", ",", "Point2D_F64", "tangentA1", ",", "Point2D_F64", "tangentA2", ",", "Point2D_F64", "tangentA3", ",", "Point2D_F64", "tangentB0", ",...
Select the initial tangent points on the ellipses. This is done by: 1) picking an arbitrary point on ellipseA. 2) Find tangent points on B using point from step 1 3) Use those two tangent points on B to find 4 points on ellipse A 4) Use those 4 points to select 4 points on B.
[ "Select", "the", "initial", "tangent", "points", "on", "the", "ellipses", ".", "This", "is", "done", "by", ":" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/algs/TangentLinesTwoEllipses_F64.java#L170-L206
test
Initializes the 2D curve.
Of course, here is the Java code you requested: ```java boolean initialize(EllipseRotated_F64 ellipseA, EllipseRotated_F64 ellipseB, Point2D_F64 tangentA0, Point2D_F64 tangentA1, Point2D_F64 tangentA2, Point2D_F64 tangentA3, Point2D_F64 tangentB0, Point2D_F64 tangentB1, Point2D_F64 tang...
ozlerhakan/poiji
src/main/java/com/poiji/bind/mapping/PoijiHandler.java
PoijiHandler.getInstance
private Object getInstance(Field field) { Object ins = null; try { if (fieldInstances.containsKey(field.getName())) { ins = fieldInstances.get(field.getName()); } else { ins = field.getType().getDeclaredConstructor().newInstance(); ...
java
private Object getInstance(Field field) { Object ins = null; try { if (fieldInstances.containsKey(field.getName())) { ins = fieldInstances.get(field.getName()); } else { ins = field.getType().getDeclaredConstructor().newInstance(); ...
[ "private", "Object", "getInstance", "(", "Field", "field", ")", "{", "Object", "ins", "=", "null", ";", "try", "{", "if", "(", "fieldInstances", ".", "containsKey", "(", "field", ".", "getName", "(", ")", ")", ")", "{", "ins", "=", "fieldInstances", "....
Using this to hold inner objects that will be mapped to the main object *
[ "Using", "this", "to", "hold", "inner", "objects", "that", "will", "be", "mapped", "to", "the", "main", "object", "*" ]
3d27d7ae586d8cdac46a5403a030198937c28fe6
https://github.com/ozlerhakan/poiji/blob/3d27d7ae586d8cdac46a5403a030198937c28fe6/src/main/java/com/poiji/bind/mapping/PoijiHandler.java#L79-L93
test
Get the instance of a class field.
Of course, here is the Java code you requested: ```java private Object getInstance(Field field) { Object ins = null; try { if (fieldInstances.containsKey(field.getName())) { ins = fieldInstances.get(field.getName()); } else { ins = field.getType()...
wildfly/wildfly
legacy/messaging/src/main/java/org/jboss/as/messaging/MigrateOperation.java
MigrateOperation.parameterIsAllowed
private boolean parameterIsAllowed(String name, String resourceType) { switch (resourceType) { case REMOTE_ACCEPTOR: case HTTP_ACCEPTOR: case REMOTE_CONNECTOR: case HTTP_CONNECTOR: // WFLY-5667 - for now remove only use-nio. Revisit this code when ...
java
private boolean parameterIsAllowed(String name, String resourceType) { switch (resourceType) { case REMOTE_ACCEPTOR: case HTTP_ACCEPTOR: case REMOTE_CONNECTOR: case HTTP_CONNECTOR: // WFLY-5667 - for now remove only use-nio. Revisit this code when ...
[ "private", "boolean", "parameterIsAllowed", "(", "String", "name", ",", "String", "resourceType", ")", "{", "switch", "(", "resourceType", ")", "{", "case", "REMOTE_ACCEPTOR", ":", "case", "HTTP_ACCEPTOR", ":", "case", "REMOTE_CONNECTOR", ":", "case", "HTTP_CONNEC...
Check if the name of the parameter is allowed for the given resourceType.
[ "Check", "if", "the", "name", "of", "the", "parameter", "is", "allowed", "for", "the", "given", "resourceType", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/legacy/messaging/src/main/java/org/jboss/as/messaging/MigrateOperation.java#L452-L469
test
Checks if the parameter is allowed for the resource type.
Of course, here is the Java code you requested: ```java private boolean parameterIsAllowed(String name, String resourceType) { switch (resourceType) { case REMOTE_ACCEPTOR: case HTTP_ACCEPTOR: case REMOTE_CONNECTOR: case HTTP_CONNECTOR: // WFLY-56...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/chart/objects/LineChart.java
LineChart.getCTNumDataSourceFromCTSer
@Override public final CTNumDataSource getCTNumDataSourceFromCTSer( final Object ctObjSer) { if (ctObjSer instanceof CTLineSer) { return ((CTLineSer) ctObjSer).getVal(); } return null; }
java
@Override public final CTNumDataSource getCTNumDataSourceFromCTSer( final Object ctObjSer) { if (ctObjSer instanceof CTLineSer) { return ((CTLineSer) ctObjSer).getVal(); } return null; }
[ "@", "Override", "public", "final", "CTNumDataSource", "getCTNumDataSourceFromCTSer", "(", "final", "Object", "ctObjSer", ")", "{", "if", "(", "ctObjSer", "instanceof", "CTLineSer", ")", "{", "return", "(", "(", "CTLineSer", ")", "ctObjSer", ")", ".", "getVal", ...
/* (non-Javadoc) @see org.tiefaces.components.websheet.chart.objects.ChartObject# getCTNumDataSourceFromCTSer(java.lang.Object)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/chart/objects/LineChart.java#L114-L121
test
Override to return the CTNumDataSource from a CTSer object.
Of course, here is the Java code you requested: ```java @Override public final CTNumDataSource getCTNumDataSourceFromCTSer( final Object ctObjSer) { if (ctObjSer instanceof CTLineSer) { return ((CTLineSer) ctObjSer).getVal(); } return null; } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/table/HidableTableColumnModel.java
HidableTableColumnModel.removeColumn
@Override public void removeColumn(TableColumn column) { int allColumnsIndex = allTableColumns.indexOf(column); if (allColumnsIndex != -1) { allTableColumns.removeElementAt(allColumnsIndex); } super.removeColumn(column); }
java
@Override public void removeColumn(TableColumn column) { int allColumnsIndex = allTableColumns.indexOf(column); if (allColumnsIndex != -1) { allTableColumns.removeElementAt(allColumnsIndex); } super.removeColumn(column); }
[ "@", "Override", "public", "void", "removeColumn", "(", "TableColumn", "column", ")", "{", "int", "allColumnsIndex", "=", "allTableColumns", ".", "indexOf", "(", "column", ")", ";", "if", "(", "allColumnsIndex", "!=", "-", "1", ")", "{", "allTableColumns", "...
Removes <code>column</code> from this column model. Posts <code>columnRemoved</code> event. Will do nothing if the column is not in this model. @param column the column to be added @see #addColumn
[ "Removes", "<code", ">", "column<", "/", "code", ">", "from", "this", "column", "model", ".", "Posts", "<code", ">", "columnRemoved<", "/", "code", ">", "event", ".", "Will", "do", "nothing", "if", "the", "column", "is", "not", "in", "this", "model", "...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/table/HidableTableColumnModel.java#L114-L121
test
Removes a column from the table.
Of course, here is the Java code you requested: ```java @Override public void removeColumn(TableColumn column) { int allColumnsIndex = allTableColumns.indexOf(column); if (allColumnsIndex != -1) { allTableColumns.removeElementAt(allColumnsIndex); } super.removeColumn(col...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/Schema.java
Schema.parent
public void parent(String name, String parentName) { ElementType child = getElementType(name); ElementType parent = getElementType(parentName); if (child == null) { throw new Error("No child " + name + " for parent " + parentName); } if (parent == null) { ...
java
public void parent(String name, String parentName) { ElementType child = getElementType(name); ElementType parent = getElementType(parentName); if (child == null) { throw new Error("No child " + name + " for parent " + parentName); } if (parent == null) { ...
[ "public", "void", "parent", "(", "String", "name", ",", "String", "parentName", ")", "{", "ElementType", "child", "=", "getElementType", "(", "name", ")", ";", "ElementType", "parent", "=", "getElementType", "(", "parentName", ")", ";", "if", "(", "child", ...
Specify natural parent of an element in this schema. @param name Name of the child element @param parentName Name of the parent element
[ "Specify", "natural", "parent", "of", "an", "element", "in", "this", "schema", "." ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/Schema.java#L96-L106
test
Sets the parent of the child element.
Of course, here is the Java code you requested: ```java public void parent(String name, String parentName) { ElementType child = getElementType(name); ElementType parent = getElementType(parentName); if (child == null) { throw new Error("No child " + name + " for parent " + parentNa...
deliveredtechnologies/rulebook
rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/StandardDecision.java
StandardDecision.using
@Override @SuppressWarnings("unchecked") public Decision<T, U> using(String... factNames) { _rule.using(factNames); return this; }
java
@Override @SuppressWarnings("unchecked") public Decision<T, U> using(String... factNames) { _rule.using(factNames); return this; }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Decision", "<", "T", ",", "U", ">", "using", "(", "String", "...", "factNames", ")", "{", "_rule", ".", "using", "(", "factNames", ")", ";", "return", "this", ";", "}" ]
The using() method reduces the facts to those specifically named here. The using() method only applies to the then() method immediately following it. @param factNames the names of the facts to be used @return the current object
[ "The", "using", "()", "method", "reduces", "the", "facts", "to", "those", "specifically", "named", "here", ".", "The", "using", "()", "method", "only", "applies", "to", "the", "then", "()", "method", "immediately", "following", "it", "." ]
253738f6bc1e7804bb8649863e969956075a19ae
https://github.com/deliveredtechnologies/rulebook/blob/253738f6bc1e7804bb8649863e969956075a19ae/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/StandardDecision.java#L167-L172
test
Override the using method.
Of course, here is the Java code you requested: ```java @Override @SuppressWarnings("unchecked") public Decision<T, U> using(String... factNames) { _rule.using(factNames); return this; } ``` Hope this helps!
basis-technology-corp/tcl-regex-java
src/main/java/com/basistech/tclre/HsrePattern.java
HsrePattern.compile
public static RePattern compile(String pattern, EnumSet<PatternFlags> flags) throws RegexException { return Compiler.compile(pattern, flags); }
java
public static RePattern compile(String pattern, EnumSet<PatternFlags> flags) throws RegexException { return Compiler.compile(pattern, flags); }
[ "public", "static", "RePattern", "compile", "(", "String", "pattern", ",", "EnumSet", "<", "PatternFlags", ">", "flags", ")", "throws", "RegexException", "{", "return", "Compiler", ".", "compile", "(", "pattern", ",", "flags", ")", ";", "}" ]
Compile a pattern. @param pattern the pattern. @param flags flags that determine the interpretation of the pattern. @return the compiled pattern. @throws RegexException
[ "Compile", "a", "pattern", "." ]
de0d5eaccf9a61b694cb8793f234cc229c395b43
https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/HsrePattern.java#L54-L56
test
Compiles a regular expression pattern.
Of course, here is the Java code you requested: ```java public static RePattern compile(String pattern, EnumSet<PatternFlags> flags) throws RegexException { return Compiler.compile(pattern, flags); } ``` Hope this helps!
spring-projects/spring-security
core/src/main/java/org/springframework/security/authentication/jaas/JaasAuthenticationProvider.java
JaasAuthenticationProvider.afterPropertiesSet
@Override public void afterPropertiesSet() throws Exception { // the superclass is not called because it does additional checks that are // non-passive Assert.hasLength(getLoginContextName(), () -> "loginContextName must be set on " + getClass()); Assert.notNull(this.loginConfig, () -> "loginConfig mus...
java
@Override public void afterPropertiesSet() throws Exception { // the superclass is not called because it does additional checks that are // non-passive Assert.hasLength(getLoginContextName(), () -> "loginContextName must be set on " + getClass()); Assert.notNull(this.loginConfig, () -> "loginConfig mus...
[ "@", "Override", "public", "void", "afterPropertiesSet", "(", ")", "throws", "Exception", "{", "// the superclass is not called because it does additional checks that are", "// non-passive", "Assert", ".", "hasLength", "(", "getLoginContextName", "(", ")", ",", "(", ")", ...
========================================================================================================
[ "========================================================================================================" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/authentication/jaas/JaasAuthenticationProvider.java#L156-L171
test
Override afterPropertiesSet to check that the login context name and login config are set on the class.
Of course, here is the Java code you requested: ```java @Override public void afterPropertiesSet() throws Exception { // the superclass is not called because it does additional checks that are // non-passive Assert.hasLength(getLoginContextName(), () -> "loginContextName must be set on " + getClass()); As...
rockagen/commons-lib
src/main/java/com/rockagen/commons/util/JsonUtil.java
JsonUtil.toBean
public static <T> T toBean(Reader jsonReader, TypeReference<T> valueTypeRef) { if (valueTypeRef == null || jsonReader == null) return null; return toBean(new MyJsonParser(jsonReader), valueTypeRef); }
java
public static <T> T toBean(Reader jsonReader, TypeReference<T> valueTypeRef) { if (valueTypeRef == null || jsonReader == null) return null; return toBean(new MyJsonParser(jsonReader), valueTypeRef); }
[ "public", "static", "<", "T", ">", "T", "toBean", "(", "Reader", "jsonReader", ",", "TypeReference", "<", "T", ">", "valueTypeRef", ")", "{", "if", "(", "valueTypeRef", "==", "null", "||", "jsonReader", "==", "null", ")", "return", "null", ";", "return",...
Json string to java bean <br> <p> List,Array,Map </p> <pre> clazz= new TypeReference&lt;List&lt;MyBean&gt;&gt;(){}; e.g: toBean(jsonReader,new TypeReference&lt;List&lt;MyBean&gt;&gt;(){}) toBean(jsonReader, MyBean[]) toBean(jsonReader, new TypeReference&lt;Map&lt;String, Map&lt;String, MyBean&gt;&gt;(){}) </pre> @p...
[ "Json", "string", "to", "java", "bean", "<br", ">", "<p", ">", "List", "Array", "Map", "<", "/", "p", ">", "<pre", ">", "clazz", "=", "new", "TypeReference&lt", ";", "List&lt", ";", "MyBean&gt", ";", "&gt", ";", "()", "{}", ";" ]
f37141cf40be79d130db804c39ce61690541d5f1
https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/util/JsonUtil.java#L237-L242
test
Converts a JSON reader to a Java Bean.
Of course, here is the Java code you requested: ```java public static <T> T toBean(Reader jsonReader, TypeReference<T> valueTypeRef) { if (valueTypeRef == null || jsonReader == null) return null; return toBean(new MyJsonParser(jsonReader), valueTypeRef); } ``` Hope this helps!
ArpNetworking/logback-steno
src/main/java/com/arpnetworking/steno/Logger.java
Logger.error
public void error(@Nullable final String message, @Nullable final Throwable throwable) { log(LogLevel.ERROR, DEFAULT_EVENT, message, EMPTY_STRING_ARRAY, EMPTY_OBJECT_ARRAY, throwable); }
java
public void error(@Nullable final String message, @Nullable final Throwable throwable) { log(LogLevel.ERROR, DEFAULT_EVENT, message, EMPTY_STRING_ARRAY, EMPTY_OBJECT_ARRAY, throwable); }
[ "public", "void", "error", "(", "@", "Nullable", "final", "String", "message", ",", "@", "Nullable", "final", "Throwable", "throwable", ")", "{", "log", "(", "LogLevel", ".", "ERROR", ",", "DEFAULT_EVENT", ",", "message", ",", "EMPTY_STRING_ARRAY", ",", "EMP...
Log a message with a <code>Throwable</code> at the error level. Default values are used for all other parameters. This method is also found in the SLF4J <code>Logger</code>. It is intended to simplify migration; however, it's use is not recommended as it lacks an identifying event and typically includes serialized as ...
[ "Log", "a", "message", "with", "a", "<code", ">", "Throwable<", "/", "code", ">", "at", "the", "error", "level", ".", "Default", "values", "are", "used", "for", "all", "other", "parameters", "." ]
abd5c68ce7d42c39f80ffbad6d162d5fed3a346e
https://github.com/ArpNetworking/logback-steno/blob/abd5c68ce7d42c39f80ffbad6d162d5fed3a346e/src/main/java/com/arpnetworking/steno/Logger.java#L1391-L1393
test
Logs a message and throwable with a level of ERROR.
Of course, here is the Java code you requested: ```java public void error(@Nullable final String message, @Nullable final Throwable throwable) { log(LogLevel.ERROR, DEFAULT_EVENT, message, EMPTY_STRING_ARRAY, EMPTY_OBJECT_ARRAY, throwable); } ``` Hope this helps!
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/SessionBeanComponentDescriptionFactory.java
SessionBeanComponentDescriptionFactory.processAnnotations
@Override protected void processAnnotations(final DeploymentUnit deploymentUnit, final CompositeIndex compositeIndex) throws DeploymentUnitProcessingException { if (MetadataCompleteMarker.isMetadataComplete(deploymentUnit)) { return; } // Find and process any @Stateless bean an...
java
@Override protected void processAnnotations(final DeploymentUnit deploymentUnit, final CompositeIndex compositeIndex) throws DeploymentUnitProcessingException { if (MetadataCompleteMarker.isMetadataComplete(deploymentUnit)) { return; } // Find and process any @Stateless bean an...
[ "@", "Override", "protected", "void", "processAnnotations", "(", "final", "DeploymentUnit", "deploymentUnit", ",", "final", "CompositeIndex", "compositeIndex", ")", "throws", "DeploymentUnitProcessingException", "{", "if", "(", "MetadataCompleteMarker", ".", "isMetadataComp...
Process annotations and merge any available metadata at the same time.
[ "Process", "annotations", "and", "merge", "any", "available", "metadata", "at", "the", "same", "time", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/SessionBeanComponentDescriptionFactory.java#L78-L102
test
Process annotations from the composite index.
Of course, here is the Java code you requested: ```java @Override protected void processAnnotations(final DeploymentUnit deploymentUnit, final CompositeIndex compositeIndex) throws DeploymentUnitProcessingException { if (MetadataCompleteMarker.isMetadataComplete(deploymentUnit)) { return; ...
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/internal/http/HTTPBuilder.java
HTTPBuilder.setUri
public void setUri(Object uri) throws URISyntaxException { this.defaultURI = new URIBuilder(URIBuilder.convertToURI(uri), urlEncodingEnabled, encoderConfig); }
java
public void setUri(Object uri) throws URISyntaxException { this.defaultURI = new URIBuilder(URIBuilder.convertToURI(uri), urlEncodingEnabled, encoderConfig); }
[ "public", "void", "setUri", "(", "Object", "uri", ")", "throws", "URISyntaxException", "{", "this", ".", "defaultURI", "=", "new", "URIBuilder", "(", "URIBuilder", ".", "convertToURI", "(", "uri", ")", ",", "urlEncodingEnabled", ",", "encoderConfig", ")", ";",...
Set the default URI used for requests that do not explicitly take a <code>uri</code> param. @param uri either a {@link URL}, {@link URI} or object whose <code>toString()</code> produces a valid URI string. See {@link URIBuilder#convertToURI(Object)}. @throws URISyntaxException if the uri argument does not represent a...
[ "Set", "the", "default", "URI", "used", "for", "requests", "that", "do", "not", "explicitly", "take", "a", "<code", ">", "uri<", "/", "code", ">", "param", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/internal/http/HTTPBuilder.java#L725-L727
test
Sets the default URI.
Of course, here is the Java code you requested: ```java public void setUri(Object uri) throws URISyntaxException { this.defaultURI = new URIBuilder(URIBuilder.convertToURI(uri), urlEncodingEnabled, encoderConfig); } ``` Hope this helps!
Unidata/thredds
dap4/d4lib/src/main/java/dap4/dap4lib/XURI.java
XURI.assemble
public String assemble(EnumSet<Parts> parts) { StringBuilder uri = new StringBuilder(); // Note that format and base may be same, so case it out int useformat = (parts.contains(Parts.FORMAT) ? 1 : 0); int usebase = (parts.contains(Parts.BASE) ? 2 : 0); switch (useformat +...
java
public String assemble(EnumSet<Parts> parts) { StringBuilder uri = new StringBuilder(); // Note that format and base may be same, so case it out int useformat = (parts.contains(Parts.FORMAT) ? 1 : 0); int usebase = (parts.contains(Parts.BASE) ? 2 : 0); switch (useformat +...
[ "public", "String", "assemble", "(", "EnumSet", "<", "Parts", ">", "parts", ")", "{", "StringBuilder", "uri", "=", "new", "StringBuilder", "(", ")", ";", "// Note that format and base may be same, so case it out", "int", "useformat", "=", "(", "parts", ".", "conta...
Reassemble the url using the specified parts @param parts to include @return the assembled uri
[ "Reassemble", "the", "url", "using", "the", "specified", "parts" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/XURI.java#L289-L324
test
Assemble the phrase of a single resource.
Of course, here is the Java code you requested: ```java public String assemble(EnumSet<Parts> parts) { StringBuilder uri = new StringBuilder(); // Note that format and base may be same, so case it out int useformat = (parts.contains(Parts.FORMAT) ? 1 : 0); int usebase = (parts.c...
jkuhnert/ognl
src/main/java/ognl/OgnlOps.java
OgnlOps.convertValue
public static Object convertValue(char value, Class toType, boolean preventNull) { return convertValue(new Character(value), toType, preventNull); }
java
public static Object convertValue(char value, Class toType, boolean preventNull) { return convertValue(new Character(value), toType, preventNull); }
[ "public", "static", "Object", "convertValue", "(", "char", "value", ",", "Class", "toType", ",", "boolean", "preventNull", ")", "{", "return", "convertValue", "(", "new", "Character", "(", "value", ")", ",", "toType", ",", "preventNull", ")", ";", "}" ]
//////////////////////////////////////////////////////////////
[ "//////////////////////////////////////////////////////////////" ]
53d51a30c8c299b750dede779d05cb84beee73c3
https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlOps.java#L423-L426
test
Convert a char value to a Class.
Of course, here is the Java code you requested: ```java public static Object convertValue(char value, Class toType, boolean preventNull) { return convertValue(new Character(value), toType, preventNull); } ``` Hope this helps!
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageImpl.java
GeoPackageImpl.registerCursorWrapper
@Override public void registerCursorWrapper(String table, GeoPackageCursorWrapper cursorWrapper) { cursorFactory.registerTable(table, cursorWrapper); }
java
@Override public void registerCursorWrapper(String table, GeoPackageCursorWrapper cursorWrapper) { cursorFactory.registerTable(table, cursorWrapper); }
[ "@", "Override", "public", "void", "registerCursorWrapper", "(", "String", "table", ",", "GeoPackageCursorWrapper", "cursorWrapper", ")", "{", "cursorFactory", ".", "registerTable", "(", "table", ",", "cursorWrapper", ")", ";", "}" ]
{@inheritDoc}
[ "{" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageImpl.java#L115-L119
test
Register the GeoPackage cursor wrapper
Of course, here is the Java code you requested: ```java @Override public void registerCursorWrapper(String table, GeoPackageCursorWrapper cursorWrapper) { cursorFactory.registerTable(table, cursorWrapper); } ``` Hope this helps!
Unidata/thredds
opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java
DTSServlet.doGetSystemProps
public void doGetSystemProps(ReqState rs) throws Exception { rs.getResponse().setHeader("XDODS-Server", getServerVersion()); rs.getResponse().setContentType("text/html"); rs.getResponse().setHeader("Content-Description", "dods-status"); PrintWriter pw = new PrintWriter(n...
java
public void doGetSystemProps(ReqState rs) throws Exception { rs.getResponse().setHeader("XDODS-Server", getServerVersion()); rs.getResponse().setContentType("text/html"); rs.getResponse().setHeader("Content-Description", "dods-status"); PrintWriter pw = new PrintWriter(n...
[ "public", "void", "doGetSystemProps", "(", "ReqState", "rs", ")", "throws", "Exception", "{", "rs", ".", "getResponse", "(", ")", ".", "setHeader", "(", "\"XDODS-Server\"", ",", "getServerVersion", "(", ")", ")", ";", "rs", ".", "getResponse", "(", ")", "....
Handler for OPeNDAP status requests; not publically available, used only for debugging @param rs The client's <code> ReqState </code> @see GetHTMLInterfaceHandler
[ "Handler", "for", "OPeNDAP", "status", "requests", ";", "not", "publically", "available", "used", "only", "for", "debugging" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java#L1396-L1437
test
Method doGetSystemProps.
Of course, here is the Java code you requested: ```java public void doGetSystemProps(ReqState rs) throws Exception { rs.getResponse().setHeader("XDODS-Server", getServerVersion()); rs.getResponse().setContentType("text/html"); rs.getResponse().setHeader("Content-Description", "d...
ReactiveX/RxJava
src/main/java/io/reactivex/plugins/RxJavaPlugins.java
RxJavaPlugins.setInitIoSchedulerHandler
public static void setInitIoSchedulerHandler(@Nullable Function<? super Callable<Scheduler>, ? extends Scheduler> handler) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } onInitIoHandler = handler; }
java
public static void setInitIoSchedulerHandler(@Nullable Function<? super Callable<Scheduler>, ? extends Scheduler> handler) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } onInitIoHandler = handler; }
[ "public", "static", "void", "setInitIoSchedulerHandler", "(", "@", "Nullable", "Function", "<", "?", "super", "Callable", "<", "Scheduler", ">", ",", "?", "extends", "Scheduler", ">", "handler", ")", "{", "if", "(", "lockdown", ")", "{", "throw", "new", "I...
Sets the specific hook function. @param handler the hook function to set, null allowed, but the function may not return null
[ "Sets", "the", "specific", "hook", "function", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L570-L575
test
Sets the scheduler handler to be called when the init operation is performed.
Of course, here is the Java code you requested: ```java public static void setInitIoSchedulerHandler(@Nullable Function<? super Callable<Scheduler>, ? extends Scheduler> handler) { if (lockdown) { throw new IllegalStateException("Plugins can't be changed anymore"); } onInitIoHandler...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/util/ThrowableAnalyzer.java
ThrowableAnalyzer.registerExtractor
protected final void registerExtractor(Class<? extends Throwable> throwableType, ThrowableCauseExtractor extractor) { Assert.notNull(extractor, "Invalid extractor: null"); this.extractorMap.put(throwableType, extractor); }
java
protected final void registerExtractor(Class<? extends Throwable> throwableType, ThrowableCauseExtractor extractor) { Assert.notNull(extractor, "Invalid extractor: null"); this.extractorMap.put(throwableType, extractor); }
[ "protected", "final", "void", "registerExtractor", "(", "Class", "<", "?", "extends", "Throwable", ">", "throwableType", ",", "ThrowableCauseExtractor", "extractor", ")", "{", "Assert", ".", "notNull", "(", "extractor", ",", "\"Invalid extractor: null\"", ")", ";", ...
Registers a <code>ThrowableCauseExtractor</code> for the specified type. <i>Can be used in subclasses overriding {@link #initExtractorMap()}.</i> @param throwableType the type (has to be a subclass of <code>Throwable</code>) @param extractor the associated <code>ThrowableCauseExtractor</code> (not <code>null</code>) ...
[ "Registers", "a", "<code", ">", "ThrowableCauseExtractor<", "/", "code", ">", "for", "the", "specified", "type", ".", "<i", ">", "Can", "be", "used", "in", "subclasses", "overriding", "{", "@link", "#initExtractorMap", "()", "}", ".", "<", "/", "i", ">" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/util/ThrowableAnalyzer.java#L110-L115
test
Registers an extractor for the specified throwable type.
Of course, here is the Java code you requested: ```java protected final void registerExtractor(Class<? extends Throwable> throwableType, ThrowableCauseExtractor extractor) { Assert.notNull(extractor, "Invalid extractor: null"); this.extractorMap.put(throwableType, extractor); } ``` Hope this helps!
playframework/playframework
core/play/src/main/java/play/mvc/Controller.java
Controller.session
@Deprecated public static void session(String key, String value) { session().put(key, value); }
java
@Deprecated public static void session(String key, String value) { session().put(key, value); }
[ "@", "Deprecated", "public", "static", "void", "session", "(", "String", "key", ",", "String", "value", ")", "{", "session", "(", ")", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
Puts a new value into the current session. @param key the key to set into the session @param value the value to set for <code>key</code> @deprecated Deprecated as of 2.7.0. Use {@link Result} instead.
[ "Puts", "a", "new", "value", "into", "the", "current", "session", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Controller.java#L135-L138
test
Set a session attribute.
Of course, here is the Java code you requested: ```java @Deprecated public static void session(String key, String value) { session().put(key, value); } ``` Hope this helps!
AlejandroRivera/embedded-rabbitmq
src/main/java/io/arivera/oss/embedded/rabbitmq/bin/RabbitMqPlugins.java
RabbitMqPlugins.enable
public void enable(String plugin) throws RabbitMqCommandException { String[] args = {"enable", plugin}; String executionErrorMessage = "Error while enabling plugin '" + plugin + "'"; String unexpectedExitCodeMessage = "Enabling of plugin '" + plugin + "' failed with exit code: "; getProcessResult(args,...
java
public void enable(String plugin) throws RabbitMqCommandException { String[] args = {"enable", plugin}; String executionErrorMessage = "Error while enabling plugin '" + plugin + "'"; String unexpectedExitCodeMessage = "Enabling of plugin '" + plugin + "' failed with exit code: "; getProcessResult(args,...
[ "public", "void", "enable", "(", "String", "plugin", ")", "throws", "RabbitMqCommandException", "{", "String", "[", "]", "args", "=", "{", "\"enable\"", ",", "plugin", "}", ";", "String", "executionErrorMessage", "=", "\"Error while enabling plugin '\"", "+", "plu...
Executes the command {@code rabbitmq-plugins enable {plugin}} and blocks until the call finishes. @param plugin the name of the plugin to enable. @throws RabbitMqCommandException if the command cannot be executed, it doesn't {@link EmbeddedRabbitMqConfig.Builder#defaultRabbitMqCtlTimeoutInMillis(long) finish in time}...
[ "Executes", "the", "command", "{", "@code", "rabbitmq", "-", "plugins", "enable", "{", "plugin", "}}", "and", "blocks", "until", "the", "call", "finishes", "." ]
b9dc6e0a1b7eabf16bf5a573d0d6bf4d536f0a46
https://github.com/AlejandroRivera/embedded-rabbitmq/blob/b9dc6e0a1b7eabf16bf5a573d0d6bf4d536f0a46/src/main/java/io/arivera/oss/embedded/rabbitmq/bin/RabbitMqPlugins.java#L119-L125
test
Enables a plugin.
Of course, here is the Java code you requested: ```java public void enable(String plugin) throws RabbitMqCommandException { String[] args = {"enable", plugin}; String executionErrorMessage = "Error while enabling plugin '" + plugin + "'"; String unexpectedExitCodeMessage = "Enabling of plugin '" + plugin +...
jcodec/jcodec
src/main/java/org/jcodec/containers/mkv/util/EbmlUtil.java
EbmlUtil.computeLength
static public int computeLength(byte b) { if (b == 0x00) throw new RuntimeException("Invalid head element for ebml sequence"); int i = 1; while ((b & lengthOptions[i]) == 0) i++; return i; }
java
static public int computeLength(byte b) { if (b == 0x00) throw new RuntimeException("Invalid head element for ebml sequence"); int i = 1; while ((b & lengthOptions[i]) == 0) i++; return i; }
[ "static", "public", "int", "computeLength", "(", "byte", "b", ")", "{", "if", "(", "b", "==", "0x00", ")", "throw", "new", "RuntimeException", "(", "\"Invalid head element for ebml sequence\"", ")", ";", "int", "i", "=", "1", ";", "while", "(", "(", "b", ...
This method is used mostly during reading EBML bitstream. It asnwers the question "What is the length of an integer (signed/unsigned) encountered in the bitstream" @param b @return
[ "This", "method", "is", "used", "mostly", "during", "reading", "EBML", "bitstream", ".", "It", "asnwers", "the", "question", "What", "is", "the", "length", "of", "an", "integer", "(", "signed", "/", "unsigned", ")", "encountered", "in", "the", "bitstream" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/containers/mkv/util/EbmlUtil.java#L52-L61
test
Compute the length of a tag from a byte.
Of course, here is the Java code you requested: ```java static public int computeLength(byte b) { if (b == 0x00) throw new RuntimeException("Invalid head element for ebml sequence"); int i = 1; while ((b & lengthOptions[i]) == 0) i++; return i; } ``` Hope ...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/factory/XmlModelFactory.java
XmlModelFactory.createGroup
protected Group createGroup(final Element element) { final String name = element.getAttribute(ATTR_GROUP_NAME); final Group group = new Group(name); final List<Resource> resources = new ArrayList<Resource>(); final NodeList resourceNodeList = element.getChildNodes(); for (int i = 0; i < resourc...
java
protected Group createGroup(final Element element) { final String name = element.getAttribute(ATTR_GROUP_NAME); final Group group = new Group(name); final List<Resource> resources = new ArrayList<Resource>(); final NodeList resourceNodeList = element.getChildNodes(); for (int i = 0; i < resourc...
[ "protected", "Group", "createGroup", "(", "final", "Element", "element", ")", "{", "final", "String", "name", "=", "element", ".", "getAttribute", "(", "ATTR_GROUP_NAME", ")", ";", "final", "Group", "group", "=", "new", "Group", "(", "name", ")", ";", "fin...
Creates a group and all its associated resources. @param element Group element to parse. @return fully initialized group
[ "Creates", "a", "group", "and", "all", "its", "associated", "resources", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/factory/XmlModelFactory.java#L336-L350
test
Create a group from a XML Element.
Of course, here is the Java code you requested: ```java protected Group createGroup(final Element element) { final String name = element.getAttribute(ATTR_GROUP_NAME); final Group group = new Group(name); final List<Resource> resources = new ArrayList<Resource>(); final NodeList resourceNodeList = ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/directmemory/OByteBufferPool.java
OByteBufferPool.checkMemoryLeaks
public void checkMemoryLeaks() { boolean detected = false; if (TRACK) { for (Map.Entry<OPointer, PointerTracker> entry : pointerMapping.entrySet()) { OLogManager.instance() .errorNoDb(this, "DIRECT-TRACK: unreleased direct memory pointer `%X` detected.", entry.getValue().allocation, ...
java
public void checkMemoryLeaks() { boolean detected = false; if (TRACK) { for (Map.Entry<OPointer, PointerTracker> entry : pointerMapping.entrySet()) { OLogManager.instance() .errorNoDb(this, "DIRECT-TRACK: unreleased direct memory pointer `%X` detected.", entry.getValue().allocation, ...
[ "public", "void", "checkMemoryLeaks", "(", ")", "{", "boolean", "detected", "=", "false", ";", "if", "(", "TRACK", ")", "{", "for", "(", "Map", ".", "Entry", "<", "OPointer", ",", "PointerTracker", ">", "entry", ":", "pointerMapping", ".", "entrySet", "(...
Checks whether there are not released buffers in the pool
[ "Checks", "whether", "there", "are", "not", "released", "buffers", "in", "the", "pool" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/directmemory/OByteBufferPool.java#L192-L204
test
Check if memory leaks are detected.
Of course, here is the Java code you requested: ```java public void checkMemoryLeaks() { boolean detected = false; if (TRACK) { for (Map.Entry<OPointer, PointerTracker> entry : pointerMapping.entrySet()) { OLogManager.instance() .errorNoDb(this, "DIRECT-TRACK: unreleased direct memory...
streamsets/datacollector
client-api/src/main/java/com/streamsets/datacollector/client/api/SystemApi.java
SystemApi.getConfiguration
public Map<String, Object> getConfiguration () throws ApiException { Object postBody = null; byte[] postBinaryBody = null; // create path and map variables String path = "/v1/system/configuration".replaceAll("\\{format\\}","json"); // query params List<Pair> queryParams = new ArrayList<Pair>()...
java
public Map<String, Object> getConfiguration () throws ApiException { Object postBody = null; byte[] postBinaryBody = null; // create path and map variables String path = "/v1/system/configuration".replaceAll("\\{format\\}","json"); // query params List<Pair> queryParams = new ArrayList<Pair>()...
[ "public", "Map", "<", "String", ",", "Object", ">", "getConfiguration", "(", ")", "throws", "ApiException", "{", "Object", "postBody", "=", "null", ";", "byte", "[", "]", "postBinaryBody", "=", "null", ";", "// create path and map variables", "String", "path", ...
Returns ALL SDC Configuration @return Map<String, Object>
[ "Returns", "ALL", "SDC", "Configuration" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/client-api/src/main/java/com/streamsets/datacollector/client/api/SystemApi.java#L55-L82
test
Get configuration Returns configuration for the system
Of course, here is the Java code you requested: ```java public Map<String, Object> getConfiguration () throws ApiException { Object postBody = null; byte[] postBinaryBody = null; // create path and map variables String path = "/v1/system/configuration".replaceAll("\\{format\\}","json"); // query ...
Unidata/thredds
dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Notes.java
Nc4Notes.getVarId
static public long getVarId(VarNotes note) { return getVarId(note.gid, note.id, note.getFieldIndex()); }
java
static public long getVarId(VarNotes note) { return getVarId(note.gid, note.id, note.getFieldIndex()); }
[ "static", "public", "long", "getVarId", "(", "VarNotes", "note", ")", "{", "return", "getVarId", "(", "note", ".", "gid", ",", "note", ".", "id", ",", "note", ".", "getFieldIndex", "(", ")", ")", ";", "}" ]
Manage the compound id for variables
[ "Manage", "the", "compound", "id", "for", "variables" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Notes.java#L54-L58
test
Get the var id of a SECTYPE from a VarNotes object.
Of course, here is the Java code you requested: ```java static public long getVarId(VarNotes note) { return getVarId(note.gid, note.id, note.getFieldIndex()); } ``` Hope this helps!
GojaFramework/goja
goja-core/src/main/java/goja/core/kits/MoneyKit.java
MoneyKit.allocate
public MoneyKit[] allocate(long[] ratios) { MoneyKit[] results = new MoneyKit[ratios.length]; long total = 0; for (long ratio : ratios) { total += ratio; } long remainder = cent; for (int i = 0; i < results.length; i++) { results[i] = newMoneyW...
java
public MoneyKit[] allocate(long[] ratios) { MoneyKit[] results = new MoneyKit[ratios.length]; long total = 0; for (long ratio : ratios) { total += ratio; } long remainder = cent; for (int i = 0; i < results.length; i++) { results[i] = newMoneyW...
[ "public", "MoneyKit", "[", "]", "allocate", "(", "long", "[", "]", "ratios", ")", "{", "MoneyKit", "[", "]", "results", "=", "new", "MoneyKit", "[", "ratios", ".", "length", "]", ";", "long", "total", "=", "0", ";", "for", "(", "long", "ratio", ":"...
货币分配。 <p/> <p/> 将本货币对象按照规定的比例分配成若干份。分配所剩的零头 从第一份开始顺序分配。分配运算确保不会丢失金额零头。 @param ratios 分配比例数组,每一个比例是一个长整型,代表 相对于总数的相对数。 @return 货币对象数组,数组的长度与分配比例数组的长度相同。
[ "货币分配。", "<p", "/", ">", "<p", "/", ">", "将本货币对象按照规定的比例分配成若干份。分配所剩的零头", "从第一份开始顺序分配。分配运算确保不会丢失金额零头。" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/MoneyKit.java#L477-L498
test
Allocate a list of MoneyKit objects from the given ratios.
Of course, here is the Java code you requested: ```java public MoneyKit[] allocate(long[] ratios) { MoneyKit[] results = new MoneyKit[ratios.length]; long total = 0; for (long ratio : ratios) { total += ratio; } long remainder = cent; for (int i = 0; i < ...
ReactiveX/RxJava
src/main/java/io/reactivex/Single.java
Single.compose
@SuppressWarnings("unchecked") @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Single<R> compose(SingleTransformer<? super T, ? extends R> transformer) { return wrap(((SingleTransformer<T, R>) ObjectHelper.requireNonNull(transformer, "transformer is null")).apply(this)); ...
java
@SuppressWarnings("unchecked") @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Single<R> compose(SingleTransformer<? super T, ? extends R> transformer) { return wrap(((SingleTransformer<T, R>) ObjectHelper.requireNonNull(transformer, "transformer is null")).apply(this)); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Single", "<", "R", ">", "compose", "(", "SingleTransformer", "<", "?", "super", ...
Transform a Single by applying a particular Transformer function to it. <p> <img width="640" height="612" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.compose.png" alt=""> <p> This method operates on the Single itself whereas {@link #lift} operates on the Single's SingleObservers. <p> If...
[ "Transform", "a", "Single", "by", "applying", "a", "particular", "Transformer", "function", "to", "it", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "612", "src", "=", "https", ":", "//", "raw", ".", "github", ".", "com", "/", "wiki", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L2060-L2065
test
Compose a single object with another SingleTransformer.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Single<R> compose(SingleTransformer<? super T, ? extends R> transformer) { return wrap(((SingleTransformer<T, R>) ObjectHelper.requireNo...
oblac/jodd
jodd-core/src/main/java/jodd/util/ResourceBundleMessageResolver.java
ResourceBundleMessageResolver.getMessage
public String getMessage(final String bundleName, final Locale locale, final String key) { ResourceBundle bundle = findResourceBundle(bundleName, locale); if (bundle == null) { return null; } /* //jdk6: if (bundle.containsKey(key) == false) { return null; } */ try { return bundle.getString(key); ...
java
public String getMessage(final String bundleName, final Locale locale, final String key) { ResourceBundle bundle = findResourceBundle(bundleName, locale); if (bundle == null) { return null; } /* //jdk6: if (bundle.containsKey(key) == false) { return null; } */ try { return bundle.getString(key); ...
[ "public", "String", "getMessage", "(", "final", "String", "bundleName", ",", "final", "Locale", "locale", ",", "final", "String", "key", ")", "{", "ResourceBundle", "bundle", "=", "findResourceBundle", "(", "bundleName", ",", "locale", ")", ";", "if", "(", "...
Gets the message from the named resource bundle. Performs the failback only when bundle name or locale are not specified (i.e. are <code>null</code>).
[ "Gets", "the", "message", "from", "the", "named", "resource", "bundle", ".", "Performs", "the", "failback", "only", "when", "bundle", "name", "or", "locale", "are", "not", "specified", "(", "i", ".", "e", ".", "are", "<code", ">", "null<", "/", "code", ...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ResourceBundleMessageResolver.java#L159-L175
test
Gets the message from the specified bundle name and key.
Of course, here is the Java code you requested: ```java public String getMessage(final String bundleName, final Locale locale, final String key) { ResourceBundle bundle = findResourceBundle(bundleName, locale); if (bundle == null) { return null; } /* //jdk6: if (bundle.containsKey(key) == false) { retu...
Unidata/thredds
opendap/src/main/java/ucar/nc2/dods/DODSNetcdfFile.java
DODSNetcdfFile.addAttributes
private void addAttributes(Variable v, DodsV dodsV) { List<DODSAttribute> atts = dodsV.attributes; for (Attribute ncatt : atts) { v.addAttribute(ncatt); } // this is the case where its (probably) a Grid, and so _Coordinate.Axes has been assigned, but if // theres also a coordinates attribute,...
java
private void addAttributes(Variable v, DodsV dodsV) { List<DODSAttribute> atts = dodsV.attributes; for (Attribute ncatt : atts) { v.addAttribute(ncatt); } // this is the case where its (probably) a Grid, and so _Coordinate.Axes has been assigned, but if // theres also a coordinates attribute,...
[ "private", "void", "addAttributes", "(", "Variable", "v", ",", "DodsV", "dodsV", ")", "{", "List", "<", "DODSAttribute", ">", "atts", "=", "dodsV", ".", "attributes", ";", "for", "(", "Attribute", "ncatt", ":", "atts", ")", "{", "v", ".", "addAttribute",...
/* private void addAttributes(String tableName, AttributeTable attTable) { java.util.Enumeration attNames = attTable.getNames(); while (attNames.hasMoreElements()) { String attName = (String) attNames.nextElement(); dods.dap.Attribute att = attTable.getAttribute(attName); if (!att.isContainer()) { DODSAttribute ncatt ...
[ "/", "*", "private", "void", "addAttributes", "(", "String", "tableName", "AttributeTable", "attTable", ")", "{" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/ucar/nc2/dods/DODSNetcdfFile.java#L1038-L1051
test
Add the attributes of the DODS variable to the output variable.
Of course, here is the Java code you requested: ```java private void addAttributes(Variable v, DodsV dodsV) { List<DODSAttribute> atts = dodsV.attributes; for (Attribute ncatt : atts) { v.addAttribute(ncatt); } // this is the case where its (probably) a Grid, and so _Coordinate.Axes has been ass...
CAFapi/caf-common
config-rest/src/main/java/com/hpe/caf/config/rest/RestConfigurationSource.java
RestConfigurationSource.getConfigurationStream
@Override protected InputStream getConfigurationStream(final Class configClass, final Name relativePath) throws ConfigurationException { try { return remoteCall(relativePath.toString(), configClass.getSimpleName()).getBody().in(); } catch (final HttpConfigurationException e) ...
java
@Override protected InputStream getConfigurationStream(final Class configClass, final Name relativePath) throws ConfigurationException { try { return remoteCall(relativePath.toString(), configClass.getSimpleName()).getBody().in(); } catch (final HttpConfigurationException e) ...
[ "@", "Override", "protected", "InputStream", "getConfigurationStream", "(", "final", "Class", "configClass", ",", "final", "Name", "relativePath", ")", "throws", "ConfigurationException", "{", "try", "{", "return", "remoteCall", "(", "relativePath", ".", "toString", ...
{@inheritDoc} Descend back through the full service path to try and acquire configuration. This means we will try and get a more specific configuration first before going down to a more general configuration.
[ "{", "@inheritDoc", "}" ]
c9e617cd0b39e19d9480653f8c82efee53dee885
https://github.com/CAFapi/caf-common/blob/c9e617cd0b39e19d9480653f8c82efee53dee885/config-rest/src/main/java/com/hpe/caf/config/rest/RestConfigurationSource.java#L115-L126
test
Gets the configuration stream.
Of course, here is the Java code you requested: ```java @Override protected InputStream getConfigurationStream(final Class configClass, final Name relativePath) throws ConfigurationException { try { return remoteCall(relativePath.toString(), configClass.getSimpleName()).getBody().in...
wildfly/wildfly
legacy/jacorb/src/main/java/org/jboss/as/jacorb/JacORBSubsystemParser.java
JacORBSubsystemParser.parsePropertiesConfig
private void parsePropertiesConfig(Namespace namespace, XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException { // the properties element doesn't define any attributes, just sub-elements. requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() !=...
java
private void parsePropertiesConfig(Namespace namespace, XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException { // the properties element doesn't define any attributes, just sub-elements. requireNoAttributes(reader); while (reader.hasNext() && reader.nextTag() !=...
[ "private", "void", "parsePropertiesConfig", "(", "Namespace", "namespace", ",", "XMLExtendedStreamReader", "reader", ",", "ModelNode", "node", ")", "throws", "XMLStreamException", "{", "// the properties element doesn't define any attributes, just sub-elements.", "requireNoAttribut...
<p> Parses the {@code properties} section of the JacORB subsystem configuration. </p> @param namespace the expected {@code Namespace} of the parsed elements. @param reader the {@code XMLExtendedStreamReader} used to read the configuration XML. @param node the {@code ModelNode} that will hold the parsed properties. @...
[ "<p", ">", "Parses", "the", "{", "@code", "properties", "}", "section", "of", "the", "JacORB", "subsystem", "configuration", ".", "<", "/", "p", ">" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/legacy/jacorb/src/main/java/org/jboss/as/jacorb/JacORBSubsystemParser.java#L621-L643
test
Parses the properties config.
Of course, here is the Java code you requested: ```java private void parsePropertiesConfig(Namespace namespace, XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException { // the properties element doesn't define any attributes, just sub-elements. requireNoAttributes(reader)...
Unidata/thredds
cdm/src/main/java/ucar/nc2/wmo/Util.java
Util.isUnitless
public static boolean isUnitless(String unit) { if (unit == null) return true; String munge = unit.toLowerCase().trim(); munge = StringUtil2.remove(munge, '('); return munge.length() == 0 || munge.startsWith("numeric") || munge.startsWith("non-dim") || munge.startsWith("see") || m...
java
public static boolean isUnitless(String unit) { if (unit == null) return true; String munge = unit.toLowerCase().trim(); munge = StringUtil2.remove(munge, '('); return munge.length() == 0 || munge.startsWith("numeric") || munge.startsWith("non-dim") || munge.startsWith("see") || m...
[ "public", "static", "boolean", "isUnitless", "(", "String", "unit", ")", "{", "if", "(", "unit", "==", "null", ")", "return", "true", ";", "String", "munge", "=", "unit", ".", "toLowerCase", "(", ")", ".", "trim", "(", ")", ";", "munge", "=", "String...
The given unit is "unitless".
[ "The", "given", "unit", "is", "unitless", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/wmo/Util.java#L94-L102
test
Checks if the unit is unitless.
Of course, here is the Java code you requested: ```java public static boolean isUnitless(String unit) { if (unit == null) return true; String munge = unit.toLowerCase().trim(); munge = StringUtil2.remove(munge, '('); return munge.length() == 0 || munge.startsWith("numeric") || munge.start...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/simplegeom/SimpleGeomController.java
SimpleGeomController.setField
private boolean setField(Object fld) { GridDatatype gg = null; if (fld instanceof GridDatatype) gg = (GridDatatype) fld; else if (fld instanceof String) gg = gridDataset.findGridDatatype( (String) fld); if (null == gg) return false; renderGrid.setGeoGrid(gg); current...
java
private boolean setField(Object fld) { GridDatatype gg = null; if (fld instanceof GridDatatype) gg = (GridDatatype) fld; else if (fld instanceof String) gg = gridDataset.findGridDatatype( (String) fld); if (null == gg) return false; renderGrid.setGeoGrid(gg); current...
[ "private", "boolean", "setField", "(", "Object", "fld", ")", "{", "GridDatatype", "gg", "=", "null", ";", "if", "(", "fld", "instanceof", "GridDatatype", ")", "gg", "=", "(", "GridDatatype", ")", "fld", ";", "else", "if", "(", "fld", "instanceof", "Strin...
public GridDatatype getField() { return currentField; }
[ "public", "GridDatatype", "getField", "()", "{", "return", "currentField", ";", "}" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/simplegeom/SimpleGeomController.java#L709-L753
test
Set the field from the RenderGrid
Of course, here is the Java code you requested: ```java private boolean setField(Object fld) { GridDatatype gg = null; if (fld instanceof GridDatatype) gg = (GridDatatype) fld; else if (fld instanceof String) gg = gridDataset.findGridDatatype( (String) fld); if (null == gg) ret...
Unidata/thredds
legacy/src/main/java/thredds/catalog/InvDatasetImpl.java
InvDatasetImpl.finish
public boolean finish() { boolean ok = true; java.util.Iterator iter; logger.debug("Now finish " + getName() + " id= " + getID()); authorityName = null; dataType = null; dataFormatType = null; defaultService = null; gc = null; tc = null; docs = new ArrayList<>(); metadata =...
java
public boolean finish() { boolean ok = true; java.util.Iterator iter; logger.debug("Now finish " + getName() + " id= " + getID()); authorityName = null; dataType = null; dataFormatType = null; defaultService = null; gc = null; tc = null; docs = new ArrayList<>(); metadata =...
[ "public", "boolean", "finish", "(", ")", "{", "boolean", "ok", "=", "true", ";", "java", ".", "util", ".", "Iterator", "iter", ";", "logger", ".", "debug", "(", "\"Now finish \"", "+", "getName", "(", ")", "+", "\" id= \"", "+", "getID", "(", ")", ")...
Finish constructing after all elements have been added. This does the inheritence thing This can be called again if new elements are added. @return true if successful.
[ "Finish", "constructing", "after", "all", "elements", "have", "been", "added", ".", "This", "does", "the", "inheritence", "thing", "This", "can", "be", "called", "again", "if", "new", "elements", "are", "added", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/InvDatasetImpl.java#L91-L148
test
Finish the generation of the data structures.
Of course, here is the Java code you requested: ```java public boolean finish() { boolean ok = true; java.util.Iterator iter; logger.debug("Now finish " + getName() + " id= " + getID()); authorityName = null; dataType = null; dataFormatType = null; defaultService = null; gc = null; ...
oblac/jodd
jodd-core/src/main/java/jodd/io/FileUtil.java
FileUtil.copyFileToDir
public static File copyFileToDir(final File srcFile, final File destDir) throws IOException { checkExistsAndDirectory(destDir); File destFile = file(destDir, srcFile.getName()); copyFile(srcFile, destFile); return destFile; }
java
public static File copyFileToDir(final File srcFile, final File destDir) throws IOException { checkExistsAndDirectory(destDir); File destFile = file(destDir, srcFile.getName()); copyFile(srcFile, destFile); return destFile; }
[ "public", "static", "File", "copyFileToDir", "(", "final", "File", "srcFile", ",", "final", "File", "destDir", ")", "throws", "IOException", "{", "checkExistsAndDirectory", "(", "destDir", ")", ";", "File", "destFile", "=", "file", "(", "destDir", ",", "srcFil...
Copies a {@link File} to directory with specified copy params and returns copied destination.
[ "Copies", "a", "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L307-L312
test
Copy a file to a destination directory.
Of course, here is the Java code you requested: ```java public static File copyFileToDir(final File srcFile, final File destDir) throws IOException { checkExistsAndDirectory(destDir); File destFile = file(destDir, srcFile.getName()); copyFile(srcFile, destFile); return destFile; } ``` Hope this helps!
dbmdz/iiif-apis
src/main/java/de/digitalcollections/iiif/model/image/ImageApiSelector.java
ImageApiSelector.urlEncode
private static String urlEncode(String str) { Set<String> excluded = ImmutableSet.of( ":", "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="); String encoded = new Encoded(str).toString(); for (String ex : excluded) { encoded = encoded.replaceAll(new Encoded(ex).toString(), ex); } ...
java
private static String urlEncode(String str) { Set<String> excluded = ImmutableSet.of( ":", "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="); String encoded = new Encoded(str).toString(); for (String ex : excluded) { encoded = encoded.replaceAll(new Encoded(ex).toString(), ex); } ...
[ "private", "static", "String", "urlEncode", "(", "String", "str", ")", "{", "Set", "<", "String", ">", "excluded", "=", "ImmutableSet", ".", "of", "(", "\":\"", ",", "\"!\"", ",", "\"$\"", ",", "\"&\"", ",", "\"'\"", ",", "\"(\"", ",", "\")\"", ",", ...
The spec says we have to urlencode values, but only characters outside of the US ASCII range and gen-delims from RFC3986. However, our URL library can only encode the full set of gen-delims (EXCEPT the colon) and sub-delims, which iswhy we have to manually decode the encoded sub-delims... Great and pragmatic choice for...
[ "The", "spec", "says", "we", "have", "to", "urlencode", "values", "but", "only", "characters", "outside", "of", "the", "US", "ASCII", "range", "and", "gen", "-", "delims", "from", "RFC3986", ".", "However", "our", "URL", "library", "can", "only", "encode",...
3e77c1044ca4bf4acabb38269c7d72af2f042fc8
https://github.com/dbmdz/iiif-apis/blob/3e77c1044ca4bf4acabb38269c7d72af2f042fc8/src/main/java/de/digitalcollections/iiif/model/image/ImageApiSelector.java#L105-L113
test
URL encode a string
Of course, here is the Java code you requested: ```java private static String urlEncode(String str) { Set<String> excluded = ImmutableSet.of( ":", "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="); String encoded = new Encoded(str).toString(); for (String ex : excluded) { encoded = encod...
GojaFramework/goja
goja-web/src/main/java/goja/mvc/kits/Requests.java
Requests.clientOS
public static String clientOS(HttpServletRequest req) { String userAgent = req.getHeader("User-Agent"); String cos = "unknow os"; Pattern p = Pattern.compile(".*(Windows NT 6\\.2).*"); Matcher m = p.matcher(userAgent); if (m.find()) { cos = "Win 8"; return...
java
public static String clientOS(HttpServletRequest req) { String userAgent = req.getHeader("User-Agent"); String cos = "unknow os"; Pattern p = Pattern.compile(".*(Windows NT 6\\.2).*"); Matcher m = p.matcher(userAgent); if (m.find()) { cos = "Win 8"; return...
[ "public", "static", "String", "clientOS", "(", "HttpServletRequest", "req", ")", "{", "String", "userAgent", "=", "req", ".", "getHeader", "(", "\"User-Agent\"", ")", ";", "String", "cos", "=", "\"unknow os\"", ";", "Pattern", "p", "=", "Pattern", ".", "comp...
获取客户端操作系统信息 @param req http request. @return string
[ "获取客户端操作系统信息" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/mvc/kits/Requests.java#L133-L208
test
Get the client OS name from the user agent.
Of course, here is the Java code you requested: ```java public static String clientOS(HttpServletRequest req) { String userAgent = req.getHeader("User-Agent"); String cos = "unknow os"; Pattern p = Pattern.compile(".*(Windows NT 6\\.2).*"); Matcher m = p.matcher(userAgent); if (...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/doublemaps/SymbolTableImpl.java
SymbolTableImpl.getSymbolKey
public SymbolKey getSymbolKey(K key) { // Create an entry in the sequence function for the key, if one does not already exist. int scopeSequenceKey = hashFunction.apply(new CompositeKey<K>(parentSequenceKey, key)); return new SymbolKeyImpl(scopeSequenceKey); }
java
public SymbolKey getSymbolKey(K key) { // Create an entry in the sequence function for the key, if one does not already exist. int scopeSequenceKey = hashFunction.apply(new CompositeKey<K>(parentSequenceKey, key)); return new SymbolKeyImpl(scopeSequenceKey); }
[ "public", "SymbolKey", "getSymbolKey", "(", "K", "key", ")", "{", "// Create an entry in the sequence function for the key, if one does not already exist.", "int", "scopeSequenceKey", "=", "hashFunction", ".", "apply", "(", "new", "CompositeKey", "<", "K", ">", "(", "pare...
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/doublemaps/SymbolTableImpl.java#L292-L298
test
Get a symbol key for the given key.
Of course, here is the Java code you requested: ```java public SymbolKey getSymbolKey(K key) { // Create an entry in the sequence function for the key, if one does not already exist. int scopeSequenceKey = hashFunction.apply(new CompositeKey<K>(parentSequenceKey, key)); return new SymbolKe...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/chart/ChartHelper.java
ChartHelper.createPieChart
public JFreeChart createPieChart(final ChartData chartData) { // create the chart... final JFreeChart chart = ChartFactory.createPieChart( getPieTitle(chartData), // chart title createPieDataset(chartData), // data true, // include legend false, // tooltips false // urls ); setu...
java
public JFreeChart createPieChart(final ChartData chartData) { // create the chart... final JFreeChart chart = ChartFactory.createPieChart( getPieTitle(chartData), // chart title createPieDataset(chartData), // data true, // include legend false, // tooltips false // urls ); setu...
[ "public", "JFreeChart", "createPieChart", "(", "final", "ChartData", "chartData", ")", "{", "// create the chart...\r", "final", "JFreeChart", "chart", "=", "ChartFactory", ".", "createPieChart", "(", "getPieTitle", "(", "chartData", ")", ",", "// chart title\r", "cre...
Create jfree bar chart. @param chartData contain information gathered from excel chart object. @return jfree line chart.
[ "Create", "jfree", "bar", "chart", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/chart/ChartHelper.java#L392-L407
test
Create a JFreeChart.
Of course, here is the Java code you requested: ```java public JFreeChart createPieChart(final ChartData chartData) { // create the chart... final JFreeChart chart = ChartFactory.createPieChart( getPieTitle(chartData), // chart title createPieDataset(chartData), // data true, // include legend ...
Enterprise-Content-Management/infoarchive-sip-sdk
core/src/main/java/com/opentext/ia/sdk/sip/SipAssembler.java
SipAssembler.forPdiAndContent
public static <D> SipAssembler<D> forPdiAndContent(PackagingInformation prototype, Assembler<HashedContents<D>> pdiAssembler, ContentAssembler<D> contentAssembler) { HashAssembler noHashAssembler = new NoHashAssembler(); return forPdiAndContentWithHashing(prototype, pdiAssembler, noHashAssembler, contentA...
java
public static <D> SipAssembler<D> forPdiAndContent(PackagingInformation prototype, Assembler<HashedContents<D>> pdiAssembler, ContentAssembler<D> contentAssembler) { HashAssembler noHashAssembler = new NoHashAssembler(); return forPdiAndContentWithHashing(prototype, pdiAssembler, noHashAssembler, contentA...
[ "public", "static", "<", "D", ">", "SipAssembler", "<", "D", ">", "forPdiAndContent", "(", "PackagingInformation", "prototype", ",", "Assembler", "<", "HashedContents", "<", "D", ">", ">", "pdiAssembler", ",", "ContentAssembler", "<", "D", ">", "contentAssembler...
Assemble a SIP that contains only structured data and is the only SIP in its DSS. @param <D> The type of domain objects to assemble the SIP from @param prototype Prototype for the Packaging Information @param pdiAssembler Assembler that builds up the PDI @param contentAssembler ContentAssembler that adds the digital ob...
[ "Assemble", "a", "SIP", "that", "contains", "only", "structured", "data", "and", "is", "the", "only", "SIP", "in", "its", "DSS", "." ]
3c84a4d9ce569139e9a442034526944d3e63436e
https://github.com/Enterprise-Content-Management/infoarchive-sip-sdk/blob/3c84a4d9ce569139e9a442034526944d3e63436e/core/src/main/java/com/opentext/ia/sdk/sip/SipAssembler.java#L153-L157
test
Create a SipAssembler for a given packed information.
Of course, here is the Java code you requested: ```java public static <D> SipAssembler<D> forPdiAndContent(PackagingInformation prototype, Assembler<HashedContents<D>> pdiAssembler, ContentAssembler<D> contentAssembler) { HashAssembler noHashAssembler = new NoHashAssembler(); return forPdiAndContentWithH...
oblac/jodd
jodd-petite/src/main/java/jodd/petite/PetiteBeans.java
PetiteBeans.registerPetitePropertyInjectionPoint
public void registerPetitePropertyInjectionPoint(final String beanName, final String property, final String reference) { BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName); ClassDescriptor cd = ClassIntrospector.get().lookup(beanDefinition.type); PropertyDescriptor propertyDescriptor = cd.get...
java
public void registerPetitePropertyInjectionPoint(final String beanName, final String property, final String reference) { BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName); ClassDescriptor cd = ClassIntrospector.get().lookup(beanDefinition.type); PropertyDescriptor propertyDescriptor = cd.get...
[ "public", "void", "registerPetitePropertyInjectionPoint", "(", "final", "String", "beanName", ",", "final", "String", "property", ",", "final", "String", "reference", ")", "{", "BeanDefinition", "beanDefinition", "=", "lookupExistingBeanDefinition", "(", "beanName", ")"...
Registers property injection point. @param beanName bean name @param property property name @param reference explicit injection reference, may be <code>null</code>
[ "Registers", "property", "injection", "point", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/PetiteBeans.java#L562-L577
test
Registers a property injection point.
Of course, here is the Java code you requested: ```java public void registerPetitePropertyInjectionPoint(final String beanName, final String property, final String reference) { BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName); ClassDescriptor cd = ClassIntrospector.get().lookup(beanDefinitio...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/IndexEntry.java
IndexEntry.make
public static IndexEntry make(long position, long timeStamp, int flags, int size, int minDistance) { long cPtr = VideoJNI.IndexEntry_make(position, timeStamp, flags, size, minDistance); return (cPtr == 0) ? null : new IndexEntry(cPtr, false); }
java
public static IndexEntry make(long position, long timeStamp, int flags, int size, int minDistance) { long cPtr = VideoJNI.IndexEntry_make(position, timeStamp, flags, size, minDistance); return (cPtr == 0) ? null : new IndexEntry(cPtr, false); }
[ "public", "static", "IndexEntry", "make", "(", "long", "position", ",", "long", "timeStamp", ",", "int", "flags", ",", "int", "size", ",", "int", "minDistance", ")", "{", "long", "cPtr", "=", "VideoJNI", ".", "IndexEntry_make", "(", "position", ",", "timeS...
Create a new IndexEntry with the specified<br> values.<br> <br> @param position The value to be returned from #getPosition().<br> @param timeStamp The value to be returned from #getTimeStamp().<br> @param flags The value to be returned from #getFlags().<br> @param size The value to be returned from #getSize().<br> @par...
[ "Create", "a", "new", "IndexEntry", "with", "the", "specified<br", ">", "values", ".", "<br", ">", "<br", ">" ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/IndexEntry.java#L169-L172
test
Create an IndexEntry from the given parameters.
Of course, here is the Java code you requested: ```java public static IndexEntry make(long position, long timeStamp, int flags, int size, int minDistance) { long cPtr = VideoJNI.IndexEntry_make(position, timeStamp, flags, size, minDistance); return (cPtr == 0) ? null : new IndexEntry(cPtr, false); } ``` Hop...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/api/producer/AbstractHollowProducer.java
AbstractHollowProducer.checkIntegrity
private ReadStateHelper checkIntegrity( ListenerSupport.Listeners listeners, ReadStateHelper readStates, Artifacts artifacts) throws Exception { Status.StageWithStateBuilder status = listeners.fireIntegrityCheckStart(readStates.pending()); try { ReadStateHelper result = readState...
java
private ReadStateHelper checkIntegrity( ListenerSupport.Listeners listeners, ReadStateHelper readStates, Artifacts artifacts) throws Exception { Status.StageWithStateBuilder status = listeners.fireIntegrityCheckStart(readStates.pending()); try { ReadStateHelper result = readState...
[ "private", "ReadStateHelper", "checkIntegrity", "(", "ListenerSupport", ".", "Listeners", "listeners", ",", "ReadStateHelper", "readStates", ",", "Artifacts", "artifacts", ")", "throws", "Exception", "{", "Status", ".", "StageWithStateBuilder", "status", "=", "listeners...
Given these read states <p> * S(cur) at the currently announced version * S(pnd) at the pending version <p> Ensure that: <p> S(cur).apply(forwardDelta).checksum == S(pnd).checksum S(pnd).apply(reverseDelta).checksum == S(cur).checksum @return updated read states
[ "Given", "these", "read", "states", "<p", ">", "*", "S", "(", "cur", ")", "at", "the", "currently", "announced", "version", "*", "S", "(", "pnd", ")", "at", "the", "pending", "version", "<p", ">", "Ensure", "that", ":", "<p", ">", "S", "(", "cur", ...
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/api/producer/AbstractHollowProducer.java#L663-L711
test
Check integrity of the read state helper.
Of course, here is the Java code you requested: ```java private ReadStateHelper checkIntegrity( ListenerSupport.Listeners listeners, ReadStateHelper readStates, Artifacts artifacts) throws Exception { Status.StageWithStateBuilder status = listeners.fireIntegrityCheckStart(readStates.pending()); ...
VanRoy/spring-data-jest
spring-boot-starter-data-jest/src/main/java/com/github/vanroy/springboot/autoconfigure/data/jest/ElasticsearchJestAutoConfiguration.java
ElasticsearchJestAutoConfiguration.createJestClient
private JestClient createJestClient(String uri) { HttpClientConfig.Builder builder = new HttpClientConfig.Builder(uri) .maxTotalConnection(properties.getMaxTotalConnection()) .defaultMaxTotalConnectionPerRoute(properties.getDefaultMaxTotalConnectionPerRoute()) .maxConnectionIdleTime(properties.getMaxConnect...
java
private JestClient createJestClient(String uri) { HttpClientConfig.Builder builder = new HttpClientConfig.Builder(uri) .maxTotalConnection(properties.getMaxTotalConnection()) .defaultMaxTotalConnectionPerRoute(properties.getDefaultMaxTotalConnectionPerRoute()) .maxConnectionIdleTime(properties.getMaxConnect...
[ "private", "JestClient", "createJestClient", "(", "String", "uri", ")", "{", "HttpClientConfig", ".", "Builder", "builder", "=", "new", "HttpClientConfig", ".", "Builder", "(", "uri", ")", ".", "maxTotalConnection", "(", "properties", ".", "getMaxTotalConnection", ...
Create Jest client with URI @param uri URI of Elasticsearch @return JestClient
[ "Create", "Jest", "client", "with", "URI" ]
e6bcce1a49696aba34b02244bde74f85575c2c12
https://github.com/VanRoy/spring-data-jest/blob/e6bcce1a49696aba34b02244bde74f85575c2c12/spring-boot-starter-data-jest/src/main/java/com/github/vanroy/springboot/autoconfigure/data/jest/ElasticsearchJestAutoConfiguration.java#L109-L139
test
Creates a JestClient based on the properties.
Of course, here is the Java code you requested: ```java private JestClient createJestClient(String uri) { HttpClientConfig.Builder builder = new HttpClientConfig.Builder(uri) .maxTotalConnection(properties.getMaxTotalConnection()) .defaultMaxTotalConnectionPerRoute(properties.getDefaultMaxTotalConnectionPerRo...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/comparator/OComparatorFactory.java
OComparatorFactory.getComparator
@SuppressWarnings("unchecked") public <T> Comparator<T> getComparator(Class<T> clazz) { boolean useUnsafe = OGlobalConfiguration.MEMORY_USE_UNSAFE.getValueAsBoolean(); if (clazz.equals(byte[].class)) { if (useUnsafe && unsafeWasDetected) return (Comparator<T>) OUnsafeByteArrayComparator.INSTANC...
java
@SuppressWarnings("unchecked") public <T> Comparator<T> getComparator(Class<T> clazz) { boolean useUnsafe = OGlobalConfiguration.MEMORY_USE_UNSAFE.getValueAsBoolean(); if (clazz.equals(byte[].class)) { if (useUnsafe && unsafeWasDetected) return (Comparator<T>) OUnsafeByteArrayComparator.INSTANC...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "Comparator", "<", "T", ">", "getComparator", "(", "Class", "<", "T", ">", "clazz", ")", "{", "boolean", "useUnsafe", "=", "OGlobalConfiguration", ".", "MEMORY_USE_UNSAFE", ".", "ge...
Returns {@link Comparator} instance if applicable one exist or <code>null</code> otherwise. @param clazz Class of object that is going to be compared. @param <T> Class of object that is going to be compared. @return {@link Comparator} instance if applicable one exist or <code>null</code> otherwise.
[ "Returns", "{", "@link", "Comparator", "}", "instance", "if", "applicable", "one", "exist", "or", "<code", ">", "null<", "/", "code", ">", "otherwise", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/comparator/OComparatorFactory.java#L59-L71
test
Get the comparator for the given class.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public <T> Comparator<T> getComparator(Class<T> clazz) { boolean useUnsafe = OGlobalConfiguration.MEMORY_USE_UNSAFE.getValueAsBoolean(); if (clazz.equals(byte[].class)) { if (useUnsafe && unsafeWasDetected) ...
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientConfigurableGraph.java
OrientConfigurableGraph.init
protected void init(final Configuration configuration) { final Boolean saveOriginalIds = configuration.getBoolean("blueprints.orientdb.saveOriginalIds", null); if (saveOriginalIds != null) setSaveOriginalIds(saveOriginalIds); final Boolean keepInMemoryReferences = configuration.getBoolean("blueprints...
java
protected void init(final Configuration configuration) { final Boolean saveOriginalIds = configuration.getBoolean("blueprints.orientdb.saveOriginalIds", null); if (saveOriginalIds != null) setSaveOriginalIds(saveOriginalIds); final Boolean keepInMemoryReferences = configuration.getBoolean("blueprints...
[ "protected", "void", "init", "(", "final", "Configuration", "configuration", ")", "{", "final", "Boolean", "saveOriginalIds", "=", "configuration", ".", "getBoolean", "(", "\"blueprints.orientdb.saveOriginalIds\"", ",", "null", ")", ";", "if", "(", "saveOriginalIds", ...
Builds a OrientGraph instance passing a configuration. Supported configuration settings are: <table> <tr> <td><b>Name</b></td> <td><b>Description</b></td> <td><b>Default value</b></td> </tr> <tr> <td>blueprints.orientdb.url</td> <td>Database URL</td> <td>-</td> </tr> <tr> <td>blueprints.orientdb.username</td> <td>User ...
[ "Builds", "a", "OrientGraph", "instance", "passing", "a", "configuration", ".", "Supported", "configuration", "settings", "are", ":", "<table", ">", "<tr", ">", "<td", ">", "<b", ">", "Name<", "/", "b", ">", "<", "/", "td", ">", "<td", ">", "<b", ">", ...
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientConfigurableGraph.java#L939-L980
test
Initialize the object from the configuration.
Of course, here is the Java code you requested: ```java protected void init(final Configuration configuration) { final Boolean saveOriginalIds = configuration.getBoolean("blueprints.orientdb.saveOriginalIds", null); if (saveOriginalIds != null) setSaveOriginalIds(saveOriginalIds); final Boolean keep...
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java
OrientEdge.getRecord
@Override public ODocument getRecord() { if (rawElement == null) { // CREATE AT THE FLY final ODocument tmp = new ODocument(getClassName(label)).setTrackingChanges(false); tmp.field(OrientBaseGraph.CONNECTION_IN, vIn.getIdentity()); tmp.field(OrientBaseGraph.CONNECTION_OUT, vOut.getIdentit...
java
@Override public ODocument getRecord() { if (rawElement == null) { // CREATE AT THE FLY final ODocument tmp = new ODocument(getClassName(label)).setTrackingChanges(false); tmp.field(OrientBaseGraph.CONNECTION_IN, vIn.getIdentity()); tmp.field(OrientBaseGraph.CONNECTION_OUT, vOut.getIdentit...
[ "@", "Override", "public", "ODocument", "getRecord", "(", ")", "{", "if", "(", "rawElement", "==", "null", ")", "{", "// CREATE AT THE FLY", "final", "ODocument", "tmp", "=", "new", "ODocument", "(", "getClassName", "(", "label", ")", ")", ".", "setTrackingC...
(Blueprints Extension) Returns the underlying record if it's a regular edge, otherwise it created a document with no identity with the edge properties.
[ "(", "Blueprints", "Extension", ")", "Returns", "the", "underlying", "record", "if", "it", "s", "a", "regular", "edge", "otherwise", "it", "created", "a", "document", "with", "no", "identity", "with", "the", "edge", "properties", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java#L421-L434
test
Returns the raw element of the segment.
Of course, here is the Java code you requested: ```java @Override public ODocument getRecord() { if (rawElement == null) { // CREATE AT THE FLY final ODocument tmp = new ODocument(getClassName(label)).setTrackingChanges(false); tmp.field(OrientBaseGraph.CONNECTION_IN, vIn.getIdentity()); ...
Unidata/thredds
waterml/src/main/java/ucar/nc2/ogc/om/NcTimeObjectPropertyType.java
NcTimeObjectPropertyType.initPhenomenonTime
public static TimeObjectPropertyType initPhenomenonTime( TimeObjectPropertyType phenomenonTime, StationTimeSeriesFeature stationFeat) throws IOException { // gml:TimePeriod TimePeriodDocument timePeriodDoc = TimePeriodDocument.Factory.newInstance(); NcTimePeriodType.initTimePeriod(ti...
java
public static TimeObjectPropertyType initPhenomenonTime( TimeObjectPropertyType phenomenonTime, StationTimeSeriesFeature stationFeat) throws IOException { // gml:TimePeriod TimePeriodDocument timePeriodDoc = TimePeriodDocument.Factory.newInstance(); NcTimePeriodType.initTimePeriod(ti...
[ "public", "static", "TimeObjectPropertyType", "initPhenomenonTime", "(", "TimeObjectPropertyType", "phenomenonTime", ",", "StationTimeSeriesFeature", "stationFeat", ")", "throws", "IOException", "{", "// gml:TimePeriod", "TimePeriodDocument", "timePeriodDoc", "=", "TimePeriodDocu...
wml2:Collection/wml2:observationMember/om:OM_Observation/om:phenomenonTime
[ "wml2", ":", "Collection", "/", "wml2", ":", "observationMember", "/", "om", ":", "OM_Observation", "/", "om", ":", "phenomenonTime" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/waterml/src/main/java/ucar/nc2/ogc/om/NcTimeObjectPropertyType.java#L15-L23
test
This method initializes a new NcTimePeriod object property from a data file.
Of course, here is the Java code you requested: ```java public static TimeObjectPropertyType initPhenomenonTime( TimeObjectPropertyType phenomenonTime, StationTimeSeriesFeature stationFeat) throws IOException { // gml:TimePeriod TimePeriodDocument timePeriodDoc = TimePeriodDocument.Factory....
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.getChildren
public Iterator<Operator<Term>> getChildren(boolean reverse) { if ((traverser != null) && (traverser instanceof FunctorTraverser)) { return ((FunctorTraverser) traverser).traverse(this, reverse); } else { if (arguments == null) { ...
java
public Iterator<Operator<Term>> getChildren(boolean reverse) { if ((traverser != null) && (traverser instanceof FunctorTraverser)) { return ((FunctorTraverser) traverser).traverse(this, reverse); } else { if (arguments == null) { ...
[ "public", "Iterator", "<", "Operator", "<", "Term", ">", ">", "getChildren", "(", "boolean", "reverse", ")", "{", "if", "(", "(", "traverser", "!=", "null", ")", "&&", "(", "traverser", "instanceof", "FunctorTraverser", ")", ")", "{", "return", "(", "(",...
Provides an iterator over the child terms, if there are any. Only functors are compound, and built across a list of child arguments. @param reverse Set, if the children should be presented in reverse order. @return The sub-terms of a compound term.
[ "Provides", "an", "iterator", "over", "the", "child", "terms", "if", "there", "are", "any", ".", "Only", "functors", "are", "compound", "and", "built", "across", "a", "list", "of", "child", "arguments", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L337-L365
test
Get the children of this term.
Of course, here is the Java code you requested: ```java public Iterator<Operator<Term>> getChildren(boolean reverse) { if ((traverser != null) && (traverser instanceof FunctorTraverser)) { return ((FunctorTraverser) traverser).traverse(this, reverse); } else { ...
deeplearning4j/nd4j
nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/flow/impl/GridFlowController.java
GridFlowController.synchronizeToHost
@Override public void synchronizeToHost(AllocationPoint point) { if (!point.isConstant() && point.isEnqueued()) { waitTillFinished(point); } super.synchronizeToHost(point); }
java
@Override public void synchronizeToHost(AllocationPoint point) { if (!point.isConstant() && point.isEnqueued()) { waitTillFinished(point); } super.synchronizeToHost(point); }
[ "@", "Override", "public", "void", "synchronizeToHost", "(", "AllocationPoint", "point", ")", "{", "if", "(", "!", "point", ".", "isConstant", "(", ")", "&&", "point", ".", "isEnqueued", "(", ")", ")", "{", "waitTillFinished", "(", "point", ")", ";", "}"...
This method makes sure HOST memory contains latest data from GPU Additionally, this method checks, that there's no ops pending execution for this array @param point
[ "This", "method", "makes", "sure", "HOST", "memory", "contains", "latest", "data", "from", "GPU" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/flow/impl/GridFlowController.java#L28-L35
test
This method is called by the allocation point when the thread is in a thread - local state.
Of course, here is the Java code you requested: ```java @Override public void synchronizeToHost(AllocationPoint point) { if (!point.isConstant() && point.isEnqueued()) { waitTillFinished(point); } super.synchronizeToHost(point); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/Variable.java
Variable.read
public Array read(ucar.ma2.Section section) throws java.io.IOException, ucar.ma2.InvalidRangeException { return (section == null) ? _read() : _read(Section.fill(section, shape)); }
java
public Array read(ucar.ma2.Section section) throws java.io.IOException, ucar.ma2.InvalidRangeException { return (section == null) ? _read() : _read(Section.fill(section, shape)); }
[ "public", "Array", "read", "(", "ucar", ".", "ma2", ".", "Section", "section", ")", "throws", "java", ".", "io", ".", "IOException", ",", "ucar", ".", "ma2", ".", "InvalidRangeException", "{", "return", "(", "section", "==", "null", ")", "?", "_read", ...
Read a section of the data for this Variable from the netcdf file and return a memory resident Array. The Array has the same element type as the Variable, and the requested shape. Note that this does not do rank reduction, so the returned Array has the same rank as the Variable. Use Array.reduce() for rank reduction. <...
[ "Read", "a", "section", "of", "the", "data", "for", "this", "Variable", "from", "the", "netcdf", "file", "and", "return", "a", "memory", "resident", "Array", ".", "The", "Array", "has", "the", "same", "element", "type", "as", "the", "Variable", "and", "t...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/Variable.java#L618-L620
test
Read a CID array.
Of course, here is the Java code you requested: ```java public Array read(ucar.ma2.Section section) throws java.io.IOException, ucar.ma2.InvalidRangeException { return (section == null) ? _read() : _read(Section.fill(section, shape)); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft2/coverage/HorizCoordSys.java
HorizCoordSys.subsetLon
private Optional<CoverageCoordAxis> subsetLon(LatLonRect llbb, int stride) throws InvalidRangeException { double wantMin = LatLonPointImpl.lonNormalFrom(llbb.getLonMin(), lonAxis.getStartValue()); double wantMax = LatLonPointImpl.lonNormalFrom(llbb.getLonMax(), lonAxis.getStartValue()); double start = lonAx...
java
private Optional<CoverageCoordAxis> subsetLon(LatLonRect llbb, int stride) throws InvalidRangeException { double wantMin = LatLonPointImpl.lonNormalFrom(llbb.getLonMin(), lonAxis.getStartValue()); double wantMax = LatLonPointImpl.lonNormalFrom(llbb.getLonMax(), lonAxis.getStartValue()); double start = lonAx...
[ "private", "Optional", "<", "CoverageCoordAxis", ">", "subsetLon", "(", "LatLonRect", "llbb", ",", "int", "stride", ")", "throws", "InvalidRangeException", "{", "double", "wantMin", "=", "LatLonPointImpl", ".", "lonNormalFrom", "(", "llbb", ".", "getLonMin", "(", ...
here's where to deal with crossing seam
[ "here", "s", "where", "to", "deal", "with", "crossing", "seam" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/coverage/HorizCoordSys.java#L280-L300
test
subsetLon returns optional of coverage coord axis
Of course, here is the Java code you requested: ```java private Optional<CoverageCoordAxis> subsetLon(LatLonRect llbb, int stride) throws InvalidRangeException { double wantMin = LatLonPointImpl.lonNormalFrom(llbb.getLonMin(), lonAxis.getStartValue()); double wantMax = LatLonPointImpl.lonNormalFrom(llbb.getLon...
oblac/jodd
jodd-http/src/main/java/jodd/http/Buffer.java
Buffer.writeTo
public void writeTo(final OutputStream out, final HttpProgressListener progressListener) throws IOException { // start final int size = size(); final int callbackSize = progressListener.callbackSize(size); int count = 0; // total count int step = 0; // step is offset in current chunk progressListener.t...
java
public void writeTo(final OutputStream out, final HttpProgressListener progressListener) throws IOException { // start final int size = size(); final int callbackSize = progressListener.callbackSize(size); int count = 0; // total count int step = 0; // step is offset in current chunk progressListener.t...
[ "public", "void", "writeTo", "(", "final", "OutputStream", "out", ",", "final", "HttpProgressListener", "progressListener", ")", "throws", "IOException", "{", "// start", "final", "int", "size", "=", "size", "(", ")", ";", "final", "int", "callbackSize", "=", ...
Writes content to the output stream, using progress listener to track the sending progress.
[ "Writes", "content", "to", "the", "output", "stream", "using", "progress", "listener", "to", "track", "the", "sending", "progress", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/Buffer.java#L183-L268
test
Write the contents of this list to the given output stream.
Of course, here is the Java code you requested: ```java public void writeTo(final OutputStream out, final HttpProgressListener progressListener) throws IOException { // start final int size = size(); final int callbackSize = progressListener.callbackSize(size); int count = 0; // total count int step = 0; ...
lessthanoptimal/GeoRegression
main/src/georegression/fitting/plane/FitPlane3D_F64.java
FitPlane3D_F64.svd
public boolean svd( List<Point3D_F64> points , Point3D_F64 outputCenter , Vector3D_F64 outputNormal ) { final int N = points.size(); // find the centroid outputCenter.set(0,0,0); for( int i = 0; i < N; i++ ) { Point3D_F64 p = points.get(i); outputCenter.x += p.x; outputCenter.y += p.y; outputCente...
java
public boolean svd( List<Point3D_F64> points , Point3D_F64 outputCenter , Vector3D_F64 outputNormal ) { final int N = points.size(); // find the centroid outputCenter.set(0,0,0); for( int i = 0; i < N; i++ ) { Point3D_F64 p = points.get(i); outputCenter.x += p.x; outputCenter.y += p.y; outputCente...
[ "public", "boolean", "svd", "(", "List", "<", "Point3D_F64", ">", "points", ",", "Point3D_F64", "outputCenter", ",", "Vector3D_F64", "outputNormal", ")", "{", "final", "int", "N", "=", "points", ".", "size", "(", ")", ";", "// find the centroid", "outputCenter...
SVD based method for fitting a plane to a set of points. The plane's equation is returned as a point on the plane and the normal vector. @param points (Input) Set of points on a plane. @param outputCenter (Output) Centroid of the passed in points. Modified. @param outputNormal (Output) Vector tangent to the plane. N...
[ "SVD", "based", "method", "for", "fitting", "a", "plane", "to", "a", "set", "of", "points", ".", "The", "plane", "s", "equation", "is", "returned", "as", "a", "point", "on", "the", "plane", "and", "the", "normal", "vector", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/fitting/plane/FitPlane3D_F64.java#L50-L68
test
Computes the SVD of the given list of points.
Of course, here is the Java code you requested: ```java public boolean svd( List<Point3D_F64> points , Point3D_F64 outputCenter , Vector3D_F64 outputNormal ) { final int N = points.size(); // find the centroid outputCenter.set(0,0,0); for( int i = 0; i < N; i++ ) { Point3D_F64 p = points.get(i); output...
orientechnologies/orientdb
graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java
OrientEdge.getClassName
public String getClassName(final String iLabel) { if (iLabel != null && (settings == null || settings.isUseClassForEdgeLabel())) // USE THE LABEL AS DOCUMENT CLASS return checkForClassInSchema(iLabel); return OrientEdgeType.CLASS_NAME; }
java
public String getClassName(final String iLabel) { if (iLabel != null && (settings == null || settings.isUseClassForEdgeLabel())) // USE THE LABEL AS DOCUMENT CLASS return checkForClassInSchema(iLabel); return OrientEdgeType.CLASS_NAME; }
[ "public", "String", "getClassName", "(", "final", "String", "iLabel", ")", "{", "if", "(", "iLabel", "!=", "null", "&&", "(", "settings", "==", "null", "||", "settings", ".", "isUseClassForEdgeLabel", "(", ")", ")", ")", "// USE THE LABEL AS DOCUMENT CLASS", "...
(Blueprints Extension) Returns the class name based on graph settings.
[ "(", "Blueprints", "Extension", ")", "Returns", "the", "class", "name", "based", "on", "graph", "settings", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java#L482-L488
test
Get the class name for the given label.
Of course, here is the Java code you requested: ```java public String getClassName(final String iLabel) { if (iLabel != null && (settings == null || settings.isUseClassForEdgeLabel())) // USE THE LABEL AS DOCUMENT CLASS return checkForClassInSchema(iLabel); return OrientEdgeType.CLASS_NAME; } ``...
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/indexing/classes/DifferentialIndex.java
DifferentialIndex.setIncrementalMode
public void setIncrementalMode(boolean incremental) { if (this.incrementalMode == incremental) // already set return; LOGGER_.trace("set incremental mode: " + incremental); this.incrementalMode = incremental; if (!incremental) { clearDeletedRules(); commitAddedRules(); initClassChanges(); init...
java
public void setIncrementalMode(boolean incremental) { if (this.incrementalMode == incremental) // already set return; LOGGER_.trace("set incremental mode: " + incremental); this.incrementalMode = incremental; if (!incremental) { clearDeletedRules(); commitAddedRules(); initClassChanges(); init...
[ "public", "void", "setIncrementalMode", "(", "boolean", "incremental", ")", "{", "if", "(", "this", ".", "incrementalMode", "==", "incremental", ")", "// already set", "return", ";", "LOGGER_", ".", "trace", "(", "\"set incremental mode: \"", "+", "incremental", "...
Sets the incremental mode for this {@code DifferentialIndex}. @param incremental if {@code true}, deletions and additions to this indexed are stored separately; if {@code false} all changes are immediately applied to the index.
[ "Sets", "the", "incremental", "mode", "for", "this", "{", "@code", "DifferentialIndex", "}", "." ]
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/indexing/classes/DifferentialIndex.java#L549-L561
test
Sets the incremental mode.
Of course, here is the Java code you requested: ```java public void setIncrementalMode(boolean incremental) { if (this.incrementalMode == incremental) // already set return; LOGGER_.trace("set incremental mode: " + incremental); this.incrementalMode = incremental; if (!incremental) { clearDeletedRules...
subchen/jetbrick-all-1x
jetbrick-orm/src/main/java/jetbrick/dao/jdbclog/JdbcLogConnection.java
JdbcLogConnection.getInstance
public static Connection getInstance(Connection conn) { InvocationHandler handler = new JdbcLogConnection(conn); ClassLoader cl = Connection.class.getClassLoader(); return (Connection) Proxy.newProxyInstance(cl, new Class[] { Connection.class }, handler); }
java
public static Connection getInstance(Connection conn) { InvocationHandler handler = new JdbcLogConnection(conn); ClassLoader cl = Connection.class.getClassLoader(); return (Connection) Proxy.newProxyInstance(cl, new Class[] { Connection.class }, handler); }
[ "public", "static", "Connection", "getInstance", "(", "Connection", "conn", ")", "{", "InvocationHandler", "handler", "=", "new", "JdbcLogConnection", "(", "conn", ")", ";", "ClassLoader", "cl", "=", "Connection", ".", "class", ".", "getClassLoader", "(", ")", ...
Creates a logging version of a connection @param conn - the original connection @return - the connection with logging
[ "Creates", "a", "logging", "version", "of", "a", "connection" ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-orm/src/main/java/jetbrick/dao/jdbclog/JdbcLogConnection.java#L36-L40
test
Get a Connection instance.
Of course, here is the Java code you requested: ```java public static Connection getInstance(Connection conn) { InvocationHandler handler = new JdbcLogConnection(conn); ClassLoader cl = Connection.class.getClassLoader(); return (Connection) Proxy.newProxyInstance(cl, new Class[] { Connection.cl...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/ProtectedFunctionMapper.java
ProtectedFunctionMapper.getInstance
public static ProtectedFunctionMapper getInstance() { ProtectedFunctionMapper funcMapper; if (SecurityUtil.isPackageProtectionEnabled()) { funcMapper = AccessController.doPrivileged( new PrivilegedAction<ProtectedFunctionMapper>() { public ProtectedFunctionMapper run() { return new ProtectedFunc...
java
public static ProtectedFunctionMapper getInstance() { ProtectedFunctionMapper funcMapper; if (SecurityUtil.isPackageProtectionEnabled()) { funcMapper = AccessController.doPrivileged( new PrivilegedAction<ProtectedFunctionMapper>() { public ProtectedFunctionMapper run() { return new ProtectedFunc...
[ "public", "static", "ProtectedFunctionMapper", "getInstance", "(", ")", "{", "ProtectedFunctionMapper", "funcMapper", ";", "if", "(", "SecurityUtil", ".", "isPackageProtectionEnabled", "(", ")", ")", "{", "funcMapper", "=", "AccessController", ".", "doPrivileged", "("...
Generated Servlet and Tag Handler implementations call this method to retrieve an instance of the ProtectedFunctionMapper. This is necessary since generated code does not have access to create instances of classes in this package. @return A new protected function mapper.
[ "Generated", "Servlet", "and", "Tag", "Handler", "implementations", "call", "this", "method", "to", "retrieve", "an", "instance", "of", "the", "ProtectedFunctionMapper", ".", "This", "is", "necessary", "since", "generated", "code", "does", "not", "have", "access",...
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/ProtectedFunctionMapper.java#L103-L117
test
Get a new instance of the class.
Of course, here is the Java code you requested: ```java public static ProtectedFunctionMapper getInstance() { ProtectedFunctionMapper funcMapper; if (SecurityUtil.isPackageProtectionEnabled()) { funcMapper = AccessController.doPrivileged( new PrivilegedAction<ProtectedFunctionMapper>() { public Prote...
xmlet/XsdParser
src/main/java/org/xmlet/xsdparser/xsdelements/elementswrapper/ReferenceBase.java
ReferenceBase.createFromXsd
public static ReferenceBase createFromXsd(XsdAbstractElement element) { String ref = getRef(element); String name = getName(element); if (!(element instanceof XsdNamedElements)){ return new ConcreteElement(element); } if (ref == null){ if (name == null){...
java
public static ReferenceBase createFromXsd(XsdAbstractElement element) { String ref = getRef(element); String name = getName(element); if (!(element instanceof XsdNamedElements)){ return new ConcreteElement(element); } if (ref == null){ if (name == null){...
[ "public", "static", "ReferenceBase", "createFromXsd", "(", "XsdAbstractElement", "element", ")", "{", "String", "ref", "=", "getRef", "(", "element", ")", ";", "String", "name", "=", "getName", "(", "element", ")", ";", "if", "(", "!", "(", "element", "ins...
This method creates a ReferenceBase object that serves as a wrapper to {@link XsdAbstractElement} objects. If a {@link XsdAbstractElement} has a ref attribute it results in a {@link UnsolvedReference} object. If it doesn't have a ref attribute and has a name attribute it's a {@link NamedConcreteElement}. If it isn't a ...
[ "This", "method", "creates", "a", "ReferenceBase", "object", "that", "serves", "as", "a", "wrapper", "to", "{" ]
0044681d77400e1568d1e7b1024a38ec76caa2cb
https://github.com/xmlet/XsdParser/blob/0044681d77400e1568d1e7b1024a38ec76caa2cb/src/main/java/org/xmlet/xsdparser/xsdelements/elementswrapper/ReferenceBase.java#L33-L50
test
Create a ReferenceBase from a XsdAbstractElement.
Of course, here is the Java code you requested: ```java public static ReferenceBase createFromXsd(XsdAbstractElement element) { String ref = getRef(element); String name = getName(element); if (!(element instanceof XsdNamedElements)){ return new ConcreteElement(element); } ...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/AES256Local.java
AES256Local.encrypt
public static byte[] encrypt(byte[] keyParam, byte[] dataToEncryptParam, byte[] ivParam) { if (dataToEncryptParam == null) { throw new FluidClientException("No data to encrypt provided. ", FluidClientException.ErrorCode.AES_256); } Key key = new SecretKeySpec(key...
java
public static byte[] encrypt(byte[] keyParam, byte[] dataToEncryptParam, byte[] ivParam) { if (dataToEncryptParam == null) { throw new FluidClientException("No data to encrypt provided. ", FluidClientException.ErrorCode.AES_256); } Key key = new SecretKeySpec(key...
[ "public", "static", "byte", "[", "]", "encrypt", "(", "byte", "[", "]", "keyParam", ",", "byte", "[", "]", "dataToEncryptParam", ",", "byte", "[", "]", "ivParam", ")", "{", "if", "(", "dataToEncryptParam", "==", "null", ")", "{", "throw", "new", "Fluid...
Encrypts the {@code dataToEncryptParam} data using key {@code keyParam}. @param keyParam Key to encrypt with. @param dataToEncryptParam Data to encrypt. @param ivParam - 16 bytes for AES-256. @return Cipher text.
[ "Encrypts", "the", "{", "@code", "dataToEncryptParam", "}", "data", "using", "key", "{", "@code", "keyParam", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/user/AES256Local.java#L239-L274
test
Encrypts the data using the key and IV parameters.
Of course, here is the Java code you requested: ```java public static byte[] encrypt(byte[] keyParam, byte[] dataToEncryptParam, byte[] ivParam) { if (dataToEncryptParam == null) { throw new FluidClientException("No data to encrypt provided. ", FluidClientException.ErrorCode.AES...
kiegroup/droolsjbpm-tools
drools-eclipse/org.jbpm.eclipse/src/main/java/org/jbpm/eclipse/wizard/project/NewJBPMProjectWizard.java
NewJBPMProjectWizard.createOnlineExampleProjectPage
@Override protected IKieProjectWizardPage createOnlineExampleProjectPage(String pageId) { return new AbstractKieOnlineExampleProjectWizardPage(ONLINE_EXAMPLE_PROJECT_PAGE) { @Override public String getTitle() { return "Create jBPM Projects from Online Examples"; } @Override public String getDe...
java
@Override protected IKieProjectWizardPage createOnlineExampleProjectPage(String pageId) { return new AbstractKieOnlineExampleProjectWizardPage(ONLINE_EXAMPLE_PROJECT_PAGE) { @Override public String getTitle() { return "Create jBPM Projects from Online Examples"; } @Override public String getDe...
[ "@", "Override", "protected", "IKieProjectWizardPage", "createOnlineExampleProjectPage", "(", "String", "pageId", ")", "{", "return", "new", "AbstractKieOnlineExampleProjectWizardPage", "(", "ONLINE_EXAMPLE_PROJECT_PAGE", ")", "{", "@", "Override", "public", "String", "getT...
/* (non-Javadoc) @see org.kie.eclipse.wizard.project.AbstractKieProjectWizard#createOnlineExampleProjectPage(java.lang.String) Create the Online Example Project Wizard Page
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.jbpm.eclipse/src/main/java/org/jbpm/eclipse/wizard/project/NewJBPMProjectWizard.java#L320-L343
test
Create an online example project page.
Of course, here is the Java code you requested: ```java @Override protected IKieProjectWizardPage createOnlineExampleProjectPage(String pageId) { return new AbstractKieOnlineExampleProjectWizardPage(ONLINE_EXAMPLE_PROJECT_PAGE) { @Override public String getTitle() { return "Create jBPM Projects from Onlin...