repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
NextFaze/power-adapters
power-adapters/src/main/java/com/nextfaze/poweradapters/binding/MapperBuilder.java
MapperBuilder.bind
@NonNull public <E extends T> MapperBuilder<T> bind(@NonNull Class<E> itemClass, @NonNull Binder<? super E, ?> binder) { //noinspection unchecked return bind(itemClass, 0, binder, ALWAYS); }
java
@NonNull public <E extends T> MapperBuilder<T> bind(@NonNull Class<E> itemClass, @NonNull Binder<? super E, ?> binder) { //noinspection unchecked return bind(itemClass, 0, binder, ALWAYS); }
[ "@", "NonNull", "public", "<", "E", "extends", "T", ">", "MapperBuilder", "<", "T", ">", "bind", "(", "@", "NonNull", "Class", "<", "E", ">", "itemClass", ",", "@", "NonNull", "Binder", "<", "?", "super", "E", ",", "?", ">", "binder", ")", "{", "...
Map an item type to the specified binder. @param itemClass The type of item accepted by the specified binder. @param binder The binder to be used to bind the specified item type. @return This builder, to allow chaining.
[ "Map", "an", "item", "type", "to", "the", "specified", "binder", "." ]
cdf00b1b723ed9d6bcd549ae9741a19dd59651e1
https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters/src/main/java/com/nextfaze/poweradapters/binding/MapperBuilder.java#L112-L117
train
Binds the given item class to the given binder.
Of course, here is the Java code you requested: ```java @NonNull public <E extends T> MapperBuilder<T> bind(@NonNull Class<E> itemClass, @NonNull Binder<? super E, ?> binder) { //noinspection unchecked return bind(itemClass, 0, binder, ALWAYS); } `...
agentsoz/jill
jill/src/main/java/io/github/agentsoz/jill/core/ProgramLoader.java
ProgramLoader.processPlansForGoal
private static boolean processPlansForGoal(GoalType gtype, String[] plans) { for (int j = 0; j < plans.length; j++) { // Load the Plan class Class<?> pclass = loadClass(plans[j], Plan.class); if (pclass == null) { return false; } // Found the plan class, so add this plan to the...
java
private static boolean processPlansForGoal(GoalType gtype, String[] plans) { for (int j = 0; j < plans.length; j++) { // Load the Plan class Class<?> pclass = loadClass(plans[j], Plan.class); if (pclass == null) { return false; } // Found the plan class, so add this plan to the...
[ "private", "static", "boolean", "processPlansForGoal", "(", "GoalType", "gtype", ",", "String", "[", "]", "plans", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "plans", ".", "length", ";", "j", "++", ")", "{", "// Load the Plan class", "C...
Loads the given plan classes and sets up parent-child links with the given goal type. @param gtype the goal for which the list of plans is provided @param plans list of plans to be loaded @return true if successful, false otherwise
[ "Loads", "the", "given", "plan", "classes", "and", "sets", "up", "parent", "-", "child", "links", "with", "the", "given", "goal", "type", "." ]
13126fc78350465b477386132465f84cad719426
https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/core/ProgramLoader.java#L139-L156
test
Process the plans for a Goal.
Of course, here is the Java code you requested: ```java private static boolean processPlansForGoal(GoalType gtype, String[] plans) { for (int j = 0; j < plans.length; j++) { // Load the Plan class Class<?> pclass = loadClass(plans[j], Plan.class); if (pclass == null) { return false; ...
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java
DiagnosticsInner.getSiteAnalysisSlotAsync
public ServiceFuture<DiagnosticAnalysisInner> getSiteAnalysisSlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot, final ServiceCallback<DiagnosticAnalysisInner> serviceCallback) { return ServiceFuture.fromResponse(getSiteAnalysisSlotWithServiceRespons...
java
public ServiceFuture<DiagnosticAnalysisInner> getSiteAnalysisSlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot, final ServiceCallback<DiagnosticAnalysisInner> serviceCallback) { return ServiceFuture.fromResponse(getSiteAnalysisSlotWithServiceRespons...
[ "public", "ServiceFuture", "<", "DiagnosticAnalysisInner", ">", "getSiteAnalysisSlotAsync", "(", "String", "resourceGroupName", ",", "String", "siteName", ",", "String", "diagnosticCategory", ",", "String", "analysisName", ",", "String", "slot", ",", "final", "ServiceCa...
Get Site Analysis. Get Site Analysis. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param diagnosticCategory Diagnostic Category @param analysisName Analysis Name @param slot Slot - optional @param serviceCallback the async ServiceCallback to handle succe...
[ "Get", "Site", "Analysis", ".", "Get", "Site", "Analysis", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1752-L1754
train
Get a slot in the specified slot.
Of course, here is the Java code you requested: ```java public ServiceFuture<DiagnosticAnalysisInner> getSiteAnalysisSlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot, final ServiceCallback<DiagnosticAnalysisInner> serviceCallback) { return Service...
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java
Mathlib.touches
public static boolean touches(Geometry geometry, Coordinate coordinate) { if (geometry instanceof MultiPolygon) { for (int i = 0; i < geometry.getNumGeometries(); i++) { if (touches(geometry.getGeometryN(i), coordinate)) { return true; } } return false; } else if (geometry instanceof Polygon) ...
java
public static boolean touches(Geometry geometry, Coordinate coordinate) { if (geometry instanceof MultiPolygon) { for (int i = 0; i < geometry.getNumGeometries(); i++) { if (touches(geometry.getGeometryN(i), coordinate)) { return true; } } return false; } else if (geometry instanceof Polygon) ...
[ "public", "static", "boolean", "touches", "(", "Geometry", "geometry", ",", "Coordinate", "coordinate", ")", "{", "if", "(", "geometry", "instanceof", "MultiPolygon", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "geometry", ".", "getNumGeomet...
Does a certain coordinate touch a given geometry? @param geometry The geometry to check against. @param coordinate The position to check. @return Returns true if the coordinate touches the geometry.
[ "Does", "a", "certain", "coordinate", "touch", "a", "given", "geometry?" ]
1c1adc48deb192ed825265eebcc74d70bbf45670
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java#L127-L162
train
Checks if the geometry touches the coordinate
Of course, here is the Java code you requested: ```java public static boolean touches(Geometry geometry, Coordinate coordinate) { if (geometry instanceof MultiPolygon) { for (int i = 0; i < geometry.getNumGeometries(); i++) { if (touches(geometry.getGeometryN(i), coordinate)) { return true; } } ...
maochen/NLP
CoreNLP-NLP/src/main/java/org/maochen/nlp/ml/classifier/maxent/OnePassRealValueDataIndexer.java
OnePassRealValueDataIndexer.toIndexedStringArray
protected static String[] toIndexedStringArray(Map<String, Integer> labelToIndexMap) { final String[] array = new String[labelToIndexMap.size()]; for (String label : labelToIndexMap.keySet()) { array[labelToIndexMap.get(label)] = label; } return array; }
java
protected static String[] toIndexedStringArray(Map<String, Integer> labelToIndexMap) { final String[] array = new String[labelToIndexMap.size()]; for (String label : labelToIndexMap.keySet()) { array[labelToIndexMap.get(label)] = label; } return array; }
[ "protected", "static", "String", "[", "]", "toIndexedStringArray", "(", "Map", "<", "String", ",", "Integer", ">", "labelToIndexMap", ")", "{", "final", "String", "[", "]", "array", "=", "new", "String", "[", "labelToIndexMap", ".", "size", "(", ")", "]", ...
Utility method for creating a String[] array from a map whose keys are labels (Strings) to be stored in the array and whose values are the indices (Integers) at which the corresponding labels should be inserted. @param labelToIndexMap a <code>TObjectIntHashMap</code> value @return a <code>String[]</code> value @since ...
[ "Utility", "method", "for", "creating", "a", "String", "[]", "array", "from", "a", "map", "whose", "keys", "are", "labels", "(", "Strings", ")", "to", "be", "stored", "in", "the", "array", "and", "whose", "values", "are", "the", "indices", "(", "Integers...
38ae7b384d5295334d9efa9dc4cd901b19d9c27e
https://github.com/maochen/NLP/blob/38ae7b384d5295334d9efa9dc4cd901b19d9c27e/CoreNLP-NLP/src/main/java/org/maochen/nlp/ml/classifier/maxent/OnePassRealValueDataIndexer.java#L204-L210
train
To indexed string array.
Of course, here is the Java code you requested: ```java protected static String[] toIndexedStringArray(Map<String, Integer> labelToIndexMap) { final String[] array = new String[labelToIndexMap.size()]; for (String label : labelToIndexMap.keySet()) { array[labelToIndexMap.get(label)] = label...
zaproxy/zaproxy
src/org/zaproxy/zap/spider/Spider.java
Spider.init
private void init() { this.paused = false; this.stopped = true; this.tasksDoneCount = 0; this.tasksTotalCount = 0; this.initialized = false; // Add a default fetch filter and any custom ones defaultFetchFilter = new DefaultFetchFilter(); this.addFetchFilter(defaultFetchFilter); for (FetchFilter fi...
java
private void init() { this.paused = false; this.stopped = true; this.tasksDoneCount = 0; this.tasksTotalCount = 0; this.initialized = false; // Add a default fetch filter and any custom ones defaultFetchFilter = new DefaultFetchFilter(); this.addFetchFilter(defaultFetchFilter); for (FetchFilter fi...
[ "private", "void", "init", "(", ")", "{", "this", ".", "paused", "=", "false", ";", "this", ".", "stopped", "=", "true", ";", "this", ".", "tasksDoneCount", "=", "0", ";", "this", ".", "tasksTotalCount", "=", "0", ";", "this", ".", "initialized", "="...
Initialize the spider.
[ "Initialize", "the", "spider", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/Spider.java#L183-L207
train
Initializes the internal state of the object.
Of course, here is the Java code you requested: ```java private void init() { this.paused = false; this.stopped = true; this.tasksDoneCount = 0; this.tasksTotalCount = 0; this.initialized = false; // Add a default fetch filter and any custom ones defaultFetchFilter = new DefaultFetchFilter(); this.add...
apache/incubator-druid
core/src/main/java/org/apache/druid/java/util/common/io/smoosh/FileSmoosher.java
FileSmoosher.delegateSmooshedWriter
private SmooshedWriter delegateSmooshedWriter(final String name, final long size) throws IOException { final File tmpFile = new File(baseDir, name); filesInProcess.add(tmpFile); return new SmooshedWriter() { private final GatheringByteChannel channel = FileChannel.open( ...
java
private SmooshedWriter delegateSmooshedWriter(final String name, final long size) throws IOException { final File tmpFile = new File(baseDir, name); filesInProcess.add(tmpFile); return new SmooshedWriter() { private final GatheringByteChannel channel = FileChannel.open( ...
[ "private", "SmooshedWriter", "delegateSmooshedWriter", "(", "final", "String", "name", ",", "final", "long", "size", ")", "throws", "IOException", "{", "final", "File", "tmpFile", "=", "new", "File", "(", "baseDir", ",", "name", ")", ";", "filesInProcess", "."...
Returns a new SmooshedWriter which writes into temporary file and close method on returned SmooshedWriter tries to merge temporary file into original FileSmoosher object(if not open). @param name fileName @param size size of the file. @return @throws IOException
[ "Returns", "a", "new", "SmooshedWriter", "which", "writes", "into", "temporary", "file", "and", "close", "method", "on", "returned", "SmooshedWriter", "tries", "to", "merge", "temporary", "file", "into", "original", "FileSmoosher", "object", "(", "if", "not", "o...
f776b9408962b9006cfcfe4d6c1794751972cc8e
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/io/smoosh/FileSmoosher.java#L273-L343
train
delegateSmooshedWriter
Of course, here is the Java code you requested: ```java private SmooshedWriter delegateSmooshedWriter(final String name, final long size) throws IOException { final File tmpFile = new File(baseDir, name); filesInProcess.add(tmpFile); return new SmooshedWriter() { private final GatheringByteCha...
aws/aws-sdk-java
aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/AudioSelector.java
AudioSelector.setPids
public void setPids(java.util.Collection<Integer> pids) { if (pids == null) { this.pids = null; return; } this.pids = new java.util.ArrayList<Integer>(pids); }
java
public void setPids(java.util.Collection<Integer> pids) { if (pids == null) { this.pids = null; return; } this.pids = new java.util.ArrayList<Integer>(pids); }
[ "public", "void", "setPids", "(", "java", ".", "util", ".", "Collection", "<", "Integer", ">", "pids", ")", "{", "if", "(", "pids", "==", "null", ")", "{", "this", ".", "pids", "=", "null", ";", "return", ";", "}", "this", ".", "pids", "=", "new"...
Selects a specific PID from within an audio source (e.g. 257 selects PID 0x101). @param pids Selects a specific PID from within an audio source (e.g. 257 selects PID 0x101).
[ "Selects", "a", "specific", "PID", "from", "within", "an", "audio", "source", "(", "e", ".", "g", ".", "257", "selects", "PID", "0x101", ")", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/AudioSelector.java#L310-L317
train
Sets the value pids property.
Of course, here is the Java code you requested: ```java public void setPids(java.util.Collection<Integer> pids) { if (pids == null) { this.pids = null; return; } this.pids = new java.util.ArrayList<Integer>(pids); } ``` Hope this helps!
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultCumulatives.java
DefaultCumulatives.addDim
@Override public void addDim(List<IntVar> c, int[] cUse, IntVar[] dUse) { capacities.add(c); cUsages.add(cUse); dUsages.add(dUse); }
java
@Override public void addDim(List<IntVar> c, int[] cUse, IntVar[] dUse) { capacities.add(c); cUsages.add(cUse); dUsages.add(dUse); }
[ "@", "Override", "public", "void", "addDim", "(", "List", "<", "IntVar", ">", "c", ",", "int", "[", "]", "cUse", ",", "IntVar", "[", "]", "dUse", ")", "{", "capacities", ".", "add", "(", "c", ")", ";", "cUsages", ".", "add", "(", "cUse", ")", "...
Add a dimension. @param c the resource capacity of each of the nodes @param cUse the resource usage of each of the cSlices @param dUse the resource usage of each of the dSlices
[ "Add", "a", "dimension", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultCumulatives.java#L62-L67
train
Add a single domain to the list of domain objects.
Of course, here is the Java code you requested: ```java @Override public void addDim(List<IntVar> c, int[] cUse, IntVar[] dUse) { capacities.add(c); cUsages.add(cUse); dUsages.add(dUse); } ``` Hope this helps!
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/annotations/Annotation.java
Annotation.getClassAccessors
public static JMapAccessor getClassAccessors(Class<?> clazz, String fieldName, boolean isOpposite){ return getAccessor(clazz, clazz.getAnnotations(),fieldName,isOpposite); }
java
public static JMapAccessor getClassAccessors(Class<?> clazz, String fieldName, boolean isOpposite){ return getAccessor(clazz, clazz.getAnnotations(),fieldName,isOpposite); }
[ "public", "static", "JMapAccessor", "getClassAccessors", "(", "Class", "<", "?", ">", "clazz", ",", "String", "fieldName", ",", "boolean", "isOpposite", ")", "{", "return", "getAccessor", "(", "clazz", ",", "clazz", ".", "getAnnotations", "(", ")", ",", "fie...
Checks if this field contains a definition of accessors for the name given as input. @param clazz class to check @param fieldName name to find @param isOpposite true if accessor methods to check belong to the opposite field, false otherwise @return JMapAccessor if exists, null otherwise
[ "Checks", "if", "this", "field", "contains", "a", "definition", "of", "accessors", "for", "the", "name", "given", "as", "input", "." ]
b48fd3527f35055b8b4a30f53a51136f183acc90
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/annotations/Annotation.java#L131-L133
train
Gets the accessors for the given field.
Of course, here is the Java code you requested: ```java public static JMapAccessor getClassAccessors(Class<?> clazz, String fieldName, boolean isOpposite){ return getAccessor(clazz, clazz.getAnnotations(),fieldName,isOpposite); } ``` Hope this helps!
theHilikus/JRoboCom
jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/robot/RobotStatusProxy.java
RobotStatusProxy.getInstructionSet
@Override public InstructionSet getInstructionSet() { int penalty = Timing.getInstance().LOCAL_READ; log.trace("[getInstructionSet] Waiting {} cycles", penalty); turnsControl.waitTurns(penalty, "Get Instruction set"); return this.robot.getData().getInstructionSet(); }
java
@Override public InstructionSet getInstructionSet() { int penalty = Timing.getInstance().LOCAL_READ; log.trace("[getInstructionSet] Waiting {} cycles", penalty); turnsControl.waitTurns(penalty, "Get Instruction set"); return this.robot.getData().getInstructionSet(); }
[ "@", "Override", "public", "InstructionSet", "getInstructionSet", "(", ")", "{", "int", "penalty", "=", "Timing", ".", "getInstance", "(", ")", ".", "LOCAL_READ", ";", "log", ".", "trace", "(", "\"[getInstructionSet] Waiting {} cycles\"", ",", "penalty", ")", ";...
/* (non-Javadoc) @see com.github.thehilikus.jrobocom.RobotInfo#getInstructionSet()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0e31c1ecf1006e35f68c229ff66c37640effffac
https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/robot/RobotStatusProxy.java#L122-L128
train
Get the InstructionSet.
Of course, here is the Java code you requested: ```java @Override public InstructionSet getInstructionSet() { int penalty = Timing.getInstance().LOCAL_READ; log.trace("[getInstructionSet] Waiting {} cycles", penalty); turnsControl.waitTurns(penalty, "Get Instruction set"); return this.robot.getData().getInstru...
markhobson/hamcrest-compose
main/src/main/java/org/hobsoft/hamcrest/compose/ComposeMatchers.java
ComposeMatchers.compose
@SafeVarargs public static <T> ConjunctionMatcher<T> compose(Matcher<? super T>... matchers) { return compose(null, matchers); }
java
@SafeVarargs public static <T> ConjunctionMatcher<T> compose(Matcher<? super T>... matchers) { return compose(null, matchers); }
[ "@", "SafeVarargs", "public", "static", "<", "T", ">", "ConjunctionMatcher", "<", "T", ">", "compose", "(", "Matcher", "<", "?", "super", "T", ">", "...", "matchers", ")", "{", "return", "compose", "(", "null", ",", "matchers", ")", ";", "}" ]
Returns a matcher that logically ANDs the specified matchers with any number of further matchers. <p> For example: <pre> assertThat("ham", compose(startsWith("h")).and(containsString("a")).and(endsWith("m"))); </pre> See {@code ConjunctionMatcher} as to how this matcher differs from {@code allOf} and {@code both}. @pa...
[ "Returns", "a", "matcher", "that", "logically", "ANDs", "the", "specified", "matchers", "with", "any", "number", "of", "further", "matchers", ".", "<p", ">", "For", "example", ":", "<pre", ">", "assertThat", "(", "ham", "compose", "(", "startsWith", "(", "...
83ca6a6bdee08340a73cb39c3d7a30ca9d37bce5
https://github.com/markhobson/hamcrest-compose/blob/83ca6a6bdee08340a73cb39c3d7a30ca9d37bce5/main/src/main/java/org/hobsoft/hamcrest/compose/ComposeMatchers.java#L59-L63
train
Compose the given matchers into a conjunction matcher.
Of course, here is the Java code you requested: ```java @SafeVarargs public static <T> ConjunctionMatcher<T> compose(Matcher<? super T>... matchers) { return compose(null, matchers); } ``` Hope this helps!
palatable/lambda
src/main/java/com/jnape/palatable/lambda/adt/hlist/HList.java
HList.tuple
@SuppressWarnings("JavaDoc") public static <_1, _2> Tuple2<_1, _2> tuple(_1 _1, _2 _2) { return singletonHList(_2).cons(_1); }
java
@SuppressWarnings("JavaDoc") public static <_1, _2> Tuple2<_1, _2> tuple(_1 _1, _2 _2) { return singletonHList(_2).cons(_1); }
[ "@", "SuppressWarnings", "(", "\"JavaDoc\"", ")", "public", "static", "<", "_1", ",", "_2", ">", "Tuple2", "<", "_1", ",", "_2", ">", "tuple", "(", "_1", "_1", ",", "_2", "_2", ")", "{", "return", "singletonHList", "(", "_2", ")", ".", "cons", "(",...
Static factory method for creating a 2-element HList. @param _1 the head element @param _2 the second element @param <_1> the head element type @param <_2> the second element type @return the 2-element HList @see Tuple2
[ "Static", "factory", "method", "for", "creating", "a", "2", "-", "element", "HList", "." ]
b643ba836c5916d1d8193822e5efb4e7b40c489a
https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/hlist/HList.java#L90-L93
train
Returns a tuple of two types of resources.
Of course, here is the Java code you requested: ```java @SuppressWarnings("JavaDoc") public static <_1, _2> Tuple2<_1, _2> tuple(_1 _1, _2 _2) { return singletonHList(_2).cons(_1); } ``` Hope this helps!
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java
StringUtils.cleanPath
public static String cleanPath(final String path) { if (!StringUtils.hasLength(path)) { return path; } String pathToUse = StringUtils.replace(path, StringUtils.WINDOWS_FOLDER_SEPARATOR, StringUtils.FOLDER_SEPARATOR); // Strip prefix from path to analyze, to not treat it as part of the ...
java
public static String cleanPath(final String path) { if (!StringUtils.hasLength(path)) { return path; } String pathToUse = StringUtils.replace(path, StringUtils.WINDOWS_FOLDER_SEPARATOR, StringUtils.FOLDER_SEPARATOR); // Strip prefix from path to analyze, to not treat it as part of the ...
[ "public", "static", "String", "cleanPath", "(", "final", "String", "path", ")", "{", "if", "(", "!", "StringUtils", ".", "hasLength", "(", "path", ")", ")", "{", "return", "path", ";", "}", "String", "pathToUse", "=", "StringUtils", ".", "replace", "(", ...
Normalize the path by suppressing sequences like "path/.." and inner simple dots. <p> The result is convenient for path comparison. For other uses, notice that Windows separators ("\") are replaced by simple slashes. @param path the original path @return the normalized path
[ "Normalize", "the", "path", "by", "suppressing", "sequences", "like", "path", "/", "..", "and", "inner", "simple", "dots", ".", "<p", ">", "The", "result", "is", "convenient", "for", "path", "comparison", ".", "For", "other", "uses", "notice", "that", "Win...
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java#L671-L727
train
Clean the path.
Of course, here is the Java code you requested: ```java public static String cleanPath(final String path) { if (!StringUtils.hasLength(path)) { return path; } String pathToUse = StringUtils.replace(path, StringUtils.WINDOWS_FOLDER_SEPARATOR, StringUtils.FOLDER_SEPARATOR); // Strip prefix...
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/acceptors/BehaviorUnitGuardRemoveModification.java
BehaviorUnitGuardRemoveModification.accept
public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResolutionAcceptor acceptor) { final BehaviorUnitGuardRemoveModification modification = new BehaviorUnitGuardRemoveModification(); modification.setIssue(issue); modification.setTools(provider); acceptor.accept(issue, Messages.SARLQui...
java
public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResolutionAcceptor acceptor) { final BehaviorUnitGuardRemoveModification modification = new BehaviorUnitGuardRemoveModification(); modification.setIssue(issue); modification.setTools(provider); acceptor.accept(issue, Messages.SARLQui...
[ "public", "static", "void", "accept", "(", "SARLQuickfixProvider", "provider", ",", "Issue", "issue", ",", "IssueResolutionAcceptor", "acceptor", ")", "{", "final", "BehaviorUnitGuardRemoveModification", "modification", "=", "new", "BehaviorUnitGuardRemoveModification", "("...
Create the quick fix if needed. @param provider the quick fix provider. @param issue the issue to fix. @param acceptor the quick fix acceptor.
[ "Create", "the", "quick", "fix", "if", "needed", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/acceptors/BehaviorUnitGuardRemoveModification.java#L50-L60
train
Accept the given issue with a specific tool.
Of course, here is the Java code you requested: ```java public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResolutionAcceptor acceptor) { final BehaviorUnitGuardRemoveModification modification = new BehaviorUnitGuardRemoveModification(); modification.setIssue(issue); modification.setTools...
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.setify
public static <K, V> Set<Map<K, V>> setify(ObjectMapper mapper, Object source, Class<K> targetKeyType, Class<V> targetValueType) { return (Set<Map<K, V>>) collectify(mapper, source, Set.class, targetKeyType, targetValueType); }
java
public static <K, V> Set<Map<K, V>> setify(ObjectMapper mapper, Object source, Class<K> targetKeyType, Class<V> targetValueType) { return (Set<Map<K, V>>) collectify(mapper, source, Set.class, targetKeyType, targetValueType); }
[ "public", "static", "<", "K", ",", "V", ">", "Set", "<", "Map", "<", "K", ",", "V", ">", ">", "setify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ",", "Class", "<", "K", ">", "targetKeyType", ",", "Class", "<", "V", ">", "targetValueT...
Convert an object to a collection of maps. @param mapper the object mapper @param source the source object @param targetKeyType the target map key type @param targetValueType the target map value type @return collection
[ "Convert", "an", "object", "to", "a", "collection", "of", "maps", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L230-L232
train
Collect a Set of Maps from the source object to a Set of Maps.
Of course, here is the Java code you requested: ```java public static <K, V> Set<Map<K, V>> setify(ObjectMapper mapper, Object source, Class<K> targetKeyType, Class<V> targetValueType) { return (Set<Map<K, V>>) collectify(mapper, source, Set.class, targetKeyType, targetValueType); } ``` Hope this helps!
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java
ArffParser.parseAttributeStatements
private void parseAttributeStatements(BufferedReader br, ArrayList<String> names, ArrayList<String> types) throws IOException { String line; // Load attribute metadata while(true) { line = br.readLine(); if(line == null) { throw new AbortException(ARFF_HEADER_DATA + " not found in file."...
java
private void parseAttributeStatements(BufferedReader br, ArrayList<String> names, ArrayList<String> types) throws IOException { String line; // Load attribute metadata while(true) { line = br.readLine(); if(line == null) { throw new AbortException(ARFF_HEADER_DATA + " not found in file."...
[ "private", "void", "parseAttributeStatements", "(", "BufferedReader", "br", ",", "ArrayList", "<", "String", ">", "names", ",", "ArrayList", "<", "String", ">", "types", ")", "throws", "IOException", "{", "String", "line", ";", "// Load attribute metadata", "while...
Parse the "@attribute" section of the ARFF file. @param br Input @param names List (to fill) of attribute names @param types List (to fill) of attribute types @throws IOException
[ "Parse", "the", "@attribute", "section", "of", "the", "ARFF", "file", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java#L492-L527
train
Parses the attribute statements.
Of course, here is the Java code you requested: ```java private void parseAttributeStatements(BufferedReader br, ArrayList<String> names, ArrayList<String> types) throws IOException { String line; // Load attribute metadata while(true) { line = br.readLine(); if(line == null) { throw ne...
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/io/ExtendedBufferedReader.java
ExtendedBufferedReader.skipUntil
public long skipUntil(char c) throws IllegalArgumentException, IOException { if (lookaheadChar == UNDEFINED) { lookaheadChar = super.read(); } long counter = 0; while (lookaheadChar != c && lookaheadChar != END_OF_STREAM) { if (lookaheadChar == '\n') { ...
java
public long skipUntil(char c) throws IllegalArgumentException, IOException { if (lookaheadChar == UNDEFINED) { lookaheadChar = super.read(); } long counter = 0; while (lookaheadChar != c && lookaheadChar != END_OF_STREAM) { if (lookaheadChar == '\n') { ...
[ "public", "long", "skipUntil", "(", "char", "c", ")", "throws", "IllegalArgumentException", ",", "IOException", "{", "if", "(", "lookaheadChar", "==", "UNDEFINED", ")", "{", "lookaheadChar", "=", "super", ".", "read", "(", ")", ";", "}", "long", "counter", ...
Skips all chars in the input until (but excluding) the given char @param c @return @throws IllegalArgumentException @throws IOException
[ "Skips", "all", "chars", "in", "the", "input", "until", "(", "but", "excluding", ")", "the", "given", "char" ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/ExtendedBufferedReader.java#L266-L279
train
Skip until the specified character is reached.
Of course, here is the Java code you requested: ```java public long skipUntil(char c) throws IllegalArgumentException, IOException { if (lookaheadChar == UNDEFINED) { lookaheadChar = super.read(); } long counter = 0; while (lookaheadChar != c && lookaheadChar != END_OF_STREA...
aws/aws-sdk-java
aws-java-sdk-iot1clickdevices/src/main/java/com/amazonaws/services/iot1clickdevices/AWSIoT1ClickDevicesClient.java
AWSIoT1ClickDevicesClient.unclaimDevice
@Override public UnclaimDeviceResult unclaimDevice(UnclaimDeviceRequest request) { request = beforeClientExecution(request); return executeUnclaimDevice(request); }
java
@Override public UnclaimDeviceResult unclaimDevice(UnclaimDeviceRequest request) { request = beforeClientExecution(request); return executeUnclaimDevice(request); }
[ "@", "Override", "public", "UnclaimDeviceResult", "unclaimDevice", "(", "UnclaimDeviceRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeUnclaimDevice", "(", "request", ")", ";", "}" ]
<p> Disassociates a device from your AWS account using its device ID. </p> @param unclaimDeviceRequest @return Result of the UnclaimDevice operation returned by the service. @throws ResourceNotFoundException 404 response @throws InvalidRequestException 400 response @throws InternalFailureException 500 response @sample...
[ "<p", ">", "Disassociates", "a", "device", "from", "your", "AWS", "account", "using", "its", "device", "ID", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot1clickdevices/src/main/java/com/amazonaws/services/iot1clickdevices/AWSIoT1ClickDevicesClient.java#L779-L783
train
Unclaims a CID .
Of course, here is the Java code you requested: ```java @Override public UnclaimDeviceResult unclaimDevice(UnclaimDeviceRequest request) { request = beforeClientExecution(request); return executeUnclaimDevice(request); } ``` Hope this helps!
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/CertificateOperations.java
CertificateOperations.getCertificate
public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint) throws BatchErrorException, IOException { return getCertificate(thumbprintAlgorithm, thumbprint, null, null); }
java
public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint) throws BatchErrorException, IOException { return getCertificate(thumbprintAlgorithm, thumbprint, null, null); }
[ "public", "Certificate", "getCertificate", "(", "String", "thumbprintAlgorithm", ",", "String", "thumbprint", ")", "throws", "BatchErrorException", ",", "IOException", "{", "return", "getCertificate", "(", "thumbprintAlgorithm", ",", "thumbprint", ",", "null", ",", "n...
Gets the specified {@link Certificate}. @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1. @param thumbprint The thumbprint of the certificate to get. @return A {@link Certificate} containing information about the specified certificate in the Azure Batch account. @thro...
[ "Gets", "the", "specified", "{", "@link", "Certificate", "}", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/CertificateOperations.java#L244-L246
train
Get the certificate from the server.
Of course, here is the Java code you requested: ```java public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint) throws BatchErrorException, IOException { return getCertificate(thumbprintAlgorithm, thumbprint, null, null); } ``` Hope this helps!
google/guava
android/guava/src/com/google/common/collect/ForwardingNavigableMap.java
ForwardingNavigableMap.standardLastKey
protected K standardLastKey() { Entry<K, V> entry = lastEntry(); if (entry == null) { throw new NoSuchElementException(); } else { return entry.getKey(); } }
java
protected K standardLastKey() { Entry<K, V> entry = lastEntry(); if (entry == null) { throw new NoSuchElementException(); } else { return entry.getKey(); } }
[ "protected", "K", "standardLastKey", "(", ")", "{", "Entry", "<", "K", ",", "V", ">", "entry", "=", "lastEntry", "(", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "throw", "new", "NoSuchElementException", "(", ")", ";", "}", "else", "{", "...
A sensible definition of {@link #lastKey} in terms of {@code lastEntry}. If you override {@code lastEntry}, you may wish to override {@code lastKey} to forward to this implementation.
[ "A", "sensible", "definition", "of", "{" ]
7155d12b70a2406fa84d94d4b8b3bc108e89abfd
https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/android/guava/src/com/google/common/collect/ForwardingNavigableMap.java#L224-L231
valid
Standard last key.
Of course, here is the Java code you requested: ```java protected K standardLastKey() { Entry<K, V> entry = lastEntry(); if (entry == null) { throw new NoSuchElementException(); } else { return entry.getKey(); } } ``` Hope this helps!
feedzai/pdb
src/main/java/com/feedzai/commons/sql/abstraction/dml/Expression.java
Expression.leftOuterJoin
public Expression leftOuterJoin(final Expression table, final Expression expr) { if (table instanceof Query) { table.enclose(); } joins.add(new Join("LEFT OUTER JOIN", table, expr)); return this; }
java
public Expression leftOuterJoin(final Expression table, final Expression expr) { if (table instanceof Query) { table.enclose(); } joins.add(new Join("LEFT OUTER JOIN", table, expr)); return this; }
[ "public", "Expression", "leftOuterJoin", "(", "final", "Expression", "table", ",", "final", "Expression", "expr", ")", "{", "if", "(", "table", "instanceof", "Query", ")", "{", "table", ".", "enclose", "(", ")", ";", "}", "joins", ".", "add", "(", "new",...
Sets a left outer join with the current table. @param table The table to join. @param expr The expressions to join. @return This expression.
[ "Sets", "a", "left", "outer", "join", "with", "the", "current", "table", "." ]
fe07ca08417e0ddcd620a36aa1fdbca7f338be98
https://github.com/feedzai/pdb/blob/fe07ca08417e0ddcd620a36aa1fdbca7f338be98/src/main/java/com/feedzai/commons/sql/abstraction/dml/Expression.java#L182-L190
train
Add a LEFT OUTER JOIN to the expression.
Of course, here is the Java code you requested: ```java public Expression leftOuterJoin(final Expression table, final Expression expr) { if (table instanceof Query) { table.enclose(); } joins.add(new Join("LEFT OUTER JOIN", table, expr)); return this; } ``` Hope this ...
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/transformer/TransformationChainFactory.java
TransformationChainFactory.first
public <Intermediate> TransformationConcatenator<Intermediate, Target> first(Transformation<Source, Intermediate> firstTransformation) { transformationChain = new TransformationChain<Source, Target>(); transformationChain.chain.add(firstTransformation); return new TransformationConcatenator<In...
java
public <Intermediate> TransformationConcatenator<Intermediate, Target> first(Transformation<Source, Intermediate> firstTransformation) { transformationChain = new TransformationChain<Source, Target>(); transformationChain.chain.add(firstTransformation); return new TransformationConcatenator<In...
[ "public", "<", "Intermediate", ">", "TransformationConcatenator", "<", "Intermediate", ",", "Target", ">", "first", "(", "Transformation", "<", "Source", ",", "Intermediate", ">", "firstTransformation", ")", "{", "transformationChain", "=", "new", "TransformationChain...
Adds the first sub-transformation to the chain. Subsequent transformations can be added by invoking methods on the TransformationConcatenator returned by this method. @param firstTransformation The first transformation in the chain. @param <Intermediate> The type of the output produced by the (intermediate) transforma...
[ "Adds", "the", "first", "sub", "-", "transformation", "to", "the", "chain", ".", "Subsequent", "transformations", "can", "be", "added", "by", "invoking", "methods", "on", "the", "TransformationConcatenator", "returned", "by", "this", "method", "." ]
dc7f92b04d8c6cb706e78cb95e746d8f12089d95
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/transformer/TransformationChainFactory.java#L65-L71
train
Create a new TransformationConcatenator for the first Transformation
Of course, here is the Java code you requested: ```java public <Intermediate> TransformationConcatenator<Intermediate, Target> first(Transformation<Source, Intermediate> firstTransformation) { transformationChain = new TransformationChain<Source, Target>(); transformationChain.chain.add(firstTransform...
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/matrix/TransformStatistics.java
TransformStatistics.extractValues
private static <T extends Number> double[] extractValues( Map<Integer, T> map, int size) { double[] values = new double[size]; for (Map.Entry<Integer, T> entry : map.entrySet()) { if (entry.getKey() > values.length) throw new IllegalArgumentException( ...
java
private static <T extends Number> double[] extractValues( Map<Integer, T> map, int size) { double[] values = new double[size]; for (Map.Entry<Integer, T> entry : map.entrySet()) { if (entry.getKey() > values.length) throw new IllegalArgumentException( ...
[ "private", "static", "<", "T", "extends", "Number", ">", "double", "[", "]", "extractValues", "(", "Map", "<", "Integer", ",", "T", ">", "map", ",", "int", "size", ")", "{", "double", "[", "]", "values", "=", "new", "double", "[", "size", "]", ";",...
Extracts the values from the given map into an array form. This is neccesary since {@code toArray} on a {@link IntegerMap} does not work with primitives and {@code Map} does not provide this functionality. Each key in the map corresponds to an index in the array being created and the value is the value in stored at th...
[ "Extracts", "the", "values", "from", "the", "given", "map", "into", "an", "array", "form", ".", "This", "is", "neccesary", "since", "{" ]
a608102737dfd3d59038a9ead33fe60356bc6029
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/TransformStatistics.java#L207-L218
train
Extract values from the map.
Of course, here is the Java code you requested: ```java private static <T extends Number> double[] extractValues( Map<Integer, T> map, int size) { double[] values = new double[size]; for (Map.Entry<Integer, T> entry : map.entrySet()) { if (entry.getKey() > values.length) ...
Wikidata/Wikidata-Toolkit
wdtk-examples/src/main/java/org/wikidata/wdtk/examples/ExampleHelpers.java
ExampleHelpers.configureLogging
public static void configureLogging() { // Create the appender that will write log messages to the console. ConsoleAppender consoleAppender = new ConsoleAppender(); // Define the pattern of log messages. // Insert the string "%c{1}:%L" to also show class name and line. String pattern = "%d{yyyy-MM-dd HH:mm:ss...
java
public static void configureLogging() { // Create the appender that will write log messages to the console. ConsoleAppender consoleAppender = new ConsoleAppender(); // Define the pattern of log messages. // Insert the string "%c{1}:%L" to also show class name and line. String pattern = "%d{yyyy-MM-dd HH:mm:ss...
[ "public", "static", "void", "configureLogging", "(", ")", "{", "// Create the appender that will write log messages to the console.", "ConsoleAppender", "consoleAppender", "=", "new", "ConsoleAppender", "(", ")", ";", "// Define the pattern of log messages.", "// Insert the string ...
Defines how messages should be logged. This method can be modified to restrict the logging messages that are shown on the console or to change their formatting. See the documentation of Log4J for details on how to do this.
[ "Defines", "how", "messages", "should", "be", "logged", ".", "This", "method", "can", "be", "modified", "to", "restrict", "the", "logging", "messages", "that", "are", "shown", "on", "the", "console", "or", "to", "change", "their", "formatting", ".", "See", ...
7732851dda47e1febff406fba27bfec023f4786e
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/ExampleHelpers.java#L97-L109
train
Configure logging.
Of course, here is the Java code you requested: ```java public static void configureLogging() { // Create the appender that will write log messages to the console. ConsoleAppender consoleAppender = new ConsoleAppender(); // Define the pattern of log messages. // Insert the string "%c{1}:%L" to also show class ...
googleapis/google-cloud-java
google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/UnixPath.java
UnixPath.getParent
@Nullable public UnixPath getParent() { if (path.isEmpty() || isRoot()) { return null; } int index = hasTrailingSeparator() ? path.lastIndexOf(SEPARATOR, path.length() - 2) : path.lastIndexOf(SEPARATOR); if (index == -1) { return isAbsolute() ? ROOT_PATH : n...
java
@Nullable public UnixPath getParent() { if (path.isEmpty() || isRoot()) { return null; } int index = hasTrailingSeparator() ? path.lastIndexOf(SEPARATOR, path.length() - 2) : path.lastIndexOf(SEPARATOR); if (index == -1) { return isAbsolute() ? ROOT_PATH : n...
[ "@", "Nullable", "public", "UnixPath", "getParent", "(", ")", "{", "if", "(", "path", ".", "isEmpty", "(", ")", "||", "isRoot", "(", ")", ")", "{", "return", "null", ";", "}", "int", "index", "=", "hasTrailingSeparator", "(", ")", "?", "path", ".", ...
Returns parent directory (including trailing separator) or {@code null} if no parent remains. @see java.nio.file.Path#getParent()
[ "Returns", "parent", "directory", "(", "including", "trailing", "separator", ")", "or", "{", "@code", "null", "}", "if", "no", "parent", "remains", "." ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/UnixPath.java#L177-L191
train
Gets the parent of this path.
Of course, here is the Java code you requested: ```java @Nullable public UnixPath getParent() { if (path.isEmpty() || isRoot()) { return null; } int index = hasTrailingSeparator() ? path.lastIndexOf(SEPARATOR, path.length() - 2) : path.lastIndexOf(SEPARATOR); if ...
jmxtrans/jmxtrans
jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java
Settings.getIntegerSetting
public static Integer getIntegerSetting(Map<String, Object> settings, String key, Integer defaultVal) { final Object value = settings.get(key); if (value == null) { return defaultVal; } if (value instanceof Number) { return ((Number) value).intValue(); } if (value instanceof String) { try { re...
java
public static Integer getIntegerSetting(Map<String, Object> settings, String key, Integer defaultVal) { final Object value = settings.get(key); if (value == null) { return defaultVal; } if (value instanceof Number) { return ((Number) value).intValue(); } if (value instanceof String) { try { re...
[ "public", "static", "Integer", "getIntegerSetting", "(", "Map", "<", "String", ",", "Object", ">", "settings", ",", "String", "key", ",", "Integer", "defaultVal", ")", "{", "final", "Object", "value", "=", "settings", ".", "get", "(", "key", ")", ";", "i...
Gets an Integer value for the key, returning the default value given if not specified or not a valid numeric value. @param settings @param key the key to get the Integer setting for @param defaultVal the default value to return if the setting was not specified or was not coercible to an Integer value @return t...
[ "Gets", "an", "Integer", "value", "for", "the", "key", "returning", "the", "default", "value", "given", "if", "not", "specified", "or", "not", "a", "valid", "numeric", "value", "." ]
496f342de3bcf2c2226626374b7a16edf8f4ba2a
https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java#L88-L105
train
Gets an Integer value from a Map.
Of course, here is the Java code you requested: ```java public static Integer getIntegerSetting(Map<String, Object> settings, String key, Integer defaultVal) { final Object value = settings.get(key); if (value == null) { return defaultVal; } if (value instanceof Number) { return ((Number) value).intValu...
Netflix/astyanax
astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java
Mapping.make
public static <T> Mapping<T> make(Class<T> clazz, AnnotationSet<?, ?> annotationSet, boolean includeParentFields) { return new Mapping<T>(clazz, annotationSet, includeParentFields); }
java
public static <T> Mapping<T> make(Class<T> clazz, AnnotationSet<?, ?> annotationSet, boolean includeParentFields) { return new Mapping<T>(clazz, annotationSet, includeParentFields); }
[ "public", "static", "<", "T", ">", "Mapping", "<", "T", ">", "make", "(", "Class", "<", "T", ">", "clazz", ",", "AnnotationSet", "<", "?", ",", "?", ">", "annotationSet", ",", "boolean", "includeParentFields", ")", "{", "return", "new", "Mapping", "<",...
Convenience for allocation a mapping object @param clazz clazz type to map @param annotationSet annotations to use when analyzing a bean @return mapper
[ "Convenience", "for", "allocation", "a", "mapping", "object" ]
bcc3fd26e2dda05a923751aa32b139f6209fecdf
https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java#L86-L88
train
Create a new instance of the class mapping class.
Of course, here is the Java code you requested: ```java public static <T> Mapping<T> make(Class<T> clazz, AnnotationSet<?, ?> annotationSet, boolean includeParentFields) { return new Mapping<T>(clazz, annotationSet, includeParentFields); } ``` Hope this helps!
agmip/translator-dssat
src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java
DssatXFileOutput.setSecDataArr
private int setSecDataArr(HashMap m, ArrayList arr, boolean isEvent) { int idx = setSecDataArr(m, arr); if (idx != 0 && isEvent && getValueOr(m, "date", "").equals("")) { return -1; } else { return idx; } }
java
private int setSecDataArr(HashMap m, ArrayList arr, boolean isEvent) { int idx = setSecDataArr(m, arr); if (idx != 0 && isEvent && getValueOr(m, "date", "").equals("")) { return -1; } else { return idx; } }
[ "private", "int", "setSecDataArr", "(", "HashMap", "m", ",", "ArrayList", "arr", ",", "boolean", "isEvent", ")", "{", "int", "idx", "=", "setSecDataArr", "(", "m", ",", "arr", ")", ";", "if", "(", "idx", "!=", "0", "&&", "isEvent", "&&", "getValueOr", ...
Get index value of the record and set new id value in the array. In addition, it will check if the event date is available. If not, then return 0. @param m sub data @param arr array of sub data @return current index value of the sub data
[ "Get", "index", "value", "of", "the", "record", "and", "set", "new", "id", "value", "in", "the", "array", ".", "In", "addition", "it", "will", "check", "if", "the", "event", "date", "is", "available", ".", "If", "not", "then", "return", "0", "." ]
4be61d998f106eb7234ea8701b63c3746ae688f4
https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1436-L1445
train
setSecDataArr Method.
Of course, here is the Java code you requested: ```java private int setSecDataArr(HashMap m, ArrayList arr, boolean isEvent) { int idx = setSecDataArr(m, arr); if (idx != 0 && isEvent && getValueOr(m, "date", "").equals("")) { return -1; } else { return...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
EnvironmentInformation.getVersion
public static String getVersion() { String version = EnvironmentInformation.class.getPackage().getImplementationVersion(); return version != null ? version : UNKNOWN; }
java
public static String getVersion() { String version = EnvironmentInformation.class.getPackage().getImplementationVersion(); return version != null ? version : UNKNOWN; }
[ "public", "static", "String", "getVersion", "(", ")", "{", "String", "version", "=", "EnvironmentInformation", ".", "class", ".", "getPackage", "(", ")", ".", "getImplementationVersion", "(", ")", ";", "return", "version", "!=", "null", "?", "version", ":", ...
Returns the version of the code as String. If version == null, then the JobManager does not run from a Maven build. An example is a source code checkout, compile, and run from inside an IDE. @return The version string.
[ "Returns", "the", "version", "of", "the", "code", "as", "String", ".", "If", "version", "==", "null", "then", "the", "JobManager", "does", "not", "run", "from", "a", "Maven", "build", ".", "An", "example", "is", "a", "source", "code", "checkout", "compil...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java#L49-L52
train
Get the version of the application.
Of course, here is the Java code you requested: ```java public static String getVersion() { String version = EnvironmentInformation.class.getPackage().getImplementationVersion(); return version != null ? version : UNKNOWN; } ``` Hope this helps!
ow2-chameleon/fuchsia
bases/knx/calimero/src/main/java/tuwien/auto/calimero/xml/def/DefaultEntityResolver.java
DefaultEntityResolver.resolveInput
public InputStream resolveInput(String systemID) throws KNXMLException { try { try { final URL loc = new URL(systemID); return loc.openConnection().getInputStream(); } catch (final MalformedURLException e) { return new FileInputStream(systemID); } } catch (final IOException e) ...
java
public InputStream resolveInput(String systemID) throws KNXMLException { try { try { final URL loc = new URL(systemID); return loc.openConnection().getInputStream(); } catch (final MalformedURLException e) { return new FileInputStream(systemID); } } catch (final IOException e) ...
[ "public", "InputStream", "resolveInput", "(", "String", "systemID", ")", "throws", "KNXMLException", "{", "try", "{", "try", "{", "final", "URL", "loc", "=", "new", "URL", "(", "systemID", ")", ";", "return", "loc", ".", "openConnection", "(", ")", ".", ...
/* (non-Javadoc) @see tuwien.auto.calimero.xml.EntityResolver#resolveInput(java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
4e9318eadbdeb945e529789f573b45386e619bed
https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/xml/def/DefaultEntityResolver.java#L109-L123
train
Resolves the input stream for the given system ID.
Of course, here is the Java code you requested: ```java public InputStream resolveInput(String systemID) throws KNXMLException { try { try { final URL loc = new URL(systemID); return loc.openConnection().getInputStream(); } catch (final MalformedURLException e) { return new FileInputStr...
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/GeneratorRegistry.java
GeneratorRegistry.getAvailableVariants
public Map<String, VariantSet> getAvailableVariants(String path) { Map<String, VariantSet> availableVariants = new TreeMap<>(); ResourceGenerator generator = resolveResourceGenerator(path); if (generator != null) { if (generator instanceof VariantResourceGenerator) { Map<String, VariantSet> tempResult = ...
java
public Map<String, VariantSet> getAvailableVariants(String path) { Map<String, VariantSet> availableVariants = new TreeMap<>(); ResourceGenerator generator = resolveResourceGenerator(path); if (generator != null) { if (generator instanceof VariantResourceGenerator) { Map<String, VariantSet> tempResult = ...
[ "public", "Map", "<", "String", ",", "VariantSet", ">", "getAvailableVariants", "(", "String", "path", ")", "{", "Map", "<", "String", ",", "VariantSet", ">", "availableVariants", "=", "new", "TreeMap", "<>", "(", ")", ";", "ResourceGenerator", "generator", ...
Returns the available variant for a path @param path the path @return the available variant for a path
[ "Returns", "the", "available", "variant", "for", "a", "path" ]
5381f6acf461cd2502593c67a77bd6ef9eab848d
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/GeneratorRegistry.java#L595-L618
train
Returns the available variants for the given path
Of course, here is the Java code you requested: ```java public Map<String, VariantSet> getAvailableVariants(String path) { Map<String, VariantSet> availableVariants = new TreeMap<>(); ResourceGenerator generator = resolveResourceGenerator(path); if (generator != null) { if (generator instanceof VariantResour...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java
Ifc2x3tc1PackageImpl.getIfcDraughtingPreDefinedTextFont
public EClass getIfcDraughtingPreDefinedTextFont() { if (ifcDraughtingPreDefinedTextFontEClass == null) { ifcDraughtingPreDefinedTextFontEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(178); } return ifcDraughtingPreDefinedTextFontEClass; }
java
public EClass getIfcDraughtingPreDefinedTextFont() { if (ifcDraughtingPreDefinedTextFontEClass == null) { ifcDraughtingPreDefinedTextFontEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(178); } return ifcDraughtingPreDefinedTextFontEClass; }
[ "public", "EClass", "getIfcDraughtingPreDefinedTextFont", "(", ")", "{", "if", "(", "ifcDraughtingPreDefinedTextFontEClass", "==", "null", ")", "{", "ifcDraughtingPreDefinedTextFontEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "g...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L13671-L13677
train
Get the IfcDraughtingPreDefinedTextFontEClass attribute of the interface.
Of course, here is the Java code you requested: ```java public EClass getIfcDraughtingPreDefinedTextFont() { if (ifcDraughtingPreDefinedTextFontEClass == null) { ifcDraughtingPreDefinedTextFontEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(178); ...
dlemmermann/CalendarFX
CalendarFXView/src/main/java/impl/com/calendarfx/view/MonthViewSkin.java
MonthViewSkin.updateDaySelection
private void updateDaySelection() { for (MonthDayView view : controlsMap.values()) { view.pseudoClassStateChanged(selectedClass, false); } for (LocalDate date : getSkinnable().getSelectedDates()) { MonthDayView view = controlsMap.get(date); if (view != null) ...
java
private void updateDaySelection() { for (MonthDayView view : controlsMap.values()) { view.pseudoClassStateChanged(selectedClass, false); } for (LocalDate date : getSkinnable().getSelectedDates()) { MonthDayView view = controlsMap.get(date); if (view != null) ...
[ "private", "void", "updateDaySelection", "(", ")", "{", "for", "(", "MonthDayView", "view", ":", "controlsMap", ".", "values", "(", ")", ")", "{", "view", ".", "pseudoClassStateChanged", "(", "selectedClass", ",", "false", ")", ";", "}", "for", "(", "Local...
$NON-NLS-1$
[ "$NON", "-", "NLS", "-", "1$" ]
f2b91c2622c3f29d004485b6426b23b86c331f96
https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/impl/com/calendarfx/view/MonthViewSkin.java#L208-L219
train
Update calendar calendar
Of course, here is the Java code you requested: ```java private void updateDaySelection() { for (MonthDayView view : controlsMap.values()) { view.pseudoClassStateChanged(selectedClass, false); } for (LocalDate date : getSkinnable().getSelectedDates()) { MonthDayView vie...
structr/structr
structr-ui/src/main/java/org/structr/console/Console.java
Console.runCypher
private void runCypher(final String line, final Writable writable) throws FrameworkException, IOException { final App app = StructrApp.getInstance(actionContext.getSecurityContext()); try (final Tx tx = app.tx()) { final long t0 = System.currentTimeMillis(); final List<GraphObject> result ...
java
private void runCypher(final String line, final Writable writable) throws FrameworkException, IOException { final App app = StructrApp.getInstance(actionContext.getSecurityContext()); try (final Tx tx = app.tx()) { final long t0 = System.currentTimeMillis(); final List<GraphObject> result ...
[ "private", "void", "runCypher", "(", "final", "String", "line", ",", "final", "Writable", "writable", ")", "throws", "FrameworkException", ",", "IOException", "{", "final", "App", "app", "=", "StructrApp", ".", "getInstance", "(", "actionContext", ".", "getSecur...
----- private methods -----
[ "-----", "private", "methods", "-----" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/console/Console.java#L236-L265
train
Run Cypher query.
Of course, here is the Java code you requested: ```java private void runCypher(final String line, final Writable writable) throws FrameworkException, IOException { final App app = StructrApp.getInstance(actionContext.getSecurityContext()); try (final Tx tx = app.tx()) { final long t0 = Syste...
MenoData/Time4J
base/src/main/java/net/time4j/format/platform/SimpleFormatter.java
SimpleFormatter.ofDatePattern
public static SimpleFormatter<PlainDate> ofDatePattern( String pattern, Locale locale ) { return new SimpleFormatter<>( PlainDate.class, pattern, locale, Leniency.SMART, null ); }
java
public static SimpleFormatter<PlainDate> ofDatePattern( String pattern, Locale locale ) { return new SimpleFormatter<>( PlainDate.class, pattern, locale, Leniency.SMART, null ); }
[ "public", "static", "SimpleFormatter", "<", "PlainDate", ">", "ofDatePattern", "(", "String", "pattern", ",", "Locale", "locale", ")", "{", "return", "new", "SimpleFormatter", "<>", "(", "PlainDate", ".", "class", ",", "pattern", ",", "locale", ",", "Leniency"...
/*[deutsch] <p>Erzeugt ein neues Format-Objekt f&uuml;r reine Datumsobjekte mit Hilfe des angegebenen Musters in der angegebenen Sprach- und L&auml;ndereinstellung. </p> <p>Das Formatmuster wird nur beim Formatieren oder Interpretieren gepr&uuml;ft. </p> @param pattern format definition as pattern as defined by...
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Erzeugt", "ein", "neues", "Format", "-", "Objekt", "f&uuml", ";", "r", "reine", "Datumsobjekte", "mit", "Hilfe", "des", "angegebenen", "Musters", "in", "der", "angegebenen", "Sprach", "-", "und", "L&auml", ";", ...
08b2eda6b2dbb140b92011cf7071bb087edd46a5
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/platform/SimpleFormatter.java#L218-L231
train
Create a SimpleFormatter for a .
Of course, here is the Java code you requested: ```java public static SimpleFormatter<PlainDate> ofDatePattern( String pattern, Locale locale ) { return new SimpleFormatter<>( PlainDate.class, pattern, locale, Leniency.SMART, null...
super-csv/super-csv
super-csv-dozer/src/main/java/org/supercsv/io/dozer/CsvDozerBeanWriter.java
CsvDozerBeanWriter.write
public void write(final Object source, final CellProcessor[] processors) throws IOException { if( source == null ) { throw new NullPointerException("object to write should not be null"); } else if( processors == null ) { throw new NullPointerException("processors should not be null"); } // update th...
java
public void write(final Object source, final CellProcessor[] processors) throws IOException { if( source == null ) { throw new NullPointerException("object to write should not be null"); } else if( processors == null ) { throw new NullPointerException("processors should not be null"); } // update th...
[ "public", "void", "write", "(", "final", "Object", "source", ",", "final", "CellProcessor", "[", "]", "processors", ")", "throws", "IOException", "{", "if", "(", "source", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"object to write ...
{@inheritDoc}
[ "{" ]
f18db724674dc1c4116e25142c1b5403ebf43e96
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv-dozer/src/main/java/org/supercsv/io/dozer/CsvDozerBeanWriter.java#L119-L139
train
Write the object to the output.
Of course, here is the Java code you requested: ```java public void write(final Object source, final CellProcessor[] processors) throws IOException { if( source == null ) { throw new NullPointerException("object to write should not be null"); } else if( processors == null ) { throw new NullPointerExceptio...
virgo47/javasimon
core/src/main/java/org/javasimon/callback/logging/LogTemplates.java
LogTemplates.everyNMilliseconds
static <C> LogTemplate<C> everyNMilliseconds(LogTemplate<C> delegateLogger, long period, SimonClock clock) { return new PeriodicLogTemplate<>(delegateLogger, period, clock); }
java
static <C> LogTemplate<C> everyNMilliseconds(LogTemplate<C> delegateLogger, long period, SimonClock clock) { return new PeriodicLogTemplate<>(delegateLogger, period, clock); }
[ "static", "<", "C", ">", "LogTemplate", "<", "C", ">", "everyNMilliseconds", "(", "LogTemplate", "<", "C", ">", "delegateLogger", ",", "long", "period", ",", "SimonClock", "clock", ")", "{", "return", "new", "PeriodicLogTemplate", "<>", "(", "delegateLogger", ...
Produces a log template which logs something at most every N milliseconds. @param delegateLogger Concrete log template @param period N value in milliseconds, maximum period @param clock clock to get current system time @return Logger
[ "Produces", "a", "log", "template", "which", "logs", "something", "at", "most", "every", "N", "milliseconds", "." ]
17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/logging/LogTemplates.java#L50-L52
train
Creates a new periodic log template that logs every N milliseconds.
Of course, here is the Java code you requested: ```java static <C> LogTemplate<C> everyNMilliseconds(LogTemplate<C> delegateLogger, long period, SimonClock clock) { return new PeriodicLogTemplate<>(delegateLogger, period, clock); } ``` Hope this helps!
viltgroup/minium
minium-script-rhinojs/src/main/java/minium/script/rhinojs/RhinoEngine.java
RhinoEngine.runScript
@Override public <T> T runScript(File sourceFile) throws IOException { try (FileReader reader = new FileReader(sourceFile)) { return runScript(reader, sourceFile.getPath()); } }
java
@Override public <T> T runScript(File sourceFile) throws IOException { try (FileReader reader = new FileReader(sourceFile)) { return runScript(reader, sourceFile.getPath()); } }
[ "@", "Override", "public", "<", "T", ">", "T", "runScript", "(", "File", "sourceFile", ")", "throws", "IOException", "{", "try", "(", "FileReader", "reader", "=", "new", "FileReader", "(", "sourceFile", ")", ")", "{", "return", "runScript", "(", "reader", ...
/* (non-Javadoc) @see minium.script.rhinojs.JsEngine#runScript(java.io.File)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
f512fdd966ed4034d3ed53518eae7ad993562ab1
https://github.com/viltgroup/minium/blob/f512fdd966ed4034d3ed53518eae7ad993562ab1/minium-script-rhinojs/src/main/java/minium/script/rhinojs/RhinoEngine.java#L151-L156
train
Run a CRASS script.
Of course, here is the Java code you requested: ```java @Override public <T> T runScript(File sourceFile) throws IOException { try (FileReader reader = new FileReader(sourceFile)) { return runScript(reader, sourceFile.getPath()); } } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspRuntimeContext.java
JspRuntimeContext.getBytecodeBirthTime
public long getBytecodeBirthTime(String name) { Long time = bytecodeBirthTimes.get(name); return (time != null? time.longValue(): 0); }
java
public long getBytecodeBirthTime(String name) { Long time = bytecodeBirthTimes.get(name); return (time != null? time.longValue(): 0); }
[ "public", "long", "getBytecodeBirthTime", "(", "String", "name", ")", "{", "Long", "time", "=", "bytecodeBirthTimes", ".", "get", "(", "name", ")", ";", "return", "(", "time", "!=", "null", "?", "time", ".", "longValue", "(", ")", ":", "0", ")", ";", ...
Retrieve the time the bytecode for a class was created
[ "Retrieve", "the", "time", "the", "bytecode", "for", "a", "class", "was", "created" ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspRuntimeContext.java#L415-L418
test
Gets the bytecode birth time.
Of course, here is the Java code you requested: ```java public long getBytecodeBirthTime(String name) { Long time = bytecodeBirthTimes.get(name); return (time != null? time.longValue(): 0); } ``` Hope this helps!
comapi/comapi-sdk-android
COMAPI/foundation/src/main/java/com/comapi/internal/data/DeviceDAO.java
DeviceDAO.loadDevice
private Device loadDevice() { //Initialise object with the content saved in shared pref file. SharedPreferences sharedPreferences = getSharedPreferences(); return new Device() .setApiSpaceId(sharedPreferences.getString(KEY_API_SPACE_ID, null)) .setAppVer(sharedPre...
java
private Device loadDevice() { //Initialise object with the content saved in shared pref file. SharedPreferences sharedPreferences = getSharedPreferences(); return new Device() .setApiSpaceId(sharedPreferences.getString(KEY_API_SPACE_ID, null)) .setAppVer(sharedPre...
[ "private", "Device", "loadDevice", "(", ")", "{", "//Initialise object with the content saved in shared pref file.", "SharedPreferences", "sharedPreferences", "=", "getSharedPreferences", "(", ")", ";", "return", "new", "Device", "(", ")", ".", "setApiSpaceId", "(", "shar...
Loads device details from internal storage. @return Loaded device details.
[ "Loads", "device", "details", "from", "internal", "storage", "." ]
53140a58d5a62afe196047ccc5120bfe090ef211
https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/data/DeviceDAO.java#L60-L69
train
Load the Device object from the SharedPreferences file.
Of course, here is the Java code you requested: ```java private Device loadDevice() { //Initialise object with the content saved in shared pref file. SharedPreferences sharedPreferences = getSharedPreferences(); return new Device() .setApiSpaceId(sharedPreferences.getString(KEY_...
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/network/NetworkUtil.java
NetworkUtil.toInetAddress
public static InetAddress toInetAddress(URI uri) { try { // Copy/paste from the ZeroMQ lib final String protocol = uri.getScheme(); final String address = uri.getHost(); if ("tcp".equalsIgnoreCase(protocol)) { //$NON-NLS-1$ return InetAddress.getByName(address); } throw new IllegalArgumentExcept...
java
public static InetAddress toInetAddress(URI uri) { try { // Copy/paste from the ZeroMQ lib final String protocol = uri.getScheme(); final String address = uri.getHost(); if ("tcp".equalsIgnoreCase(protocol)) { //$NON-NLS-1$ return InetAddress.getByName(address); } throw new IllegalArgumentExcept...
[ "public", "static", "InetAddress", "toInetAddress", "(", "URI", "uri", ")", "{", "try", "{", "// Copy/paste from the ZeroMQ lib", "final", "String", "protocol", "=", "uri", ".", "getScheme", "(", ")", ";", "final", "String", "address", "=", "uri", ".", "getHos...
Extract an Inet address from an URI. @param uri the address. @return the address.
[ "Extract", "an", "Inet", "address", "from", "an", "URI", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/network/NetworkUtil.java#L209-L221
train
Convert a URI to an InetAddress.
Of course, here is the Java code you requested: ```java public static InetAddress toInetAddress(URI uri) { try { // Copy/paste from the ZeroMQ lib final String protocol = uri.getScheme(); final String address = uri.getHost(); if ("tcp".equalsIgnoreCase(protocol)) { //$NON-NLS-1$ return InetAddress.ge...
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java
CmsListItemWidget.removeMouseHandlers
public void removeMouseHandlers() { Iterator<HandlerRegistration> it = m_handlerRegistrations.iterator(); while (it.hasNext()) { it.next().removeHandler(); } m_handlerRegistrations.clear(); }
java
public void removeMouseHandlers() { Iterator<HandlerRegistration> it = m_handlerRegistrations.iterator(); while (it.hasNext()) { it.next().removeHandler(); } m_handlerRegistrations.clear(); }
[ "public", "void", "removeMouseHandlers", "(", ")", "{", "Iterator", "<", "HandlerRegistration", ">", "it", "=", "m_handlerRegistrations", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "it", ".", "next", "(", ")",...
Removes all registered mouse event handlers including the context menu handler.<p>
[ "Removes", "all", "registered", "mouse", "event", "handlers", "including", "the", "context", "menu", "handler", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java#L608-L615
train
Remove all mouse handlers.
Of course, here is the Java code you requested: ```java public void removeMouseHandlers() { Iterator<HandlerRegistration> it = m_handlerRegistrations.iterator(); while (it.hasNext()) { it.next().removeHandler(); } m_handlerRegistrations.clear(); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/util/DateUtils.java
DateUtils.formatRFC822Date
public static String formatRFC822Date(Date date) { try { return rfc822DateFormat.print(date.getTime()); } catch(RuntimeException ex) { throw handleException(ex); } }
java
public static String formatRFC822Date(Date date) { try { return rfc822DateFormat.print(date.getTime()); } catch(RuntimeException ex) { throw handleException(ex); } }
[ "public", "static", "String", "formatRFC822Date", "(", "Date", "date", ")", "{", "try", "{", "return", "rfc822DateFormat", ".", "print", "(", "date", ".", "getTime", "(", ")", ")", ";", "}", "catch", "(", "RuntimeException", "ex", ")", "{", "throw", "han...
Formats the specified date as an RFC 822 string. @param date The date to format. @return The RFC 822 string representing the specified date.
[ "Formats", "the", "specified", "date", "as", "an", "RFC", "822", "string", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/DateUtils.java#L210-L216
train
Format RFC 822 date.
Of course, here is the Java code you requested: ```java public static String formatRFC822Date(Date date) { try { return rfc822DateFormat.print(date.getTime()); } catch(RuntimeException ex) { throw handleException(ex); } } ``` Hope this helps!
couchbase/couchbase-lite-java-core
src/main/java/com/couchbase/lite/support/SerializableCookie.java
SerializableCookie.byteArrayToHexString
private static String byteArrayToHexString(byte[] bytes) { StringBuilder sb = new StringBuilder(bytes.length * 2); for (byte element : bytes) { int v = element & 0xff; if (v < 16) { sb.append('0'); } sb.append(Integer.toHexString(v)); ...
java
private static String byteArrayToHexString(byte[] bytes) { StringBuilder sb = new StringBuilder(bytes.length * 2); for (byte element : bytes) { int v = element & 0xff; if (v < 16) { sb.append('0'); } sb.append(Integer.toHexString(v)); ...
[ "private", "static", "String", "byteArrayToHexString", "(", "byte", "[", "]", "bytes", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "bytes", ".", "length", "*", "2", ")", ";", "for", "(", "byte", "element", ":", "bytes", ")", "{", ...
Using some super basic byte array &lt;-&gt; hex conversions so we don't have to rely on any large Base64 libraries. Can be overridden if you like! @param bytes byte array to be converted @return string containing hex values
[ "Using", "some", "super", "basic", "byte", "array", "&lt", ";", "-", "&gt", ";", "hex", "conversions", "so", "we", "don", "t", "have", "to", "rely", "on", "any", "large", "Base64", "libraries", ".", "Can", "be", "overridden", "if", "you", "like!" ]
3b275642e2d2f231fd155ad9def9c5e9eff3118e
https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/support/SerializableCookie.java#L67-L77
train
This method convert a byte array to a hex string.
Of course, here is the Java code you requested: ```java private static String byteArrayToHexString(byte[] bytes) { StringBuilder sb = new StringBuilder(bytes.length * 2); for (byte element : bytes) { int v = element & 0xff; if (v < 16) { sb.append('0'); ...
duraspace/fcrepo-cloudsync
fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/backend/PIDPatternFilter.java
PIDPatternFilter.isPid
private boolean isPid(String value) { if ( (value == null) || (value.indexOf("+") != -1) || (value.indexOf("/") != -1) || (value.indexOf(" ") != -1) ) { return false; } int i = value.indexOf(":"); return i > 0 && i < (value.leng...
java
private boolean isPid(String value) { if ( (value == null) || (value.indexOf("+") != -1) || (value.indexOf("/") != -1) || (value.indexOf(" ") != -1) ) { return false; } int i = value.indexOf(":"); return i > 0 && i < (value.leng...
[ "private", "boolean", "isPid", "(", "String", "value", ")", "{", "if", "(", "(", "value", "==", "null", ")", "||", "(", "value", ".", "indexOf", "(", "\"+\"", ")", "!=", "-", "1", ")", "||", "(", "value", ".", "indexOf", "(", "\"/\"", ")", "!=", ...
TODO: Make PID syntax checks more robust
[ "TODO", ":", "Make", "PID", "syntax", "checks", "more", "robust" ]
2d90e2c9c84a827f2605607ff40e116c67eff9b9
https://github.com/duraspace/fcrepo-cloudsync/blob/2d90e2c9c84a827f2605607ff40e116c67eff9b9/fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/backend/PIDPatternFilter.java#L26-L35
train
isPid returns true if the value is a pid.
Of course, here is the Java code you requested: ```java private boolean isPid(String value) { if ( (value == null) || (value.indexOf("+") != -1) || (value.indexOf("/") != -1) || (value.indexOf(" ") != -1) ) { return false; } int i = va...
Azure/azure-sdk-for-java
common/azure-common/src/main/java/com/azure/common/implementation/SwaggerMethodParser.java
SwaggerMethodParser.expectsResponseBody
public boolean expectsResponseBody() { boolean result = true; if (TypeUtil.isTypeOrSubTypeOf(returnType, Void.class)) { result = false; } else if (TypeUtil.isTypeOrSubTypeOf(returnType, Mono.class) || TypeUtil.isTypeOrSubTypeOf(returnType, Flux.class)) { final Parameteri...
java
public boolean expectsResponseBody() { boolean result = true; if (TypeUtil.isTypeOrSubTypeOf(returnType, Void.class)) { result = false; } else if (TypeUtil.isTypeOrSubTypeOf(returnType, Mono.class) || TypeUtil.isTypeOrSubTypeOf(returnType, Flux.class)) { final Parameteri...
[ "public", "boolean", "expectsResponseBody", "(", ")", "{", "boolean", "result", "=", "true", ";", "if", "(", "TypeUtil", ".", "isTypeOrSubTypeOf", "(", "returnType", ",", "Void", ".", "class", ")", ")", "{", "result", "=", "false", ";", "}", "else", "if"...
Checks whether or not the Swagger method expects the response to contain a body. @return true if Swagger method expects the response to contain a body, false otherwise
[ "Checks", "whether", "or", "not", "the", "Swagger", "method", "expects", "the", "response", "to", "contain", "a", "body", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/SwaggerMethodParser.java#L489-L507
train
Checks if the response type expects a body.
Of course, here is the Java code you requested: ```java public boolean expectsResponseBody() { boolean result = true; if (TypeUtil.isTypeOrSubTypeOf(returnType, Void.class)) { result = false; } else if (TypeUtil.isTypeOrSubTypeOf(returnType, Mono.class) || TypeUtil.isTypeOrSubTypeO...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java
DTMDefaultBase.getFirstChild
public int getFirstChild(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int firstChild = _firstch(identity); return makeNodeHandle(firstChild); }
java
public int getFirstChild(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int firstChild = _firstch(identity); return makeNodeHandle(firstChild); }
[ "public", "int", "getFirstChild", "(", "int", "nodeHandle", ")", "{", "int", "identity", "=", "makeNodeIdentity", "(", "nodeHandle", ")", ";", "int", "firstChild", "=", "_firstch", "(", "identity", ")", ";", "return", "makeNodeHandle", "(", "firstChild", ")", ...
Given a node handle, get the handle of the node's first child. If not yet resolved, waits for more nodes to be added to the document and tries again. @param nodeHandle int Handle of the node. @return int DTM node-number of first child, or DTM.NULL to indicate none exists.
[ "Given", "a", "node", "handle", "get", "the", "handle", "of", "the", "node", "s", "first", "child", ".", "If", "not", "yet", "resolved", "waits", "for", "more", "nodes", "to", "be", "added", "to", "the", "document", "and", "tries", "again", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java#L969-L976
train
Gets the first child of a node.
Of course, here is the Java code you requested: ```java public int getFirstChild(int nodeHandle) { int identity = makeNodeIdentity(nodeHandle); int firstChild = _firstch(identity); return makeNodeHandle(firstChild); } ``` Hope this helps!
canhnt/sne-xacml
sne-xacml/src/main/java/nl/uva/sne/xacml/profiles/_2_0_/policy/ObjectFactory.java
ObjectFactory.createSubjectAttributeDesignator
@XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", name = "SubjectAttributeDesignator", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", substitutionHeadName = "Expression") public JAXBElement<SubjectAttributeDesignatorType> createSubjectAttributeDesignator(Subj...
java
@XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", name = "SubjectAttributeDesignator", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", substitutionHeadName = "Expression") public JAXBElement<SubjectAttributeDesignatorType> createSubjectAttributeDesignator(Subj...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"urn:oasis:names:tc:xacml:2.0:policy:schema:os\"", ",", "name", "=", "\"SubjectAttributeDesignator\"", ",", "substitutionHeadNamespace", "=", "\"urn:oasis:names:tc:xacml:2.0:policy:schema:os\"", ",", "substitutionHeadName", "=", "\"Ex...
Create an instance of {@link JAXBElement }{@code <}{@link SubjectAttributeDesignatorType }{@code >}}
[ "Create", "an", "instance", "of", "{" ]
7ffca16bf558d2c3ee16181d926f066ab1de75b2
https://github.com/canhnt/sne-xacml/blob/7ffca16bf558d2c3ee16181d926f066ab1de75b2/sne-xacml/src/main/java/nl/uva/sne/xacml/profiles/_2_0_/policy/ObjectFactory.java#L612-L615
train
Create an instance of the SubjectAttributeDesignator JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", name = "SubjectAttributeDesignator", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", substitutionHeadName = "Expression") public JAXBElement<SubjectAttri...
mijecu25/dsa
src/main/java/com/mijecu25/dsa/algorithms/search/linear/LinearSearch.java
LinearSearch.search
public static int search(int[] intArray, int value, int occurrence) { if(occurrence <= 0 || occurrence > intArray.length) { throw new IllegalArgumentException("Occurrence must be greater or equal to 1 and less than " + "the array length: " + occurrence); } int va...
java
public static int search(int[] intArray, int value, int occurrence) { if(occurrence <= 0 || occurrence > intArray.length) { throw new IllegalArgumentException("Occurrence must be greater or equal to 1 and less than " + "the array length: " + occurrence); } int va...
[ "public", "static", "int", "search", "(", "int", "[", "]", "intArray", ",", "int", "value", ",", "int", "occurrence", ")", "{", "if", "(", "occurrence", "<=", "0", "||", "occurrence", ">", "intArray", ".", "length", ")", "{", "throw", "new", "IllegalAr...
Search for the value in the int array and return the index of the specified occurrence from the beginning of the array. @param intArray array that we are searching in. @param value value that is being searched in the array. @param occurrence number of times we have seen the value before returning the index. @return t...
[ "Search", "for", "the", "value", "in", "the", "int", "array", "and", "return", "the", "index", "of", "the", "specified", "occurrence", "from", "the", "beginning", "of", "the", "array", "." ]
a22971b746833e78a3939ae4de65e8f6bf2e3fd4
https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/linear/LinearSearch.java#L554-L573
train
Search for the value in the int array and return the index of the first occurrence from the beginning of the array.
Of course, here is the Java code you requested: ```java public static int search(int[] intArray, int value, int occurrence) { if(occurrence <= 0 || occurrence > intArray.length) { throw new IllegalArgumentException("Occurrence must be greater or equal to 1 and less than " + "the...
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/process/WhitespaceTokenizer.java
WhitespaceTokenizer.getNext
@SuppressWarnings("unchecked") @Override protected T getNext() { T token = null; if (lexer == null) { return token; } try { token = (T) lexer.next(); while (token != null && token.word().equals(WhitespaceLexer.NEWLINE)) { if (eolIsSignificant) { return ...
java
@SuppressWarnings("unchecked") @Override protected T getNext() { T token = null; if (lexer == null) { return token; } try { token = (T) lexer.next(); while (token != null && token.word().equals(WhitespaceLexer.NEWLINE)) { if (eolIsSignificant) { return ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "protected", "T", "getNext", "(", ")", "{", "T", "token", "=", "null", ";", "if", "(", "lexer", "==", "null", ")", "{", "return", "token", ";", "}", "try", "{", "token", "=", "(", ...
Internally fetches the next token. @return the next token in the token stream, or null if none exists.
[ "Internally", "fetches", "the", "next", "token", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/WhitespaceTokenizer.java#L117-L137
train
Returns the next token from the token list.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override protected T getNext() { T token = null; if (lexer == null) { return token; } try { token = (T) lexer.next(); while (token != null && token.word().equals(WhitespaceLexer.NEWLIN...
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/expr/AbsExpression.java
AbsExpression.hasNext
@Override public synchronized boolean hasNext() { resetToLastKey(); if (mIsFirst) { mIsFirst = false; // evaluate expression try { evaluate(); } catch (final TTXPathException e) { throw new RuntimeException(e); ...
java
@Override public synchronized boolean hasNext() { resetToLastKey(); if (mIsFirst) { mIsFirst = false; // evaluate expression try { evaluate(); } catch (final TTXPathException e) { throw new RuntimeException(e); ...
[ "@", "Override", "public", "synchronized", "boolean", "hasNext", "(", ")", "{", "resetToLastKey", "(", ")", ";", "if", "(", "mIsFirst", ")", "{", "mIsFirst", "=", "false", ";", "// evaluate expression", "try", "{", "evaluate", "(", ")", ";", "}", "catch", ...
{@inheritDoc}
[ "{" ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/expr/AbsExpression.java#L77-L103
train
Returns true if the iterator is not empty.
Of course, here is the Java code you requested: ```java @Override public synchronized boolean hasNext() { resetToLastKey(); if (mIsFirst) { mIsFirst = false; // evaluate expression try { evaluate(); } catch (final TTXPathException e...
phax/ph-schedule
ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java
CalendarIntervalScheduleBuilder.withIntervalInMonths
@Nonnull public CalendarIntervalScheduleBuilder withIntervalInMonths (final int intervalInMonths) { _validateInterval (intervalInMonths); m_nInterval = intervalInMonths; m_eIntervalUnit = EIntervalUnit.MONTH; return this; }
java
@Nonnull public CalendarIntervalScheduleBuilder withIntervalInMonths (final int intervalInMonths) { _validateInterval (intervalInMonths); m_nInterval = intervalInMonths; m_eIntervalUnit = EIntervalUnit.MONTH; return this; }
[ "@", "Nonnull", "public", "CalendarIntervalScheduleBuilder", "withIntervalInMonths", "(", "final", "int", "intervalInMonths", ")", "{", "_validateInterval", "(", "intervalInMonths", ")", ";", "m_nInterval", "=", "intervalInMonths", ";", "m_eIntervalUnit", "=", "EIntervalU...
Specify an interval in the IntervalUnit.MONTH that the produced Trigger will repeat at. @param intervalInMonths the number of months at which the trigger should repeat. @return the updated CalendarIntervalScheduleBuilder @see ICalendarIntervalTrigger#getRepeatInterval() @see ICalendarIntervalTrigger#getRepeatIntervalU...
[ "Specify", "an", "interval", "in", "the", "IntervalUnit", ".", "MONTH", "that", "the", "produced", "Trigger", "will", "repeat", "at", "." ]
b000790b46a9f8d23ad44cc20591f753d07c0229
https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java#L229-L236
train
Sets the interval in months.
Of course, here is the Java code you requested: ```java @Nonnull public CalendarIntervalScheduleBuilder withIntervalInMonths (final int intervalInMonths) { _validateInterval (intervalInMonths); m_nInterval = intervalInMonths; m_eIntervalUnit = EIntervalUnit.MONTH; return this; } ``` Hope this he...
NanoHttpd/nanohttpd
core/src/main/java/org/nanohttpd/protocols/http/NanoHTTPD.java
NanoHTTPD.serve
@Deprecated protected Response serve(IHTTPSession session) { return Response.newFixedLengthResponse(Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, "Not Found"); }
java
@Deprecated protected Response serve(IHTTPSession session) { return Response.newFixedLengthResponse(Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, "Not Found"); }
[ "@", "Deprecated", "protected", "Response", "serve", "(", "IHTTPSession", "session", ")", "{", "return", "Response", ".", "newFixedLengthResponse", "(", "Status", ".", "NOT_FOUND", ",", "NanoHTTPD", ".", "MIME_PLAINTEXT", ",", "\"Not Found\"", ")", ";", "}" ]
Override this to customize the server. <p/> <p/> (By default, this returns a 404 "Not Found" plain text error response.) @param session The HTTP session @return HTTP response, see class Response for details
[ "Override", "this", "to", "customize", "the", "server", ".", "<p", "/", ">", "<p", "/", ">", "(", "By", "default", "this", "returns", "a", "404", "Not", "Found", "plain", "text", "error", "response", ".", ")" ]
b04a342a4bcd0ff44be65138acffc73a29381c72
https://github.com/NanoHttpd/nanohttpd/blob/b04a342a4bcd0ff44be65138acffc73a29381c72/core/src/main/java/org/nanohttpd/protocols/http/NanoHTTPD.java#L548-L551
test
Override this method to provide a response for a 404 Not Found response.
Of course, here is the Java code you requested: ```java @Deprecated protected Response serve(IHTTPSession session) { return Response.newFixedLengthResponse(Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, "Not Found"); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.tx.embeddable/src/com/ibm/ws/uow/embeddable/ClientUOWManagerImpl.java
ClientUOWManagerImpl.runUnderUOW
@Override public Object runUnderUOW(int uowType, boolean join, ExtendedUOWAction uowAction, Class<?>[] rollbackOn, Class<?>[] dontRollbackOn) throws Exception { throw new IllegalStateException(); }
java
@Override public Object runUnderUOW(int uowType, boolean join, ExtendedUOWAction uowAction, Class<?>[] rollbackOn, Class<?>[] dontRollbackOn) throws Exception { throw new IllegalStateException(); }
[ "@", "Override", "public", "Object", "runUnderUOW", "(", "int", "uowType", ",", "boolean", "join", ",", "ExtendedUOWAction", "uowAction", ",", "Class", "<", "?", ">", "[", "]", "rollbackOn", ",", "Class", "<", "?", ">", "[", "]", "dontRollbackOn", ")", "...
/* (non-Javadoc) @see com.ibm.wsspi.uow.UOWManager#runUnderUOW(int, boolean, com.ibm.wsspi.uow.ExtendedUOWAction, java.lang.Class[], java.lang.Class[])
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/ws/uow/embeddable/ClientUOWManagerImpl.java#L74-L77
train
Override this method to perform a run under a UOW.
Of course, here is the Java code you requested: ```java @Override public Object runUnderUOW(int uowType, boolean join, ExtendedUOWAction uowAction, Class<?>[] rollbackOn, Class<?>[] dontRollbackOn) throws Exception { throw new IllegalStateException(); } ``` Hope this helps!
gosu-lang/gosu-lang
gosu-core/src/main/java/gw/internal/gosu/template/TemplateGenerator.java
TemplateGenerator.compile
private Program compile( Stack<IScriptPartId> scriptPartIdStack, String strCompiledSource, ISymbolTable symbolTable, Map<String, List<IFunctionSymbol>> dfsDeclByName, ITypeUsesMap typeUsesMap, Stack<BlockExpression> blocks, ContextInferenceManager ctxInferenceMgr) throws ParseResultsException { IGosuParser parser...
java
private Program compile( Stack<IScriptPartId> scriptPartIdStack, String strCompiledSource, ISymbolTable symbolTable, Map<String, List<IFunctionSymbol>> dfsDeclByName, ITypeUsesMap typeUsesMap, Stack<BlockExpression> blocks, ContextInferenceManager ctxInferenceMgr) throws ParseResultsException { IGosuParser parser...
[ "private", "Program", "compile", "(", "Stack", "<", "IScriptPartId", ">", "scriptPartIdStack", ",", "String", "strCompiledSource", ",", "ISymbolTable", "symbolTable", ",", "Map", "<", "String", ",", "List", "<", "IFunctionSymbol", ">", ">", "dfsDeclByName", ",", ...
@return the program to execute @throws gw.lang.parser.exceptions.ParseException
[ "@return", "the", "program", "to", "execute", "@throws", "gw", ".", "lang", ".", "parser", ".", "exceptions", ".", "ParseException" ]
d6e9261b137ce66fef3726cabe7826d4a1f946b7
https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/template/TemplateGenerator.java#L371-L433
train
Compile the given source.
Of course, here is the Java code you requested: ```java private Program compile( Stack<IScriptPartId> scriptPartIdStack, String strCompiledSource, ISymbolTable symbolTable, Map<String, List<IFunctionSymbol>> dfsDeclByName, ITypeUsesMap typeUsesMap, Stack<BlockExpression> blocks, ContextInferenceManager ctxInferenceMgr...
JRebirth/JRebirth
org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/ServiceTaskBase.java
ServiceTaskBase.call
@SuppressWarnings("unchecked") @Override protected T call() throws CoreException { this.wave.status(Status.Consumed); T res = null; try { // Build parameter list of the searched method final List<Object> params = new ArrayList<>(); for (final Object...
java
@SuppressWarnings("unchecked") @Override protected T call() throws CoreException { this.wave.status(Status.Consumed); T res = null; try { // Build parameter list of the searched method final List<Object> params = new ArrayList<>(); for (final Object...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "protected", "T", "call", "(", ")", "throws", "CoreException", "{", "this", ".", "wave", ".", "status", "(", "Status", ".", "Consumed", ")", ";", "T", "res", "=", "null", ";", "try", ...
{@inheritDoc} @throws CoreException if return WaveType has bad API
[ "{", "@inheritDoc", "}" ]
93f4fc087b83c73db540333b9686e97b4cec694d
https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/ServiceTaskBase.java#L141-L189
train
Call the method.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override protected T call() throws CoreException { this.wave.status(Status.Consumed); T res = null; try { // Build parameter list of the searched method final List<Object> ...
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/ImageParser.java
ImageParser.processBufferedImage
private static void processBufferedImage(BufferedImage buffimage, String formatName, NodeList nodes) throws Exception { HashMap<Object, Object> bandMap = new HashMap<Object, Object>(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node....
java
private static void processBufferedImage(BufferedImage buffimage, String formatName, NodeList nodes) throws Exception { HashMap<Object, Object> bandMap = new HashMap<Object, Object>(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node....
[ "private", "static", "void", "processBufferedImage", "(", "BufferedImage", "buffimage", ",", "String", "formatName", ",", "NodeList", "nodes", ")", "throws", "Exception", "{", "HashMap", "<", "Object", ",", "Object", ">", "bandMap", "=", "new", "HashMap", "<", ...
/* Process buffered image obtained from Reader 2011-09-08 PwD added formatName param to support getBase64Data()
[ "/", "*", "Process", "buffered", "image", "obtained", "from", "Reader", "2011", "-", "09", "-", "08", "PwD", "added", "formatName", "param", "to", "support", "getBase64Data", "()" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/ImageParser.java#L194-L383
train
Process a buffered image.
Of course, here is the Java code you requested: ```java private static void processBufferedImage(BufferedImage buffimage, String formatName, NodeList nodes) throws Exception { HashMap<Object, Object> bandMap = new HashMap<Object, Object>(); for (int i = 0; i < nodes.getLength(); i++) { ...
Blazebit/blaze-utils
blaze-common-utils/src/main/java/com/blazebit/security/BCrypt.java
BCrypt.crypt_raw
private byte[] crypt_raw(final byte password[], final byte salt[], final int log_rounds) { int rounds, i, j; final int cdata[] = bf_crypt_ciphertext.clone(); final int clen = cdata.length; byte ret[]; if ((log_rounds < 4) || (log_rounds > 31)) { ...
java
private byte[] crypt_raw(final byte password[], final byte salt[], final int log_rounds) { int rounds, i, j; final int cdata[] = bf_crypt_ciphertext.clone(); final int clen = cdata.length; byte ret[]; if ((log_rounds < 4) || (log_rounds > 31)) { ...
[ "private", "byte", "[", "]", "crypt_raw", "(", "final", "byte", "password", "[", "]", ",", "final", "byte", "salt", "[", "]", ",", "final", "int", "log_rounds", ")", "{", "int", "rounds", ",", "i", ",", "j", ";", "final", "int", "cdata", "[", "]", ...
Perform the central password hashing step in the bcrypt scheme @param password the password to hash @param salt the binary salt to hash with the password @param log_rounds the binary logarithm of the number of rounds of hashing to apply @return an array containing the binary hashed password
[ "Perform", "the", "central", "password", "hashing", "step", "in", "the", "bcrypt", "scheme" ]
3e35a694a8f71d515aad066196acd523994d6aaa
https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/security/BCrypt.java#L558-L594
train
Crypt raw.
Of course, here is the Java code you requested: ```java private byte[] crypt_raw(final byte password[], final byte salt[], final int log_rounds) { int rounds, i, j; final int cdata[] = bf_crypt_ciphertext.clone(); final int clen = cdata.length; byte ret[]; ...
burberius/eve-esi
src/main/java/net/troja/eve/esi/api/BookmarksApi.java
BookmarksApi.getCorporationsCorporationIdBookmarksAsync
public com.squareup.okhttp.Call getCorporationsCorporationIdBookmarksAsync(Integer corporationId, String datasource, String ifNoneMatch, Integer page, String token, final ApiCallback<List<CorporationBookmarksResponse>> callback) throws ApiException { com.squareup.okhttp.Call call = getC...
java
public com.squareup.okhttp.Call getCorporationsCorporationIdBookmarksAsync(Integer corporationId, String datasource, String ifNoneMatch, Integer page, String token, final ApiCallback<List<CorporationBookmarksResponse>> callback) throws ApiException { com.squareup.okhttp.Call call = getC...
[ "public", "com", ".", "squareup", ".", "okhttp", ".", "Call", "getCorporationsCorporationIdBookmarksAsync", "(", "Integer", "corporationId", ",", "String", "datasource", ",", "String", "ifNoneMatch", ",", "Integer", "page", ",", "String", "token", ",", "final", "A...
List corporation bookmarks (asynchronously) A list of your corporation&#39;s bookmarks --- This route is cached for up to 3600 seconds SSO Scope: esi-bookmarks.read_corporation_bookmarks.v1 @param corporationId An EVE corporation ID (required) @param datasource The server name you would like data from (optional, defau...
[ "List", "corporation", "bookmarks", "(", "asynchronously", ")", "A", "list", "of", "your", "corporation&#39", ";", "s", "bookmarks", "---", "This", "route", "is", "cached", "for", "up", "to", "3600", "seconds", "SSO", "Scope", ":", "esi", "-", "bookmarks", ...
24a941c592cfc15f23471ef849b282fbc582ca13
https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/BookmarksApi.java#L584-L594
train
Get corporationId bookmarks. getAsync
Of course, here is the Java code you requested: ```java public com.squareup.okhttp.Call getCorporationsCorporationIdBookmarksAsync(Integer corporationId, String datasource, String ifNoneMatch, Integer page, String token, final ApiCallback<List<CorporationBookmarksResponse>> callback) throws Api...
lessthanoptimal/ejml
main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java
QrHelperFunctions_ZDRM.extractHouseholderRow
public static void extractHouseholderRow( ZMatrixRMaj A , int row , int col0, int col1 , double u[], int offsetU ) { int indexU = (offsetU+col0)*2; u[indexU] = 1; u[indexU+1] = 0; int index...
java
public static void extractHouseholderRow( ZMatrixRMaj A , int row , int col0, int col1 , double u[], int offsetU ) { int indexU = (offsetU+col0)*2; u[indexU] = 1; u[indexU+1] = 0; int index...
[ "public", "static", "void", "extractHouseholderRow", "(", "ZMatrixRMaj", "A", ",", "int", "row", ",", "int", "col0", ",", "int", "col1", ",", "double", "u", "[", "]", ",", "int", "offsetU", ")", "{", "int", "indexU", "=", "(", "offsetU", "+", "col0", ...
Extracts a house holder vector from the rows of A and stores it in u @param A Complex matrix with householder vectors stored in the upper right triangle @param row Row in A @param col0 first row in A (implicitly assumed to be r + i0) @param col1 last row +1 in A @param u Output array storage @param offsetU first index ...
[ "Extracts", "a", "house", "holder", "vector", "from", "the", "rows", "of", "A", "and", "stores", "it", "in", "u" ]
1444680cc487af5e866730e62f48f5f9636850d9
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java#L343-L353
train
Extracts the householder row from A
Of course, here is the Java code you requested: ```java public static void extractHouseholderRow( ZMatrixRMaj A , int row , int col0, int col1 , double u[], int offsetU ) { int indexU = (offsetU+col0)*2; u[i...
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java
JedisUtils.newJedisPool
public static JedisPool newJedisPool(JedisPoolConfig poolConfig, String hostAndPort, String password, int db, int timeoutMs) { String[] tokens = hostAndPort.split(":"); String host = tokens.length > 0 ? tokens[0] : Protocol.DEFAULT_HOST; int port = tokens.length > 1 ? Integer.parseIn...
java
public static JedisPool newJedisPool(JedisPoolConfig poolConfig, String hostAndPort, String password, int db, int timeoutMs) { String[] tokens = hostAndPort.split(":"); String host = tokens.length > 0 ? tokens[0] : Protocol.DEFAULT_HOST; int port = tokens.length > 1 ? Integer.parseIn...
[ "public", "static", "JedisPool", "newJedisPool", "(", "JedisPoolConfig", "poolConfig", ",", "String", "hostAndPort", ",", "String", "password", ",", "int", "db", ",", "int", "timeoutMs", ")", "{", "String", "[", "]", "tokens", "=", "hostAndPort", ".", "split",...
Create a new {@link JedisPool}. @param poolConfig @param hostAndPort format {@code host:port} or {@code host}, default Redis port is used if not specified @param password @param db @param timeoutMs @return
[ "Create", "a", "new", "{", "@link", "JedisPool", "}", "." ]
734f0e77321d41eeca78a557be9884df9874e46e
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java#L178-L187
train
Create a JedisPool with the specified configuration.
Of course, here is the Java code you requested: ```java public static JedisPool newJedisPool(JedisPoolConfig poolConfig, String hostAndPort, String password, int db, int timeoutMs) { String[] tokens = hostAndPort.split(":"); String host = tokens.length > 0 ? tokens[0] : Protocol.DEFAULT_HOS...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServices.java
TaskManagerServices.shutDown
public void shutDown() throws FlinkException { Exception exception = null; try { taskManagerStateStore.shutdown(); } catch (Exception e) { exception = e; } try { memoryManager.shutdown(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { ioMan...
java
public void shutDown() throws FlinkException { Exception exception = null; try { taskManagerStateStore.shutdown(); } catch (Exception e) { exception = e; } try { memoryManager.shutdown(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { ioMan...
[ "public", "void", "shutDown", "(", ")", "throws", "FlinkException", "{", "Exception", "exception", "=", "null", ";", "try", "{", "taskManagerStateStore", ".", "shutdown", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ...
Shuts the {@link TaskExecutor} services down.
[ "Shuts", "the", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServices.java#L164-L215
train
Shuts down the TaskManager services.
Of course, here is the Java code you requested: ```java public void shutDown() throws FlinkException { Exception exception = null; try { taskManagerStateStore.shutdown(); } catch (Exception e) { exception = e; } try { memoryManager.shutdown(); } catch (Exception e) { exception = ExceptionUti...
FasterXML/jackson-jr
jr-objects/src/main/java/com/fasterxml/jackson/jr/type/ResolvedType.java
ResolvedType.typeParametersFor
public List<ResolvedType> typeParametersFor(Class<?> erasedSupertype) { ResolvedType type = findSupertype(erasedSupertype); if (type != null) { return type.typeParams(); } return null; }
java
public List<ResolvedType> typeParametersFor(Class<?> erasedSupertype) { ResolvedType type = findSupertype(erasedSupertype); if (type != null) { return type.typeParams(); } return null; }
[ "public", "List", "<", "ResolvedType", ">", "typeParametersFor", "(", "Class", "<", "?", ">", "erasedSupertype", ")", "{", "ResolvedType", "type", "=", "findSupertype", "(", "erasedSupertype", ")", ";", "if", "(", "type", "!=", "null", ")", "{", "return", ...
Method that will try to find type parameterization this type has for specified super type @return List of type parameters for specified supertype (which may be empty, if supertype is not a parametric type); null if specified type is not a super type of this type
[ "Method", "that", "will", "try", "to", "find", "type", "parameterization", "this", "type", "has", "for", "specified", "super", "type" ]
62ca7a82bd90a9be77028e0b62364307d7532837
https://github.com/FasterXML/jackson-jr/blob/62ca7a82bd90a9be77028e0b62364307d7532837/jr-objects/src/main/java/com/fasterxml/jackson/jr/type/ResolvedType.java#L94-L100
train
Returns the type parameters for the specified class.
Of course, here is the Java code you requested: ```java public List<ResolvedType> typeParametersFor(Class<?> erasedSupertype) { ResolvedType type = findSupertype(erasedSupertype); if (type != null) { return type.typeParams(); } return null; } ``` Hope this helps!
streamsets/datacollector
hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/cache/HMSCache.java
HMSCache.put
public <T extends HMSCacheSupport.HMSCacheInfo> void put( HMSCacheType cacheType, String qualifiedTableName, T hmsCacheInfo ) throws StageException { if (!cacheMap.containsKey(cacheType)) { throw new StageException(Errors.HIVE_16, cacheType); } cacheMap.get(cacheType).put(qualified...
java
public <T extends HMSCacheSupport.HMSCacheInfo> void put( HMSCacheType cacheType, String qualifiedTableName, T hmsCacheInfo ) throws StageException { if (!cacheMap.containsKey(cacheType)) { throw new StageException(Errors.HIVE_16, cacheType); } cacheMap.get(cacheType).put(qualified...
[ "public", "<", "T", "extends", "HMSCacheSupport", ".", "HMSCacheInfo", ">", "void", "put", "(", "HMSCacheType", "cacheType", ",", "String", "qualifiedTableName", ",", "T", "hmsCacheInfo", ")", "throws", "StageException", "{", "if", "(", "!", "cacheMap", ".", "...
Puts/ updates the {@link HMSCache} with {@link HMSCacheSupport.HMSCacheInfo} for corresponding {@link HMSCacheType} and qualified table name. This method skips any locking provided by getOrLoad() and hence the caller code should not mix getOrLoad() and put() calls in the same code. @param cacheType {@link HMSCacheTyp...
[ "Puts", "/", "updates", "the", "{", "@link", "HMSCache", "}", "with", "{", "@link", "HMSCacheSupport", ".", "HMSCacheInfo", "}", "for", "corresponding", "{", "@link", "HMSCacheType", "}", "and", "qualified", "table", "name", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/hive-protolib/src/main/java/com/streamsets/pipeline/stage/lib/hive/cache/HMSCache.java#L169-L178
test
Put a single HMS CacheInfo into the cache.
Of course, here is the Java code you requested: ```java public <T extends HMSCacheSupport.HMSCacheInfo> void put( HMSCacheType cacheType, String qualifiedTableName, T hmsCacheInfo ) throws StageException { if (!cacheMap.containsKey(cacheType)) { throw new StageException(Errors.HIVE_16, ca...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java
ForkJoinPool.externalSubmit
private <T> ForkJoinTask<T> externalSubmit(ForkJoinTask<T> task) { Thread t; ForkJoinWorkerThread w; WorkQueue q; if (task == null) throw new NullPointerException(); if (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) && (w = (ForkJoinWorkerThread)t).pool =...
java
private <T> ForkJoinTask<T> externalSubmit(ForkJoinTask<T> task) { Thread t; ForkJoinWorkerThread w; WorkQueue q; if (task == null) throw new NullPointerException(); if (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) && (w = (ForkJoinWorkerThread)t).pool =...
[ "private", "<", "T", ">", "ForkJoinTask", "<", "T", ">", "externalSubmit", "(", "ForkJoinTask", "<", "T", ">", "task", ")", "{", "Thread", "t", ";", "ForkJoinWorkerThread", "w", ";", "WorkQueue", "q", ";", "if", "(", "task", "==", "null", ")", "throw",...
Pushes a possibly-external submission.
[ "Pushes", "a", "possibly", "-", "external", "submission", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java#L2553-L2564
train
External submit method.
Of course, here is the Java code you requested: ```java private <T> ForkJoinTask<T> externalSubmit(ForkJoinTask<T> task) { Thread t; ForkJoinWorkerThread w; WorkQueue q; if (task == null) throw new NullPointerException(); if (((t = Thread.currentThread()) instanceof ForkJoinWorkerTh...
r0adkll/PostOffice
library/src/main/java/com/r0adkll/postoffice/styles/EditTextStyle.java
EditTextStyle.applyDesign
@Override public void applyDesign(Design design, int themeColor) { Context ctx = mInputField.getContext(); int smallPadId = design.isMaterial() ? R.dimen.default_margin : R.dimen.default_margin_small; int largePadId = design.isMaterial() ? R.dimen.material_edittext_spacing : R.dimen.default...
java
@Override public void applyDesign(Design design, int themeColor) { Context ctx = mInputField.getContext(); int smallPadId = design.isMaterial() ? R.dimen.default_margin : R.dimen.default_margin_small; int largePadId = design.isMaterial() ? R.dimen.material_edittext_spacing : R.dimen.default...
[ "@", "Override", "public", "void", "applyDesign", "(", "Design", "design", ",", "int", "themeColor", ")", "{", "Context", "ctx", "=", "mInputField", ".", "getContext", "(", ")", ";", "int", "smallPadId", "=", "design", ".", "isMaterial", "(", ")", "?", "...
Apply a design to the style @param design the design, i.e. Holo, Material, Light, Dark
[ "Apply", "a", "design", "to", "the", "style" ]
f98e365fd66c004ccce64ee87d9f471b97e4e3c2
https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/EditTextStyle.java#L50-L82
train
Override the design to apply the theme color.
Of course, here is the Java code you requested: ```java @Override public void applyDesign(Design design, int themeColor) { Context ctx = mInputField.getContext(); int smallPadId = design.isMaterial() ? R.dimen.default_margin : R.dimen.default_margin_small; int largePadId = design.isMateria...
io7m/jcanephora
com.io7m.jcanephora.lwjgl3/src/main/java/com/io7m/jcanephora/lwjgl3/LWJGL3TypeConversions.java
LWJGL3TypeConversions.textureFilterMinFromGL
public static JCGLTextureFilterMinification textureFilterMinFromGL( final int min_filter) { switch (min_filter) { case GL11.GL_LINEAR: return JCGLTextureFilterMinification.TEXTURE_FILTER_LINEAR; case GL11.GL_NEAREST: return JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST; ...
java
public static JCGLTextureFilterMinification textureFilterMinFromGL( final int min_filter) { switch (min_filter) { case GL11.GL_LINEAR: return JCGLTextureFilterMinification.TEXTURE_FILTER_LINEAR; case GL11.GL_NEAREST: return JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST; ...
[ "public", "static", "JCGLTextureFilterMinification", "textureFilterMinFromGL", "(", "final", "int", "min_filter", ")", "{", "switch", "(", "min_filter", ")", "{", "case", "GL11", ".", "GL_LINEAR", ":", "return", "JCGLTextureFilterMinification", ".", "TEXTURE_FILTER_LINE...
Convert filters from GL constants. @param min_filter The GL constant. @return The value.
[ "Convert", "filters", "from", "GL", "constants", "." ]
0004c1744b7f0969841d04cd4fa693f402b10980
https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.lwjgl3/src/main/java/com/io7m/jcanephora/lwjgl3/LWJGL3TypeConversions.java#L834-L857
train
Get the texture filter from GL constants.
Of course, here is the Java code you requested: ```java public static JCGLTextureFilterMinification textureFilterMinFromGL( final int min_filter) { switch (min_filter) { case GL11.GL_LINEAR: return JCGLTextureFilterMinification.TEXTURE_FILTER_LINEAR; case GL11.GL_NEAREST: return J...
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/ResultSetResult.java
ResultSetResult.getColumnCount
@Override public int getColumnCount() { int count = 0; try { count = resultSet.getMetaData().getColumnCount(); } catch (SQLException e) { throw new GeoPackageException( "Failed to get ResultSet column count", e); } return count; }
java
@Override public int getColumnCount() { int count = 0; try { count = resultSet.getMetaData().getColumnCount(); } catch (SQLException e) { throw new GeoPackageException( "Failed to get ResultSet column count", e); } return count; }
[ "@", "Override", "public", "int", "getColumnCount", "(", ")", "{", "int", "count", "=", "0", ";", "try", "{", "count", "=", "resultSet", ".", "getMetaData", "(", ")", ".", "getColumnCount", "(", ")", ";", "}", "catch", "(", "SQLException", "e", ")", ...
{@inheritDoc}
[ "{" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/ResultSetResult.java#L116-L126
train
Get the number of columns in the ResultSet
Of course, here is the Java code you requested: ```java @Override public int getColumnCount() { int count = 0; try { count = resultSet.getMetaData().getColumnCount(); } catch (SQLException e) { throw new GeoPackageException( "Failed to get ResultSet column count", e); } return count; } ``` Hope...
kejunxia/AndroidMvc
library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/MvcFragment.java
MvcFragment.registerOnViewReadyListener
public void registerOnViewReadyListener(Runnable action) { if (onViewReadyListeners == null) { onViewReadyListeners = new CopyOnWriteArrayList<>(); } onViewReadyListeners.add(action); }
java
public void registerOnViewReadyListener(Runnable action) { if (onViewReadyListeners == null) { onViewReadyListeners = new CopyOnWriteArrayList<>(); } onViewReadyListeners.add(action); }
[ "public", "void", "registerOnViewReadyListener", "(", "Runnable", "action", ")", "{", "if", "(", "onViewReadyListeners", "==", "null", ")", "{", "onViewReadyListeners", "=", "new", "CopyOnWriteArrayList", "<>", "(", ")", ";", "}", "onViewReadyListeners", ".", "add...
Register a callback after {@link #onViewReady(View, Bundle, Reason)} is called. This is useful when an action that can't be executed after the fragment is instantiated but before the fragment has gone through life cycles and gets created and ready to use. If this is one time action, use {@link #unregisterOnViewReadyLis...
[ "Register", "a", "callback", "after", "{", "@link", "#onViewReady", "(", "View", "Bundle", "Reason", ")", "}", "is", "called", ".", "This", "is", "useful", "when", "an", "action", "that", "can", "t", "be", "executed", "after", "the", "fragment", "is", "i...
c7893f0a13119d64297b9eb2988f7323b7da5bbc
https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/MvcFragment.java#L472-L477
train
Register an action to be invoked when the application is ready to be used.
Of course, here is the Java code you requested: ```java public void registerOnViewReadyListener(Runnable action) { if (onViewReadyListeners == null) { onViewReadyListeners = new CopyOnWriteArrayList<>(); } onViewReadyListeners.add(action); } ``` Hope this helps!
cdk/cdk
base/core/src/main/java/org/openscience/cdk/DynamicFactory.java
DynamicFactory.register
public <S extends ICDKObject, T extends S> boolean register(Class<S> intf, Constructor<T> constructor) { return register(intf, constructor, null); }
java
public <S extends ICDKObject, T extends S> boolean register(Class<S> intf, Constructor<T> constructor) { return register(intf, constructor, null); }
[ "public", "<", "S", "extends", "ICDKObject", ",", "T", "extends", "S", ">", "boolean", "register", "(", "Class", "<", "S", ">", "intf", ",", "Constructor", "<", "T", ">", "constructor", ")", "{", "return", "register", "(", "intf", ",", "constructor", "...
Register a specific constructor with an explicit interface. <pre>{@code // only register construction of IAtom using a string - Atom("C") factory.register(IAtom.class, Atom.class.getConstructor(String.class)); }</pre> @param intf the interface @param constructor a constructor which builds the given interface @...
[ "Register", "a", "specific", "constructor", "with", "an", "explicit", "interface", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/DynamicFactory.java#L352-L354
train
Register an interface with a constructor.
Of course, here is the Java code you requested: ```java public <S extends ICDKObject, T extends S> boolean register(Class<S> intf, Constructor<T> constructor) { return register(intf, constructor, null); } ``` Hope this helps!
ironjacamar/ironjacamar
common/src/main/java/org/ironjacamar/common/spi/annotations/repository/AnnotationScannerFactory.java
AnnotationScannerFactory.getAnnotationScanner
public static AnnotationScanner getAnnotationScanner() { if (active != null) return active; if (defaultImplementation == null) throw new IllegalStateException(bundle.noAnnotationScanner()); return defaultImplementation; }
java
public static AnnotationScanner getAnnotationScanner() { if (active != null) return active; if (defaultImplementation == null) throw new IllegalStateException(bundle.noAnnotationScanner()); return defaultImplementation; }
[ "public", "static", "AnnotationScanner", "getAnnotationScanner", "(", ")", "{", "if", "(", "active", "!=", "null", ")", "return", "active", ";", "if", "(", "defaultImplementation", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "bundle", ".", ...
Get the annotation scanner @return The scanner
[ "Get", "the", "annotation", "scanner" ]
f0389ee7e62aa8b40ba09b251edad76d220ea796
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/spi/annotations/repository/AnnotationScannerFactory.java#L75-L84
train
Get the AnnotationScanner object.
Of course, here is the Java code you requested: ```java public static AnnotationScanner getAnnotationScanner() { if (active != null) return active; if (defaultImplementation == null) throw new IllegalStateException(bundle.noAnnotationScanner()); return defaultImplementation; ...
spring-cloud/spring-cloud-config
spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientWatch.java
ConfigClientWatch.stateChanged
boolean stateChanged(String oldState, String newState) { return (!hasText(oldState) && hasText(newState)) || (hasText(oldState) && !oldState.equals(newState)); }
java
boolean stateChanged(String oldState, String newState) { return (!hasText(oldState) && hasText(newState)) || (hasText(oldState) && !oldState.equals(newState)); }
[ "boolean", "stateChanged", "(", "String", "oldState", ",", "String", "newState", ")", "{", "return", "(", "!", "hasText", "(", "oldState", ")", "&&", "hasText", "(", "newState", ")", ")", "||", "(", "hasText", "(", "oldState", ")", "&&", "!", "oldState",...
/* for testing
[ "/", "*", "for", "testing" ]
6b99631f78bac4e1b521d2cc126c8b2da45d1f1f
https://github.com/spring-cloud/spring-cloud-config/blob/6b99631f78bac4e1b521d2cc126c8b2da45d1f1f/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientWatch.java#L75-L78
train
Check if the state of the node has changed.
Of course, here is the Java code you requested: ```java boolean stateChanged(String oldState, String newState) { return (!hasText(oldState) && hasText(newState)) || (hasText(oldState) && !oldState.equals(newState)); } ``` Hope this helps!
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java
Ifc2x3tc1PackageImpl.getIfcFurnitureType
public EClass getIfcFurnitureType() { if (ifcFurnitureTypeEClass == null) { ifcFurnitureTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(262); } return ifcFurnitureTypeEClass; }
java
public EClass getIfcFurnitureType() { if (ifcFurnitureTypeEClass == null) { ifcFurnitureTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(262); } return ifcFurnitureTypeEClass; }
[ "public", "EClass", "getIfcFurnitureType", "(", ")", "{", "if", "(", "ifcFurnitureTypeEClass", "==", "null", ")", "{", "ifcFurnitureTypeEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "Ifc2x3tc1Package", "...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L16059-L16065
train
Get the IfcFurnitureType resource.
Of course, here is the Java code you requested: ```java public EClass getIfcFurnitureType() { if (ifcFurnitureTypeEClass == null) { ifcFurnitureTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(262); } return ifcFurnitureTypeEClass; } ```...
real-logic/aeron
aeron-driver/src/main/java/io/aeron/driver/PublicationImage.java
PublicationImage.onGapDetected
public void onGapDetected(final int termId, final int termOffset, final int length) { final long changeNumber = beginLossChange + 1; beginLossChange = changeNumber; lossTermId = termId; lossTermOffset = termOffset; lossLength = length; endLossChange = changeNumber;...
java
public void onGapDetected(final int termId, final int termOffset, final int length) { final long changeNumber = beginLossChange + 1; beginLossChange = changeNumber; lossTermId = termId; lossTermOffset = termOffset; lossLength = length; endLossChange = changeNumber;...
[ "public", "void", "onGapDetected", "(", "final", "int", "termId", ",", "final", "int", "termOffset", ",", "final", "int", "length", ")", "{", "final", "long", "changeNumber", "=", "beginLossChange", "+", "1", ";", "beginLossChange", "=", "changeNumber", ";", ...
Called from the {@link LossDetector} when gap is detected by the {@link DriverConductor} thread. {@inheritDoc}
[ "Called", "from", "the", "{", "@link", "LossDetector", "}", "when", "gap", "is", "detected", "by", "the", "{", "@link", "DriverConductor", "}", "thread", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-driver/src/main/java/io/aeron/driver/PublicationImage.java#L339-L365
test
On gap detected.
Of course, here is the Java code you requested: ```java public void onGapDetected(final int termId, final int termOffset, final int length) { final long changeNumber = beginLossChange + 1; beginLossChange = changeNumber; lossTermId = termId; lossTermOffset = termOffset; lo...
HeidelTime/heideltime
src/jvntextpro/JVnTextPro.java
JVnTextPro.posTagging
public String posTagging(String text){ String ret = text; if (vnPosTagger != null){ ret = vnPosTagger.tagging(text); } return ret; }
java
public String posTagging(String text){ String ret = text; if (vnPosTagger != null){ ret = vnPosTagger.tagging(text); } return ret; }
[ "public", "String", "posTagging", "(", "String", "text", ")", "{", "String", "ret", "=", "text", ";", "if", "(", "vnPosTagger", "!=", "null", ")", "{", "ret", "=", "vnPosTagger", ".", "tagging", "(", "text", ")", ";", "}", "return", "ret", ";", "}" ]
Do pos tagging. @param text to be tagged with POS of speech (need to have words segmented) @return the string
[ "Do", "pos", "tagging", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/JVnTextPro.java#L253-L260
train
This method is used to determine if a VN POS tagging is available.
Of course, here is the Java code you requested: ```java public String posTagging(String text){ String ret = text; if (vnPosTagger != null){ ret = vnPosTagger.tagging(text); } return ret; } ``` Hope this helps!
eFaps/eFaps-WebApp
src/main/java/org/efaps/ui/wicket/connectionregistry/RegistryManager.java
RegistryManager.registerUserSession
public static void registerUserSession(final String _userName, final String _sessionId) { if (EFapsApplication.getMaxInactiveInterval() > 0) { RegistryManager.getCache().put(_sessionId, new UserSession().setUserName(_userName...
java
public static void registerUserSession(final String _userName, final String _sessionId) { if (EFapsApplication.getMaxInactiveInterval() > 0) { RegistryManager.getCache().put(_sessionId, new UserSession().setUserName(_userName...
[ "public", "static", "void", "registerUserSession", "(", "final", "String", "_userName", ",", "final", "String", "_sessionId", ")", "{", "if", "(", "EFapsApplication", ".", "getMaxInactiveInterval", "(", ")", ">", "0", ")", "{", "RegistryManager", ".", "getCache"...
Register user session. @param _userName the user name @param _sessionId the session ID
[ "Register", "user", "session", "." ]
785c1aba0860dd65c673f123214fbe8c24ebdb17
https://github.com/eFaps/eFaps-WebApp/blob/785c1aba0860dd65c673f123214fbe8c24ebdb17/src/main/java/org/efaps/ui/wicket/connectionregistry/RegistryManager.java#L87-L99
valid
Register a user session.
Of course, here is the Java code you requested: ```java public static void registerUserSession(final String _userName, final String _sessionId) { if (EFapsApplication.getMaxInactiveInterval() > 0) { RegistryManager.getCache().put(_sessionId, ...
alipay/sofa-rpc
core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterChain.java
FilterChain.parseExcludeFilter
private static HashSet<String> parseExcludeFilter(List<Filter> customFilters) { HashSet<String> excludeKeys = new HashSet<String>(); if (CommonUtils.isNotEmpty(customFilters)) { for (Filter filter : customFilters) { if (filter instanceof ExcludeFilter) { /...
java
private static HashSet<String> parseExcludeFilter(List<Filter> customFilters) { HashSet<String> excludeKeys = new HashSet<String>(); if (CommonUtils.isNotEmpty(customFilters)) { for (Filter filter : customFilters) { if (filter instanceof ExcludeFilter) { /...
[ "private", "static", "HashSet", "<", "String", ">", "parseExcludeFilter", "(", "List", "<", "Filter", ">", "customFilters", ")", "{", "HashSet", "<", "String", ">", "excludeKeys", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "if", "(", "Comm...
判断是否需要排除自定义过滤器 @param customFilters 自定义filter列表 @return 需要排除的过滤器的key列表
[ "判断是否需要排除自定义过滤器" ]
a31406410291e56696185a29c3ba4bd1f54488fd
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterChain.java#L227-L253
train
Parse exclude filters.
Of course, here is the Java code you requested: ```java private static HashSet<String> parseExcludeFilter(List<Filter> customFilters) { HashSet<String> excludeKeys = new HashSet<String>(); if (CommonUtils.isNotEmpty(customFilters)) { for (Filter filter : customFilters) { if ...
ArcBees/gwtquery
gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java
JsUtils.runJavascriptFunction
public static <T> T runJavascriptFunction(JavaScriptObject o, String meth, Object... args) { return runJavascriptFunctionImpl(o, meth, JsObjectArray.create().add(args).<JsArrayMixed>cast()); }
java
public static <T> T runJavascriptFunction(JavaScriptObject o, String meth, Object... args) { return runJavascriptFunctionImpl(o, meth, JsObjectArray.create().add(args).<JsArrayMixed>cast()); }
[ "public", "static", "<", "T", ">", "T", "runJavascriptFunction", "(", "JavaScriptObject", "o", ",", "String", "meth", ",", "Object", "...", "args", ")", "{", "return", "runJavascriptFunctionImpl", "(", "o", ",", "meth", ",", "JsObjectArray", ".", "create", "...
Call via jsni any arbitrary function present in a Javascript object. It's thought for avoiding to create jsni methods to call external functions and facilitate the writing of js wrappers. Example <pre> // Create a svg node in our document. Element svg = runJavascriptFunction(document, "createElementNS", "http://www.w...
[ "Call", "via", "jsni", "any", "arbitrary", "function", "present", "in", "a", "Javascript", "object", "." ]
93e02bc8eb030081061c56134ebee1f585981107
https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L593-L595
train
Run a javascript function on a JavaScript object.
Of course, here is the Java code you requested: ```java public static <T> T runJavascriptFunction(JavaScriptObject o, String meth, Object... args) { return runJavascriptFunctionImpl(o, meth, JsObjectArray.create().add(args).<JsArrayMixed>cast()); } ``` Hope this helps!
h2oai/h2o-2
src/main/java/hex/gbm/DTreeUtils.java
DTreeUtils.scoreTree
public static void scoreTree(double data[], float preds[], CompressedTree[] ts) { for( int c=0; c<ts.length; c++ ) if( ts[c] != null ) preds[ts.length==1?0:c+1] += ts[c].score(data); }
java
public static void scoreTree(double data[], float preds[], CompressedTree[] ts) { for( int c=0; c<ts.length; c++ ) if( ts[c] != null ) preds[ts.length==1?0:c+1] += ts[c].score(data); }
[ "public", "static", "void", "scoreTree", "(", "double", "data", "[", "]", ",", "float", "preds", "[", "]", ",", "CompressedTree", "[", "]", "ts", ")", "{", "for", "(", "int", "c", "=", "0", ";", "c", "<", "ts", ".", "length", ";", "c", "++", ")...
Score given tree on the row of data. @param data row of data @param preds array to hold resulting prediction @param ts a tree representation (single regression tree, or multi tree)
[ "Score", "given", "tree", "on", "the", "row", "of", "data", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/DTreeUtils.java#L15-L19
train
Score a tree.
Of course, here is the Java code you requested: ```java public static void scoreTree(double data[], float preds[], CompressedTree[] ts) { for( int c=0; c<ts.length; c++ ) if( ts[c] != null ) preds[ts.length==1?0:c+1] += ts[c].score(data); } ``` Hope this helps!
play2-maven-plugin/play2-maven-plugin
play2-providers/play2-provider-play23/src/main/java/com/google/code/play2/provider/play23/Play23LessCompiler.java
Play23LessCompiler.readContent
public static String readContent( File file ) throws IOException { String result = null; BufferedReader is = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); try { StringBuilder sb = new StringBuilder(); String line...
java
public static String readContent( File file ) throws IOException { String result = null; BufferedReader is = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); try { StringBuilder sb = new StringBuilder(); String line...
[ "public", "static", "String", "readContent", "(", "File", "file", ")", "throws", "IOException", "{", "String", "result", "=", "null", ";", "BufferedReader", "is", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "new", "FileInputStream", "(", ...
Called from Less script, must be "public"
[ "Called", "from", "Less", "script", "must", "be", "public" ]
34e174b02c4245cfad64abd230f3cbeda9d9b2f4
https://github.com/play2-maven-plugin/play2-maven-plugin/blob/34e174b02c4245cfad64abd230f3cbeda9d9b2f4/play2-providers/play2-provider-play23/src/main/java/com/google/code/play2/provider/play23/Play23LessCompiler.java#L214-L236
test
read content of a file into a String
Of course, here is the Java code you requested: ```java public static String readContent( File file ) throws IOException { String result = null; BufferedReader is = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); try { String...
google/error-prone
check_api/src/main/java/com/google/errorprone/dataflow/DataFlow.java
DataFlow.methodDataflow
private static <A extends AbstractValue<A>, S extends Store<S>, T extends TransferFunction<A, S>> Result<A, S, T> methodDataflow(TreePath methodPath, Context context, T transfer) { final ProcessingEnvironment env = JavacProcessingEnvironment.instance(context); final ControlFlowGraph cfg; try { ...
java
private static <A extends AbstractValue<A>, S extends Store<S>, T extends TransferFunction<A, S>> Result<A, S, T> methodDataflow(TreePath methodPath, Context context, T transfer) { final ProcessingEnvironment env = JavacProcessingEnvironment.instance(context); final ControlFlowGraph cfg; try { ...
[ "private", "static", "<", "A", "extends", "AbstractValue", "<", "A", ">", ",", "S", "extends", "Store", "<", "S", ">", ",", "T", "extends", "TransferFunction", "<", "A", ",", "S", ">", ">", "Result", "<", "A", ",", "S", ",", "T", ">", "methodDatafl...
Run the {@code transfer} dataflow analysis over the method or lambda which is the leaf of the {@code methodPath}. <p>For caching, we make the following assumptions: - if two paths to methods are {@code equal}, their control flow graph is the same. - if two transfer functions are {@code equal}, and are run over the sam...
[ "Run", "the", "{", "@code", "transfer", "}", "dataflow", "analysis", "over", "the", "method", "or", "lambda", "which", "is", "the", "leaf", "of", "the", "{", "@code", "methodPath", "}", "." ]
fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/dataflow/DataFlow.java#L162-L187
train
Method dataflow.
Of course, here is the Java code you requested: ```java private static <A extends AbstractValue<A>, S extends Store<S>, T extends TransferFunction<A, S>> Result<A, S, T> methodDataflow(TreePath methodPath, Context context, T transfer) { final ProcessingEnvironment env = JavacProcessingEnvironment.instance(co...
knightliao/apollo
src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java
DateUtils.isOverlay
public static boolean isOverlay(String date1StartStr, String date1EndStr, String date2StartStr, String date2EndStr, String patten) { Date date1Start = DateUtils.parseDate(date1StartStr, patten); Date date1End = DateUtils.parseDate(date1EndStr, patten); Date da...
java
public static boolean isOverlay(String date1StartStr, String date1EndStr, String date2StartStr, String date2EndStr, String patten) { Date date1Start = DateUtils.parseDate(date1StartStr, patten); Date date1End = DateUtils.parseDate(date1EndStr, patten); Date da...
[ "public", "static", "boolean", "isOverlay", "(", "String", "date1StartStr", ",", "String", "date1EndStr", ",", "String", "date2StartStr", ",", "String", "date2EndStr", ",", "String", "patten", ")", "{", "Date", "date1Start", "=", "DateUtils", ".", "parseDate", "...
校验两段时间是否有重合 @param date1StartStr 时间段1开始 @param date1EndStr 时间段1结束 @param date2StartStr 时间段2开始 @param date2EndStr 时间段2结束 @param patten @return <p/> <code>true</code>:有重合 <p/> <code>false</code>:无重合
[ "校验两段时间是否有重合" ]
d7a283659fa3e67af6375db8969b2d065a8ce6eb
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java#L1151-L1158
train
Check if the two date strings are overlay.
Of course, here is the Java code you requested: ```java public static boolean isOverlay(String date1StartStr, String date1EndStr, String date2StartStr, String date2EndStr, String patten) { Date date1Start = DateUtils.parseDate(date1StartStr, patten); Date date1End = ...
3redronin/mu-server
src/main/java/io/muserver/ParameterizedHeader.java
ParameterizedHeader.fromString
public static ParameterizedHeader fromString(String input) { if (input == null || input.trim().isEmpty()) { return new ParameterizedHeader(emptyMap()); } StringBuilder buffer = new StringBuilder(); Map<String, String> parameters = new LinkedHashMap<>(); // keeps insertion or...
java
public static ParameterizedHeader fromString(String input) { if (input == null || input.trim().isEmpty()) { return new ParameterizedHeader(emptyMap()); } StringBuilder buffer = new StringBuilder(); Map<String, String> parameters = new LinkedHashMap<>(); // keeps insertion or...
[ "public", "static", "ParameterizedHeader", "fromString", "(", "String", "input", ")", "{", "if", "(", "input", "==", "null", "||", "input", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "new", "ParameterizedHeader", "(", "emptyMap", ...
<p>Converts a comma-separated list of param names (with optional values) into a Parameterized Header</p> <p>Null or blank strings return value with an empty parameter map.</p> @param input The value to parse @return An object containing a map of name/value pairs (where values may be null) @throws IllegalArgumentExcepti...
[ "<p", ">", "Converts", "a", "comma", "-", "separated", "list", "of", "param", "names", "(", "with", "optional", "values", ")", "into", "a", "Parameterized", "Header<", "/", "p", ">", "<p", ">", "Null", "or", "blank", "strings", "return", "value", "with",...
51598606a3082a121fbd785348ee9770b40308e6
https://github.com/3redronin/mu-server/blob/51598606a3082a121fbd785348ee9770b40308e6/src/main/java/io/muserver/ParameterizedHeader.java#L77-L159
train
Parses a string of parameters.
Of course, here is the Java code you requested: ```java public static ParameterizedHeader fromString(String input) { if (input == null || input.trim().isEmpty()) { return new ParameterizedHeader(emptyMap()); } StringBuilder buffer = new StringBuilder(); Map<String, String> ...
jinahya/database-metadata-bind
src/main/java/com/github/jinahya/database/metadata/bind/MetadataContext.java
MetadataContext.getTypeInfo
public List<TypeInfo> getTypeInfo() throws SQLException { final List<TypeInfo> list = new ArrayList<>(); try (ResultSet results = databaseMetadata.getTypeInfo()) { if (results != null) { bind(results, TypeInfo.class, list); } } return list; }
java
public List<TypeInfo> getTypeInfo() throws SQLException { final List<TypeInfo> list = new ArrayList<>(); try (ResultSet results = databaseMetadata.getTypeInfo()) { if (results != null) { bind(results, TypeInfo.class, list); } } return list; }
[ "public", "List", "<", "TypeInfo", ">", "getTypeInfo", "(", ")", "throws", "SQLException", "{", "final", "List", "<", "TypeInfo", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "(", "ResultSet", "results", "=", "databaseMetadata", ".", ...
Invokes {@link DatabaseMetaData#getTypeInfo()} and returns bound information. @return a list of type info @throws SQLException if a database error occurs.
[ "Invokes", "{", "@link", "DatabaseMetaData#getTypeInfo", "()", "}", "and", "returns", "bound", "information", "." ]
94fc9f9c85149c30dcfd10434f475d8332eedf76
https://github.com/jinahya/database-metadata-bind/blob/94fc9f9c85149c30dcfd10434f475d8332eedf76/src/main/java/com/github/jinahya/database/metadata/bind/MetadataContext.java#L784-L792
train
Gets the type info.
Of course, here is the Java code you requested: ```java public List<TypeInfo> getTypeInfo() throws SQLException { final List<TypeInfo> list = new ArrayList<>(); try (ResultSet results = databaseMetadata.getTypeInfo()) { if (results != null) { bind(results, TypeInfo.class, li...
aws/aws-sdk-java
aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/transform/JobOutputMarshaller.java
JobOutputMarshaller.marshall
public void marshall(JobOutput jobOutput, ProtocolMarshaller protocolMarshaller) { if (jobOutput == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(jobOutput.getId(), ID_BINDING); protocol...
java
public void marshall(JobOutput jobOutput, ProtocolMarshaller protocolMarshaller) { if (jobOutput == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(jobOutput.getId(), ID_BINDING); protocol...
[ "public", "void", "marshall", "(", "JobOutput", "jobOutput", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "jobOutput", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshall(...)\"", ")", ";",...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/transform/JobOutputMarshaller.java#L83-L114
train
marshalls the specified JobOutput to the JSON object.
Of course, here is the Java code you requested: ```java public void marshall(JobOutput jobOutput, ProtocolMarshaller protocolMarshaller) { if (jobOutput == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.mars...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AbstractLockedMessageEnumeration.java
AbstractLockedMessageEnumeration.addNewMessage
void addNewMessage(JsMessageWrapper message, boolean isStored, boolean isRecoverable) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addNewMessage", new Object[] { new Integer(hashCode()), message, ...
java
void addNewMessage(JsMessageWrapper message, boolean isStored, boolean isRecoverable) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addNewMessage", new Object[] { new Integer(hashCode()), message, ...
[ "void", "addNewMessage", "(", "JsMessageWrapper", "message", ",", "boolean", "isStored", ",", "boolean", "isRecoverable", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", "....
Add a new message to te end of the LME @param id @param message @param isStored @param isRecoverable @throws SIResourceException
[ "Add", "a", "new", "message", "to", "te", "end", "of", "the", "LME" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AbstractLockedMessageEnumeration.java#L360-L488
train
Add a new message to the message pool.
Of course, here is the Java code you requested: ```java void addNewMessage(JsMessageWrapper message, boolean isStored, boolean isRecoverable) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addNewMessage", new Object[] { new Integer(ha...
josueeduardo/snappy
plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/jar/JarFile.java
JarFile.getUrl
public URL getUrl() throws MalformedURLException { if (this.url == null) { Handler handler = new Handler(this); String file = this.rootFile.getFile().toURI() + this.pathFromRoot + "!/"; file = file.replace("file:////", "file://"); // Fix UNC paths this.url = new U...
java
public URL getUrl() throws MalformedURLException { if (this.url == null) { Handler handler = new Handler(this); String file = this.rootFile.getFile().toURI() + this.pathFromRoot + "!/"; file = file.replace("file:////", "file://"); // Fix UNC paths this.url = new U...
[ "public", "URL", "getUrl", "(", ")", "throws", "MalformedURLException", "{", "if", "(", "this", ".", "url", "==", "null", ")", "{", "Handler", "handler", "=", "new", "Handler", "(", "this", ")", ";", "String", "file", "=", "this", ".", "rootFile", ".",...
Return a URL that can be used to access this JAR file. NOTE: the specified URL cannot be serialized and or cloned. @return the URL @throws MalformedURLException if the URL is malformed
[ "Return", "a", "URL", "that", "can", "be", "used", "to", "access", "this", "JAR", "file", ".", "NOTE", ":", "the", "specified", "URL", "cannot", "be", "serialized", "and", "or", "cloned", "." ]
d95a9e811eda3c24a5e53086369208819884fa49
https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/jar/JarFile.java#L452-L460
train
Gets the URL of the jar file.
Of course, here is the Java code you requested: ```java public URL getUrl() throws MalformedURLException { if (this.url == null) { Handler handler = new Handler(this); String file = this.rootFile.getFile().toURI() + this.pathFromRoot + "!/"; file = file.replace("file:////", ...
OpenLiberty/open-liberty
dev/com.ibm.ws.security.jaas.common/src/com/ibm/ws/security/jaas/common/internal/JAASLoginContextEntryImpl.java
JAASLoginContextEntryImpl.setJaasLoginModuleConfig
@Reference(cardinality = ReferenceCardinality.MULTIPLE) protected void setJaasLoginModuleConfig(JAASLoginModuleConfig lmc, Map<String, Object> props) { String pid = (String) props.get(KEY_SERVICE_PID); loginModuleMap.put(pid, lmc); }
java
@Reference(cardinality = ReferenceCardinality.MULTIPLE) protected void setJaasLoginModuleConfig(JAASLoginModuleConfig lmc, Map<String, Object> props) { String pid = (String) props.get(KEY_SERVICE_PID); loginModuleMap.put(pid, lmc); }
[ "@", "Reference", "(", "cardinality", "=", "ReferenceCardinality", ".", "MULTIPLE", ")", "protected", "void", "setJaasLoginModuleConfig", "(", "JAASLoginModuleConfig", "lmc", ",", "Map", "<", "String", ",", "Object", ">", "props", ")", "{", "String", "pid", "=",...
SINCE THIS IS A STATIC REFERENCE DS provides enough synchronization so that we don't need to synchronize on the map.
[ "SINCE", "THIS", "IS", "A", "STATIC", "REFERENCE", "DS", "provides", "enough", "synchronization", "so", "that", "we", "don", "t", "need", "to", "synchronize", "on", "the", "map", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaas.common/src/com/ibm/ws/security/jaas/common/internal/JAASLoginContextEntryImpl.java#L55-L59
train
Sets the JAAS login module configuration.
Of course, here is the Java code you requested: ```java @Reference(cardinality = ReferenceCardinality.MULTIPLE) protected void setJaasLoginModuleConfig(JAASLoginModuleConfig lmc, Map<String, Object> props) { String pid = (String) props.get(KEY_SERVICE_PID); loginModuleMap.put(pid, lmc); } ``` ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/serialization/types/ODateTimeSerializer.java
ODateTimeSerializer.deserializeFromByteBufferObject
@Override public Date deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) { final Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(walChanges.getLongValue(buffer, offset)); return calendar.getTime(); }
java
@Override public Date deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) { final Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(walChanges.getLongValue(buffer, offset)); return calendar.getTime(); }
[ "@", "Override", "public", "Date", "deserializeFromByteBufferObject", "(", "ByteBuffer", "buffer", ",", "OWALChanges", "walChanges", ",", "int", "offset", ")", "{", "final", "Calendar", "calendar", "=", "Calendar", ".", "getInstance", "(", ")", ";", "calendar", ...
{@inheritDoc}
[ "{" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/serialization/types/ODateTimeSerializer.java#L125-L130
test
Deserialize a Date from a ByteBuffer object.
Of course, here is the Java code you requested: ```java @Override public Date deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) { final Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(walChanges.getLongValue(buffer, offset)); return calendar.getTi...
zaproxy/zaproxy
src/org/parosproxy/paros/view/SessionGeneralPanel.java
SessionGeneralPanel.getPanelSession
private JPanel getPanelSession() { if (panelSession == null) { panelSession = new JPanel(); panelSession.setLayout(new GridBagLayout()); panelSession.setName(Constant.messages.getString("session.general")); if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) { ...
java
private JPanel getPanelSession() { if (panelSession == null) { panelSession = new JPanel(); panelSession.setLayout(new GridBagLayout()); panelSession.setName(Constant.messages.getString("session.general")); if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) { ...
[ "private", "JPanel", "getPanelSession", "(", ")", "{", "if", "(", "panelSession", "==", "null", ")", "{", "panelSession", "=", "new", "JPanel", "(", ")", ";", "panelSession", ".", "setLayout", "(", "new", "GridBagLayout", "(", ")", ")", ";", "panelSession"...
This method initializes panelSession @return javax.swing.JPanel
[ "This", "method", "initializes", "panelSession" ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/SessionGeneralPanel.java#L81-L103
train
This method initializes panelSession
Of course, here is the Java code you requested: ```java private JPanel getPanelSession() { if (panelSession == null) { panelSession = new JPanel(); panelSession.setLayout(new GridBagLayout()); panelSession.setName(Constant.messages.getString("session.general")); if (Model.getSingleton().getOption...
googleapis/google-cloud-java
google-api-grpc/proto-google-cloud-datalabeling-v1beta1/src/main/java/com/google/cloud/datalabeling/v1beta1/LabelOperationMetadata.java
LabelOperationMetadata.getVideoEventDetails
public com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata getVideoEventDetails() { if (detailsCase_ == 8) { return (com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata) details_; } return com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadat...
java
public com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata getVideoEventDetails() { if (detailsCase_ == 8) { return (com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata) details_; } return com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadat...
[ "public", "com", ".", "google", ".", "cloud", ".", "datalabeling", ".", "v1beta1", ".", "LabelVideoEventOperationMetadata", "getVideoEventDetails", "(", ")", "{", "if", "(", "detailsCase_", "==", "8", ")", "{", "return", "(", "com", ".", "google", ".", "clou...
<code> .google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata video_event_details = 8; </code>
[ "<code", ">", ".", "google", ".", "cloud", ".", "datalabeling", ".", "v1beta1", ".", "LabelVideoEventOperationMetadata", "video_event_details", "=", "8", ";", "<", "/", "code", ">" ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-api-grpc/proto-google-cloud-datalabeling-v1beta1/src/main/java/com/google/cloud/datalabeling/v1beta1/LabelOperationMetadata.java#L957-L964
train
Gets the value of the videoEventDetails property.
Of course, here is the Java code you requested: ```java public com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata getVideoEventDetails() { if (detailsCase_ == 8) { return (com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata) details_; } return com.google.c...
cocoahero/android-geojson
androidgeojson/src/main/java/com/cocoahero/android/geojson/GeoJSONObject.java
GeoJSONObject.readParcel
protected static GeoJSONObject readParcel(Parcel parcel) { String json = parcel.readString(); try { return GeoJSON.parse(json); } catch (JSONException e) { throw new RuntimeException(e); } }
java
protected static GeoJSONObject readParcel(Parcel parcel) { String json = parcel.readString(); try { return GeoJSON.parse(json); } catch (JSONException e) { throw new RuntimeException(e); } }
[ "protected", "static", "GeoJSONObject", "readParcel", "(", "Parcel", "parcel", ")", "{", "String", "json", "=", "parcel", ".", "readString", "(", ")", ";", "try", "{", "return", "GeoJSON", ".", "parse", "(", "json", ")", ";", "}", "catch", "(", "JSONExce...
------------------------------------------------------------------------
[ "------------------------------------------------------------------------" ]
eec45c0a5429d5c8fb0c2536e135084f87aa958a
https://github.com/cocoahero/android-geojson/blob/eec45c0a5429d5c8fb0c2536e135084f87aa958a/androidgeojson/src/main/java/com/cocoahero/android/geojson/GeoJSONObject.java#L24-L32
train
Read a CIDCTYPE from a Parcel object.
Of course, here is the Java code you requested: ```java protected static GeoJSONObject readParcel(Parcel parcel) { String json = parcel.readString(); try { return GeoJSON.parse(json); } catch (JSONException e) { throw new RuntimeException(e); } } ``` ...
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
FlowControllerFactory.getSharedFlowsForRequest
public Map/*< String, SharedFlowController >*/ getSharedFlowsForRequest( RequestContext context ) throws ClassNotFoundException, InstantiationException, IllegalAccessException { String path = InternalUtils.getDecodedServletPath( context.getHttpRequest() ); return getSharedFlowsForPath( c...
java
public Map/*< String, SharedFlowController >*/ getSharedFlowsForRequest( RequestContext context ) throws ClassNotFoundException, InstantiationException, IllegalAccessException { String path = InternalUtils.getDecodedServletPath( context.getHttpRequest() ); return getSharedFlowsForPath( c...
[ "public", "Map", "/*< String, SharedFlowController >*/", "getSharedFlowsForRequest", "(", "RequestContext", "context", ")", "throws", "ClassNotFoundException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "String", "path", "=", "InternalUtils", ".", "get...
Get the map of shared flows for the given request. The map is derived from the shared flows that are declared (through the <code>sharedFlowRefs</code> attribute of {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller &#64;Jpf.Controller}) in the page flow for the request. @param context a {@link Reques...
[ "Get", "the", "map", "of", "shared", "flows", "for", "the", "given", "request", ".", "The", "map", "is", "derived", "from", "the", "shared", "flows", "that", "are", "declared", "(", "through", "the", "<code", ">", "sharedFlowRefs<", "/", "code", ">", "at...
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L452-L457
train
Get the SharedFlows for a request
Of course, here is the Java code you requested: ```java public Map/*< String, SharedFlowController >*/ getSharedFlowsForRequest( RequestContext context ) throws ClassNotFoundException, InstantiationException, IllegalAccessException { String path = InternalUtils.getDecodedServletPath( context.ge...
apache/incubator-atlas
repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java
DefaultMetadataService.updateEntities
@Override public CreateUpdateEntitiesResult updateEntities(String entityInstanceDefinition) throws AtlasException { entityInstanceDefinition = ParamChecker.notEmpty(entityInstanceDefinition, "Entity instance definition"); ITypedReferenceableInstance[] typedInstances = deserializeClassInstances(entit...
java
@Override public CreateUpdateEntitiesResult updateEntities(String entityInstanceDefinition) throws AtlasException { entityInstanceDefinition = ParamChecker.notEmpty(entityInstanceDefinition, "Entity instance definition"); ITypedReferenceableInstance[] typedInstances = deserializeClassInstances(entit...
[ "@", "Override", "public", "CreateUpdateEntitiesResult", "updateEntities", "(", "String", "entityInstanceDefinition", ")", "throws", "AtlasException", "{", "entityInstanceDefinition", "=", "ParamChecker", ".", "notEmpty", "(", "entityInstanceDefinition", ",", "\"Entity instan...
Updates an entity, instance of the type based on the guid set. @param entityInstanceDefinition json array of entity definitions @return guids - json array of guids
[ "Updates", "an", "entity", "instance", "of", "the", "type", "based", "on", "the", "guid", "set", "." ]
e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java#L385-L393
train
Update the entities in the repository
Of course, here is the Java code you requested: ```java @Override public CreateUpdateEntitiesResult updateEntities(String entityInstanceDefinition) throws AtlasException { entityInstanceDefinition = ParamChecker.notEmpty(entityInstanceDefinition, "Entity instance definition"); ITypedReferenceableIn...
Azure/azure-sdk-for-java
batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java
JobsInner.listByExperimentWithServiceResponseAsync
public Observable<ServiceResponse<Page<JobInner>>> listByExperimentWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String experimentName, final JobsListByExperimentOptions jobsListByExperimentOptions) { return listByExperimentSinglePageAsync(resourceGroupName, workspac...
java
public Observable<ServiceResponse<Page<JobInner>>> listByExperimentWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String experimentName, final JobsListByExperimentOptions jobsListByExperimentOptions) { return listByExperimentSinglePageAsync(resourceGroupName, workspac...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "JobInner", ">", ">", ">", "listByExperimentWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "workspaceName", ",", "final", "String", "experimentName", ","...
Gets a list of Jobs within the specified Experiment. @param resourceGroupName Name of the resource group to which the resource belongs. @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from...
[ "Gets", "a", "list", "of", "Jobs", "within", "the", "specified", "Experiment", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java#L323-L335
train
List jobs in an experiment. List jobs in an experiment.
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<Page<JobInner>>> listByExperimentWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String experimentName, final JobsListByExperimentOptions jobsListByExperimentOptions) { return li...
mcaserta/spring-crypto-utils
src/main/java/com/springcryptoutils/core/cipher/symmetric/CiphererWithStaticKeyImpl.java
CiphererWithStaticKeyImpl.encrypt
public byte[] encrypt(byte[] message) { try { final Cipher cipher = (((provider == null) || (provider.length() == 0)) ? Cipher.getInstance(cipherAlgorithm) : Cipher.getInstance(cipherAlgorithm, provider)); switch (mode) { case ENCRYPT: cipher.init(Cipher.ENCRYPT_MODE, keySpec, initializationV...
java
public byte[] encrypt(byte[] message) { try { final Cipher cipher = (((provider == null) || (provider.length() == 0)) ? Cipher.getInstance(cipherAlgorithm) : Cipher.getInstance(cipherAlgorithm, provider)); switch (mode) { case ENCRYPT: cipher.init(Cipher.ENCRYPT_MODE, keySpec, initializationV...
[ "public", "byte", "[", "]", "encrypt", "(", "byte", "[", "]", "message", ")", "{", "try", "{", "final", "Cipher", "cipher", "=", "(", "(", "(", "provider", "==", "null", ")", "||", "(", "provider", ".", "length", "(", ")", "==", "0", ")", ")", ...
Encrypts/decrypts a message based on the underlying mode of operation. @param message if in encryption mode, the clear-text message, otherwise the message to decrypt @return if in encryption mode, the encrypted message, otherwise the decrypted message @throws SymmetricEncryptionException on runtime errors @see #setMod...
[ "Encrypts", "/", "decrypts", "a", "message", "based", "on", "the", "underlying", "mode", "of", "operation", "." ]
1dbf6211542fb1e3f9297941d691e7e89cc72c46
https://github.com/mcaserta/spring-crypto-utils/blob/1dbf6211542fb1e3f9297941d691e7e89cc72c46/src/main/java/com/springcryptoutils/core/cipher/symmetric/CiphererWithStaticKeyImpl.java#L118-L137
train
Encrypts the given message using the specified key and provider.
Of course, here is the Java code you requested: ```java public byte[] encrypt(byte[] message) { try { final Cipher cipher = (((provider == null) || (provider.length() == 0)) ? Cipher.getInstance(cipherAlgorithm) : Cipher.getInstance(cipherAlgorithm, provider)); switch (mode) { case ENCRYPT: ...
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/FeaturableConfig.java
FeaturableConfig.exportSetup
public static Xml exportSetup(String setup) { Check.notNull(setup); final Xml node = new Xml(ATT_SETUP); node.setText(setup); return node; }
java
public static Xml exportSetup(String setup) { Check.notNull(setup); final Xml node = new Xml(ATT_SETUP); node.setText(setup); return node; }
[ "public", "static", "Xml", "exportSetup", "(", "String", "setup", ")", "{", "Check", ".", "notNull", "(", "setup", ")", ";", "final", "Xml", "node", "=", "new", "Xml", "(", "ATT_SETUP", ")", ";", "node", ".", "setText", "(", "setup", ")", ";", "retur...
Export the featurable node from setup data. @param setup The setup name (must not be <code>null</code>). @return The setup node. @throws LionEngineException If unable to export node.
[ "Export", "the", "featurable", "node", "from", "setup", "data", "." ]
cac3d5578532cf11724a737b9f09e71bf9995ab2
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/FeaturableConfig.java#L143-L151
train
Export a setup node.
Of course, here is the Java code you requested: ```java public static Xml exportSetup(String setup) { Check.notNull(setup); final Xml node = new Xml(ATT_SETUP); node.setText(setup); return node; } ``` Hope this helps!
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java
AfplibFactoryImpl.convertImageEncodingRECIDToString
public String convertImageEncodingRECIDToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
java
public String convertImageEncodingRECIDToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
[ "public", "String", "convertImageEncodingRECIDToString", "(", "EDataType", "eDataType", ",", "Object", "instanceValue", ")", "{", "return", "instanceValue", "==", "null", "?", "null", ":", "instanceValue", ".", "toString", "(", ")", ";", "}" ]
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L6939-L6941
train
Convert an object to a String.
Of course, here is the Java code you requested: ```java public String convertImageEncodingRECIDToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } ``` Hope this helps!
HeidelTime/heideltime
src/jmaxent/Classification.java
Classification.classify
public List classify(List data) { List list = new ArrayList(); for (int i = 0; i < data.size(); i++) { list.add(classify((String)data.get(i))); } return list; }
java
public List classify(List data) { List list = new ArrayList(); for (int i = 0; i < data.size(); i++) { list.add(classify((String)data.get(i))); } return list; }
[ "public", "List", "classify", "(", "List", "data", ")", "{", "List", "list", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "data", ".", "size", "(", ")", ";", "i", "++", ")", "{", "list", ".", "add",...
classify a list of observation. @param data contains a list of cps @return the list
[ "classify", "a", "list", "of", "observation", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Classification.java#L258-L266
train
Classify a list of strings.
Of course, here is the Java code you requested: ```java public List classify(List data) { List list = new ArrayList(); for (int i = 0; i < data.size(); i++) { list.add(classify((String)data.get(i))); } return list; } ``` Hope this helps!