repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java
DrizzlePreparedStatement.setCharacterStream
public void setCharacterStream(final int parameterIndex, final Reader reader) throws SQLException { """ Sets the designated parameter to the given <code>Reader</code> object. When a very large UNICODE value is input to a <code>LONGVARCHAR</code> parameter, it may be more practical to send it via a <code>java.io.R...
java
public void setCharacterStream(final int parameterIndex, final Reader reader) throws SQLException { if(reader == null) { setNull(parameterIndex, Types.BLOB); return; } try { setParameter(parameterIndex, new BufferedReaderParameter(reader)); } catch (...
[ "public", "void", "setCharacterStream", "(", "final", "int", "parameterIndex", ",", "final", "Reader", "reader", ")", "throws", "SQLException", "{", "if", "(", "reader", "==", "null", ")", "{", "setNull", "(", "parameterIndex", ",", "Types", ".", "BLOB", ")"...
Sets the designated parameter to the given <code>Reader</code> object. When a very large UNICODE value is input to a <code>LONGVARCHAR</code> parameter, it may be more practical to send it via a <code>java.io.Reader</code> object. The data will be read from the stream as needed until end-of-file is reached. The JDBC d...
[ "Sets", "the", "designated", "parameter", "to", "the", "given", "<code", ">", "Reader<", "/", "code", ">", "object", ".", "When", "a", "very", "large", "UNICODE", "value", "is", "input", "to", "a", "<code", ">", "LONGVARCHAR<", "/", "code", ">", "paramet...
train
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L926-L938
basho/riak-java-client
src/main/java/com/basho/riak/client/api/convert/Converter.java
Converter.fromDomain
public OrmExtracted fromDomain(T domainObject, Namespace namespace, BinaryValue key) { """ Convert from a domain object to a RiakObject. <p> The domain object itself may be completely annotated with everything required to produce a RiakObject except for the value portion. This will prefer annotated items over...
java
public OrmExtracted fromDomain(T domainObject, Namespace namespace, BinaryValue key) { BinaryValue bucketName = namespace != null ? namespace.getBucketName() : null; BinaryValue bucketType = namespace != null ? namespace.getBucketType() : null; key = AnnotationUtil.getKey(domainObject, key)...
[ "public", "OrmExtracted", "fromDomain", "(", "T", "domainObject", ",", "Namespace", "namespace", ",", "BinaryValue", "key", ")", "{", "BinaryValue", "bucketName", "=", "namespace", "!=", "null", "?", "namespace", ".", "getBucketName", "(", ")", ":", "null", ";...
Convert from a domain object to a RiakObject. <p> The domain object itself may be completely annotated with everything required to produce a RiakObject except for the value portion. This will prefer annotated items over the {@code Location} passed in. </p> @param domainObject a domain object to be stored in Riak. @para...
[ "Convert", "from", "a", "domain", "object", "to", "a", "RiakObject", ".", "<p", ">", "The", "domain", "object", "itself", "may", "be", "completely", "annotated", "with", "everything", "required", "to", "produce", "a", "RiakObject", "except", "for", "the", "v...
train
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/convert/Converter.java#L128-L172
Cornutum/tcases
tcases-io/src/main/java/org/cornutum/tcases/io/Resource.java
Resource.withDefaultType
public static <T extends Resource> T withDefaultType( T resource, Type defaultType) { """ Returns the given resource, assigning the default type if no type yet defined. """ if( resource.getType() == null) { resource.setType( defaultType); } return resource; }
java
public static <T extends Resource> T withDefaultType( T resource, Type defaultType) { if( resource.getType() == null) { resource.setType( defaultType); } return resource; }
[ "public", "static", "<", "T", "extends", "Resource", ">", "T", "withDefaultType", "(", "T", "resource", ",", "Type", "defaultType", ")", "{", "if", "(", "resource", ".", "getType", "(", ")", "==", "null", ")", "{", "resource", ".", "setType", "(", "def...
Returns the given resource, assigning the default type if no type yet defined.
[ "Returns", "the", "given", "resource", "assigning", "the", "default", "type", "if", "no", "type", "yet", "defined", "." ]
train
https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/Resource.java#L163-L171
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java
TilesOverlay.drawTiles
public void drawTiles(final Canvas c, final Projection projection, final double zoomLevel, final RectL viewPort) { """ This is meant to be a "pure" tile drawing function that doesn't take into account osmdroid-specific characteristics (like osmdroid's canvas's having 0,0 as the center rather than the upper-left ...
java
public void drawTiles(final Canvas c, final Projection projection, final double zoomLevel, final RectL viewPort) { mProjection = projection; mTileLooper.loop(zoomLevel, viewPort, c); }
[ "public", "void", "drawTiles", "(", "final", "Canvas", "c", ",", "final", "Projection", "projection", ",", "final", "double", "zoomLevel", ",", "final", "RectL", "viewPort", ")", "{", "mProjection", "=", "projection", ";", "mTileLooper", ".", "loop", "(", "z...
This is meant to be a "pure" tile drawing function that doesn't take into account osmdroid-specific characteristics (like osmdroid's canvas's having 0,0 as the center rather than the upper-left corner). Once the tile is ready to be drawn, it is passed to onTileReadyToDraw where custom manipulations can be made before d...
[ "This", "is", "meant", "to", "be", "a", "pure", "tile", "drawing", "function", "that", "doesn", "t", "take", "into", "account", "osmdroid", "-", "specific", "characteristics", "(", "like", "osmdroid", "s", "canvas", "s", "having", "0", "0", "as", "the", ...
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java#L213-L216
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/filters/FilterAdapter.java
FilterAdapter.throwIfUnsupportedFilter
public void throwIfUnsupportedFilter(Scan scan, Filter filter) { """ Throw a new UnsupportedFilterException if the given filter cannot be adapted to bigtable reader expressions. @param scan a {@link org.apache.hadoop.hbase.client.Scan} object. @param filter a {@link org.apache.hadoop.hbase.filter.Filter} obje...
java
public void throwIfUnsupportedFilter(Scan scan, Filter filter) { List<FilterSupportStatus> filterSupportStatuses = new ArrayList<>(); FilterAdapterContext context = new FilterAdapterContext(scan, null); collectUnsupportedStatuses(context, filter, filterSupportStatuses); if (!filterSupportStatuses.isEmpt...
[ "public", "void", "throwIfUnsupportedFilter", "(", "Scan", "scan", ",", "Filter", "filter", ")", "{", "List", "<", "FilterSupportStatus", ">", "filterSupportStatuses", "=", "new", "ArrayList", "<>", "(", ")", ";", "FilterAdapterContext", "context", "=", "new", "...
Throw a new UnsupportedFilterException if the given filter cannot be adapted to bigtable reader expressions. @param scan a {@link org.apache.hadoop.hbase.client.Scan} object. @param filter a {@link org.apache.hadoop.hbase.filter.Filter} object.
[ "Throw", "a", "new", "UnsupportedFilterException", "if", "the", "given", "filter", "cannot", "be", "adapted", "to", "bigtable", "reader", "expressions", "." ]
train
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/filters/FilterAdapter.java#L181-L188
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.startScheduler
public static void startScheduler(int threadPoolSize, String annotatedJobsPackageName) throws SundialSchedulerException { """ Starts the Sundial Scheduler @param threadPoolSize @param annotatedJobsPackageName A comma(,) or colon(:) can be used to specify multiple packages to scan for Jobs. """ ...
java
public static void startScheduler(int threadPoolSize, String annotatedJobsPackageName) throws SundialSchedulerException { try { createScheduler(threadPoolSize, annotatedJobsPackageName); getScheduler().start(); } catch (SchedulerException e) { throw new SundialSchedulerException(...
[ "public", "static", "void", "startScheduler", "(", "int", "threadPoolSize", ",", "String", "annotatedJobsPackageName", ")", "throws", "SundialSchedulerException", "{", "try", "{", "createScheduler", "(", "threadPoolSize", ",", "annotatedJobsPackageName", ")", ";", "getS...
Starts the Sundial Scheduler @param threadPoolSize @param annotatedJobsPackageName A comma(,) or colon(:) can be used to specify multiple packages to scan for Jobs.
[ "Starts", "the", "Sundial", "Scheduler" ]
train
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L84-L93
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java
PermissionUtil.getEffectivePermission
public static long getEffectivePermission(Channel channel, Member member) { """ Gets the {@code long} representation of the effective permissions allowed for this {@link net.dv8tion.jda.core.entities.Member Member} in this {@link net.dv8tion.jda.core.entities.Channel Channel}. This can be used in conjunction with...
java
public static long getEffectivePermission(Channel channel, Member member) { Checks.notNull(channel, "Channel"); Checks.notNull(member, "Member"); Checks.check(channel.getGuild().equals(member.getGuild()), "Provided channel and provided member are not of the same guild!"); if (membe...
[ "public", "static", "long", "getEffectivePermission", "(", "Channel", "channel", ",", "Member", "member", ")", "{", "Checks", ".", "notNull", "(", "channel", ",", "\"Channel\"", ")", ";", "Checks", ".", "notNull", "(", "member", ",", "\"Member\"", ")", ";", ...
Gets the {@code long} representation of the effective permissions allowed for this {@link net.dv8tion.jda.core.entities.Member Member} in this {@link net.dv8tion.jda.core.entities.Channel Channel}. This can be used in conjunction with {@link net.dv8tion.jda.core.Permission#getPermissions(long) Permission.getPermissions...
[ "Gets", "the", "{", "@code", "long", "}", "representation", "of", "the", "effective", "permissions", "allowed", "for", "this", "{", "@link", "net", ".", "dv8tion", ".", "jda", ".", "core", ".", "entities", ".", "Member", "Member", "}", "in", "this", "{",...
train
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java#L361-L404
alibaba/jstorm
jstorm-core/src/main/java/backtype/storm/ConfigValidation.java
ConfigValidation.listFv
public static NestableFieldValidator listFv(final NestableFieldValidator validator, final boolean nullAllowed) { """ Returns a new NestableFieldValidator for a List where each item is validated by validator. @param validator used to validate each item in the list @param nullAllowed whether or not a value of ...
java
public static NestableFieldValidator listFv(final NestableFieldValidator validator, final boolean nullAllowed) { return new NestableFieldValidator() { @Override public void validateField(String pd, String name, Object field) throws IllegalArgumentException { if (nullAllow...
[ "public", "static", "NestableFieldValidator", "listFv", "(", "final", "NestableFieldValidator", "validator", ",", "final", "boolean", "nullAllowed", ")", "{", "return", "new", "NestableFieldValidator", "(", ")", "{", "@", "Override", "public", "void", "validateField",...
Returns a new NestableFieldValidator for a List where each item is validated by validator. @param validator used to validate each item in the list @param nullAllowed whether or not a value of null is valid @return a NestableFieldValidator for a list with each item validated by a different validator.
[ "Returns", "a", "new", "NestableFieldValidator", "for", "a", "List", "where", "each", "item", "is", "validated", "by", "validator", "." ]
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/ConfigValidation.java#L100-L116
micrometer-metrics/micrometer
micrometer-spring-legacy/src/main/java/io/micrometer/spring/async/ThreadPoolTaskExecutorMetrics.java
ThreadPoolTaskExecutorMetrics.monitor
public static Executor monitor(MeterRegistry registry, String name, Tag... tags) { """ Returns a new {@link ThreadPoolTaskExecutor} with recorded metrics. @param registry The registry to bind metrics to. @param name The name prefix of the metrics. @param tags Tags to apply to all recorded metrics. @r...
java
public static Executor monitor(MeterRegistry registry, String name, Tag... tags) { return monitor(registry, name, asList(tags)); }
[ "public", "static", "Executor", "monitor", "(", "MeterRegistry", "registry", ",", "String", "name", ",", "Tag", "...", "tags", ")", "{", "return", "monitor", "(", "registry", ",", "name", ",", "asList", "(", "tags", ")", ")", ";", "}" ]
Returns a new {@link ThreadPoolTaskExecutor} with recorded metrics. @param registry The registry to bind metrics to. @param name The name prefix of the metrics. @param tags Tags to apply to all recorded metrics. @return The instrumented executor, proxied.
[ "Returns", "a", "new", "{", "@link", "ThreadPoolTaskExecutor", "}", "with", "recorded", "metrics", "." ]
train
https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-spring-legacy/src/main/java/io/micrometer/spring/async/ThreadPoolTaskExecutorMetrics.java#L76-L78
virgo47/javasimon
console-embed/src/main/java/org/javasimon/console/SimonCallbacks.java
SimonCallbacks.getCallbackByType
public static <T extends Callback> T getCallbackByType(Manager manager, Class<T> callbackType) { """ Get the first callback of given type in manager @param manager Simon manager containing callbacks @param callbackType Expected callback type @return Callback or null if not any """ return getCallbackByT...
java
public static <T extends Callback> T getCallbackByType(Manager manager, Class<T> callbackType) { return getCallbackByType(manager.callback().callbacks(), callbackType); }
[ "public", "static", "<", "T", "extends", "Callback", ">", "T", "getCallbackByType", "(", "Manager", "manager", ",", "Class", "<", "T", ">", "callbackType", ")", "{", "return", "getCallbackByType", "(", "manager", ".", "callback", "(", ")", ".", "callbacks", ...
Get the first callback of given type in manager @param manager Simon manager containing callbacks @param callbackType Expected callback type @return Callback or null if not any
[ "Get", "the", "first", "callback", "of", "given", "type", "in", "manager" ]
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/SimonCallbacks.java#L24-L26
js-lib-com/commons
src/main/java/js/util/Params.java
Params.notNullOrEmpty
public static void notNullOrEmpty(File parameter, String name) throws IllegalArgumentException { """ Test if file parameter is not null and has not empty path. @param parameter invocation file parameter, @param name the name of invocation parameter. @throws IllegalArgumentException if <code>parameter</code> i...
java
public static void notNullOrEmpty(File parameter, String name) throws IllegalArgumentException { if (parameter == null || parameter.getPath().isEmpty()) { throw new IllegalArgumentException(name + " path is null or empty."); } }
[ "public", "static", "void", "notNullOrEmpty", "(", "File", "parameter", ",", "String", "name", ")", "throws", "IllegalArgumentException", "{", "if", "(", "parameter", "==", "null", "||", "parameter", ".", "getPath", "(", ")", ".", "isEmpty", "(", ")", ")", ...
Test if file parameter is not null and has not empty path. @param parameter invocation file parameter, @param name the name of invocation parameter. @throws IllegalArgumentException if <code>parameter</code> is null or its path is empty.
[ "Test", "if", "file", "parameter", "is", "not", "null", "and", "has", "not", "empty", "path", "." ]
train
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L107-L111
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/map/AbstractMap.java
AbstractMap.chooseGrowCapacity
protected int chooseGrowCapacity(int size, double minLoad, double maxLoad) { """ Chooses a new prime table capacity optimized for growing that (approximately) satisfies the invariant <tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt> and has at least one FREE slot for the given size. """ return nex...
java
protected int chooseGrowCapacity(int size, double minLoad, double maxLoad) { return nextPrime(Math.max(size+1, (int) ((4*size / (3*minLoad+maxLoad))))); }
[ "protected", "int", "chooseGrowCapacity", "(", "int", "size", ",", "double", "minLoad", ",", "double", "maxLoad", ")", "{", "return", "nextPrime", "(", "Math", ".", "max", "(", "size", "+", "1", ",", "(", "int", ")", "(", "(", "4", "*", "size", "/", ...
Chooses a new prime table capacity optimized for growing that (approximately) satisfies the invariant <tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt> and has at least one FREE slot for the given size.
[ "Chooses", "a", "new", "prime", "table", "capacity", "optimized", "for", "growing", "that", "(", "approximately", ")", "satisfies", "the", "invariant", "<tt", ">", "c", "*", "minLoadFactor", "<", "=", "size", "<", "=", "c", "*", "maxLoadFactor<", "/", "tt"...
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractMap.java#L61-L63
cqframework/clinical_quality_language
Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java
ElmBaseVisitor.visitFunctionDef
public T visitFunctionDef(FunctionDef elm, C context) { """ Visit a FunctionDef. This method will be called for every node in the tree that is a FunctionDef. @param elm the ELM tree @param context the context passed to the visitor @return the visitor result """ for (OperandDef element : elm.g...
java
public T visitFunctionDef(FunctionDef elm, C context) { for (OperandDef element : elm.getOperand()) { visitElement(element, context); } visitElement(elm.getExpression(), context); return null; }
[ "public", "T", "visitFunctionDef", "(", "FunctionDef", "elm", ",", "C", "context", ")", "{", "for", "(", "OperandDef", "element", ":", "elm", ".", "getOperand", "(", ")", ")", "{", "visitElement", "(", "element", ",", "context", ")", ";", "}", "visitElem...
Visit a FunctionDef. This method will be called for every node in the tree that is a FunctionDef. @param elm the ELM tree @param context the context passed to the visitor @return the visitor result
[ "Visit", "a", "FunctionDef", ".", "This", "method", "will", "be", "called", "for", "every", "node", "in", "the", "tree", "that", "is", "a", "FunctionDef", "." ]
train
https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L329-L335
OpenLiberty/open-liberty
dev/wlp.lib.extract/src/wlp/lib/extract/ShutdownHook.java
ShutdownHook.writeWindowsCleanup
private void writeWindowsCleanup(File file, BufferedWriter bw) throws IOException { """ Write logic for windows cleanup script @param file - script File object @param bw - bufferedWriter to write into script file @throws IOException """ bw.write("set max=30\n"); bw.write("set cnt=0\n"); ...
java
private void writeWindowsCleanup(File file, BufferedWriter bw) throws IOException { bw.write("set max=30\n"); bw.write("set cnt=0\n"); bw.write("set dir=" + dir + "\n"); bw.write("echo delete %dir%\n"); bw.write(":while\n"); bw.write(" if exist %dir% (\n"); bw.w...
[ "private", "void", "writeWindowsCleanup", "(", "File", "file", ",", "BufferedWriter", "bw", ")", "throws", "IOException", "{", "bw", ".", "write", "(", "\"set max=30\\n\"", ")", ";", "bw", ".", "write", "(", "\"set cnt=0\\n\"", ")", ";", "bw", ".", "write", ...
Write logic for windows cleanup script @param file - script File object @param bw - bufferedWriter to write into script file @throws IOException
[ "Write", "logic", "for", "windows", "cleanup", "script" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp.lib.extract/src/wlp/lib/extract/ShutdownHook.java#L151-L166
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/FormattedWriter.java
FormattedWriter.taggedValue
public final void taggedValue(String tag, Object value) throws IOException { """ Write out a one-line XML tag with a Object datatype, for instance &lttag&gtobject&lt/tag&lt @param tag The name of the tag to be written @param value The data value to be written @throws IOException If an I/O error occurs whi...
java
public final void taggedValue(String tag, Object value) throws IOException { startTag(tag); if (value == null) { write("null"); } else { write(value.toString()); } endTag(tag); }
[ "public", "final", "void", "taggedValue", "(", "String", "tag", ",", "Object", "value", ")", "throws", "IOException", "{", "startTag", "(", "tag", ")", ";", "if", "(", "value", "==", "null", ")", "{", "write", "(", "\"null\"", ")", ";", "}", "else", ...
Write out a one-line XML tag with a Object datatype, for instance &lttag&gtobject&lt/tag&lt @param tag The name of the tag to be written @param value The data value to be written @throws IOException If an I/O error occurs while attempting to write the characters
[ "Write", "out", "a", "one", "-", "line", "XML", "tag", "with", "a", "Object", "datatype", "for", "instance", "&lttag&gtobject&lt", "/", "tag&lt" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/FormattedWriter.java#L228-L236
anotheria/moskito
moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java
AnnotationUtils.findAnnotationInAnnotations
private static <A extends Annotation> A findAnnotationInAnnotations(final AnnotatedElement source, final Class<A> targetAnnotationClass) { """ Tries to find required annotation in scope of all annotations of incoming 'source'. @param source {@link AnnotatedElement} @param targetAnnotationClass {@link Class} ...
java
private static <A extends Annotation> A findAnnotationInAnnotations(final AnnotatedElement source, final Class<A> targetAnnotationClass) { final Annotation[] allAnnotations = source.getAnnotations(); for (final Annotation annotation : allAnnotations) { final A result = findAnnotation(annotation, targetAnnotation...
[ "private", "static", "<", "A", "extends", "Annotation", ">", "A", "findAnnotationInAnnotations", "(", "final", "AnnotatedElement", "source", ",", "final", "Class", "<", "A", ">", "targetAnnotationClass", ")", "{", "final", "Annotation", "[", "]", "allAnnotations",...
Tries to find required annotation in scope of all annotations of incoming 'source'. @param source {@link AnnotatedElement} @param targetAnnotationClass {@link Class} - actually required annotation class @param <A> - type param @return {@link A} in case if found, {@code null} otherwise
[ "Tries", "to", "find", "required", "annotation", "in", "scope", "of", "all", "annotations", "of", "incoming", "source", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/annotation/AnnotationUtils.java#L54-L63
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java
DiscreteFourierTransformOps.realToComplex
public static void realToComplex(GrayF64 real , InterleavedF64 complex ) { """ Converts a regular image into a complex interleaved image with the imaginary component set to zero. @param real (Input) Regular image. @param complex (Output) Equivalent complex image. """ checkImageArguments(real,complex); ...
java
public static void realToComplex(GrayF64 real , InterleavedF64 complex ) { checkImageArguments(real,complex); for( int y = 0; y < complex.height; y++ ) { int indexReal = real.startIndex + y*real.stride; int indexComplex = complex.startIndex + y*complex.stride; for( int x = 0; x < real.width; x++, indexRe...
[ "public", "static", "void", "realToComplex", "(", "GrayF64", "real", ",", "InterleavedF64", "complex", ")", "{", "checkImageArguments", "(", "real", ",", "complex", ")", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "complex", ".", "height", ";",...
Converts a regular image into a complex interleaved image with the imaginary component set to zero. @param real (Input) Regular image. @param complex (Output) Equivalent complex image.
[ "Converts", "a", "regular", "image", "into", "a", "complex", "interleaved", "image", "with", "the", "imaginary", "component", "set", "to", "zero", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java#L374-L386
Azure/azure-sdk-for-java
network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java
ApplicationSecurityGroupsInner.beginCreateOrUpdate
public ApplicationSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { """ Creates or updates an application security group. @param resourceGroupName The name of the resource group. @param applicationSecurityGroupName ...
java
public ApplicationSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().single().body(); }
[ "public", "ApplicationSecurityGroupInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "applicationSecurityGroupName", ",", "ApplicationSecurityGroupInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "resource...
Creates or updates an application security group. @param resourceGroupName The name of the resource group. @param applicationSecurityGroupName The name of the application security group. @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. @throws IllegalArgumentException t...
[ "Creates", "or", "updates", "an", "application", "security", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java#L426-L428
lucee/Lucee
core/src/main/java/lucee/runtime/crypt/BinConverter.java
BinConverter.byteArrayToUNCString
public static String byteArrayToUNCString(byte[] data, int nStartPos, int nNumOfBytes) { """ converts a byte array into an UNICODE string @param data the byte array @param nStartPos where to begin the conversion @param nNumOfBytes number of bytes to handle @return the string """ // we need two bytes for...
java
public static String byteArrayToUNCString(byte[] data, int nStartPos, int nNumOfBytes) { // we need two bytes for every character nNumOfBytes &= ~1; // enough bytes in the buffer? int nAvailCapacity = data.length - nStartPos; if (nAvailCapacity < nNumOfBytes) nNumOfBytes = nAvailCapacity; StringBuilder sbuf = new...
[ "public", "static", "String", "byteArrayToUNCString", "(", "byte", "[", "]", "data", ",", "int", "nStartPos", ",", "int", "nNumOfBytes", ")", "{", "// we need two bytes for every character", "nNumOfBytes", "&=", "~", "1", ";", "// enough bytes in the buffer?", "int", ...
converts a byte array into an UNICODE string @param data the byte array @param nStartPos where to begin the conversion @param nNumOfBytes number of bytes to handle @return the string
[ "converts", "a", "byte", "array", "into", "an", "UNICODE", "string" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/crypt/BinConverter.java#L187-L202
ZuInnoTe/hadoopoffice
fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/parser/msexcel/internal/EncryptedCachedDiskStringsTable.java
EncryptedCachedDiskStringsTable.addString
private void addString(String str, OutputStream os) throws IOException { """ Adds a string to the table on disk @param str string to store @param os OutputStream to use to write it @throws IOException """ if (this.cacheSize >= 0) { // add to disk byte[] strbytes = str.getBytes(EncryptedCachedDiskStr...
java
private void addString(String str, OutputStream os) throws IOException { if (this.cacheSize >= 0) { // add to disk byte[] strbytes = str.getBytes(EncryptedCachedDiskStringsTable.encoding); byte[] sizeOfStr = ByteBuffer.allocate(4).putInt(strbytes.length).array(); this.stringPositionInFileList.add(this.tempFi...
[ "private", "void", "addString", "(", "String", "str", ",", "OutputStream", "os", ")", "throws", "IOException", "{", "if", "(", "this", ".", "cacheSize", ">=", "0", ")", "{", "// add to disk", "byte", "[", "]", "strbytes", "=", "str", ".", "getBytes", "("...
Adds a string to the table on disk @param str string to store @param os OutputStream to use to write it @throws IOException
[ "Adds", "a", "string", "to", "the", "table", "on", "disk" ]
train
https://github.com/ZuInnoTe/hadoopoffice/blob/58fc9223ee290bcb14847aaaff3fadf39c465e46/fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/parser/msexcel/internal/EncryptedCachedDiskStringsTable.java#L258-L281
dita-ot/dita-ot
src/main/java/org/dita/dost/module/DebugAndFilterModule.java
DebugAndFilterModule.getPathtoProject
public static File getPathtoProject(final File filename, final File traceFilename, final File inputMap, final Job job) { """ Get path to base directory @param filename relative input file path from base directory @param traceFilename absolute input file @param inputMap absolute path to start file @return pat...
java
public static File getPathtoProject(final File filename, final File traceFilename, final File inputMap, final Job job) { if (job.getGeneratecopyouter() != Job.Generate.OLDSOLUTION) { if (isOutFile(traceFilename, inputMap)) { return toFile(getRelativePathFromOut(traceFilename.getAbsol...
[ "public", "static", "File", "getPathtoProject", "(", "final", "File", "filename", ",", "final", "File", "traceFilename", ",", "final", "File", "inputMap", ",", "final", "Job", "job", ")", "{", "if", "(", "job", ".", "getGeneratecopyouter", "(", ")", "!=", ...
Get path to base directory @param filename relative input file path from base directory @param traceFilename absolute input file @param inputMap absolute path to start file @return path to base directory, {@code null} if not available
[ "Get", "path", "to", "base", "directory" ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/DebugAndFilterModule.java#L511-L521
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.getView
public <T extends View> T getView(Class<T> viewClass, int index) { """ Returns a View matching the specified class and index. @param viewClass the class of the requested view @param index the index of the {@link View}. {@code 0} if only one is available @return a {@link View} matching the specified class and ...
java
public <T extends View> T getView(Class<T> viewClass, int index){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "getView("+viewClass+", "+index+")"); } return waiter.waitForAndGetView(index, viewClass); }
[ "public", "<", "T", "extends", "View", ">", "T", "getView", "(", "Class", "<", "T", ">", "viewClass", ",", "int", "index", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", ...
Returns a View matching the specified class and index. @param viewClass the class of the requested view @param index the index of the {@link View}. {@code 0} if only one is available @return a {@link View} matching the specified class and index
[ "Returns", "a", "View", "matching", "the", "specified", "class", "and", "index", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3158-L3164
MenoData/Time4J
base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java
GregorianTimezoneRule.ofWeekdayBeforeDate
public static GregorianTimezoneRule ofWeekdayBeforeDate( Month month, int dayOfMonth, Weekday dayOfWeek, int timeOfDay, OffsetIndicator indicator, int savings ) { """ /*[deutsch] <p>Konstruiert ein Muster f&uuml;r einen Wochentag vor einem festen Monatstag im a...
java
public static GregorianTimezoneRule ofWeekdayBeforeDate( Month month, int dayOfMonth, Weekday dayOfWeek, int timeOfDay, OffsetIndicator indicator, int savings ) { return new DayOfWeekInMonthPattern(month, dayOfMonth, dayOfWeek, timeOfDay, indicator, savings, ...
[ "public", "static", "GregorianTimezoneRule", "ofWeekdayBeforeDate", "(", "Month", "month", ",", "int", "dayOfMonth", ",", "Weekday", "dayOfWeek", ",", "int", "timeOfDay", ",", "OffsetIndicator", "indicator", ",", "int", "savings", ")", "{", "return", "new", "DayOf...
/*[deutsch] <p>Konstruiert ein Muster f&uuml;r einen Wochentag vor einem festen Monatstag im angegebenen Monat. </p> @param month calendar month @param dayOfMonth reference day of month (1 - 31) @param dayOfWeek day of week when time switch happens @param timeOfDay clock time in seconds after midnig...
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Konstruiert", "ein", "Muster", "f&uuml", ";", "r", "einen", "Wochentag", "vor", "einem", "festen", "Monatstag", "im", "angegebenen", "Monat", ".", "<", "/", "p", ">" ]
train
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java#L421-L432
susom/database
src/main/java/com/github/susom/database/DatabaseProvider.java
DatabaseProvider.fromDriverManager
@CheckReturnValue public static Builder fromDriverManager(String url, String user, String password) { """ Builder method to create and initialize an instance of this class using the JDBC standard DriverManager method. The url parameter will be inspected to determine the Flavor for this database. """ re...
java
@CheckReturnValue public static Builder fromDriverManager(String url, String user, String password) { return fromDriverManager(url, Flavor.fromJdbcUrl(url), null, user, password); }
[ "@", "CheckReturnValue", "public", "static", "Builder", "fromDriverManager", "(", "String", "url", ",", "String", "user", ",", "String", "password", ")", "{", "return", "fromDriverManager", "(", "url", ",", "Flavor", ".", "fromJdbcUrl", "(", "url", ")", ",", ...
Builder method to create and initialize an instance of this class using the JDBC standard DriverManager method. The url parameter will be inspected to determine the Flavor for this database.
[ "Builder", "method", "to", "create", "and", "initialize", "an", "instance", "of", "this", "class", "using", "the", "JDBC", "standard", "DriverManager", "method", ".", "The", "url", "parameter", "will", "be", "inspected", "to", "determine", "the", "Flavor", "fo...
train
https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/DatabaseProvider.java#L171-L174
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.getCertificateIssuersAsync
public Observable<Page<CertificateIssuerItem>> getCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults) { """ List certificate issuers for a specified key vault. The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation re...
java
public Observable<Page<CertificateIssuerItem>> getCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults) { return getCertificateIssuersWithServiceResponseAsync(vaultBaseUrl, maxresults) .map(new Func1<ServiceResponse<Page<CertificateIssuerItem>>, Page<CertificateIssuerItem>>() ...
[ "public", "Observable", "<", "Page", "<", "CertificateIssuerItem", ">", ">", "getCertificateIssuersAsync", "(", "final", "String", "vaultBaseUrl", ",", "final", "Integer", "maxresults", ")", "{", "return", "getCertificateIssuersWithServiceResponseAsync", "(", "vaultBaseUr...
List certificate issuers for a specified key vault. The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.n...
[ "List", "certificate", "issuers", "for", "a", "specified", "key", "vault", ".", "The", "GetCertificateIssuers", "operation", "returns", "the", "set", "of", "certificate", "issuer", "resources", "in", "the", "specified", "key", "vault", ".", "This", "operation", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5817-L5825
alkacon/opencms-core
src/org/opencms/jlan/CmsJlanDiskInterface.java
CmsJlanDiskInterface.translateName
protected String translateName(String path) { """ Translates the last path segment of a path using the configured OpenCms file translations.<p> @param path the path for which the last segment should be translated @return the path with the translated last segment """ return CmsStringUtil.substi...
java
protected String translateName(String path) { return CmsStringUtil.substitute(Pattern.compile("/([^/]+)$"), path, new I_CmsRegexSubstitution() { public String substituteMatch(String text, Matcher matcher) { String name = text.substring(matcher.start(1), matcher.end(1)); ...
[ "protected", "String", "translateName", "(", "String", "path", ")", "{", "return", "CmsStringUtil", ".", "substitute", "(", "Pattern", ".", "compile", "(", "\"/([^/]+)$\"", ")", ",", "path", ",", "new", "I_CmsRegexSubstitution", "(", ")", "{", "public", "Strin...
Translates the last path segment of a path using the configured OpenCms file translations.<p> @param path the path for which the last segment should be translated @return the path with the translated last segment
[ "Translates", "the", "last", "path", "segment", "of", "a", "path", "using", "the", "configured", "OpenCms", "file", "translations", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jlan/CmsJlanDiskInterface.java#L528-L538
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/ObjectStoreVisitor.java
ObjectStoreVisitor.getStoreClient
public static IStoreClient getStoreClient(URI fsuri, Configuration conf) throws IOException { """ fs.stocator.scheme.list contains comma separated list of the provided back-end storage drivers. If none provided or key is not present, then 'swift' is the default value. For each provided scheme: fs.stocator....
java
public static IStoreClient getStoreClient(URI fsuri, Configuration conf) throws IOException { final String fsSchema = fsuri.toString().substring(0, fsuri.toString().indexOf("://")); final ClassLoader classLoader = ObjectStoreVisitor.class.getClassLoader(); String[] supportedSchemas = conf.get("fs.stocator.s...
[ "public", "static", "IStoreClient", "getStoreClient", "(", "URI", "fsuri", ",", "Configuration", "conf", ")", "throws", "IOException", "{", "final", "String", "fsSchema", "=", "fsuri", ".", "toString", "(", ")", ".", "substring", "(", "0", ",", "fsuri", ".",...
fs.stocator.scheme.list contains comma separated list of the provided back-end storage drivers. If none provided or key is not present, then 'swift' is the default value. For each provided scheme: fs.stocator.provided scheme.scheme - scheme value. If none provided, 'swift2d' is the default value fs.stocator.provided ...
[ "fs", ".", "stocator", ".", "scheme", ".", "list", "contains", "comma", "separated", "list", "of", "the", "provided", "back", "-", "end", "storage", "drivers", ".", "If", "none", "provided", "or", "key", "is", "not", "present", "then", "swift", "is", "th...
train
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/ObjectStoreVisitor.java#L98-L139
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.addField
public void addField(String name, String value) throws IllegalStateException { """ Add to a multi-value field value. If the message is editable, then a header field is set. Otherwise if the meesage is sending and a HTTP/1.1 version, then a trailer field is set. @param name Name of field @param value N...
java
public void addField(String name, String value) throws IllegalStateException { if (_state!=__MSG_EDITABLE) return; _header.add(name,value); }
[ "public", "void", "addField", "(", "String", "name", ",", "String", "value", ")", "throws", "IllegalStateException", "{", "if", "(", "_state", "!=", "__MSG_EDITABLE", ")", "return", ";", "_header", ".", "add", "(", "name", ",", "value", ")", ";", "}" ]
Add to a multi-value field value. If the message is editable, then a header field is set. Otherwise if the meesage is sending and a HTTP/1.1 version, then a trailer field is set. @param name Name of field @param value New value to add to the field @exception IllegalStateException Not editable or sending 1.1 with traile...
[ "Add", "to", "a", "multi", "-", "value", "field", "value", ".", "If", "the", "message", "is", "editable", "then", "a", "header", "field", "is", "set", ".", "Otherwise", "if", "the", "meesage", "is", "sending", "and", "a", "HTTP", "/", "1", ".", "1", ...
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L307-L313
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableCompactor.java
TableCompactor.generateAttributeUpdates
private Collection<AttributeUpdate> generateAttributeUpdates(CompactionArgs candidates) { """ Generates a Collection of {@link AttributeUpdate}s that will be applied to the Segment at the end of each compaction. The following {@link TableAttributes} are modified: - {@link TableAttributes#COMPACTION_OFFSET}: upda...
java
private Collection<AttributeUpdate> generateAttributeUpdates(CompactionArgs candidates) { return Arrays.asList( new AttributeUpdate(TableAttributes.COMPACTION_OFFSET, AttributeUpdateType.ReplaceIfEquals, candidates.endOffset, candidates.startOffset), new AttributeUpdate(TableAttr...
[ "private", "Collection", "<", "AttributeUpdate", ">", "generateAttributeUpdates", "(", "CompactionArgs", "candidates", ")", "{", "return", "Arrays", ".", "asList", "(", "new", "AttributeUpdate", "(", "TableAttributes", ".", "COMPACTION_OFFSET", ",", "AttributeUpdateType...
Generates a Collection of {@link AttributeUpdate}s that will be applied to the Segment at the end of each compaction. The following {@link TableAttributes} are modified: - {@link TableAttributes#COMPACTION_OFFSET}: update to where we finished, so that the next compaction can resume from there. - {@link TableAttributes#...
[ "Generates", "a", "Collection", "of", "{", "@link", "AttributeUpdate", "}", "s", "that", "will", "be", "applied", "to", "the", "Segment", "at", "the", "end", "of", "each", "compaction", ".", "The", "following", "{", "@link", "TableAttributes", "}", "are", ...
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableCompactor.java#L336-L340
resilience4j/resilience4j
resilience4j-ratelimiter/src/main/java/io/github/resilience4j/ratelimiter/internal/AtomicRateLimiter.java
AtomicRateLimiter.waitForPermissionIfNecessary
private boolean waitForPermissionIfNecessary(final long timeoutInNanos, final long nanosToWait) { """ If nanosToWait is bigger than 0 it tries to park {@link Thread} for nanosToWait but not longer then timeoutInNanos. @param timeoutInNanos max time that caller can wait @param nanosToWait nanoseconds caller ...
java
private boolean waitForPermissionIfNecessary(final long timeoutInNanos, final long nanosToWait) { boolean canAcquireImmediately = nanosToWait <= 0; boolean canAcquireInTime = timeoutInNanos >= nanosToWait; if (canAcquireImmediately) { return true; } if (canAcquireInT...
[ "private", "boolean", "waitForPermissionIfNecessary", "(", "final", "long", "timeoutInNanos", ",", "final", "long", "nanosToWait", ")", "{", "boolean", "canAcquireImmediately", "=", "nanosToWait", "<=", "0", ";", "boolean", "canAcquireInTime", "=", "timeoutInNanos", "...
If nanosToWait is bigger than 0 it tries to park {@link Thread} for nanosToWait but not longer then timeoutInNanos. @param timeoutInNanos max time that caller can wait @param nanosToWait nanoseconds caller need to wait @return true if caller was able to wait for nanosToWait without {@link Thread#interrupt} and not ...
[ "If", "nanosToWait", "is", "bigger", "than", "0", "it", "tries", "to", "park", "{", "@link", "Thread", "}", "for", "nanosToWait", "but", "not", "longer", "then", "timeoutInNanos", "." ]
train
https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-ratelimiter/src/main/java/io/github/resilience4j/ratelimiter/internal/AtomicRateLimiter.java#L260-L272
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/sql/JCRSQLQueryBuilder.java
JCRSQLQueryBuilder.createQuery
public static QueryRootNode createQuery(String statement, LocationFactory resolver, QueryNodeFactory factory) throws InvalidQueryException { """ Creates a <code>QueryNode</code> tree from a SQL <code>statement</code> using the passed query node <code>factory</code>. @param statement the SQL statement. @...
java
public static QueryRootNode createQuery(String statement, LocationFactory resolver, QueryNodeFactory factory) throws InvalidQueryException { try { // get parser JCRSQLParser parser; synchronized (parsers) { parser = parsers.get(resolver); ...
[ "public", "static", "QueryRootNode", "createQuery", "(", "String", "statement", ",", "LocationFactory", "resolver", ",", "QueryNodeFactory", "factory", ")", "throws", "InvalidQueryException", "{", "try", "{", "// get parser", "JCRSQLParser", "parser", ";", "synchronized...
Creates a <code>QueryNode</code> tree from a SQL <code>statement</code> using the passed query node <code>factory</code>. @param statement the SQL statement. @param resolver the namespace resolver to use. @return the <code>QueryNode</code> tree. @throws InvalidQueryException if <code>statement</code> is malformed.
[ "Creates", "a", "<code", ">", "QueryNode<", "/", "code", ">", "tree", "from", "a", "SQL", "<code", ">", "statement<", "/", "code", ">", "using", "the", "passed", "query", "node", "<code", ">", "factory<", "/", "code", ">", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/sql/JCRSQLQueryBuilder.java#L142-L184
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFVec2f.java
MFVec2f.insertValue
public void insertValue(int index, float[] newValue) { """ Insert a new value prior to the index location in the existing value array, increasing the field length accordingly. @param index - where the new values in an SFVec2f object will be placed in the array list @param newValue - the new x, y value for the a...
java
public void insertValue(int index, float[] newValue) { if ( newValue.length == 2) { try { value.add( index, new SFVec2f(newValue[0], newValue[1]) ); } catch (IndexOutOfBoundsException e) { Log.e(TAG, "X3D MFVec2f get1Value(index) out of bounds....
[ "public", "void", "insertValue", "(", "int", "index", ",", "float", "[", "]", "newValue", ")", "{", "if", "(", "newValue", ".", "length", "==", "2", ")", "{", "try", "{", "value", ".", "add", "(", "index", ",", "new", "SFVec2f", "(", "newValue", "[...
Insert a new value prior to the index location in the existing value array, increasing the field length accordingly. @param index - where the new values in an SFVec2f object will be placed in the array list @param newValue - the new x, y value for the array list
[ "Insert", "a", "new", "value", "prior", "to", "the", "index", "location", "in", "the", "existing", "value", "array", "increasing", "the", "field", "length", "accordingly", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFVec2f.java#L134-L149
GoogleCloudPlatform/bigdata-interop
gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java
GoogleCloudStorageFileSystem.createInternal
WritableByteChannel createInternal(URI path, CreateFileOptions options) throws IOException { """ Creates and opens an object for writing. If the object already exists, it is deleted. @param path Object full path of the form gs://bucket/object-path. @return A channel for writing to the given object. @th...
java
WritableByteChannel createInternal(URI path, CreateFileOptions options) throws IOException { // Validate the given path. false == do not allow empty object name. StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, false); if (options.getExistingGenerationId() != StorageResourceId.UNKN...
[ "WritableByteChannel", "createInternal", "(", "URI", "path", ",", "CreateFileOptions", "options", ")", "throws", "IOException", "{", "// Validate the given path. false == do not allow empty object name.", "StorageResourceId", "resourceId", "=", "pathCodec", ".", "validatePathAndG...
Creates and opens an object for writing. If the object already exists, it is deleted. @param path Object full path of the form gs://bucket/object-path. @return A channel for writing to the given object. @throws IOException
[ "Creates", "and", "opens", "an", "object", "for", "writing", ".", "If", "the", "object", "already", "exists", "it", "is", "deleted", "." ]
train
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L293-L307
jimmoores/quandl4j
core/src/main/java/com/jimmoores/quandl/SearchResult.java
SearchResult.getDocumentsPerPage
public int getDocumentsPerPage() { """ Get the number of documents per page in this result set. Throws a QuandlRuntimeException if Quandl response doesn't contain this field, although it should. @return the number of documents per page in this result set """ try { final int perPage = _jsonObject....
java
public int getDocumentsPerPage() { try { final int perPage = _jsonObject.getJSONObject(META_OBJECT_FIELD).getInt("per_page"); return perPage; } catch (JSONException ex) { throw new QuandlRuntimeException("Could not find total_count field in results from Quandl", ex); } }
[ "public", "int", "getDocumentsPerPage", "(", ")", "{", "try", "{", "final", "int", "perPage", "=", "_jsonObject", ".", "getJSONObject", "(", "META_OBJECT_FIELD", ")", ".", "getInt", "(", "\"per_page\"", ")", ";", "return", "perPage", ";", "}", "catch", "(", ...
Get the number of documents per page in this result set. Throws a QuandlRuntimeException if Quandl response doesn't contain this field, although it should. @return the number of documents per page in this result set
[ "Get", "the", "number", "of", "documents", "per", "page", "in", "this", "result", "set", ".", "Throws", "a", "QuandlRuntimeException", "if", "Quandl", "response", "doesn", "t", "contain", "this", "field", "although", "it", "should", "." ]
train
https://github.com/jimmoores/quandl4j/blob/5d67ae60279d889da93ae7aa3bf6b7d536f88822/core/src/main/java/com/jimmoores/quandl/SearchResult.java#L62-L69
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/TableAppender.java
TableAppender.appendPreamble
public void appendPreamble(final XMLUtil util, final Appendable appendable) throws IOException { """ Append the preamble @param util an util @param appendable the destination @throws IOException if an I/O error occurs """ if (this.preambleWritten) return; appendable.append("<tab...
java
public void appendPreamble(final XMLUtil util, final Appendable appendable) throws IOException { if (this.preambleWritten) return; appendable.append("<table:table"); util.appendEAttribute(appendable, "table:name", this.builder.getName()); util.appendEAttribute(appendable, "t...
[ "public", "void", "appendPreamble", "(", "final", "XMLUtil", "util", ",", "final", "Appendable", "appendable", ")", "throws", "IOException", "{", "if", "(", "this", ".", "preambleWritten", ")", "return", ";", "appendable", ".", "append", "(", "\"<table:table\"",...
Append the preamble @param util an util @param appendable the destination @throws IOException if an I/O error occurs
[ "Append", "the", "preamble" ]
train
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableAppender.java#L68-L83
craterdog/java-general-utilities
src/main/java/craterdog/utils/ByteUtils.java
ByteUtils.stringToBytes
static public int stringToBytes(String string, byte[] buffer, int index) { """ This function converts a string into its corresponding byte format and inserts it into the specified buffer at the specified index. @param string The string to be converted. @param buffer The byte array. @param index The index in ...
java
static public int stringToBytes(String string, byte[] buffer, int index) { byte[] bytes = string.getBytes(); int length = bytes.length; System.arraycopy(bytes, 0, buffer, index, length); return length; }
[ "static", "public", "int", "stringToBytes", "(", "String", "string", ",", "byte", "[", "]", "buffer", ",", "int", "index", ")", "{", "byte", "[", "]", "bytes", "=", "string", ".", "getBytes", "(", ")", ";", "int", "length", "=", "bytes", ".", "length...
This function converts a string into its corresponding byte format and inserts it into the specified buffer at the specified index. @param string The string to be converted. @param buffer The byte array. @param index The index in the array to begin inserting bytes. @return The number of bytes inserted.
[ "This", "function", "converts", "a", "string", "into", "its", "corresponding", "byte", "format", "and", "inserts", "it", "into", "the", "specified", "buffer", "at", "the", "specified", "index", "." ]
train
https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L581-L586
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/requests/RestAction.java
RestAction.queueAfter
public ScheduledFuture<?> queueAfter(long delay, TimeUnit unit) { """ Schedules a call to {@link #queue()} to be executed after the specified {@code delay}. <br>This is an <b>asynchronous</b> operation that will return a {@link java.util.concurrent.ScheduledFuture ScheduledFuture} representing the task. <p>Th...
java
public ScheduledFuture<?> queueAfter(long delay, TimeUnit unit) { return queueAfter(delay, unit, api.get().getRateLimitPool()); }
[ "public", "ScheduledFuture", "<", "?", ">", "queueAfter", "(", "long", "delay", ",", "TimeUnit", "unit", ")", "{", "return", "queueAfter", "(", "delay", ",", "unit", ",", "api", ".", "get", "(", ")", ".", "getRateLimitPool", "(", ")", ")", ";", "}" ]
Schedules a call to {@link #queue()} to be executed after the specified {@code delay}. <br>This is an <b>asynchronous</b> operation that will return a {@link java.util.concurrent.ScheduledFuture ScheduledFuture} representing the task. <p>This operation gives no access to the response value. <br>Use {@link #queueAfter(...
[ "Schedules", "a", "call", "to", "{", "@link", "#queue", "()", "}", "to", "be", "executed", "after", "the", "specified", "{", "@code", "delay", "}", ".", "<br", ">", "This", "is", "an", "<b", ">", "asynchronous<", "/", "b", ">", "operation", "that", "...
train
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/RestAction.java#L566-L569
haraldk/TwelveMonkeys
sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java
DebugUtil.printTimeDifference
public static void printTimeDifference(final Calendar pStartCalendar, final Calendar pEndCalendar, final PrintStream pPrintStream) { """ Prints out the difference between to calendar times. The first calendar object is subtracted from the second one. <p> @param pStartCalendar the first {@code java.util.Calendar...
java
public static void printTimeDifference(final Calendar pStartCalendar, final Calendar pEndCalendar, final PrintStream pPrintStream) { if (pPrintStream == null) { System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE); return; } pPrintStream.println(buildTimeDifference(pStartCalendar, pEndCa...
[ "public", "static", "void", "printTimeDifference", "(", "final", "Calendar", "pStartCalendar", ",", "final", "Calendar", "pEndCalendar", ",", "final", "PrintStream", "pPrintStream", ")", "{", "if", "(", "pPrintStream", "==", "null", ")", "{", "System", ".", "err...
Prints out the difference between to calendar times. The first calendar object is subtracted from the second one. <p> @param pStartCalendar the first {@code java.util.Calendar}. @param pEndCalendar the second {@code java.util.Calendar}. @param pPrintStream the {@code java.io.PrintStream} for flushing the results. @see ...
[ "Prints", "out", "the", "difference", "between", "to", "calendar", "times", ".", "The", "first", "calendar", "object", "is", "subtracted", "from", "the", "second", "one", ".", "<p", ">" ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L1029-L1036
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
CuratorUtil.startAndWait
public static void startAndWait(PersistentNode node, int maxWaitSec) { """ Starts the ephemeral node and waits for it to be created @param node Node to start @param maxWaitSec Maximum time in seconds to wait """ node.start(); int waitTime = 0; try { while (node.waitForInitialCreate(1, Tim...
java
public static void startAndWait(PersistentNode node, int maxWaitSec) { node.start(); int waitTime = 0; try { while (node.waitForInitialCreate(1, TimeUnit.SECONDS) == false) { waitTime += 1; log.info("Waited " + waitTime + " sec for ephemeral node to be created"); if (waitTime >...
[ "public", "static", "void", "startAndWait", "(", "PersistentNode", "node", ",", "int", "maxWaitSec", ")", "{", "node", ".", "start", "(", ")", ";", "int", "waitTime", "=", "0", ";", "try", "{", "while", "(", "node", ".", "waitForInitialCreate", "(", "1",...
Starts the ephemeral node and waits for it to be created @param node Node to start @param maxWaitSec Maximum time in seconds to wait
[ "Starts", "the", "ephemeral", "node", "and", "waits", "for", "it", "to", "be", "created" ]
train
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java#L163-L177
spockframework/spock
spock-core/src/main/java/org/spockframework/util/ReflectionUtil.java
ReflectionUtil.getClassFile
public static File getClassFile(Class<?> clazz) { """ Returns the class file for the given class (which has been verified to exist in the returned location), or null if the class file could not be found (e.g. because it is contained in a Jar). """ File dir = new File(clazz.getProtectionDomain().getCodeSou...
java
public static File getClassFile(Class<?> clazz) { File dir = new File(clazz.getProtectionDomain().getCodeSource().getLocation().getPath()); if (!dir.isDirectory()) return null; // class file might be contained in Jar File clazzFile = new File(dir, clazz.getName().replace('.', File.separatorChar) + ".class")...
[ "public", "static", "File", "getClassFile", "(", "Class", "<", "?", ">", "clazz", ")", "{", "File", "dir", "=", "new", "File", "(", "clazz", ".", "getProtectionDomain", "(", ")", ".", "getCodeSource", "(", ")", ".", "getLocation", "(", ")", ".", "getPa...
Returns the class file for the given class (which has been verified to exist in the returned location), or null if the class file could not be found (e.g. because it is contained in a Jar).
[ "Returns", "the", "class", "file", "for", "the", "given", "class", "(", "which", "has", "been", "verified", "to", "exist", "in", "the", "returned", "location", ")", "or", "null", "if", "the", "class", "file", "could", "not", "be", "found", "(", "e", "....
train
https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/util/ReflectionUtil.java#L158-L163
briandilley/jsonrpc4j
src/main/java/com/googlecode/jsonrpc4j/DefaultExceptionResolver.java
DefaultExceptionResolver.createJsonRpcClientException
private JsonRpcClientException createJsonRpcClientException(ObjectNode errorObject) { """ Creates a {@link JsonRpcClientException} from the given {@link ObjectNode}. @param errorObject the error object @return the exception """ int code = errorObject.has(JsonRpcBasicServer.ERROR_CODE) ? errorObject.get(...
java
private JsonRpcClientException createJsonRpcClientException(ObjectNode errorObject) { int code = errorObject.has(JsonRpcBasicServer.ERROR_CODE) ? errorObject.get(JsonRpcBasicServer.ERROR_CODE).asInt() : 0; return new JsonRpcClientException(code, errorObject.get(JsonRpcBasicServer.ERROR_MESSAGE).asText(), errorObjec...
[ "private", "JsonRpcClientException", "createJsonRpcClientException", "(", "ObjectNode", "errorObject", ")", "{", "int", "code", "=", "errorObject", ".", "has", "(", "JsonRpcBasicServer", ".", "ERROR_CODE", ")", "?", "errorObject", ".", "get", "(", "JsonRpcBasicServer"...
Creates a {@link JsonRpcClientException} from the given {@link ObjectNode}. @param errorObject the error object @return the exception
[ "Creates", "a", "{", "@link", "JsonRpcClientException", "}", "from", "the", "given", "{", "@link", "ObjectNode", "}", "." ]
train
https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/DefaultExceptionResolver.java#L51-L54
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java
AbstractBeanDefinition.findBeanForMethodArgument
@SuppressWarnings("WeakerAccess") @Internal protected final Optional findBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, MethodInjectionPoint injectionPoint, Argument argument) { """ Obtains an optional bean for the method at the given index and the argument at the given...
java
@SuppressWarnings("WeakerAccess") @Internal protected final Optional findBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, MethodInjectionPoint injectionPoint, Argument argument) { return resolveBeanWithGenericsFromMethodArgument(resolutionContext, injectionPoint, argum...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "@", "Internal", "protected", "final", "Optional", "findBeanForMethodArgument", "(", "BeanResolutionContext", "resolutionContext", ",", "BeanContext", "context", ",", "MethodInjectionPoint", "injectionPoint", ",", "Argu...
Obtains an optional bean for the method at the given index and the argument at the given index <p> Warning: this method is used by internal generated code and should not be called by user code. @param resolutionContext The resolution context @param context The context @param injectionPoint The method inje...
[ "Obtains", "an", "optional", "bean", "for", "the", "method", "at", "the", "given", "index", "and", "the", "argument", "at", "the", "given", "index", "<p", ">", "Warning", ":", "this", "method", "is", "used", "by", "internal", "generated", "code", "and", ...
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L908-L914
sahan/RoboZombie
robozombie/src/main/java/com/lonepulse/robozombie/executor/BasicExecutionHandler.java
BasicExecutionHandler.onError
@Override public void onError(InvocationContext context, Exception error) { """ <p>Throws a {@link InvocationException} with the {@link InvocationContext}.</p> <p>See {@link ExecutionHandler#onError(InvocationContext, Exception)}</p> @param context the {@link InvocationContext} with information on the prox...
java
@Override public void onError(InvocationContext context, Exception error) { throw InvocationException.newInstance(context, error); }
[ "@", "Override", "public", "void", "onError", "(", "InvocationContext", "context", ",", "Exception", "error", ")", "{", "throw", "InvocationException", ".", "newInstance", "(", "context", ",", "error", ")", ";", "}" ]
<p>Throws a {@link InvocationException} with the {@link InvocationContext}.</p> <p>See {@link ExecutionHandler#onError(InvocationContext, Exception)}</p> @param context the {@link InvocationContext} with information on the proxy invocation <br><br> @param error the root {@link Exception} which resulted in a request e...
[ "<p", ">", "Throws", "a", "{", "@link", "InvocationException", "}", "with", "the", "{", "@link", "InvocationContext", "}", ".", "<", "/", "p", ">" ]
train
https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/com/lonepulse/robozombie/executor/BasicExecutionHandler.java#L82-L86
GoogleCloudPlatform/app-maven-plugin
src/main/java/com/google/cloud/tools/maven/deploy/AppDeployer.java
AppDeployer.deployAll
public void deployAll() throws MojoExecutionException { """ Deploy a single application and any found yaml configuration files. """ stager.stage(); ImmutableList.Builder<Path> computedDeployables = ImmutableList.builder(); // Look for app.yaml Path appYaml = deployMojo.getStagingDirectory().re...
java
public void deployAll() throws MojoExecutionException { stager.stage(); ImmutableList.Builder<Path> computedDeployables = ImmutableList.builder(); // Look for app.yaml Path appYaml = deployMojo.getStagingDirectory().resolve("app.yaml"); if (!Files.exists(appYaml)) { throw new MojoExecutionExc...
[ "public", "void", "deployAll", "(", ")", "throws", "MojoExecutionException", "{", "stager", ".", "stage", "(", ")", ";", "ImmutableList", ".", "Builder", "<", "Path", ">", "computedDeployables", "=", "ImmutableList", ".", "builder", "(", ")", ";", "// Look for...
Deploy a single application and any found yaml configuration files.
[ "Deploy", "a", "single", "application", "and", "any", "found", "yaml", "configuration", "files", "." ]
train
https://github.com/GoogleCloudPlatform/app-maven-plugin/blob/1f31bb8e963ce189e9ed6b88923a1853533485ff/src/main/java/com/google/cloud/tools/maven/deploy/AppDeployer.java#L64-L94
juebanlin/util4j
util4j/src/main/java/net/jueb/util4j/security/RsaUtil.java
RsaUtil.signVerify
public boolean signVerify(byte[] content,byte[] sign,PublicKey pubKey) { """ RSA验签名检查 @param content 待签名数据 @param sign 签名值 @param publicKey 分配给开发商公钥 @return 布尔值 """ try { java.security.Signature signature = java.security.Signature.getInstance(SIGN_ALGORITHMS); ...
java
public boolean signVerify(byte[] content,byte[] sign,PublicKey pubKey) { try { java.security.Signature signature = java.security.Signature.getInstance(SIGN_ALGORITHMS); signature.initVerify(pubKey); signature.update(content); return sign...
[ "public", "boolean", "signVerify", "(", "byte", "[", "]", "content", ",", "byte", "[", "]", "sign", ",", "PublicKey", "pubKey", ")", "{", "try", "{", "java", ".", "security", ".", "Signature", "signature", "=", "java", ".", "security", ".", "Signature", ...
RSA验签名检查 @param content 待签名数据 @param sign 签名值 @param publicKey 分配给开发商公钥 @return 布尔值
[ "RSA验签名检查" ]
train
https://github.com/juebanlin/util4j/blob/c404b2dbdedf7a8890533b351257fa8af4f1439f/util4j/src/main/java/net/jueb/util4j/security/RsaUtil.java#L303-L316
UrielCh/ovh-java-sdk
ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java
ApiOvhXdsl.serviceName_lines_number_dslamPort_availableProfiles_GET
public ArrayList<OvhDslamLineProfile> serviceName_lines_number_dslamPort_availableProfiles_GET(String serviceName, String number) throws IOException { """ List all availables profiles for this port REST: GET /xdsl/{serviceName}/lines/{number}/dslamPort/availableProfiles @param serviceName [required] The intern...
java
public ArrayList<OvhDslamLineProfile> serviceName_lines_number_dslamPort_availableProfiles_GET(String serviceName, String number) throws IOException { String qPath = "/xdsl/{serviceName}/lines/{number}/dslamPort/availableProfiles"; StringBuilder sb = path(qPath, serviceName, number); String resp = exec(qPath, "GE...
[ "public", "ArrayList", "<", "OvhDslamLineProfile", ">", "serviceName_lines_number_dslamPort_availableProfiles_GET", "(", "String", "serviceName", ",", "String", "number", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/xdsl/{serviceName}/lines/{number}/dslamPort/...
List all availables profiles for this port REST: GET /xdsl/{serviceName}/lines/{number}/dslamPort/availableProfiles @param serviceName [required] The internal name of your XDSL offer @param number [required] The number of the line
[ "List", "all", "availables", "profiles", "for", "this", "port" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L538-L543
alkacon/opencms-core
src/org/opencms/configuration/CmsVfsConfiguration.java
CmsVfsConfiguration.getXsdTranslator
public CmsResourceTranslator getXsdTranslator() { """ Returns the XSD translator that has been initialized with the configured XSD translation rules.<p> @return the XSD translator """ String[] array = m_xsdTranslationEnabled ? new String[m_xsdTranslations.size()] : new String[0]; for (int ...
java
public CmsResourceTranslator getXsdTranslator() { String[] array = m_xsdTranslationEnabled ? new String[m_xsdTranslations.size()] : new String[0]; for (int i = 0; i < m_xsdTranslations.size(); i++) { array[i] = m_xsdTranslations.get(i); } return new CmsResourceTranslator(arr...
[ "public", "CmsResourceTranslator", "getXsdTranslator", "(", ")", "{", "String", "[", "]", "array", "=", "m_xsdTranslationEnabled", "?", "new", "String", "[", "m_xsdTranslations", ".", "size", "(", ")", "]", ":", "new", "String", "[", "0", "]", ";", "for", ...
Returns the XSD translator that has been initialized with the configured XSD translation rules.<p> @return the XSD translator
[ "Returns", "the", "XSD", "translator", "that", "has", "been", "initialized", "with", "the", "configured", "XSD", "translation", "rules", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsVfsConfiguration.java#L864-L871
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/operation/PromotionCommitOperation.java
PromotionCommitOperation.finalizePromotion
private void finalizePromotion() { """ Processes the sent partition state and sends {@link FinalizePromotionOperation} for all promotions. """ NodeEngine nodeEngine = getNodeEngine(); InternalPartitionServiceImpl partitionService = getService(); OperationService operationService = nodeE...
java
private void finalizePromotion() { NodeEngine nodeEngine = getNodeEngine(); InternalPartitionServiceImpl partitionService = getService(); OperationService operationService = nodeEngine.getOperationService(); partitionState.setMaster(getCallerAddress()); success = partitionServic...
[ "private", "void", "finalizePromotion", "(", ")", "{", "NodeEngine", "nodeEngine", "=", "getNodeEngine", "(", ")", ";", "InternalPartitionServiceImpl", "partitionService", "=", "getService", "(", ")", ";", "OperationService", "operationService", "=", "nodeEngine", "."...
Processes the sent partition state and sends {@link FinalizePromotionOperation} for all promotions.
[ "Processes", "the", "sent", "partition", "state", "and", "sends", "{" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/operation/PromotionCommitOperation.java#L158-L188
Harium/keel
src/main/java/com/harium/keel/core/helper/ColorHelper.java
ColorHelper.fromHSV
public static int fromHSV(float h, float s, float v) { """ Method to transform from HSV to RGB (this method sets alpha as 0xff) @param h - hue @param s - saturation @param v - brightness @return rgb color """ int a = MAX_INT; return fromHSV(h, s, v, a); }
java
public static int fromHSV(float h, float s, float v) { int a = MAX_INT; return fromHSV(h, s, v, a); }
[ "public", "static", "int", "fromHSV", "(", "float", "h", ",", "float", "s", ",", "float", "v", ")", "{", "int", "a", "=", "MAX_INT", ";", "return", "fromHSV", "(", "h", ",", "s", ",", "v", ",", "a", ")", ";", "}" ]
Method to transform from HSV to RGB (this method sets alpha as 0xff) @param h - hue @param s - saturation @param v - brightness @return rgb color
[ "Method", "to", "transform", "from", "HSV", "to", "RGB", "(", "this", "method", "sets", "alpha", "as", "0xff", ")" ]
train
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/core/helper/ColorHelper.java#L299-L302
google/truth
core/src/main/java/com/google/common/truth/IterableSubject.java
IterableSubject.moveElements
private static void moveElements(List<?> input, Collection<Object> output, int maxElements) { """ Removes at most the given number of available elements from the input list and adds them to the given output collection. """ for (int i = 0; i < maxElements; i++) { output.add(input.remove(0)); } ...
java
private static void moveElements(List<?> input, Collection<Object> output, int maxElements) { for (int i = 0; i < maxElements; i++) { output.add(input.remove(0)); } }
[ "private", "static", "void", "moveElements", "(", "List", "<", "?", ">", "input", ",", "Collection", "<", "Object", ">", "output", ",", "int", "maxElements", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "maxElements", ";", "i", "++", ...
Removes at most the given number of available elements from the input list and adds them to the given output collection.
[ "Removes", "at", "most", "the", "given", "number", "of", "available", "elements", "from", "the", "input", "list", "and", "adds", "them", "to", "the", "given", "output", "collection", "." ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/IterableSubject.java#L390-L394
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/swift/SwiftAPIClient.java
SwiftAPIClient.getMergedPath
private String getMergedPath(String hostName, Path p, String objectName) { """ Merge between two paths @param hostName @param p path @param objectName @return merged path """ if ((p.getParent() != null) && (p.getName() != null) && (p.getParent().toString().equals(hostName))) { if (objec...
java
private String getMergedPath(String hostName, Path p, String objectName) { if ((p.getParent() != null) && (p.getName() != null) && (p.getParent().toString().equals(hostName))) { if (objectName.equals(p.getName())) { return p.toString(); } if (objectName.startsWith(p.getName())) { ...
[ "private", "String", "getMergedPath", "(", "String", "hostName", ",", "Path", "p", ",", "String", "objectName", ")", "{", "if", "(", "(", "p", ".", "getParent", "(", ")", "!=", "null", ")", "&&", "(", "p", ".", "getName", "(", ")", "!=", "null", ")...
Merge between two paths @param hostName @param p path @param objectName @return merged path
[ "Merge", "between", "two", "paths" ]
train
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/swift/SwiftAPIClient.java#L613-L625
Alluxio/alluxio
core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java
GrpcServerBuilder.keepAliveTimeout
public GrpcServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) { """ Sets the keep alive timeout. @param keepAliveTimeout time to wait after pinging client before closing the connection @param timeUnit unit of the timeout @return an updated instance of this {@link GrpcServerBuilder} "...
java
public GrpcServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) { mNettyServerBuilder = mNettyServerBuilder.keepAliveTimeout(keepAliveTimeout, timeUnit); return this; }
[ "public", "GrpcServerBuilder", "keepAliveTimeout", "(", "long", "keepAliveTimeout", ",", "TimeUnit", "timeUnit", ")", "{", "mNettyServerBuilder", "=", "mNettyServerBuilder", ".", "keepAliveTimeout", "(", "keepAliveTimeout", ",", "timeUnit", ")", ";", "return", "this", ...
Sets the keep alive timeout. @param keepAliveTimeout time to wait after pinging client before closing the connection @param timeUnit unit of the timeout @return an updated instance of this {@link GrpcServerBuilder}
[ "Sets", "the", "keep", "alive", "timeout", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java#L134-L137
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DisasterRecoveryConfigurationsInner.java
DisasterRecoveryConfigurationsInner.beginCreateOrUpdateAsync
public Observable<DisasterRecoveryConfigurationInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String disasterRecoveryConfigurationName) { """ Creates or updates a disaster recovery configuration. @param resourceGroupName The name of the resource group that contains the resource. Yo...
java
public Observable<DisasterRecoveryConfigurationInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String disasterRecoveryConfigurationName) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, disasterRecoveryConfigurationName).map(new Func1<ServiceRespon...
[ "public", "Observable", "<", "DisasterRecoveryConfigurationInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "disasterRecoveryConfigurationName", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsyn...
Creates or updates a disaster recovery configuration. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param disasterRecoveryConfigurationName The name of the disas...
[ "Creates", "or", "updates", "a", "disaster", "recovery", "configuration", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DisasterRecoveryConfigurationsInner.java#L474-L481
threerings/nenya
core/src/main/java/com/threerings/media/VirtualRangeModel.java
VirtualRangeModel.setScrollableArea
public void setScrollableArea (int x, int y, int width, int height) { """ Informs the virtual range model the extent of the area over which we can scroll. """ Rectangle vb = _panel.getViewBounds(); int hmax = x + width, vmax = y + height, value; if (width > vb.width) { val...
java
public void setScrollableArea (int x, int y, int width, int height) { Rectangle vb = _panel.getViewBounds(); int hmax = x + width, vmax = y + height, value; if (width > vb.width) { value = MathUtil.bound(x, _hrange.getValue(), hmax - vb.width); _hrange.setRangeProper...
[ "public", "void", "setScrollableArea", "(", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ")", "{", "Rectangle", "vb", "=", "_panel", ".", "getViewBounds", "(", ")", ";", "int", "hmax", "=", "x", "+", "width", ",", "vmax", ...
Informs the virtual range model the extent of the area over which we can scroll.
[ "Informs", "the", "virtual", "range", "model", "the", "extent", "of", "the", "area", "over", "which", "we", "can", "scroll", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/VirtualRangeModel.java#L56-L77
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/ComboBoxArrowButtonPainter.java
ComboBoxArrowButtonPainter.paintArrows
private void paintArrows(Graphics2D g, JComponent c, int width, int height) { """ Paint the arrows (both up and down, or left and right). @param g the Graphics2D context to paint with. @param c the component to paint. @param width the width. @param height the height. """ int xOffset = ...
java
private void paintArrows(Graphics2D g, JComponent c, int width, int height) { int xOffset = width / 2 - 5; int yOffset = height / 2 - 3; g.translate(xOffset, yOffset); Shape s = shapeGenerator.createArrowLeft(0.5, 0.5, 3, 4); g.setPaint(getCommonArrowPaint(s, type)); g...
[ "private", "void", "paintArrows", "(", "Graphics2D", "g", ",", "JComponent", "c", ",", "int", "width", ",", "int", "height", ")", "{", "int", "xOffset", "=", "width", "/", "2", "-", "5", ";", "int", "yOffset", "=", "height", "/", "2", "-", "3", ";"...
Paint the arrows (both up and down, or left and right). @param g the Graphics2D context to paint with. @param c the component to paint. @param width the width. @param height the height.
[ "Paint", "the", "arrows", "(", "both", "up", "and", "down", "or", "left", "and", "right", ")", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/ComboBoxArrowButtonPainter.java#L166-L182
Azure/azure-sdk-for-java
logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/PartnersInner.java
PartnersInner.getAsync
public Observable<IntegrationAccountPartnerInner> getAsync(String resourceGroupName, String integrationAccountName, String partnerName) { """ Gets an integration account partner. @param resourceGroupName The resource group name. @param integrationAccountName The integration account name. @param partnerName Th...
java
public Observable<IntegrationAccountPartnerInner> getAsync(String resourceGroupName, String integrationAccountName, String partnerName) { return getWithServiceResponseAsync(resourceGroupName, integrationAccountName, partnerName).map(new Func1<ServiceResponse<IntegrationAccountPartnerInner>, IntegrationAccountPa...
[ "public", "Observable", "<", "IntegrationAccountPartnerInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "integrationAccountName", ",", "String", "partnerName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "in...
Gets an integration account partner. @param resourceGroupName The resource group name. @param integrationAccountName The integration account name. @param partnerName The integration account partner name. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the Integration...
[ "Gets", "an", "integration", "account", "partner", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/PartnersInner.java#L381-L388
paoding-code/paoding-rose
paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/util/ExqlUtils.java
ExqlUtils.asCollection
public static Collection<?> asCollection(Object obj) { """ 将对象转换成: Collection 集合。 @param obj - 用于转换的对象 @return Collection 集合 """ if (obj == null) { return Collections.EMPTY_SET; // 返回空集合 } else if (obj.getClass().isArray()) { return Arrays.asList(asArray(obj));...
java
public static Collection<?> asCollection(Object obj) { if (obj == null) { return Collections.EMPTY_SET; // 返回空集合 } else if (obj.getClass().isArray()) { return Arrays.asList(asArray(obj)); } else if (obj instanceof Collection<?>) { return (Collection<?>) ...
[ "public", "static", "Collection", "<", "?", ">", "asCollection", "(", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "{", "return", "Collections", ".", "EMPTY_SET", ";", "// 返回空集合", "}", "else", "if", "(", "obj", ".", "getClass", "(", ...
将对象转换成: Collection 集合。 @param obj - 用于转换的对象 @return Collection 集合
[ "将对象转换成", ":", "Collection", "集合。" ]
train
https://github.com/paoding-code/paoding-rose/blob/8b512704174dd6cba95e544c7d6ab66105cb8ec4/paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/util/ExqlUtils.java#L146-L168
hudson3-plugins/warnings-plugin
src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java
ParserRegistry.getAvailableParsers
public static List<ParserDescription> getAvailableParsers() { """ Returns all available parsers groups, sorted alphabetically. @return all available parser names """ Set<String> groups = Sets.newHashSet(); for (AbstractWarningsParser parser : getAllParsers()) { groups.add(parser....
java
public static List<ParserDescription> getAvailableParsers() { Set<String> groups = Sets.newHashSet(); for (AbstractWarningsParser parser : getAllParsers()) { groups.add(parser.getGroup()); } List<ParserDescription> sorted = Lists.newArrayList(); for (String group : g...
[ "public", "static", "List", "<", "ParserDescription", ">", "getAvailableParsers", "(", ")", "{", "Set", "<", "String", ">", "groups", "=", "Sets", ".", "newHashSet", "(", ")", ";", "for", "(", "AbstractWarningsParser", "parser", ":", "getAllParsers", "(", ")...
Returns all available parsers groups, sorted alphabetically. @return all available parser names
[ "Returns", "all", "available", "parsers", "groups", "sorted", "alphabetically", "." ]
train
https://github.com/hudson3-plugins/warnings-plugin/blob/462c9f3dffede9120173935567392b22520b0966/src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java#L96-L108
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationCenter.java
ApptentiveNotificationCenter.postNotification
public synchronized void postNotification(final String name, final Map<String, Object> userInfo) { """ Creates a notification with a given name and user info and posts it to the receiver. """ ApptentiveLog.v(NOTIFICATIONS, "Post notification: name=%s userInfo={%s}", name, StringUtils.toString(userInfo)); ...
java
public synchronized void postNotification(final String name, final Map<String, Object> userInfo) { ApptentiveLog.v(NOTIFICATIONS, "Post notification: name=%s userInfo={%s}", name, StringUtils.toString(userInfo)); final ApptentiveNotificationObserverList list = findObserverList(name); if (list != null) { list....
[ "public", "synchronized", "void", "postNotification", "(", "final", "String", "name", ",", "final", "Map", "<", "String", ",", "Object", ">", "userInfo", ")", "{", "ApptentiveLog", ".", "v", "(", "NOTIFICATIONS", ",", "\"Post notification: name=%s userInfo={%s}\"", ...
Creates a notification with a given name and user info and posts it to the receiver.
[ "Creates", "a", "notification", "with", "a", "given", "name", "and", "user", "info", "and", "posts", "it", "to", "the", "receiver", "." ]
train
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/notifications/ApptentiveNotificationCenter.java#L100-L107
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/util/CompareUtil.java
CompareUtil.equalsOne
public static boolean equalsOne(Object _obj, Object... _arrObj) { """ Returns true if the specified object equals at least one of the specified other objects. @param _obj object @param _arrObj array of objects to compare to @return true if equal, false otherwise or if either parameter is null """ if ...
java
public static boolean equalsOne(Object _obj, Object... _arrObj) { if (_obj == null || _arrObj == null) { return false; } for (Object o : _arrObj) { if (o != null && _obj.equals(o)) { return true; } } return false; }
[ "public", "static", "boolean", "equalsOne", "(", "Object", "_obj", ",", "Object", "...", "_arrObj", ")", "{", "if", "(", "_obj", "==", "null", "||", "_arrObj", "==", "null", ")", "{", "return", "false", ";", "}", "for", "(", "Object", "o", ":", "_arr...
Returns true if the specified object equals at least one of the specified other objects. @param _obj object @param _arrObj array of objects to compare to @return true if equal, false otherwise or if either parameter is null
[ "Returns", "true", "if", "the", "specified", "object", "equals", "at", "least", "one", "of", "the", "specified", "other", "objects", "." ]
train
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/CompareUtil.java#L96-L106
groupon/monsoon
remote_history/src/main/java/com/groupon/monsoon/remote/history/Client.java
Client.getFileSize
@Override public long getFileSize() { """ Check disk space usage (bytes). @return The disk space used for storing metrics. """ try { final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_UDP); try { return BlockingWrapper.execute(() -> client.g...
java
@Override public long getFileSize() { try { final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_UDP); try { return BlockingWrapper.execute(() -> client.getFileSize_1()); } finally { client.close(); } } catc...
[ "@", "Override", "public", "long", "getFileSize", "(", ")", "{", "try", "{", "final", "rh_protoClient", "client", "=", "getRpcClient", "(", "OncRpcProtocols", ".", "ONCRPC_UDP", ")", ";", "try", "{", "return", "BlockingWrapper", ".", "execute", "(", "(", ")"...
Check disk space usage (bytes). @return The disk space used for storing metrics.
[ "Check", "disk", "space", "usage", "(", "bytes", ")", "." ]
train
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/remote_history/src/main/java/com/groupon/monsoon/remote/history/Client.java#L152-L165
apache/groovy
src/main/groovy/groovy/lang/MetaMethod.java
MetaMethod.compatibleModifiers
private static boolean compatibleModifiers(int modifiersA, int modifiersB) { """ Checks the compatibility between two modifier masks. Checks that they are equal with regards to access and static modifier. @return true if the modifiers are compatible """ int mask = Modifier.PRIVATE | Modifier.PROTEC...
java
private static boolean compatibleModifiers(int modifiersA, int modifiersB) { int mask = Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC | Modifier.STATIC; return (modifiersA & mask) == (modifiersB & mask); }
[ "private", "static", "boolean", "compatibleModifiers", "(", "int", "modifiersA", ",", "int", "modifiersB", ")", "{", "int", "mask", "=", "Modifier", ".", "PRIVATE", "|", "Modifier", ".", "PROTECTED", "|", "Modifier", ".", "PUBLIC", "|", "Modifier", ".", "STA...
Checks the compatibility between two modifier masks. Checks that they are equal with regards to access and static modifier. @return true if the modifiers are compatible
[ "Checks", "the", "compatibility", "between", "two", "modifier", "masks", ".", "Checks", "that", "they", "are", "equal", "with", "regards", "to", "access", "and", "static", "modifier", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaMethod.java#L229-L232
mnlipp/jgrapes
org.jgrapes.io/src/org/jgrapes/net/SslCodec.java
SslCodec.onPurge
@Handler(channels = EncryptedChannel.class) public void onPurge(Purge event, IOSubchannel encryptedChannel) { """ Forwards a {@link Purge} event downstream. @param event the event @param encryptedChannel the encrypted channel """ @SuppressWarnings("unchecked") final Optional<PlainChanne...
java
@Handler(channels = EncryptedChannel.class) public void onPurge(Purge event, IOSubchannel encryptedChannel) { @SuppressWarnings("unchecked") final Optional<PlainChannel> plainChannel = (Optional<PlainChannel>) LinkedIOSubchannel .downstreamChannel(this, encryptedChannel);...
[ "@", "Handler", "(", "channels", "=", "EncryptedChannel", ".", "class", ")", "public", "void", "onPurge", "(", "Purge", "event", ",", "IOSubchannel", "encryptedChannel", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "final", "Optional", "<", "P...
Forwards a {@link Purge} event downstream. @param event the event @param encryptedChannel the encrypted channel
[ "Forwards", "a", "{", "@link", "Purge", "}", "event", "downstream", "." ]
train
https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/net/SslCodec.java#L233-L242
csc19601128/Phynixx
phynixx/phynixx-common/src/main/java/org/csc/phynixx/common/cast/ImplementorUtils.java
ImplementorUtils.isImplementationOf
public static <T> boolean isImplementationOf(final Object obj, final Class<T> targetClass) { """ prueft, ob eine Objekt in den Zieltyp <code>targetClass</code> zu casten ist. Wird <code>null</code> uebergeben, so wird <code>false</code> geliefert. @param obj @param targetClass @return @throws IllegalArgu...
java
public static <T> boolean isImplementationOf(final Object obj, final Class<T> targetClass) { if (targetClass == null) { throw new IllegalArgumentException("Zielklasse, in welche gecasted werden soll, ist anzugeben."); } if (obj == null) { return false; } r...
[ "public", "static", "<", "T", ">", "boolean", "isImplementationOf", "(", "final", "Object", "obj", ",", "final", "Class", "<", "T", ">", "targetClass", ")", "{", "if", "(", "targetClass", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", ...
prueft, ob eine Objekt in den Zieltyp <code>targetClass</code> zu casten ist. Wird <code>null</code> uebergeben, so wird <code>false</code> geliefert. @param obj @param targetClass @return @throws IllegalArgumentException object oder Zielklasse sind undefiniert @throws ClassCastException cast konnte nicht durch...
[ "prueft", "ob", "eine", "Objekt", "in", "den", "Zieltyp", "<code", ">", "targetClass<", "/", "code", ">", "zu", "casten", "ist", "." ]
train
https://github.com/csc19601128/Phynixx/blob/a26c03bc229a8882c647799834115bec6bdc0ac8/phynixx/phynixx-common/src/main/java/org/csc/phynixx/common/cast/ImplementorUtils.java#L63-L71
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java
CFTree.printDebug
protected StringBuilder printDebug(StringBuilder buf, ClusteringFeature n, int d) { """ Utility function for debugging. @param buf Output buffer @param n Current node @param d Depth @return Output buffer """ FormatUtil.appendSpace(buf, d).append(n.n); for(int i = 0; i < n.getDimensionality(); i++...
java
protected StringBuilder printDebug(StringBuilder buf, ClusteringFeature n, int d) { FormatUtil.appendSpace(buf, d).append(n.n); for(int i = 0; i < n.getDimensionality(); i++) { buf.append(' ').append(n.centroid(i)); } buf.append(" - ").append(n.n).append('\n'); if(n instanceof TreeNode) { ...
[ "protected", "StringBuilder", "printDebug", "(", "StringBuilder", "buf", ",", "ClusteringFeature", "n", ",", "int", "d", ")", "{", "FormatUtil", ".", "appendSpace", "(", "buf", ",", "d", ")", ".", "append", "(", "n", ".", "n", ")", ";", "for", "(", "in...
Utility function for debugging. @param buf Output buffer @param n Current node @param d Depth @return Output buffer
[ "Utility", "function", "for", "debugging", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java#L577-L593
Whiley/WhileyCompiler
src/main/java/wyil/check/FlowTypeCheck.java
FlowTypeCheck.checkVariableDeclarations
private Environment checkVariableDeclarations(Tuple<Decl.Variable> decls, Environment environment) { """ Type check a given sequence of variable declarations. @param decls @param environment Determines the type of all variables immediately going into this statement. @return @throws IOException """ fo...
java
private Environment checkVariableDeclarations(Tuple<Decl.Variable> decls, Environment environment) { for (int i = 0; i != decls.size(); ++i) { environment = checkVariableDeclaration(decls.get(i), environment); } return environment; }
[ "private", "Environment", "checkVariableDeclarations", "(", "Tuple", "<", "Decl", ".", "Variable", ">", "decls", ",", "Environment", "environment", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "decls", ".", "size", "(", ")", ";", "++", "...
Type check a given sequence of variable declarations. @param decls @param environment Determines the type of all variables immediately going into this statement. @return @throws IOException
[ "Type", "check", "a", "given", "sequence", "of", "variable", "declarations", "." ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L400-L405
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java
MethodAttribUtils.findMatchingMethod
static Method findMatchingMethod(Map<String, List<Method>> methodsByName, com.ibm.ws.javaee.dd.ejb.Method me) { """ Finds the first matching method in a map of method name to list of methods. """ List<Method> methods = methodsByName.get(me.getMethodName()); if (methods == null) { re...
java
static Method findMatchingMethod(Map<String, List<Method>> methodsByName, com.ibm.ws.javaee.dd.ejb.Method me) { List<Method> methods = methodsByName.get(me.getMethodName()); if (methods == null) { return null; } List<String> meParms = me.getMethodParamList(); if (meP...
[ "static", "Method", "findMatchingMethod", "(", "Map", "<", "String", ",", "List", "<", "Method", ">", ">", "methodsByName", ",", "com", ".", "ibm", ".", "ws", ".", "javaee", ".", "dd", ".", "ejb", ".", "Method", "me", ")", "{", "List", "<", "Method",...
Finds the first matching method in a map of method name to list of methods.
[ "Finds", "the", "first", "matching", "method", "in", "a", "map", "of", "method", "name", "to", "list", "of", "methods", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java#L641-L659
jboss/jboss-jsf-api_spec
src/main/java/javax/faces/context/ExternalContext.java
ExternalContext.addResponseHeader
public void addResponseHeader(String name, String value) { """ <p class="changed_added_2_0">Add the given name and value to the response header.</p> <p><em>Servlet:</em>This must be performed by calling the <code>javax.servlet.http.HttpServletResponse</code> <code>addHeader</code> method.</p> <p>The defaul...
java
public void addResponseHeader(String name, String value) { if (defaultExternalContext != null) { defaultExternalContext.addResponseHeader(name, value); } else { throw new UnsupportedOperationException(); } }
[ "public", "void", "addResponseHeader", "(", "String", "name", ",", "String", "value", ")", "{", "if", "(", "defaultExternalContext", "!=", "null", ")", "{", "defaultExternalContext", ".", "addResponseHeader", "(", "name", ",", "value", ")", ";", "}", "else", ...
<p class="changed_added_2_0">Add the given name and value to the response header.</p> <p><em>Servlet:</em>This must be performed by calling the <code>javax.servlet.http.HttpServletResponse</code> <code>addHeader</code> method.</p> <p>The default implementation throws <code>UnsupportedOperationException</code> and is ...
[ "<p", "class", "=", "changed_added_2_0", ">", "Add", "the", "given", "name", "and", "value", "to", "the", "response", "header", ".", "<", "/", "p", ">" ]
train
https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/context/ExternalContext.java#L1690-L1698
javagl/CommonUI
src/main/java/de/javagl/common/ui/table/renderer/SortOrderTableHeaderCellRenderer.java
SortOrderTableHeaderCellRenderer.createIcon
private Icon createIcon(SortOrder sortOrder, int sortPriority) { """ Create an Icon for the given sort order and priority. The priority is assumed to be in [0,3] @param sortOrder The sort order @param sortPriority The sort priority @return The icon """ final Color color = UIManager.getColor("con...
java
private Icon createIcon(SortOrder sortOrder, int sortPriority) { final Color color = UIManager.getColor("controlDkShadow"); final int width = 12; final int height = 12; final int sizeX = Math.max(2, width - sortPriority * 2); final int sizeY = Math.max(2, height - sortP...
[ "private", "Icon", "createIcon", "(", "SortOrder", "sortOrder", ",", "int", "sortPriority", ")", "{", "final", "Color", "color", "=", "UIManager", ".", "getColor", "(", "\"controlDkShadow\"", ")", ";", "final", "int", "width", "=", "12", ";", "final", "int",...
Create an Icon for the given sort order and priority. The priority is assumed to be in [0,3] @param sortOrder The sort order @param sortPriority The sort priority @return The icon
[ "Create", "an", "Icon", "for", "the", "given", "sort", "order", "and", "priority", ".", "The", "priority", "is", "assumed", "to", "be", "in", "[", "0", "3", "]" ]
train
https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/table/renderer/SortOrderTableHeaderCellRenderer.java#L102-L139
googleapis/google-cloud-java
google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java
Query.endAt
@Nonnull public Query endAt(Object... fieldValues) { """ Creates and returns a new Query that ends at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. @param fieldValues The field values to end this query at, in o...
java
@Nonnull public Query endAt(Object... fieldValues) { QueryOptions newOptions = new QueryOptions(options); newOptions.endCursor = createCursor(newOptions.fieldOrders, fieldValues, false); return new Query(firestore, path, newOptions); }
[ "@", "Nonnull", "public", "Query", "endAt", "(", "Object", "...", "fieldValues", ")", "{", "QueryOptions", "newOptions", "=", "new", "QueryOptions", "(", "options", ")", ";", "newOptions", ".", "endCursor", "=", "createCursor", "(", "newOptions", ".", "fieldOr...
Creates and returns a new Query that ends at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query. @param fieldValues The field values to end this query at, in order of the query's order by. @return The created Query.
[ "Creates", "and", "returns", "a", "new", "Query", "that", "ends", "at", "the", "provided", "fields", "relative", "to", "the", "order", "of", "the", "query", ".", "The", "order", "of", "the", "field", "values", "must", "match", "the", "order", "of", "the"...
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L842-L847
LearnLib/automatalib
api/src/main/java/net/automatalib/words/Word.java
Word.subWord
@Nonnull public final Word<I> subWord(int fromIndex) { """ Retrieves the subword of this word starting at the given index and extending until the end of this word. Calling this method is equivalent to calling <pre>w.subWord(fromIndex, w.length())</pre> @param fromIndex the first index, inclusive @retu...
java
@Nonnull public final Word<I> subWord(int fromIndex) { if (fromIndex <= 0) { if (fromIndex == 0) { return this; } throw new IndexOutOfBoundsException("Invalid subword range [" + fromIndex + ",)"); } return subWordInternal(fromIndex, length(...
[ "@", "Nonnull", "public", "final", "Word", "<", "I", ">", "subWord", "(", "int", "fromIndex", ")", "{", "if", "(", "fromIndex", "<=", "0", ")", "{", "if", "(", "fromIndex", "==", "0", ")", "{", "return", "this", ";", "}", "throw", "new", "IndexOutO...
Retrieves the subword of this word starting at the given index and extending until the end of this word. Calling this method is equivalent to calling <pre>w.subWord(fromIndex, w.length())</pre> @param fromIndex the first index, inclusive @return the word representing the specified subrange
[ "Retrieves", "the", "subword", "of", "this", "word", "starting", "at", "the", "given", "index", "and", "extending", "until", "the", "end", "of", "this", "word", ".", "Calling", "this", "method", "is", "equivalent", "to", "calling", "<pre", ">", "w", ".", ...
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/api/src/main/java/net/automatalib/words/Word.java#L349-L358
vkostyukov/la4j
src/main/java/org/la4j/Vectors.java
Vectors.asDivFunction
public static VectorFunction asDivFunction(final double arg) { """ Creates a div function that divides it's argument by given {@code value}. @param arg a divisor value @return a closure that does {@code _ / _} """ return new VectorFunction() { @Override public double evalu...
java
public static VectorFunction asDivFunction(final double arg) { return new VectorFunction() { @Override public double evaluate(int i, double value) { return value / arg; } }; }
[ "public", "static", "VectorFunction", "asDivFunction", "(", "final", "double", "arg", ")", "{", "return", "new", "VectorFunction", "(", ")", "{", "@", "Override", "public", "double", "evaluate", "(", "int", "i", ",", "double", "value", ")", "{", "return", ...
Creates a div function that divides it's argument by given {@code value}. @param arg a divisor value @return a closure that does {@code _ / _}
[ "Creates", "a", "div", "function", "that", "divides", "it", "s", "argument", "by", "given", "{", "@code", "value", "}", "." ]
train
https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Vectors.java#L202-L209
roboconf/roboconf-platform
core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/UserDataHelper.java
UserDataHelper.reconfigureMessaging
public void reconfigureMessaging( String etcDir, Map<String,String> msgData ) throws IOException { """ Reconfigures the messaging. @param etcDir the KARAF_ETC directory @param msgData the messaging configuration parameters """ String messagingType = msgData.get( MessagingConstants.MESSAGING_TYPE_PROPERTY...
java
public void reconfigureMessaging( String etcDir, Map<String,String> msgData ) throws IOException { String messagingType = msgData.get( MessagingConstants.MESSAGING_TYPE_PROPERTY ); Logger.getLogger( getClass().getName()).fine( "Messaging type for reconfiguration: " + messagingType ); if( ! Utils.isEmptyOrWhites...
[ "public", "void", "reconfigureMessaging", "(", "String", "etcDir", ",", "Map", "<", "String", ",", "String", ">", "msgData", ")", "throws", "IOException", "{", "String", "messagingType", "=", "msgData", ".", "get", "(", "MessagingConstants", ".", "MESSAGING_TYPE...
Reconfigures the messaging. @param etcDir the KARAF_ETC directory @param msgData the messaging configuration parameters
[ "Reconfigures", "the", "messaging", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/UserDataHelper.java#L245-L272
voldemort/voldemort
src/java/voldemort/store/readonly/ReadOnlyUtils.java
ReadOnlyUtils.isFormatCorrect
public static boolean isFormatCorrect(String fileName, ReadOnlyStorageFormat format) { """ Given a file name and read-only storage format, tells whether the file name format is correct @param fileName The name of the file @param format The RO format @return true if file format is correct, else false """ ...
java
public static boolean isFormatCorrect(String fileName, ReadOnlyStorageFormat format) { switch(format) { case READONLY_V0: case READONLY_V1: if(fileName.matches("^[\\d]+_[\\d]+\\.(data|index)")) { return true; } else { ...
[ "public", "static", "boolean", "isFormatCorrect", "(", "String", "fileName", ",", "ReadOnlyStorageFormat", "format", ")", "{", "switch", "(", "format", ")", "{", "case", "READONLY_V0", ":", "case", "READONLY_V1", ":", "if", "(", "fileName", ".", "matches", "("...
Given a file name and read-only storage format, tells whether the file name format is correct @param fileName The name of the file @param format The RO format @return true if file format is correct, else false
[ "Given", "a", "file", "name", "and", "read", "-", "only", "storage", "format", "tells", "whether", "the", "file", "name", "format", "is", "correct" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/readonly/ReadOnlyUtils.java#L53-L73
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java
JobSchedulesImpl.getAsync
public Observable<CloudJobSchedule> getAsync(String jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions) { """ Gets information about the specified job schedule. @param jobScheduleId The ID of the job schedule to get. @param jobScheduleGetOptions Additional parameters for the operation @throws IllegalA...
java
public Observable<CloudJobSchedule> getAsync(String jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions) { return getWithServiceResponseAsync(jobScheduleId, jobScheduleGetOptions).map(new Func1<ServiceResponseWithHeaders<CloudJobSchedule, JobScheduleGetHeaders>, CloudJobSchedule>() { @Overrid...
[ "public", "Observable", "<", "CloudJobSchedule", ">", "getAsync", "(", "String", "jobScheduleId", ",", "JobScheduleGetOptions", "jobScheduleGetOptions", ")", "{", "return", "getWithServiceResponseAsync", "(", "jobScheduleId", ",", "jobScheduleGetOptions", ")", ".", "map",...
Gets information about the specified job schedule. @param jobScheduleId The ID of the job schedule to get. @param jobScheduleGetOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the CloudJobSchedule object
[ "Gets", "information", "about", "the", "specified", "job", "schedule", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java#L724-L731
box/box-java-sdk
src/main/java/com/box/sdk/BoxFolder.java
BoxFolder.createMetadata
public Metadata createMetadata(String templateName, String scope, Metadata metadata) { """ Creates metadata on this folder using a specified scope and template. @param templateName the name of the metadata template. @param scope the scope of the template (usually "global" or "enterprise"). @param metad...
java
public Metadata createMetadata(String templateName, String scope, Metadata metadata) { URL url = METADATA_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), scope, templateName); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "POST"); request.addHeader("Content-Type", "a...
[ "public", "Metadata", "createMetadata", "(", "String", "templateName", ",", "String", "scope", ",", "Metadata", "metadata", ")", "{", "URL", "url", "=", "METADATA_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")",...
Creates metadata on this folder using a specified scope and template. @param templateName the name of the metadata template. @param scope the scope of the template (usually "global" or "enterprise"). @param metadata the new metadata values. @return the metadata returned from the server.
[ "Creates", "metadata", "on", "this", "folder", "using", "a", "specified", "scope", "and", "template", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFolder.java#L850-L857
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java
PatternMatchingFunctions.regexpPosition
public static Expression regexpPosition(String expression, String pattern) { """ Returned expression results in the first position of the regular expression pattern within the string, or -1. """ return regexpPosition(x(expression), pattern); }
java
public static Expression regexpPosition(String expression, String pattern) { return regexpPosition(x(expression), pattern); }
[ "public", "static", "Expression", "regexpPosition", "(", "String", "expression", ",", "String", "pattern", ")", "{", "return", "regexpPosition", "(", "x", "(", "expression", ")", ",", "pattern", ")", ";", "}" ]
Returned expression results in the first position of the regular expression pattern within the string, or -1.
[ "Returned", "expression", "results", "in", "the", "first", "position", "of", "the", "regular", "expression", "pattern", "within", "the", "string", "or", "-", "1", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java#L77-L79
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/memory/MemoryReport.java
MemoryReport.getMemoryBytes
public long getMemoryBytes(MemoryType memoryType, int minibatchSize, MemoryUseMode memoryUseMode, CacheMode cacheMode) { """ Get the memory estimate (in bytes) for the specified type of memory, using the current ND4J data type @param memoryType Type of memory to get the estimate for invit...
java
public long getMemoryBytes(MemoryType memoryType, int minibatchSize, MemoryUseMode memoryUseMode, CacheMode cacheMode) { return getMemoryBytes(memoryType, minibatchSize, memoryUseMode, cacheMode, DataTypeUtil.getDtypeFromContext()); }
[ "public", "long", "getMemoryBytes", "(", "MemoryType", "memoryType", ",", "int", "minibatchSize", ",", "MemoryUseMode", "memoryUseMode", ",", "CacheMode", "cacheMode", ")", "{", "return", "getMemoryBytes", "(", "memoryType", ",", "minibatchSize", ",", "memoryUseMode",...
Get the memory estimate (in bytes) for the specified type of memory, using the current ND4J data type @param memoryType Type of memory to get the estimate for invites @param minibatchSize Mini batch size to estimate the memory for @param memoryUseMode The memory use mode (training or inference) @param cacheMode ...
[ "Get", "the", "memory", "estimate", "(", "in", "bytes", ")", "for", "the", "specified", "type", "of", "memory", "using", "the", "current", "ND4J", "data", "type" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/memory/MemoryReport.java#L149-L152
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java
Grid.addCoords
public void addCoords(Point3d[] iAtoms, BoundingBox icoordbounds, Point3d[] jAtoms, BoundingBox jcoordbounds) { """ Adds the i and j coordinates and fills the grid, passing their bounds (array of size 6 with x,y,z minima and x,y,z maxima) This way the bounds don't need to be recomputed. Subsequent call to {@link...
java
public void addCoords(Point3d[] iAtoms, BoundingBox icoordbounds, Point3d[] jAtoms, BoundingBox jcoordbounds) { this.iAtoms = iAtoms; this.iAtomObjects = null; if (icoordbounds!=null) { this.ibounds = icoordbounds; } else { this.ibounds = new BoundingBox(this.iAtoms); } this.jAtoms = jAtoms; this....
[ "public", "void", "addCoords", "(", "Point3d", "[", "]", "iAtoms", ",", "BoundingBox", "icoordbounds", ",", "Point3d", "[", "]", "jAtoms", ",", "BoundingBox", "jcoordbounds", ")", "{", "this", ".", "iAtoms", "=", "iAtoms", ";", "this", ".", "iAtomObjects", ...
Adds the i and j coordinates and fills the grid, passing their bounds (array of size 6 with x,y,z minima and x,y,z maxima) This way the bounds don't need to be recomputed. Subsequent call to {@link #getIndicesContacts()} will produce the contacts, i.e. the set of points within distance cutoff. Subsequent calls to meth...
[ "Adds", "the", "i", "and", "j", "coordinates", "and", "fills", "the", "grid", "passing", "their", "bounds", "(", "array", "of", "size", "6", "with", "x", "y", "z", "minima", "and", "x", "y", "z", "maxima", ")", "This", "way", "the", "bounds", "don", ...
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/Grid.java#L219-L244
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/util/SystemUtil.java
SystemUtil.guessDefaultTerminal
public static String guessDefaultTerminal() { """ Tries to find the "default" terminal emulator. This will be cmd.exe on windows and may vary on linux/unix systems depending on installed terminal programs. On linux/unix there is no generic way to find the default terminal, so all known terminal programs will be...
java
public static String guessDefaultTerminal() { if (System.getProperty("os.name", "").equalsIgnoreCase("windows")) { return "cmd.exe"; } String envPath = System.getenv("PATH"); if (envPath == null) { throw new RuntimeException("Could not find enviroment PATH settin...
[ "public", "static", "String", "guessDefaultTerminal", "(", ")", "{", "if", "(", "System", ".", "getProperty", "(", "\"os.name\"", ",", "\"\"", ")", ".", "equalsIgnoreCase", "(", "\"windows\"", ")", ")", "{", "return", "\"cmd.exe\"", ";", "}", "String", "envP...
Tries to find the "default" terminal emulator. This will be cmd.exe on windows and may vary on linux/unix systems depending on installed terminal programs. On linux/unix there is no generic way to find the default terminal, so all known terminal programs will be tried until any of them is found. @return String with ter...
[ "Tries", "to", "find", "the", "default", "terminal", "emulator", ".", "This", "will", "be", "cmd", ".", "exe", "on", "windows", "and", "may", "vary", "on", "linux", "/", "unix", "systems", "depending", "on", "installed", "terminal", "programs", ".", "On", ...
train
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L377-L398
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbConfiguration.java
TmdbConfiguration.getConfig
public Configuration getConfig() throws MovieDbException { """ Get the configuration<br/> If the configuration has been previously retrieved, use that instead @return @throws MovieDbException """ if (config == null) { URL configUrl = new ApiUrl(apiKey, MethodBase.CONFIGURATION).buildUr...
java
public Configuration getConfig() throws MovieDbException { if (config == null) { URL configUrl = new ApiUrl(apiKey, MethodBase.CONFIGURATION).buildUrl(); String webpage = httpTools.getRequest(configUrl); try { WrapperConfig wc = MAPPER.readValue(webpage, Wrap...
[ "public", "Configuration", "getConfig", "(", ")", "throws", "MovieDbException", "{", "if", "(", "config", "==", "null", ")", "{", "URL", "configUrl", "=", "new", "ApiUrl", "(", "apiKey", ",", "MethodBase", ".", "CONFIGURATION", ")", ".", "buildUrl", "(", "...
Get the configuration<br/> If the configuration has been previously retrieved, use that instead @return @throws MovieDbException
[ "Get", "the", "configuration<br", "/", ">", "If", "the", "configuration", "has", "been", "previously", "retrieved", "use", "that", "instead" ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbConfiguration.java#L71-L84
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/UcsApi.java
UcsApi.getInteractionDetails
public ApiSuccessResponse getInteractionDetails(String id, InteractionDetailsData interactionDetailsData) throws ApiException { """ Get the content of the interaction @param id id of the Interaction (required) @param interactionDetailsData (optional) @return ApiSuccessResponse @throws ApiException If fail t...
java
public ApiSuccessResponse getInteractionDetails(String id, InteractionDetailsData interactionDetailsData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = getInteractionDetailsWithHttpInfo(id, interactionDetailsData); return resp.getData(); }
[ "public", "ApiSuccessResponse", "getInteractionDetails", "(", "String", "id", ",", "InteractionDetailsData", "interactionDetailsData", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", "getInteractionDetailsWithHttpInfo", "(", "...
Get the content of the interaction @param id id of the Interaction (required) @param interactionDetailsData (optional) @return ApiSuccessResponse @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "the", "content", "of", "the", "interaction" ]
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/UcsApi.java#L1160-L1163
atomix/atomix
cluster/src/main/java/io/atomix/cluster/messaging/impl/AbstractClientConnection.java
AbstractClientConnection.addReplyTime
private void addReplyTime(String type, long replyTime) { """ Adds a reply time to the history. @param type the message type @param replyTime the reply time to add to the history """ DescriptiveStatistics samples = replySamples.get(type); if (samples == null) { samples = replySamples.comp...
java
private void addReplyTime(String type, long replyTime) { DescriptiveStatistics samples = replySamples.get(type); if (samples == null) { samples = replySamples.computeIfAbsent(type, t -> new SynchronizedDescriptiveStatistics(WINDOW_SIZE)); } samples.addValue(replyTime); }
[ "private", "void", "addReplyTime", "(", "String", "type", ",", "long", "replyTime", ")", "{", "DescriptiveStatistics", "samples", "=", "replySamples", ".", "get", "(", "type", ")", ";", "if", "(", "samples", "==", "null", ")", "{", "samples", "=", "replySa...
Adds a reply time to the history. @param type the message type @param replyTime the reply time to add to the history
[ "Adds", "a", "reply", "time", "to", "the", "history", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/cluster/src/main/java/io/atomix/cluster/messaging/impl/AbstractClientConnection.java#L83-L89
line/armeria
core/src/main/java/com/linecorp/armeria/server/streaming/JsonTextSequences.java
JsonTextSequences.fromPublisher
public static HttpResponse fromPublisher(Publisher<?> contentPublisher) { """ Creates a new JSON Text Sequences from the specified {@link Publisher}. @param contentPublisher the {@link Publisher} which publishes the objects supposed to send as contents """ return fromPublisher(defaultHttpHeaders, co...
java
public static HttpResponse fromPublisher(Publisher<?> contentPublisher) { return fromPublisher(defaultHttpHeaders, contentPublisher, HttpHeaders.EMPTY_HEADERS, defaultMapper); }
[ "public", "static", "HttpResponse", "fromPublisher", "(", "Publisher", "<", "?", ">", "contentPublisher", ")", "{", "return", "fromPublisher", "(", "defaultHttpHeaders", ",", "contentPublisher", ",", "HttpHeaders", ".", "EMPTY_HEADERS", ",", "defaultMapper", ")", ";...
Creates a new JSON Text Sequences from the specified {@link Publisher}. @param contentPublisher the {@link Publisher} which publishes the objects supposed to send as contents
[ "Creates", "a", "new", "JSON", "Text", "Sequences", "from", "the", "specified", "{", "@link", "Publisher", "}", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/JsonTextSequences.java#L98-L100
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/BlockLockManager.java
BlockLockManager.validateLock
public void validateLock(long sessionId, long blockId, long lockId) throws BlockDoesNotExistException, InvalidWorkerStateException { """ Validates the lock is hold by the given session for the given block. @param sessionId the session id @param blockId the block id @param lockId the lock id @throws Blo...
java
public void validateLock(long sessionId, long blockId, long lockId) throws BlockDoesNotExistException, InvalidWorkerStateException { synchronized (mSharedMapsLock) { LockRecord record = mLockIdToRecordMap.get(lockId); if (record == null) { throw new BlockDoesNotExistException(ExceptionMess...
[ "public", "void", "validateLock", "(", "long", "sessionId", ",", "long", "blockId", ",", "long", "lockId", ")", "throws", "BlockDoesNotExistException", ",", "InvalidWorkerStateException", "{", "synchronized", "(", "mSharedMapsLock", ")", "{", "LockRecord", "record", ...
Validates the lock is hold by the given session for the given block. @param sessionId the session id @param blockId the block id @param lockId the lock id @throws BlockDoesNotExistException when no lock record can be found for lock id @throws InvalidWorkerStateException when session id or block id is not consistent wi...
[ "Validates", "the", "lock", "is", "hold", "by", "the", "given", "session", "for", "the", "given", "block", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockLockManager.java#L282-L299
pf4j/pf4j-update
src/main/java/org/pf4j/update/SimpleFileDownloader.java
SimpleFileDownloader.copyLocalFile
protected Path copyLocalFile(URL fileUrl) throws IOException, PluginException { """ Efficient copy of file in case of local file system. @param fileUrl source file @return path of target file @throws IOException if problems during copy @throws PluginException in case of other problems """ Path de...
java
protected Path copyLocalFile(URL fileUrl) throws IOException, PluginException { Path destination = Files.createTempDirectory("pf4j-update-downloader"); destination.toFile().deleteOnExit(); try { Path fromFile = Paths.get(fileUrl.toURI()); String path = fileUrl.getPath();...
[ "protected", "Path", "copyLocalFile", "(", "URL", "fileUrl", ")", "throws", "IOException", ",", "PluginException", "{", "Path", "destination", "=", "Files", ".", "createTempDirectory", "(", "\"pf4j-update-downloader\"", ")", ";", "destination", ".", "toFile", "(", ...
Efficient copy of file in case of local file system. @param fileUrl source file @return path of target file @throws IOException if problems during copy @throws PluginException in case of other problems
[ "Efficient", "copy", "of", "file", "in", "case", "of", "local", "file", "system", "." ]
train
https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/SimpleFileDownloader.java#L75-L90
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/event/InitIfSubFieldHandler.java
InitIfSubFieldHandler.doSetData
public int doSetData(Object fieldPtr, boolean bDisplayOption, int iMoveMode) { """ Move the physical binary data to this field. If there is not SubFileFilter, then don't allow the field to be inited. @param objData the raw data to set the basefield to. @param bDisplayOption If true, display the change. @param ...
java
public int doSetData(Object fieldPtr, boolean bDisplayOption, int iMoveMode) { int iErrorCode = DBConstants.NORMAL_RETURN; boolean bSubExists = (this.getOwner().getRecord().getListener(SubFileFilter.class.getName()) != null); if (bSubExists) iErrorCode = super.doSetData(fieldPtr,...
[ "public", "int", "doSetData", "(", "Object", "fieldPtr", ",", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "{", "int", "iErrorCode", "=", "DBConstants", ".", "NORMAL_RETURN", ";", "boolean", "bSubExists", "=", "(", "this", ".", "getOwner", "(", ...
Move the physical binary data to this field. If there is not SubFileFilter, then don't allow the field to be inited. @param objData the raw data to set the basefield to. @param bDisplayOption If true, display the change. @param iMoveMode The type of move being done (init/read/screen). @return The error code (or NORMAL_...
[ "Move", "the", "physical", "binary", "data", "to", "this", "field", ".", "If", "there", "is", "not", "SubFileFilter", "then", "don", "t", "allow", "the", "field", "to", "be", "inited", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/InitIfSubFieldHandler.java#L61-L68
XDean/Java-EX
src/main/java/xdean/jex/util/reflect/ReflectUtil.java
ReflectUtil.getCaller
public static StackTraceElement getCaller(int deep, boolean ignoreSameClass) { """ Get caller stack info. @param deep Deep to search the caller class.If deep is 0, it returns the class who calls this method. @param ignoreSameClass If it is true, calling in same class will be ignored. """ // index 0 i...
java
public static StackTraceElement getCaller(int deep, boolean ignoreSameClass) { // index 0 is Thread.getStackTrace // index 1 is ReflectUtil.getCallerClassName StackTraceElement[] stElements = Thread.currentThread().getStackTrace(); StackTraceElement currentStack = stElements[1]; int found = dee...
[ "public", "static", "StackTraceElement", "getCaller", "(", "int", "deep", ",", "boolean", "ignoreSameClass", ")", "{", "// index 0 is Thread.getStackTrace\r", "// index 1 is ReflectUtil.getCallerClassName\r", "StackTraceElement", "[", "]", "stElements", "=", "Thread", ".", ...
Get caller stack info. @param deep Deep to search the caller class.If deep is 0, it returns the class who calls this method. @param ignoreSameClass If it is true, calling in same class will be ignored.
[ "Get", "caller", "stack", "info", "." ]
train
https://github.com/XDean/Java-EX/blob/9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7/src/main/java/xdean/jex/util/reflect/ReflectUtil.java#L224-L244
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.deleteDeployKey
public void deleteDeployKey(Integer targetProjectId, Integer targetKeyId) throws IOException { """ Delete a deploy key for a project @param targetProjectId The id of the Gitlab project @param targetKeyId The id of the Gitlab ssh key @throws IOException on gitlab api call error """ String tailU...
java
public void deleteDeployKey(Integer targetProjectId, Integer targetKeyId) throws IOException { String tailUrl = GitlabProject.URL + "/" + targetProjectId + GitlabSSHKey.DEPLOY_KEYS_URL + "/" + targetKeyId; retrieve().method(DELETE).to(tailUrl, Void.class); }
[ "public", "void", "deleteDeployKey", "(", "Integer", "targetProjectId", ",", "Integer", "targetKeyId", ")", "throws", "IOException", "{", "String", "tailUrl", "=", "GitlabProject", ".", "URL", "+", "\"/\"", "+", "targetProjectId", "+", "GitlabSSHKey", ".", "DEPLOY...
Delete a deploy key for a project @param targetProjectId The id of the Gitlab project @param targetKeyId The id of the Gitlab ssh key @throws IOException on gitlab api call error
[ "Delete", "a", "deploy", "key", "for", "a", "project" ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3203-L3206
eclipse/xtext-extras
org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java
AbstractXbaseSemanticSequencer.sequence_XStringLiteral
protected void sequence_XStringLiteral(ISerializationContext context, XStringLiteral semanticObject) { """ Contexts: XExpression returns XStringLiteral XAssignment returns XStringLiteral XAssignment.XBinaryOperation_1_1_0_0_0 returns XStringLiteral XOrExpression returns XStringLiteral XOrExpression.XBinaryOpe...
java
protected void sequence_XStringLiteral(ISerializationContext context, XStringLiteral semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XSTRING_LITERAL__VALUE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValu...
[ "protected", "void", "sequence_XStringLiteral", "(", "ISerializationContext", "context", ",", "XStringLiteral", "semanticObject", ")", "{", "if", "(", "errorAcceptor", "!=", "null", ")", "{", "if", "(", "transientValues", ".", "isValueTransient", "(", "semanticObject"...
Contexts: XExpression returns XStringLiteral XAssignment returns XStringLiteral XAssignment.XBinaryOperation_1_1_0_0_0 returns XStringLiteral XOrExpression returns XStringLiteral XOrExpression.XBinaryOperation_1_0_0_0 returns XStringLiteral XAndExpression returns XStringLiteral XAndExpression.XBinaryOperation_1_0_0_0 r...
[ "Contexts", ":", "XExpression", "returns", "XStringLiteral", "XAssignment", "returns", "XStringLiteral", "XAssignment", ".", "XBinaryOperation_1_1_0_0_0", "returns", "XStringLiteral", "XOrExpression", "returns", "XStringLiteral", "XOrExpression", ".", "XBinaryOperation_1_0_0_0", ...
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java#L1466-L1474
apache/groovy
src/main/groovy/groovy/lang/GroovyClassLoader.java
GroovyClassLoader.parseClass
public Class parseClass(final GroovyCodeSource codeSource, boolean shouldCacheSource) throws CompilationFailedException { """ Parses the given code source into a Java class. If there is a class file for the given code source, then no parsing is done, instead the cached class is returned. @param shouldCacheSour...
java
public Class parseClass(final GroovyCodeSource codeSource, boolean shouldCacheSource) throws CompilationFailedException { // it's better to cache class instances by the source code // GCL will load the unique class instance for the same source code // and avoid occupying Permanent Area/Metaspace...
[ "public", "Class", "parseClass", "(", "final", "GroovyCodeSource", "codeSource", ",", "boolean", "shouldCacheSource", ")", "throws", "CompilationFailedException", "{", "// it's better to cache class instances by the source code", "// GCL will load the unique class instance for the same...
Parses the given code source into a Java class. If there is a class file for the given code source, then no parsing is done, instead the cached class is returned. @param shouldCacheSource if true then the generated class will be stored in the source cache @return the main class defined in the given script
[ "Parses", "the", "given", "code", "source", "into", "a", "Java", "class", ".", "If", "there", "is", "a", "class", "file", "for", "the", "given", "code", "source", "then", "no", "parsing", "is", "done", "instead", "the", "cached", "class", "is", "returned...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/GroovyClassLoader.java#L319-L335
cloudant/sync-android
sample/todo-sync/src/com/cloudant/todo/TasksModel.java
TasksModel.createServerURI
private URI createServerURI() throws URISyntaxException { """ <p>Returns the URI for the remote database, based on the app's configuration.</p> @return the remote database's URI @throws URISyntaxException if the settings give an invalid URI """ // We store this in plain text for the purp...
java
private URI createServerURI() throws URISyntaxException { // We store this in plain text for the purposes of simple demonstration, // you might want to use something more secure. SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this.mContext); Stri...
[ "private", "URI", "createServerURI", "(", ")", "throws", "URISyntaxException", "{", "// We store this in plain text for the purposes of simple demonstration,", "// you might want to use something more secure.", "SharedPreferences", "sharedPref", "=", "PreferenceManager", ".", "getDefau...
<p>Returns the URI for the remote database, based on the app's configuration.</p> @return the remote database's URI @throws URISyntaxException if the settings give an invalid URI
[ "<p", ">", "Returns", "the", "URI", "for", "the", "remote", "database", "based", "on", "the", "app", "s", "configuration", ".", "<", "/", "p", ">" ]
train
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/sample/todo-sync/src/com/cloudant/todo/TasksModel.java#L259-L272
spring-projects/spring-analytics
src/main/java/org/springframework/analytics/metrics/redis/RedisAggregateCounterRepository.java
RedisAggregateCounterRepository.doIncrementHash
private void doIncrementHash(String key, String hashKey, long amount, String bookkeepingKey) { """ Internally increments the given hash key, keeping track of created hash for a given counter, so they can be cleaned up when needed. """ long newValue = hashOperations.increment(key, hashKey, amount); // TODO...
java
private void doIncrementHash(String key, String hashKey, long amount, String bookkeepingKey) { long newValue = hashOperations.increment(key, hashKey, amount); // TODO: the following test does not necessarily mean that the hash // is new, just that the key inside that hash is new. So we end up // calling add mor...
[ "private", "void", "doIncrementHash", "(", "String", "key", ",", "String", "hashKey", ",", "long", "amount", ",", "String", "bookkeepingKey", ")", "{", "long", "newValue", "=", "hashOperations", ".", "increment", "(", "key", ",", "hashKey", ",", "amount", ")...
Internally increments the given hash key, keeping track of created hash for a given counter, so they can be cleaned up when needed.
[ "Internally", "increments", "the", "given", "hash", "key", "keeping", "track", "of", "created", "hash", "for", "a", "given", "counter", "so", "they", "can", "be", "cleaned", "up", "when", "needed", "." ]
train
https://github.com/spring-projects/spring-analytics/blob/e3ef19d2b794d6dc10265c171bba46cd757b1abd/src/main/java/org/springframework/analytics/metrics/redis/RedisAggregateCounterRepository.java#L122-L130
BBN-E/bue-common-open
common-core-open/src/main/java/com/bbn/bue/common/temporal/IntervalUtils.java
IntervalUtils.plus
public static Interval plus(final Interval interval, final Period period) { """ Move both the start and end of an {@link Interval} into the future by the duration of {@code period}. """ return new Interval(interval.getStart().plus(period), interval.getEnd().plus(period)); }
java
public static Interval plus(final Interval interval, final Period period) { return new Interval(interval.getStart().plus(period), interval.getEnd().plus(period)); }
[ "public", "static", "Interval", "plus", "(", "final", "Interval", "interval", ",", "final", "Period", "period", ")", "{", "return", "new", "Interval", "(", "interval", ".", "getStart", "(", ")", ".", "plus", "(", "period", ")", ",", "interval", ".", "get...
Move both the start and end of an {@link Interval} into the future by the duration of {@code period}.
[ "Move", "both", "the", "start", "and", "end", "of", "an", "{" ]
train
https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/temporal/IntervalUtils.java#L28-L31
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/Db.java
Db.deleteByIds
public static boolean deleteByIds(String tableName, String primaryKey, Object... idValues) { """ Delete record by ids. <pre> Example: Db.deleteByIds("user", "user_id", 15); Db.deleteByIds("user_role", "user_id, role_id", 123, 456); </pre> @param tableName the table name of the table @param primaryKey the pr...
java
public static boolean deleteByIds(String tableName, String primaryKey, Object... idValues) { return MAIN.deleteByIds(tableName, primaryKey, idValues); }
[ "public", "static", "boolean", "deleteByIds", "(", "String", "tableName", ",", "String", "primaryKey", ",", "Object", "...", "idValues", ")", "{", "return", "MAIN", ".", "deleteByIds", "(", "tableName", ",", "primaryKey", ",", "idValues", ")", ";", "}" ]
Delete record by ids. <pre> Example: Db.deleteByIds("user", "user_id", 15); Db.deleteByIds("user_role", "user_id, role_id", 123, 456); </pre> @param tableName the table name of the table @param primaryKey the primary key of the table, composite primary key is separated by comma character: "," @param idValues the id val...
[ "Delete", "record", "by", "ids", ".", "<pre", ">", "Example", ":", "Db", ".", "deleteByIds", "(", "user", "user_id", "15", ")", ";", "Db", ".", "deleteByIds", "(", "user_role", "user_id", "role_id", "123", "456", ")", ";", "<", "/", "pre", ">" ]
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Db.java#L366-L368
Impetus/Kundera
src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/utils/HBaseUtils.java
HBaseUtils.isFindKeyOnly
public static boolean isFindKeyOnly(EntityMetadata metadata, List<Map<String, Object>> colToOutput) { """ Checks if is find key only. @param metadata the metadata @param colToOutput the col to output @return true, if is find key only """ if (colToOutput != null && colToOutput.size() == 1) ...
java
public static boolean isFindKeyOnly(EntityMetadata metadata, List<Map<String, Object>> colToOutput) { if (colToOutput != null && colToOutput.size() == 1) { String idCol = ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName(); return idCol.equals(colToOutput.get(0...
[ "public", "static", "boolean", "isFindKeyOnly", "(", "EntityMetadata", "metadata", ",", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "colToOutput", ")", "{", "if", "(", "colToOutput", "!=", "null", "&&", "colToOutput", ".", "size", "(", ")",...
Checks if is find key only. @param metadata the metadata @param colToOutput the col to output @return true, if is find key only
[ "Checks", "if", "is", "find", "key", "only", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/utils/HBaseUtils.java#L305-L316
foundation-runtime/monitoring
monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java
RMIRegistryManager.startOutProcRMIRegistry
public static boolean startOutProcRMIRegistry(Configuration configuration, final int port) { """ Starts rmiregistry in a separate process on the specified port. @param port on which the rmiregistry needs to be started @return true if successful, false otherwise """ LOGGER.info("Starting rmiregistry...
java
public static boolean startOutProcRMIRegistry(Configuration configuration, final int port) { LOGGER.info("Starting rmiregistry on port " + port); try { Registry registryStarted = RegistryFinder.getInstance().getRegistry(configuration, port); if (registryStarted != null) { ...
[ "public", "static", "boolean", "startOutProcRMIRegistry", "(", "Configuration", "configuration", ",", "final", "int", "port", ")", "{", "LOGGER", ".", "info", "(", "\"Starting rmiregistry on port \"", "+", "port", ")", ";", "try", "{", "Registry", "registryStarted",...
Starts rmiregistry in a separate process on the specified port. @param port on which the rmiregistry needs to be started @return true if successful, false otherwise
[ "Starts", "rmiregistry", "in", "a", "separate", "process", "on", "the", "specified", "port", "." ]
train
https://github.com/foundation-runtime/monitoring/blob/a85ec72dc5558f787704fb13d9125a5803403ee5/monitoring-jmx-lib/src/main/java/com/cisco/oss/foundation/monitoring/RMIRegistryManager.java#L130-L146
OpenBEL/openbel-framework
org.openbel.framework.common/src/main/java/org/openbel/framework/common/util/ValidationUtilities.java
ValidationUtilities.validateRegExp
protected static boolean validateRegExp(String pattern, String value) throws PatternSyntaxException { """ Validate the given value against a regular expression pattern @param pattern Regular expression pattern @param value Value to test @return boolean {@code true} if {@code value} matches {@code ...
java
protected static boolean validateRegExp(String pattern, String value) throws PatternSyntaxException { Pattern re = patternCache.get(pattern); if (re == null) { re = compile(pattern, MULTILINE | DOTALL); patternCache.put(pattern, re); } return (re.matc...
[ "protected", "static", "boolean", "validateRegExp", "(", "String", "pattern", ",", "String", "value", ")", "throws", "PatternSyntaxException", "{", "Pattern", "re", "=", "patternCache", ".", "get", "(", "pattern", ")", ";", "if", "(", "re", "==", "null", ")"...
Validate the given value against a regular expression pattern @param pattern Regular expression pattern @param value Value to test @return boolean {@code true} if {@code value} matches {@code pattern} @throws PatternSyntaxException if the given pattern is invalid
[ "Validate", "the", "given", "value", "against", "a", "regular", "expression", "pattern" ]
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/util/ValidationUtilities.java#L144-L153
iorga-group/iraj
iraj/src/main/java/com/iorga/iraj/servlet/CacheAwareServlet.java
CacheAwareServlet.checkIfModifiedSince
protected boolean checkIfModifiedSince(final HttpServletRequest request, final HttpServletResponse response, final Attributes resourceAttributes) { """ Check if the if-modified-since condition is satisfied. @param request The servlet request we are processing @param response The servlet response we are creat...
java
protected boolean checkIfModifiedSince(final HttpServletRequest request, final HttpServletResponse response, final Attributes resourceAttributes) { try { final long headerValue = request.getDateHeader("If-Modified-Since"); final long lastModified = resourceAttributes.getLastModified(); if (headerValue != -1)...
[ "protected", "boolean", "checkIfModifiedSince", "(", "final", "HttpServletRequest", "request", ",", "final", "HttpServletResponse", "response", ",", "final", "Attributes", "resourceAttributes", ")", "{", "try", "{", "final", "long", "headerValue", "=", "request", ".",...
Check if the if-modified-since condition is satisfied. @param request The servlet request we are processing @param response The servlet response we are creating @param resourceAttributes File object @return boolean true if the resource meets the specified condition, and false if the condition is not satisfied, in whic...
[ "Check", "if", "the", "if", "-", "modified", "-", "since", "condition", "is", "satisfied", "." ]
train
https://github.com/iorga-group/iraj/blob/5fdee26464248f29833610de402275eb64505542/iraj/src/main/java/com/iorga/iraj/servlet/CacheAwareServlet.java#L700-L722
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java
JobHistoryService.getJobByJobID
public JobDetails getJobByJobID(String cluster, String jobId, boolean populateTasks) throws IOException { """ Returns a specific job's data by job ID @param cluster the cluster identifier @param cluster the job ID @param populateTasks if {@code true} populate the {@link TaskDetails} records for the job ...
java
public JobDetails getJobByJobID(String cluster, String jobId, boolean populateTasks) throws IOException { return getJobByJobID(new QualifiedJobId(cluster, jobId), populateTasks); }
[ "public", "JobDetails", "getJobByJobID", "(", "String", "cluster", ",", "String", "jobId", ",", "boolean", "populateTasks", ")", "throws", "IOException", "{", "return", "getJobByJobID", "(", "new", "QualifiedJobId", "(", "cluster", ",", "jobId", ")", ",", "popul...
Returns a specific job's data by job ID @param cluster the cluster identifier @param cluster the job ID @param populateTasks if {@code true} populate the {@link TaskDetails} records for the job
[ "Returns", "a", "specific", "job", "s", "data", "by", "job", "ID" ]
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L413-L416