repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft/point/standard/Evaluator.java
Evaluator.findVariableWithAttributeValue
static public Variable findVariableWithAttributeValue(Structure struct, String attName, String attValue) { for (Variable v : struct.getVariables()) { Attribute att = v.findAttributeIgnoreCase(attName); if ((att != null) && att.getStringValue().equals(attValue)) return v; } return n...
java
static public Variable findVariableWithAttributeValue(Structure struct, String attName, String attValue) { for (Variable v : struct.getVariables()) { Attribute att = v.findAttributeIgnoreCase(attName); if ((att != null) && att.getStringValue().equals(attValue)) return v; } return n...
[ "static", "public", "Variable", "findVariableWithAttributeValue", "(", "Structure", "struct", ",", "String", "attName", ",", "String", "attValue", ")", "{", "for", "(", "Variable", "v", ":", "struct", ".", "getVariables", "(", ")", ")", "{", "Attribute", "att"...
Find first member variable in this struct with given attribute name and value @param struct in this structure @param attName attribute name, case insensitive @param attValue attribute value, case sensitive @return first member variable with given attribute name and value, or null
[ "Find", "first", "member", "variable", "in", "this", "struct", "with", "given", "attribute", "name", "and", "value" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/Evaluator.java#L147-L154
test
Find a variable with the specified attribute value.
Of course, here is the Java code you requested: ```java static public Variable findVariableWithAttributeValue(Structure struct, String attName, String attValue) { for (Variable v : struct.getVariables()) { Attribute att = v.findAttributeIgnoreCase(attName); if ((att != null) && att.getStringValue()....
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/io/PathUtils.java
PathUtils.concat
public static String concat(final String parent, final String child) { if (parent == null) { return normalize(child); } if (child == null) { return normalize(parent); } return normalize(parent + '/' + child); }
java
public static String concat(final String parent, final String child) { if (parent == null) { return normalize(child); } if (child == null) { return normalize(parent); } return normalize(parent + '/' + child); }
[ "public", "static", "String", "concat", "(", "final", "String", "parent", ",", "final", "String", "child", ")", "{", "if", "(", "parent", "==", "null", ")", "{", "return", "normalize", "(", "child", ")", ";", "}", "if", "(", "child", "==", "null", ")...
组合路径.
[ "组合路径", "." ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/io/PathUtils.java#L145-L153
test
Concatenate two strings.
Of course, here is the Java code you requested: ```java public static String concat(final String parent, final String child) { if (parent == null) { return normalize(child); } if (child == null) { return normalize(parent); } return normalize(parent + '/' ...
GojaFramework/goja
goja-core/src/main/java/goja/core/kits/lang/LocaleKit.java
LocaleKit.getLocale
public static Locale getLocale(String language, String country, String variant) { LocaleData localeData = lookupLocaleData(resolveLocaleCode(language, country, variant)); return localeData.locale; }
java
public static Locale getLocale(String language, String country, String variant) { LocaleData localeData = lookupLocaleData(resolveLocaleCode(language, country, variant)); return localeData.locale; }
[ "public", "static", "Locale", "getLocale", "(", "String", "language", ",", "String", "country", ",", "String", "variant", ")", "{", "LocaleData", "localeData", "=", "lookupLocaleData", "(", "resolveLocaleCode", "(", "language", ",", "country", ",", "variant", ")...
Returns Locale from cache.
[ "Returns", "Locale", "from", "cache", "." ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/lang/LocaleKit.java#L56-L59
test
Get the Locale for the given language country and variant.
Of course, here is the Java code you requested: ```java public static Locale getLocale(String language, String country, String variant) { LocaleData localeData = lookupLocaleData(resolveLocaleCode(language, country, variant)); return localeData.locale; } ``` Hope this helps!
jkuhnert/ognl
src/main/java/ognl/OgnlRuntime.java
OgnlRuntime.getPackageName
public static String getPackageName(Object o) { return (o == null) ? null : getClassPackageName(o.getClass()); }
java
public static String getPackageName(Object o) { return (o == null) ? null : getClassPackageName(o.getClass()); }
[ "public", "static", "String", "getPackageName", "(", "Object", "o", ")", "{", "return", "(", "o", "==", "null", ")", "?", "null", ":", "getClassPackageName", "(", "o", ".", "getClass", "(", ")", ")", ";", "}" ]
Returns the package name of the object's class.
[ "Returns", "the", "package", "name", "of", "the", "object", "s", "class", "." ]
53d51a30c8c299b750dede779d05cb84beee73c3
https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/OgnlRuntime.java#L485-L488
test
Get the package name of the object.
Of course, here is the Java code you requested: ```java public static String getPackageName(Object o) { return (o == null) ? null : getClassPackageName(o.getClass()); } ``` Hope this helps!
spring-projects/spring-security
acl/src/main/java/org/springframework/security/acls/domain/AclImpl.java
AclImpl.isGranted
@Override public boolean isGranted(List<Permission> permission, List<Sid> sids, boolean administrativeMode) throws NotFoundException, UnloadedSidException { Assert.notEmpty(permission, "Permissions required"); Assert.notEmpty(sids, "SIDs required"); if (!this.isSidLoaded(sids)) { throw new UnloadedSidExce...
java
@Override public boolean isGranted(List<Permission> permission, List<Sid> sids, boolean administrativeMode) throws NotFoundException, UnloadedSidException { Assert.notEmpty(permission, "Permissions required"); Assert.notEmpty(sids, "SIDs required"); if (!this.isSidLoaded(sids)) { throw new UnloadedSidExce...
[ "@", "Override", "public", "boolean", "isGranted", "(", "List", "<", "Permission", ">", "permission", ",", "List", "<", "Sid", ">", "sids", ",", "boolean", "administrativeMode", ")", "throws", "NotFoundException", ",", "UnloadedSidException", "{", "Assert", ".",...
Delegates to the {@link PermissionGrantingStrategy}. @throws UnloadedSidException if the passed SIDs are unknown to this ACL because the ACL was only loaded for a subset of SIDs @see DefaultPermissionGrantingStrategy
[ "Delegates", "to", "the", "{", "@link", "PermissionGrantingStrategy", "}", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/acl/src/main/java/org/springframework/security/acls/domain/AclImpl.java#L201-L213
test
Override isGranted to allow the user to access the specified permissions.
Of course, here is the Java code you requested: ```java @Override public boolean isGranted(List<Permission> permission, List<Sid> sids, boolean administrativeMode) throws NotFoundException, UnloadedSidException { Assert.notEmpty(permission, "Permissions required"); Assert.notEmpty(sids, "SIDs required"); if...
ReactiveX/RxJava
src/main/java/io/reactivex/parallel/ParallelFlowable.java
ParallelFlowable.from
@CheckReturnValue @NonNull public static <T> ParallelFlowable<T> from(@NonNull Publisher<? extends T> source, int parallelism, int prefetch) { ObjectHelper.requireNonNull(source, "source"); ObjectHelper.verifyPositive(parallelism, "parallelism"); ObjectHelper.verifyPositive(p...
java
@CheckReturnValue @NonNull public static <T> ParallelFlowable<T> from(@NonNull Publisher<? extends T> source, int parallelism, int prefetch) { ObjectHelper.requireNonNull(source, "source"); ObjectHelper.verifyPositive(parallelism, "parallelism"); ObjectHelper.verifyPositive(p...
[ "@", "CheckReturnValue", "@", "NonNull", "public", "static", "<", "T", ">", "ParallelFlowable", "<", "T", ">", "from", "(", "@", "NonNull", "Publisher", "<", "?", "extends", "T", ">", "source", ",", "int", "parallelism", ",", "int", "prefetch", ")", "{",...
Take a Publisher and prepare to consume it on parallelism number of 'rails' , possibly ordered and round-robin fashion and use custom prefetch amount and queue for dealing with the source Publisher's values. @param <T> the value type @param source the source Publisher @param parallelism the number of parallel rails @pa...
[ "Take", "a", "Publisher", "and", "prepare", "to", "consume", "it", "on", "parallelism", "number", "of", "rails", "possibly", "ordered", "and", "round", "-", "robin", "fashion", "and", "use", "custom", "prefetch", "amount", "and", "queue", "for", "dealing", "...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L113-L122
test
Creates a parallel source backed by a single Publisher.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull public static <T> ParallelFlowable<T> from(@NonNull Publisher<? extends T> source, int parallelism, int prefetch) { ObjectHelper.requireNonNull(source, "source"); ObjectHelper.verifyPositive(paralleli...
kiegroup/droolsjbpm-tools
drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java
DSLTree.getObjMetadata
protected String getObjMetadata(String text) { if (text.startsWith("[")) { return text.substring(1,text.lastIndexOf("]")); } else { return ""; } }
java
protected String getObjMetadata(String text) { if (text.startsWith("[")) { return text.substring(1,text.lastIndexOf("]")); } else { return ""; } }
[ "protected", "String", "getObjMetadata", "(", "String", "text", ")", "{", "if", "(", "text", ".", "startsWith", "(", "\"[\"", ")", ")", "{", "return", "text", ".", "substring", "(", "1", ",", "text", ".", "lastIndexOf", "(", "\"]\"", ")", ")", ";", "...
Method will return just the object metadata @param text @return
[ "Method", "will", "return", "just", "the", "object", "metadata" ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java#L207-L213
test
Get the obj metadata from the text.
Of course, here is the Java code you requested: ```java protected String getObjMetadata(String text) { if (text.startsWith("[")) { return text.substring(1,text.lastIndexOf("]")); } else { return ""; } } ``` Hope this helps!
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/Frame.java
Frame.execute
void execute( final int opcode, final int arg, final Symbol argSymbol, final SymbolTable symbolTable) { // Abstract types popped from the stack or read from local variables. int abstractType1; int abstractType2; int abstractType3; int abstractType4; switch (opcode) { case Opcodes.NOP...
java
void execute( final int opcode, final int arg, final Symbol argSymbol, final SymbolTable symbolTable) { // Abstract types popped from the stack or read from local variables. int abstractType1; int abstractType2; int abstractType3; int abstractType4; switch (opcode) { case Opcodes.NOP...
[ "void", "execute", "(", "final", "int", "opcode", ",", "final", "int", "arg", ",", "final", "Symbol", "argSymbol", ",", "final", "SymbolTable", "symbolTable", ")", "{", "// Abstract types popped from the stack or read from local variables.", "int", "abstractType1", ";",...
Simulates the action of the given instruction on the output stack frame. @param opcode the opcode of the instruction. @param arg the numeric operand of the instruction, if any. @param argSymbol the Symbol operand of the instruction, if any. @param symbolTable the type table to use to lookup and store type {@link Symbo...
[ "Simulates", "the", "action", "of", "the", "given", "instruction", "on", "the", "output", "stack", "frame", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/Frame.java#L672-L1100
test
Execute a single segment of a sequence of code.
Of course, here is the Java code you requested: ```java void execute( final int opcode, final int arg, final Symbol argSymbol, final SymbolTable symbolTable) { // Abstract types popped from the stack or read from local variables. int abstractType1; int abstractType2; int abstractType3; int ab...
oblac/jodd
jodd-servlet/src/main/java/jodd/servlet/DispatcherUtil.java
DispatcherUtil.getRequestUri
public static String getRequestUri(final HttpServletRequest request) { String result = getIncludeRequestUri(request); if (result == null) { result = request.getRequestURI(); } return result; }
java
public static String getRequestUri(final HttpServletRequest request) { String result = getIncludeRequestUri(request); if (result == null) { result = request.getRequestURI(); } return result; }
[ "public", "static", "String", "getRequestUri", "(", "final", "HttpServletRequest", "request", ")", "{", "String", "result", "=", "getIncludeRequestUri", "(", "request", ")", ";", "if", "(", "result", "==", "null", ")", "{", "result", "=", "request", ".", "ge...
Get current request uri.
[ "Get", "current", "request", "uri", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/DispatcherUtil.java#L293-L299
test
Gets the request URI.
Of course, here is the Java code you requested: ```java public static String getRequestUri(final HttpServletRequest request) { String result = getIncludeRequestUri(request); if (result == null) { result = request.getRequestURI(); } return result; } ``` Hope this helps!
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/utils/io/output/ByteArrayOutputStream.java
ByteArrayOutputStream.toBufferedInputStream
public static InputStream toBufferedInputStream(InputStream input) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); output.write(input); return output.toBufferedInputStream(); }
java
public static InputStream toBufferedInputStream(InputStream input) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); output.write(input); return output.toBufferedInputStream(); }
[ "public", "static", "InputStream", "toBufferedInputStream", "(", "InputStream", "input", ")", "throws", "IOException", "{", "ByteArrayOutputStream", "output", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "output", ".", "write", "(", "input", ")", ";", "retu...
Fetches entire contents of an <code>InputStream</code> and represent same data as result InputStream. <p> This method is useful where, <ul> <li>Source InputStream is slow.</li> <li>It has network resources associated, so we cannot keep it open for long time.</li> <li>It has network timeout associated.</li> </ul> It can...
[ "Fetches", "entire", "contents", "of", "an", "<code", ">", "InputStream<", "/", "code", ">", "and", "represent", "same", "data", "as", "result", "InputStream", ".", "<p", ">", "This", "method", "is", "useful", "where", "<ul", ">", "<li", ">", "Source", "...
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/utils/io/output/ByteArrayOutputStream.java#L276-L281
test
This method is used to convert an input stream to a buffered input stream.
Of course, here is the Java code you requested: ```java public static InputStream toBufferedInputStream(InputStream input) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); output.write(input); return output.toBufferedInputStream(); } ``` Hope thi...
blademainer/common_utils
commons-file/src/main/java/info/monitorenter/cpdetector/io/JarArchive.java
JarArchive.getSearchPath
private String getSearchPath(ITreeNode node) { List l = new LinkedList(); node.getUserObjectPathFromRoot(l); Iterator it = l.iterator(); StringBuffer ret = new StringBuffer(); int i = 0; String token; while (it.hasNext()) { // avoid the "root" token. ...
java
private String getSearchPath(ITreeNode node) { List l = new LinkedList(); node.getUserObjectPathFromRoot(l); Iterator it = l.iterator(); StringBuffer ret = new StringBuffer(); int i = 0; String token; while (it.hasNext()) { // avoid the "root" token. ...
[ "private", "String", "getSearchPath", "(", "ITreeNode", "node", ")", "{", "List", "l", "=", "new", "LinkedList", "(", ")", ";", "node", ".", "getUserObjectPathFromRoot", "(", "l", ")", ";", "Iterator", "it", "=", "l", ".", "iterator", "(", ")", ";", "S...
Little helper that transforms (back) the nodes of the tree that was parsed from the entries during initialization to canonical strings for entries.
[ "Little", "helper", "that", "transforms", "(", "back", ")", "the", "nodes", "of", "the", "tree", "that", "was", "parsed", "from", "the", "entries", "during", "initialization", "to", "canonical", "strings", "for", "entries", "." ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/commons-file/src/main/java/info/monitorenter/cpdetector/io/JarArchive.java#L163-L184
test
get the search path of the tree node
Of course, here is the Java code you requested: ```java private String getSearchPath(ITreeNode node) { List l = new LinkedList(); node.getUserObjectPathFromRoot(l); Iterator it = l.iterator(); StringBuffer ret = new StringBuffer(); int i = 0; String token; while...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java
GeoPackageManagerImpl.importGeoPackageAsExternalLink
@Override public boolean importGeoPackageAsExternalLink(File path, String database, boolean override) { return importGeoPackageAsExternalLink(path.getAbsolutePath(), database, override); }
java
@Override public boolean importGeoPackageAsExternalLink(File path, String database, boolean override) { return importGeoPackageAsExternalLink(path.getAbsolutePath(), database, override); }
[ "@", "Override", "public", "boolean", "importGeoPackageAsExternalLink", "(", "File", "path", ",", "String", "database", ",", "boolean", "override", ")", "{", "return", "importGeoPackageAsExternalLink", "(", "path", ".", "getAbsolutePath", "(", ")", ",", "database", ...
{@inheritDoc}
[ "{" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java#L1061-L1064
test
Import a GeoPackage as an external link.
Of course, here is the Java code you requested: ```java @Override public boolean importGeoPackageAsExternalLink(File path, String database, boolean override) { return importGeoPackageAsExternalLink(path.getAbsolutePath(), database, override); } ``` Hope this helps!
boonproject/boon
boon/src/main/java/org/boon/sort/Sort.java
Sort.childComparators
private List<Comparator> childComparators( Map<String, FieldAccess> fields ) { if ( this.comparators == null ) { this.comparators = new ArrayList<>( this.sorts.size() + 1 ); for ( Sort sort : sorts ) { Comparator comparator = universalComparator( ...
java
private List<Comparator> childComparators( Map<String, FieldAccess> fields ) { if ( this.comparators == null ) { this.comparators = new ArrayList<>( this.sorts.size() + 1 ); for ( Sort sort : sorts ) { Comparator comparator = universalComparator( ...
[ "private", "List", "<", "Comparator", ">", "childComparators", "(", "Map", "<", "String", ",", "FieldAccess", ">", "fields", ")", "{", "if", "(", "this", ".", "comparators", "==", "null", ")", "{", "this", ".", "comparators", "=", "new", "ArrayList", "<>...
This creates a list of children comparators based on the child list. @param fields @return
[ "This", "creates", "a", "list", "of", "children", "comparators", "based", "on", "the", "child", "list", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/sort/Sort.java#L301-L316
test
Get the list of Comparators for the child fields.
Of course, here is the Java code you requested: ```java private List<Comparator> childComparators( Map<String, FieldAccess> fields ) { if ( this.comparators == null ) { this.comparators = new ArrayList<>( this.sorts.size() + 1 ); for ( Sort sort : sorts ) { Comparator c...
Unidata/thredds
dap4/d4core/src/main/java/dap4/core/dmr/parser/DOM4Parser.java
DOM4Parser.passReserved
protected void passReserved(Node node, DapNode dap) throws ParseException { try { NamedNodeMap attrs = node.getAttributes(); for(int i = 0; i < attrs.getLength(); i++) { Node n = attrs.item(i); String key = n.getNodeName(); ...
java
protected void passReserved(Node node, DapNode dap) throws ParseException { try { NamedNodeMap attrs = node.getAttributes(); for(int i = 0; i < attrs.getLength(); i++) { Node n = attrs.item(i); String key = n.getNodeName(); ...
[ "protected", "void", "passReserved", "(", "Node", "node", ",", "DapNode", "dap", ")", "throws", "ParseException", "{", "try", "{", "NamedNodeMap", "attrs", "=", "node", ".", "getAttributes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<...
Pass reserved xml attributes unchanged @param node @param dap @throws ParseException
[ "Pass", "reserved", "xml", "attributes", "unchanged" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/dmr/parser/DOM4Parser.java#L1237-L1253
test
PassReserved method.
Of course, here is the Java code you requested: ```java protected void passReserved(Node node, DapNode dap) throws ParseException { try { NamedNodeMap attrs = node.getAttributes(); for(int i = 0; i < attrs.getLength(); i++) { Node n = attrs.item(i); ...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/reactive/WebFluxSecurityConfiguration.java
WebFluxSecurityConfiguration.springSecurityFilterChain
private SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { http .authorizeExchange() .anyExchange().authenticated(); if (isOAuth2Present && OAuth2ClasspathGuard.shouldConfigure(this.context)) { OAuth2ClasspathGuard.configure(this.context, http); } else { http .httpBasic(...
java
private SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { http .authorizeExchange() .anyExchange().authenticated(); if (isOAuth2Present && OAuth2ClasspathGuard.shouldConfigure(this.context)) { OAuth2ClasspathGuard.configure(this.context, http); } else { http .httpBasic(...
[ "private", "SecurityWebFilterChain", "springSecurityFilterChain", "(", "ServerHttpSecurity", "http", ")", "{", "http", ".", "authorizeExchange", "(", ")", ".", "anyExchange", "(", ")", ".", "authenticated", "(", ")", ";", "if", "(", "isOAuth2Present", "&&", "OAuth...
The default {@link ServerHttpSecurity} configuration. @param http @return
[ "The", "default", "{" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/reactive/WebFluxSecurityConfiguration.java#L98-L113
test
Creates a security web filter chain.
Of course, here is the Java code you requested: ```java private SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { http .authorizeExchange() .anyExchange().authenticated(); if (isOAuth2Present && OAuth2ClasspathGuard.shouldConfigure(this.context)) { OAuth2ClasspathGuard.configur...
basis-technology-corp/tcl-regex-java
src/main/java/com/basistech/tclre/Nfa.java
Nfa.cleartraverse
void cleartraverse(State s) { Arc a; if (s.tmp == null) { return; } s.tmp = null; for (a = s.outs; a != null; a = a.outchain) { cleartraverse(a.to); } }
java
void cleartraverse(State s) { Arc a; if (s.tmp == null) { return; } s.tmp = null; for (a = s.outs; a != null; a = a.outchain) { cleartraverse(a.to); } }
[ "void", "cleartraverse", "(", "State", "s", ")", "{", "Arc", "a", ";", "if", "(", "s", ".", "tmp", "==", "null", ")", "{", "return", ";", "}", "s", ".", "tmp", "=", "null", ";", "for", "(", "a", "=", "s", ".", "outs", ";", "a", "!=", "null"...
/* - cleartraverse - recursive cleanup for algorithms that leave tmp ptrs set
[ "/", "*", "-", "cleartraverse", "-", "recursive", "cleanup", "for", "algorithms", "that", "leave", "tmp", "ptrs", "set" ]
de0d5eaccf9a61b694cb8793f234cc229c395b43
https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Nfa.java#L349-L360
test
Clear all the trajectories of a state.
Of course, here is the Java code you requested: ```java void cleartraverse(State s) { Arc a; if (s.tmp == null) { return; } s.tmp = null; for (a = s.outs; a != null; a = a.outchain) { cleartraverse(a.to); } } ``` Hope this helps!
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GeodeClient.java
GeodeClient.registerAfterPut
@SuppressWarnings({ "unchecked", "rawtypes" }) public <K,V> void registerAfterPut(String regionName, Consumer<EntryEvent<K, V>> consumer) { CacheListenerBridge<K, V> listener = (CacheListenerBridge)this.listenerMap.get(regionName); if(listener == null) { Region<K,V> region = (Region<K,V>)clientCache.getRegi...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) public <K,V> void registerAfterPut(String regionName, Consumer<EntryEvent<K, V>> consumer) { CacheListenerBridge<K, V> listener = (CacheListenerBridge)this.listenerMap.get(regionName); if(listener == null) { Region<K,V> region = (Region<K,V>)clientCache.getRegi...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "<", "K", ",", "V", ">", "void", "registerAfterPut", "(", "String", "regionName", ",", "Consumer", "<", "EntryEvent", "<", "K", ",", "V", ">", ">", "consumer", "...
Add the observer as a listener for put/create events @param <K> the region key @param <V> the region value @param regionName the region name @param consumer the observer
[ "Add", "the", "observer", "as", "a", "listener", "for", "put", "/", "create", "events" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GeodeClient.java#L537-L557
test
Register a consumer after a put operation.
Of course, here is the Java code you requested: ```java @SuppressWarnings({ "unchecked", "rawtypes" }) public <K,V> void registerAfterPut(String regionName, Consumer<EntryEvent<K, V>> consumer) { CacheListenerBridge<K, V> listener = (CacheListenerBridge)this.listenerMap.get(regionName); if(listener == null) {...
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/dom/Document.java
Document.addError
public void addError(final String message) { if (config.collectErrors) { if (errors == null) { errors = new ArrayList<>(); } errors.add(message); } }
java
public void addError(final String message) { if (config.collectErrors) { if (errors == null) { errors = new ArrayList<>(); } errors.add(message); } }
[ "public", "void", "addError", "(", "final", "String", "message", ")", "{", "if", "(", "config", ".", "collectErrors", ")", "{", "if", "(", "errors", "==", "null", ")", "{", "errors", "=", "new", "ArrayList", "<>", "(", ")", ";", "}", "errors", ".", ...
Add new error message to the {@link #getErrors() errors list}. If errors are not collected error, message is ignored.
[ "Add", "new", "error", "message", "to", "the", "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/Document.java#L79-L86
test
Add an error to the errors list.
Of course, here is the Java code you requested: ```java public void addError(final String message) { if (config.collectErrors) { if (errors == null) { errors = new ArrayList<>(); } errors.add(message); } } ``` Hope this helps!
demidenko05/beigesoft-replicator
src/main/java/org/beigesoft/replicator/service/ReplicatorXmlHttps.java
ReplicatorXmlHttps.authForm
public final void authForm(final Map<String, Object> pAddParams, final CookieManager pCookieManager) throws Exception { String authUrl = (String) pAddParams.get("authUrl"); String authUserName = (String) pAddParams.get("authUserName"); String authUserPass = (String) pAddParams.get("authUserPass"); ...
java
public final void authForm(final Map<String, Object> pAddParams, final CookieManager pCookieManager) throws Exception { String authUrl = (String) pAddParams.get("authUrl"); String authUserName = (String) pAddParams.get("authUserName"); String authUserPass = (String) pAddParams.get("authUserPass"); ...
[ "public", "final", "void", "authForm", "(", "final", "Map", "<", "String", ",", "Object", ">", "pAddParams", ",", "final", "CookieManager", "pCookieManager", ")", "throws", "Exception", "{", "String", "authUrl", "=", "(", "String", ")", "pAddParams", ".", "g...
<p>It authenticate by post simulate form.</p> @param pAddParams additional params @param pCookieManager CookieManager for form auth @throws Exception - an exception
[ "<p", ">", "It", "authenticate", "by", "post", "simulate", "form", ".", "<", "/", "p", ">" ]
d3cb848c366d2f6fbf6c2fb5066f0abe577a24bf
https://github.com/demidenko05/beigesoft-replicator/blob/d3cb848c366d2f6fbf6c2fb5066f0abe577a24bf/src/main/java/org/beigesoft/replicator/service/ReplicatorXmlHttps.java#L364-L437
test
Auth form.
Of course, here is the Java code you requested: ```java public final void authForm(final Map<String, Object> pAddParams, final CookieManager pCookieManager) throws Exception { String authUrl = (String) pAddParams.get("authUrl"); String authUserName = (String) pAddParams.get("authUserName"); String au...
Unidata/thredds
dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayStructure.java
CDMArrayStructure.getScalarString
public String getScalarString(int recnum, StructureMembers.Member m) { Array data = m.getDataArray(); return (String) data.getObject(recnum).toString(); }
java
public String getScalarString(int recnum, StructureMembers.Member m) { Array data = m.getDataArray(); return (String) data.getObject(recnum).toString(); }
[ "public", "String", "getScalarString", "(", "int", "recnum", ",", "StructureMembers", ".", "Member", "m", ")", "{", "Array", "data", "=", "m", ".", "getDataArray", "(", ")", ";", "return", "(", "String", ")", "data", ".", "getObject", "(", "recnum", ")",...
Get member databuffer of type String or char. @param recnum get databuffer from the recnum-th StructureData of the ArrayStructure. Must be less than getSize(); @param m get databuffer from this StructureMembers.Member. Must be of type String or char. @return scalar String value
[ "Get", "member", "databuffer", "of", "type", "String", "or", "char", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayStructure.java#L272-L276
test
Get the scalar string from a record.
Of course, here is the Java code you requested: ```java public String getScalarString(int recnum, StructureMembers.Member m) { Array data = m.getDataArray(); return (String) data.getObject(recnum).toString(); } ``` Hope this helps!
hazelcast/hazelcast-simulator
simulator/src/main/java/com/hazelcast/simulator/utils/HistogramLogProcessor.java
HistogramLogProcessor.run
@Override public void run() { PrintStream timeIntervalLog = null; PrintStream histogramPercentileLog = System.out; Double firstStartTime = 0.0; boolean timeIntervalLogLegendWritten = false; if (config.listTags) { Set<String> tags = new TreeSet<String>(); ...
java
@Override public void run() { PrintStream timeIntervalLog = null; PrintStream histogramPercentileLog = System.out; Double firstStartTime = 0.0; boolean timeIntervalLogLegendWritten = false; if (config.listTags) { Set<String> tags = new TreeSet<String>(); ...
[ "@", "Override", "public", "void", "run", "(", ")", "{", "PrintStream", "timeIntervalLog", "=", "null", ";", "PrintStream", "histogramPercentileLog", "=", "System", ".", "out", ";", "Double", "firstStartTime", "=", "0.0", ";", "boolean", "timeIntervalLogLegendWrit...
Run the log processor with the currently provided arguments.
[ "Run", "the", "log", "processor", "with", "the", "currently", "provided", "arguments", "." ]
231ecd05c2f33a5406d2104f74dd8a8065402034
https://github.com/hazelcast/hazelcast-simulator/blob/231ecd05c2f33a5406d2104f74dd8a8065402034/simulator/src/main/java/com/hazelcast/simulator/utils/HistogramLogProcessor.java#L178-L306
test
Run the application.
Of course, here is the Java code you requested: ```java @Override public void run() { PrintStream timeIntervalLog = null; PrintStream histogramPercentileLog = System.out; Double firstStartTime = 0.0; boolean timeIntervalLogLegendWritten = false; if (config.listTags) { ...
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java
TimerServiceImpl.cancelTimeout
protected void cancelTimeout(final TimerImpl timer) { synchronized (this.scheduledTimerFutures) { java.util.TimerTask timerTask = this.scheduledTimerFutures.remove(timer.getId()); if (timerTask != null) { timerTask.cancel(); } } }
java
protected void cancelTimeout(final TimerImpl timer) { synchronized (this.scheduledTimerFutures) { java.util.TimerTask timerTask = this.scheduledTimerFutures.remove(timer.getId()); if (timerTask != null) { timerTask.cancel(); } } }
[ "protected", "void", "cancelTimeout", "(", "final", "TimerImpl", "timer", ")", "{", "synchronized", "(", "this", ".", "scheduledTimerFutures", ")", "{", "java", ".", "util", ".", "TimerTask", "timerTask", "=", "this", ".", "scheduledTimerFutures", ".", "remove",...
Cancels any scheduled {@link java.util.concurrent.Future} corresponding to the passed <code>timer</code> @param timer
[ "Cancels", "any", "scheduled", "{", "@link", "java", ".", "util", ".", "concurrent", ".", "Future", "}", "corresponding", "to", "the", "passed", "<code", ">", "timer<", "/", "code", ">" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java#L919-L926
test
Cancel a timer.
Of course, here is the Java code you requested: ```java protected void cancelTimeout(final TimerImpl timer) { synchronized (this.scheduledTimerFutures) { java.util.TimerTask timerTask = this.scheduledTimerFutures.remove(timer.getId()); if (timerTask != null) { timerTask....
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/retrieval/Document.java
Document.getSectionLabels
public String getSectionLabels(int i) { if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sectionLabels == null) jcasType.jcas.throwFeatMissing("sectionLabels", "edu.cmu.lti.oaqa.type.retrieval.Document"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)j...
java
public String getSectionLabels(int i) { if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sectionLabels == null) jcasType.jcas.throwFeatMissing("sectionLabels", "edu.cmu.lti.oaqa.type.retrieval.Document"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)j...
[ "public", "String", "getSectionLabels", "(", "int", "i", ")", "{", "if", "(", "Document_Type", ".", "featOkTst", "&&", "(", "(", "Document_Type", ")", "jcasType", ")", ".", "casFeat_sectionLabels", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatM...
indexed getter for sectionLabels - gets an indexed value - Section labels in the document, e.g. sections.0, sections1, etc. @generated @param i index in the array to get @return value of the element at index i
[ "indexed", "getter", "for", "sectionLabels", "-", "gets", "an", "indexed", "value", "-", "Section", "labels", "in", "the", "document", "e", ".", "g", ".", "sections", ".", "0", "sections1", "etc", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/retrieval/Document.java#L181-L185
test
indexed getter for sectionLabels - gets an indexed value -
Of course, here is the Java code you requested: ```java public String getSectionLabels(int i) { if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_sectionLabels == null) jcasType.jcas.throwFeatMissing("sectionLabels", "edu.cmu.lti.oaqa.type.retrieval.Document"); jcasType.jcas.checkArrayBoun...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/LoadEngine.java
LoadEngine.translate
public Result<Map<Key<?>, Object>> translate(final Result<Map<com.google.cloud.datastore.Key, Entity>> raw) { return new ResultCache<Map<Key<?>, Object>>() { /** */ private LoadContext ctx; /** */ @Override public Map<Key<?>, Object> nowUncached() { final Map<Key<?>, Object> result = new...
java
public Result<Map<Key<?>, Object>> translate(final Result<Map<com.google.cloud.datastore.Key, Entity>> raw) { return new ResultCache<Map<Key<?>, Object>>() { /** */ private LoadContext ctx; /** */ @Override public Map<Key<?>, Object> nowUncached() { final Map<Key<?>, Object> result = new...
[ "public", "Result", "<", "Map", "<", "Key", "<", "?", ">", ",", "Object", ">", ">", "translate", "(", "final", "Result", "<", "Map", "<", "com", ".", "google", ".", "cloud", ".", "datastore", ".", "Key", ",", "Entity", ">", ">", "raw", ")", "{", ...
Asynchronously translate raw to processed; might produce successive load operations as refs are filled in
[ "Asynchronously", "translate", "raw", "to", "processed", ";", "might", "produce", "successive", "load", "operations", "as", "refs", "are", "filled", "in" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/LoadEngine.java#L139-L171
test
Translate a Result of Map<Key<?>, Object&gt ; objects into a ResultCache.
Of course, here is the Java code you requested: ```java public Result<Map<Key<?>, Object>> translate(final Result<Map<com.google.cloud.datastore.Key, Entity>> raw) { return new ResultCache<Map<Key<?>, Object>>() { /** */ private LoadContext ctx; /** */ @Override public Map<Key<?>, Object> no...
streamsets/datacollector
jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/util/OffsetQueryUtil.java
OffsetQueryUtil.validateStoredAndSpecifiedOffset
public static Map<String, String> validateStoredAndSpecifiedOffset(TableContext tableContext, String offset) throws StageException { Set<String> expectedColumns = Sets.newHashSet(tableContext.getOffsetColumns()); final Map<String, String> actualOffsets = getColumnsToOffsetMapFromOffsetFormat(offset); // on...
java
public static Map<String, String> validateStoredAndSpecifiedOffset(TableContext tableContext, String offset) throws StageException { Set<String> expectedColumns = Sets.newHashSet(tableContext.getOffsetColumns()); final Map<String, String> actualOffsets = getColumnsToOffsetMapFromOffsetFormat(offset); // on...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "validateStoredAndSpecifiedOffset", "(", "TableContext", "tableContext", ",", "String", "offset", ")", "throws", "StageException", "{", "Set", "<", "String", ">", "expectedColumns", "=", "Sets", ".", ...
Validates whether offset names match in the stored offset with respect to table configuration @param tableContext {@link TableContext} for table @param offset Stored offset from the previous stage run @return the actual offset map as deserialized from the offset param, if valid @throws StageException if columns mismatc...
[ "Validates", "whether", "offset", "names", "match", "in", "the", "stored", "offset", "with", "respect", "to", "table", "configuration" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/util/OffsetQueryUtil.java#L461-L484
test
Validate the stored and specified offset.
Of course, here is the Java code you requested: ```java public static Map<String, String> validateStoredAndSpecifiedOffset(TableContext tableContext, String offset) throws StageException { Set<String> expectedColumns = Sets.newHashSet(tableContext.getOffsetColumns()); final Map<String, String> actualOffsets = ...
agentsoz/jill
jill/src/main/java/io/github/agentsoz/jill/lang/PlanBindings.java
PlanBindings.add
public void add(Plan plan, Set<Belief> planBindings) { if (plan == null) { return; } // remove any old bindings, making sure to decrement the cached size if (this.bindings.containsKey(plan)) { Set<Belief> oldBindings = this.bindings.remove(plan); if (oldBindings == null || oldBindings....
java
public void add(Plan plan, Set<Belief> planBindings) { if (plan == null) { return; } // remove any old bindings, making sure to decrement the cached size if (this.bindings.containsKey(plan)) { Set<Belief> oldBindings = this.bindings.remove(plan); if (oldBindings == null || oldBindings....
[ "public", "void", "add", "(", "Plan", "plan", ",", "Set", "<", "Belief", ">", "planBindings", ")", "{", "if", "(", "plan", "==", "null", ")", "{", "return", ";", "}", "// remove any old bindings, making sure to decrement the cached size", "if", "(", "this", "....
Add the set of bindings for a given plan to this store. Any previously stored bindings for this plan will be replaced. @param plan the plan type @param planBindings the available bindings
[ "Add", "the", "set", "of", "bindings", "for", "a", "given", "plan", "to", "this", "store", ".", "Any", "previously", "stored", "bindings", "for", "this", "plan", "will", "be", "replaced", "." ]
13126fc78350465b477386132465f84cad719426
https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/lang/PlanBindings.java#L68-L88
test
Add a binding to a single plan.
Of course, here is the Java code you requested: ```java public void add(Plan plan, Set<Belief> planBindings) { if (plan == null) { return; } // remove any old bindings, making sure to decrement the cached size if (this.bindings.containsKey(plan)) { Set<Belief> oldBindings = this.bindings.re...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/awt/BgrConverter.java
BgrConverter.toImage
@Override public BufferedImage toImage(BufferedImage output, final MediaPicture input) { validatePicture(input); // test that the picture is valid if (output == null) { final byte[] bytes = new byte[willResample() ? mResampleMediaPicture.getDataPlaneSize(0) : input.getDataPlaneSize(0)]; // cre...
java
@Override public BufferedImage toImage(BufferedImage output, final MediaPicture input) { validatePicture(input); // test that the picture is valid if (output == null) { final byte[] bytes = new byte[willResample() ? mResampleMediaPicture.getDataPlaneSize(0) : input.getDataPlaneSize(0)]; // cre...
[ "@", "Override", "public", "BufferedImage", "toImage", "(", "BufferedImage", "output", ",", "final", "MediaPicture", "input", ")", "{", "validatePicture", "(", "input", ")", ";", "// test that the picture is valid", "if", "(", "output", "==", "null", ")", "{", "...
{@inheritDoc}
[ "{" ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/awt/BgrConverter.java#L162-L222
test
Convert a MediaPicture to an image.
Of course, here is the Java code you requested: ```java @Override public BufferedImage toImage(BufferedImage output, final MediaPicture input) { validatePicture(input); // test that the picture is valid if (output == null) { final byte[] bytes = new byte[willResample() ? mResampleMediaPicture.getDa...
rupertlssmith/lojix
lojix/power_model/src/main/com/thesett/aima/attribute/impl/IntRangeType.java
IntRangeType.getAllPossibleValuesSet
public Set<Integer> getAllPossibleValuesSet() throws InfiniteValuesException { Set<Integer> results = new HashSet<Integer>(); for (int i = minValue; i <= maxValue; i++) { results.add(i); } return results; }
java
public Set<Integer> getAllPossibleValuesSet() throws InfiniteValuesException { Set<Integer> results = new HashSet<Integer>(); for (int i = minValue; i <= maxValue; i++) { results.add(i); } return results; }
[ "public", "Set", "<", "Integer", ">", "getAllPossibleValuesSet", "(", ")", "throws", "InfiniteValuesException", "{", "Set", "<", "Integer", ">", "results", "=", "new", "HashSet", "<", "Integer", ">", "(", ")", ";", "for", "(", "int", "i", "=", "minValue", ...
{@inheritDoc} <p/>Beware that as this operation creates a fully expanded set of the integer range in memory, large ranges may use a lot of memory. Consider using the {@link #getAllPossibleValuesIterator()} method instead, as it lazily creates the values on demand.
[ "{", "@inheritDoc", "}" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/power_model/src/main/com/thesett/aima/attribute/impl/IntRangeType.java#L213-L223
test
Get all possible values set.
Of course, here is the Java code you requested: ```java public Set<Integer> getAllPossibleValuesSet() throws InfiniteValuesException { Set<Integer> results = new HashSet<Integer>(); for (int i = minValue; i <= maxValue; i++) { results.add(i); } return results; ...
real-logic/aeron
aeron-client/src/main/java/io/aeron/logbuffer/TermAppender.java
TermAppender.claim
public int claim( final HeaderWriter header, final int length, final BufferClaim bufferClaim, final int activeTermId) { final int frameLength = length + HEADER_LENGTH; final int alignedLength = align(frameLength, FRAME_ALIGNMENT); final UnsafeBuffer termBuffer...
java
public int claim( final HeaderWriter header, final int length, final BufferClaim bufferClaim, final int activeTermId) { final int frameLength = length + HEADER_LENGTH; final int alignedLength = align(frameLength, FRAME_ALIGNMENT); final UnsafeBuffer termBuffer...
[ "public", "int", "claim", "(", "final", "HeaderWriter", "header", ",", "final", "int", "length", ",", "final", "BufferClaim", "bufferClaim", ",", "final", "int", "activeTermId", ")", "{", "final", "int", "frameLength", "=", "length", "+", "HEADER_LENGTH", ";",...
Claim length of a the term buffer for writing in the message with zero copy semantics. @param header for writing the default header. @param length of the message to be written. @param bufferClaim to be updated with the claimed region. @param activeTermId used for flow control. @return the resulting offset...
[ "Claim", "length", "of", "a", "the", "term", "buffer", "for", "writing", "in", "the", "message", "with", "zero", "copy", "semantics", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/logbuffer/TermAppender.java#L97-L127
test
Claim a single entry from the log.
Of course, here is the Java code you requested: ```java public int claim( final HeaderWriter header, final int length, final BufferClaim bufferClaim, final int activeTermId) { final int frameLength = length + HEADER_LENGTH; final int alignedLength = align(frameLength...
Unidata/thredds
cdm/src/main/java/ucar/nc2/util/cache/SmartArrayInt.java
SmartArrayInt.findIdx
public int findIdx(int want) { if (isConstant) return (want == start) ? 0 : -1; if (isSequential) return want - start; if (isSorted) { return Arrays.binarySearch(raw, want); } // linear search for (int i=0; i<raw.length; i++) if (raw[i] == want) return i; return -1; }
java
public int findIdx(int want) { if (isConstant) return (want == start) ? 0 : -1; if (isSequential) return want - start; if (isSorted) { return Arrays.binarySearch(raw, want); } // linear search for (int i=0; i<raw.length; i++) if (raw[i] == want) return i; return -1; }
[ "public", "int", "findIdx", "(", "int", "want", ")", "{", "if", "(", "isConstant", ")", "return", "(", "want", "==", "start", ")", "?", "0", ":", "-", "1", ";", "if", "(", "isSequential", ")", "return", "want", "-", "start", ";", "if", "(", "isSo...
Find which index holds the value want @param want value wanted @return < 0 if not found, else the index. If duplicates, then return any match
[ "Find", "which", "index", "holds", "the", "value", "want" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/cache/SmartArrayInt.java#L80-L90
test
Find the index of the first occurrence of the given value in the sequence.
Of course, here is the Java code you requested: ```java public int findIdx(int want) { if (isConstant) return (want == start) ? 0 : -1; if (isSequential) return want - start; if (isSorted) { return Arrays.binarySearch(raw, want); } // linear search for (int i=0; i<raw.length; i++) ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/wmo/CommonCodeTable.java
CommonCodeTable.getCenterNameBufr
public static String getCenterNameBufr(int center_id, int edition) { String result = (edition < 4) ? getTableValue(1, center_id) : getTableValue(11, center_id); if (result != null) return result; if (center_id == 0) return "WMO standard table"; return "Unknown center=" + center_id; }
java
public static String getCenterNameBufr(int center_id, int edition) { String result = (edition < 4) ? getTableValue(1, center_id) : getTableValue(11, center_id); if (result != null) return result; if (center_id == 0) return "WMO standard table"; return "Unknown center=" + center_id; }
[ "public", "static", "String", "getCenterNameBufr", "(", "int", "center_id", ",", "int", "edition", ")", "{", "String", "result", "=", "(", "edition", "<", "4", ")", "?", "getTableValue", "(", "1", ",", "center_id", ")", ":", "getTableValue", "(", "11", "...
Center name, from table C-1 or C-11 @param center_id center id @param edition bufr edition @return center name, or "unknown"
[ "Center", "name", "from", "table", "C", "-", "1", "or", "C", "-", "11" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/wmo/CommonCodeTable.java#L148-L153
test
Returns the name of the Bufr table for the center_id and edition
Of course, here is the Java code you requested: ```java public static String getCenterNameBufr(int center_id, int edition) { String result = (edition < 4) ? getTableValue(1, center_id) : getTableValue(11, center_id); if (result != null) return result; if (center_id == 0) return "WMO standard table"; ...
wro4j/wro4j
wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/template/AbstractJsTemplateCompiler.java
AbstractJsTemplateCompiler.compile
public String compile(final String content, final String optionalArgument) { final RhinoScriptBuilder builder = initScriptBuilder(); final String argStr = createArgStr(optionalArgument) + createArgStr(getArguments()); final String compileScript = String.format("%s(%s%s);", getCompileCommand(), WroUtil...
java
public String compile(final String content, final String optionalArgument) { final RhinoScriptBuilder builder = initScriptBuilder(); final String argStr = createArgStr(optionalArgument) + createArgStr(getArguments()); final String compileScript = String.format("%s(%s%s);", getCompileCommand(), WroUtil...
[ "public", "String", "compile", "(", "final", "String", "content", ",", "final", "String", "optionalArgument", ")", "{", "final", "RhinoScriptBuilder", "builder", "=", "initScriptBuilder", "(", ")", ";", "final", "String", "argStr", "=", "createArgStr", "(", "opt...
Compiles the javascript template into plain javascript. @param content the template to be compiled. @param optionalArgument any additional arguments used by template script. @return the compiled javascript.
[ "Compiles", "the", "javascript", "template", "into", "plain", "javascript", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/template/AbstractJsTemplateCompiler.java#L33-L39
test
Compile the content into a JS string.
Of course, here is the Java code you requested: ```java public String compile(final String content, final String optionalArgument) { final RhinoScriptBuilder builder = initScriptBuilder(); final String argStr = createArgStr(optionalArgument) + createArgStr(getArguments()); final String compileScript = ...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/properties/PropertiesAssistant.java
PropertiesAssistant.initProperties
public void initProperties() { propertiesPath = getContext().getFiles().getPropertiesLocation() + File.separator + getContext().getAddOns().getAddOn().getID() + ".properties"; this.propertiesFile = new File(propertiesPath); if (!this.propertiesFile.exists()) try { th...
java
public void initProperties() { propertiesPath = getContext().getFiles().getPropertiesLocation() + File.separator + getContext().getAddOns().getAddOn().getID() + ".properties"; this.propertiesFile = new File(propertiesPath); if (!this.propertiesFile.exists()) try { th...
[ "public", "void", "initProperties", "(", ")", "{", "propertiesPath", "=", "getContext", "(", ")", ".", "getFiles", "(", ")", ".", "getPropertiesLocation", "(", ")", "+", "File", ".", "separator", "+", "getContext", "(", ")", ".", "getAddOns", "(", ")", "...
Initializes properties in the addOn. Creates new properties file using default properties.
[ "Initializes", "properties", "in", "the", "addOn", ".", "Creates", "new", "properties", "file", "using", "default", "properties", "." ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/properties/PropertiesAssistant.java#L138-L176
test
Initialize the properties file.
Of course, here is the Java code you requested: ```java public void initProperties() { propertiesPath = getContext().getFiles().getPropertiesLocation() + File.separator + getContext().getAddOns().getAddOn().getID() + ".properties"; this.propertiesFile = new File(propertiesPath); ...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/Broadcast.java
Broadcast.max
public static INDArray max(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null) { Preconditions.checkArgument(Arrays.equals(x.shape(),y.shape()),getFormattedShapeErrorMessageXy(x,y)); Preconditions.checkArgument(Arrays.equals(x.shape(),z.shape()),getFormattedSh...
java
public static INDArray max(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null) { Preconditions.checkArgument(Arrays.equals(x.shape(),y.shape()),getFormattedShapeErrorMessageXy(x,y)); Preconditions.checkArgument(Arrays.equals(x.shape(),z.shape()),getFormattedSh...
[ "public", "static", "INDArray", "max", "(", "INDArray", "x", ",", "INDArray", "y", ",", "INDArray", "z", ",", "int", "...", "dimensions", ")", "{", "if", "(", "dimensions", "==", "null", ")", "{", "Preconditions", ".", "checkArgument", "(", "Arrays", "."...
Broadcast max op. See: {@link BroadcastMax}
[ "Broadcast", "max", "op", ".", "See", ":", "{" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/Broadcast.java#L208-L217
test
Max function for broadcasting
Of course, here is the Java code you requested: ```java public static INDArray max(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null) { Preconditions.checkArgument(Arrays.equals(x.shape(),y.shape()),getFormattedShapeErrorMessageXy(x,y)); Preconditions.checkA...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/loss/LossFunctions.java
LossFunctions.nonZeroCount
private static SDVariable nonZeroCount(SDVariable weights, SDVariable labels){ SameDiff sd = weights.getSameDiff(); SDVariable present = sd.neq(weights, 0.0); SDVariable presentBroadcast = sd.zerosLike(labels).add(present); return sd.sum(presentBroadcast); }
java
private static SDVariable nonZeroCount(SDVariable weights, SDVariable labels){ SameDiff sd = weights.getSameDiff(); SDVariable present = sd.neq(weights, 0.0); SDVariable presentBroadcast = sd.zerosLike(labels).add(present); return sd.sum(presentBroadcast); }
[ "private", "static", "SDVariable", "nonZeroCount", "(", "SDVariable", "weights", ",", "SDVariable", "labels", ")", "{", "SameDiff", "sd", "=", "weights", ".", "getSameDiff", "(", ")", ";", "SDVariable", "present", "=", "sd", ".", "neq", "(", "weights", ",", ...
Determine the number of weight entries that are non-zero, after broadcasting @param weights @param labels @return
[ "Determine", "the", "number", "of", "weight", "entries", "that", "are", "non", "-", "zero", "after", "broadcasting" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/loss/LossFunctions.java#L200-L207
test
Compute the non - zero count SDVariable
Of course, here is the Java code you requested: ```java private static SDVariable nonZeroCount(SDVariable weights, SDVariable labels){ SameDiff sd = weights.getSameDiff(); SDVariable present = sd.neq(weights, 0.0); SDVariable presentBroadcast = sd.zerosLike(labels).add(present); retur...
Unidata/thredds
legacy/src/main/java/thredds/catalog/CollectionType.java
CollectionType.getType
public static CollectionType getType(String name) { if (name == null) return null; CollectionType type = findType( name); return type != null ? type : new CollectionType( name, false); }
java
public static CollectionType getType(String name) { if (name == null) return null; CollectionType type = findType( name); return type != null ? type : new CollectionType( name, false); }
[ "public", "static", "CollectionType", "getType", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "return", "null", ";", "CollectionType", "type", "=", "findType", "(", "name", ")", ";", "return", "type", "!=", "null", "?", "type", ...
Return a CollectionType that matches the given name by either matching a known type (ignoring case) or creating an unknown type. @param name name of the desired CollectionType @return the named CollectionType or null if given name is null.
[ "Return", "a", "CollectionType", "that", "matches", "the", "given", "name", "by", "either", "matching", "a", "known", "type", "(", "ignoring", "case", ")", "or", "creating", "an", "unknown", "type", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/CollectionType.java#L58-L62
test
Get the type with the given name.
Of course, here is the Java code you requested: ```java public static CollectionType getType(String name) { if (name == null) return null; CollectionType type = findType( name); return type != null ? type : new CollectionType( name, false); } ``` Hope this helps!
Unidata/thredds
dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java
DapNode.getContainerPath
public List<DapNode> getContainerPath() { List<DapNode> path = new ArrayList<DapNode>(); DapNode current = this.getContainer(); for(; ; ) { path.add(0, current); if(current.getContainer() == null) break; current = current.getContainer(); ...
java
public List<DapNode> getContainerPath() { List<DapNode> path = new ArrayList<DapNode>(); DapNode current = this.getContainer(); for(; ; ) { path.add(0, current); if(current.getContainer() == null) break; current = current.getContainer(); ...
[ "public", "List", "<", "DapNode", ">", "getContainerPath", "(", ")", "{", "List", "<", "DapNode", ">", "path", "=", "new", "ArrayList", "<", "DapNode", ">", "(", ")", ";", "DapNode", "current", "=", "this", ".", "getContainer", "(", ")", ";", "for", ...
Get the transitive list of containers Not including this node @return list of container nodes
[ "Get", "the", "transitive", "list", "of", "containers", "Not", "including", "this", "node" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java#L436-L447
test
Get the path of the DAP document.
Of course, here is the Java code you requested: ```java public List<DapNode> getContainerPath() { List<DapNode> path = new ArrayList<DapNode>(); DapNode current = this.getContainer(); for(; ; ) { path.add(0, current); if(current.getContainer() == null) ...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Objektart.java
Objektart.getHallenLagerProd
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public List<HallenLagerProd> getHallenLagerProd() { if (hallenLagerProd == null) { hallenLagerProd = new ArrayList<HallenLagerProd>(); } return this.hallenLagerProd; ...
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public List<HallenLagerProd> getHallenLagerProd() { if (hallenLagerProd == null) { hallenLagerProd = new ArrayList<HallenLagerProd>(); } return this.hallenLagerProd; ...
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:54:50+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "List", "<", "HallenLagerProd", ">", "getHallenLagerProd", "(", ")", "{", "if", "(", ...
Gets the value of the hallenLagerProd property. <p> This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for the hallenLagerProd property. <p> For e...
[ "Gets", "the", "value", "of", "the", "hallenLagerProd", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Objektart.java#L321-L327
test
Gets the value of the hallenLagerProd property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public List<HallenLagerProd> getHallenLagerProd() { if (hallenLagerProd == null) { hallenLagerProd = new ArrayList<HallenLager...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.createImage
public CoverageDataPngImage createImage(int tileWidth, int tileHeight) { ImageInfo imageInfo = new ImageInfo(tileWidth, tileHeight, 16, false, true, false); CoverageDataPngImage image = new CoverageDataPngImage(imageInfo); return image; }
java
public CoverageDataPngImage createImage(int tileWidth, int tileHeight) { ImageInfo imageInfo = new ImageInfo(tileWidth, tileHeight, 16, false, true, false); CoverageDataPngImage image = new CoverageDataPngImage(imageInfo); return image; }
[ "public", "CoverageDataPngImage", "createImage", "(", "int", "tileWidth", ",", "int", "tileHeight", ")", "{", "ImageInfo", "imageInfo", "=", "new", "ImageInfo", "(", "tileWidth", ",", "tileHeight", ",", "16", ",", "false", ",", "true", ",", "false", ")", ";"...
Create a new 16 bit single channel image @param tileWidth tile width @param tileHeight tile height @return image
[ "Create", "a", "new", "16", "bit", "single", "channel", "image" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L453-L457
test
Create an image from the tile width and height.
Of course, here is the Java code you requested: ```java public CoverageDataPngImage createImage(int tileWidth, int tileHeight) { ImageInfo imageInfo = new ImageInfo(tileWidth, tileHeight, 16, false, true, false); CoverageDataPngImage image = new CoverageDataPngImage(imageInfo); return image; ...
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/Index.java
Index.getObject
public JSONObject getObject(String objectID, @Nullable RequestOptions requestOptions) throws AlgoliaException { try { return client.getRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8"), /* urlParameters: */ null, false, requestOptions); } catch (Unsupporte...
java
public JSONObject getObject(String objectID, @Nullable RequestOptions requestOptions) throws AlgoliaException { try { return client.getRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8"), /* urlParameters: */ null, false, requestOptions); } catch (Unsupporte...
[ "public", "JSONObject", "getObject", "(", "String", "objectID", ",", "@", "Nullable", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "try", "{", "return", "client", ".", "getRequest", "(", "\"/1/indexes/\"", "+", "encodedIndexName", "+",...
Gets an object from this index. @param objectID the unique identifier of the object to retrieve @param requestOptions Request-specific options. @throws AlgoliaException
[ "Gets", "an", "object", "from", "this", "index", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L1082-L1088
test
Get a single object from the index
Of course, here is the Java code you requested: ```java public JSONObject getObject(String objectID, @Nullable RequestOptions requestOptions) throws AlgoliaException { try { return client.getRequest("/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8"), /* urlParameters: */ ...
oblac/jodd
jodd-json/src/main/java/jodd/json/MapToBean.java
MapToBean.setValue
private void setValue(final Object target, final PropertyDescriptor pd, Object value) throws InvocationTargetException, IllegalAccessException { Class propertyType; Setter setter = pd.getSetter(true); if (setter != null) { if (value != null) { propertyType = setter.getSetterRawType(); value = jsonPars...
java
private void setValue(final Object target, final PropertyDescriptor pd, Object value) throws InvocationTargetException, IllegalAccessException { Class propertyType; Setter setter = pd.getSetter(true); if (setter != null) { if (value != null) { propertyType = setter.getSetterRawType(); value = jsonPars...
[ "private", "void", "setValue", "(", "final", "Object", "target", ",", "final", "PropertyDescriptor", "pd", ",", "Object", "value", ")", "throws", "InvocationTargetException", ",", "IllegalAccessException", "{", "Class", "propertyType", ";", "Setter", "setter", "=", ...
Sets the property value.
[ "Sets", "the", "property", "value", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-json/src/main/java/jodd/json/MapToBean.java#L186-L197
test
Sets the value of the specified property.
Of course, here is the Java code you requested: ```java private void setValue(final Object target, final PropertyDescriptor pd, Object value) throws InvocationTargetException, IllegalAccessException { Class propertyType; Setter setter = pd.getSetter(true); if (setter != null) { if (value != null) { prope...
wro4j/wro4j
wro4j-extensions/src/main/java/ro/isdc/wro/extensions/support/lint/ReportXmlFormatter.java
ReportXmlFormatter.create
public static ReportXmlFormatter create(final LintReport<LintItem> lintReport, final FormatterType formatterType) { return new ReportXmlFormatter(lintReport, formatterType); }
java
public static ReportXmlFormatter create(final LintReport<LintItem> lintReport, final FormatterType formatterType) { return new ReportXmlFormatter(lintReport, formatterType); }
[ "public", "static", "ReportXmlFormatter", "create", "(", "final", "LintReport", "<", "LintItem", ">", "lintReport", ",", "final", "FormatterType", "formatterType", ")", "{", "return", "new", "ReportXmlFormatter", "(", "lintReport", ",", "formatterType", ")", ";", ...
Factory method for creating {@link ReportXmlFormatter}. @param lintReport {@link LintReport} to build xml reports from.
[ "Factory", "method", "for", "creating", "{", "@link", "ReportXmlFormatter", "}", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/support/lint/ReportXmlFormatter.java#L98-L100
test
Create report xml formatter.
Of course, here is the Java code you requested: ```java public static ReportXmlFormatter create(final LintReport<LintItem> lintReport, final FormatterType formatterType) { return new ReportXmlFormatter(lintReport, formatterType); } ``` Hope this helps!
arnohaase/a-foundation
a-foundation-benchmark/src/main/java/com/ajjpj/afoundation/concurrent/jdk/j9new/ForkJoinPool.java
ForkJoinPool.tryTerminate
private boolean tryTerminate(boolean now, boolean enable) { int rs; if (this == common) // cannot shut down return false; if ((rs = runState) >= 0) { if (!enable) return false; rs = lockRunState(); // ente...
java
private boolean tryTerminate(boolean now, boolean enable) { int rs; if (this == common) // cannot shut down return false; if ((rs = runState) >= 0) { if (!enable) return false; rs = lockRunState(); // ente...
[ "private", "boolean", "tryTerminate", "(", "boolean", "now", ",", "boolean", "enable", ")", "{", "int", "rs", ";", "if", "(", "this", "==", "common", ")", "// cannot shut down", "return", "false", ";", "if", "(", "(", "rs", "=", "runState", ")", ">=", ...
Possibly initiates and/or completes termination. @param now if true, unconditionally terminate, else only if no work and no active workers @param enable if true, enable shutdown when next possible @return true if now terminating or terminated
[ "Possibly", "initiates", "and", "/", "or", "completes", "termination", "." ]
f3eef2ca89d67775f202a4c28140230a6229291e
https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation-benchmark/src/main/java/com/ajjpj/afoundation/concurrent/jdk/j9new/ForkJoinPool.java#L2219-L2306
test
Try to terminate the application.
Of course, here is the Java code you requested: ```java private boolean tryTerminate(boolean now, boolean enable) { int rs; if (this == common) // cannot shut down return false; if ((rs = runState) >= 0) { if (!enable) return false; ...
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/config/ActionRuntime.java
ActionRuntime.createActionString
public String createActionString() { if (actionHandler != null) { return actionHandler.getClass().getName(); } String className = actionClass.getName(); final int ndx = className.indexOf("$$"); if (ndx != -1) { className = className.substring(0, ndx); } return className + '#' + actionClassMethod....
java
public String createActionString() { if (actionHandler != null) { return actionHandler.getClass().getName(); } String className = actionClass.getName(); final int ndx = className.indexOf("$$"); if (ndx != -1) { className = className.substring(0, ndx); } return className + '#' + actionClassMethod....
[ "public", "String", "createActionString", "(", ")", "{", "if", "(", "actionHandler", "!=", "null", ")", "{", "return", "actionHandler", ".", "getClass", "(", ")", ".", "getName", "(", ")", ";", "}", "String", "className", "=", "actionClass", ".", "getName"...
Returns action string in form 'actionClass#actionMethod'.
[ "Returns", "action", "string", "in", "form", "actionClass#actionMethod", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/config/ActionRuntime.java#L257-L270
test
Create the action string.
Of course, here is the Java code you requested: ```java public String createActionString() { if (actionHandler != null) { return actionHandler.getClass().getName(); } String className = actionClass.getName(); final int ndx = className.indexOf("$$"); if (ndx != -1) { className = className.substring(0,...
amedia/meteo
meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java
ObjectFactory.createLocationTypeHighestTemperature
@XmlElementDecl(namespace = "", name = "highestTemperature", scope = LocationType.class) public JAXBElement<Temperature> createLocationTypeHighestTemperature(Temperature value) { return new JAXBElement<Temperature>(_LocationTypeHighestTemperature_QNAME, Temperature.class, LocationType.class, value); }
java
@XmlElementDecl(namespace = "", name = "highestTemperature", scope = LocationType.class) public JAXBElement<Temperature> createLocationTypeHighestTemperature(Temperature value) { return new JAXBElement<Temperature>(_LocationTypeHighestTemperature_QNAME, Temperature.class, LocationType.class, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"highestTemperature\"", ",", "scope", "=", "LocationType", ".", "class", ")", "public", "JAXBElement", "<", "Temperature", ">", "createLocationTypeHighestTemperature", "(", "Temperature", "val...
Create an instance of {@link JAXBElement }{@code <}{@link Temperature }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Temperature", "}", "{", "@code", ">", "}}" ]
cbb59e1c2f889d15c24f3625d1769b543d4af595
https://github.com/amedia/meteo/blob/cbb59e1c2f889d15c24f3625d1769b543d4af595/meteo-jaxb/src/main/java/no/api/meteo/jaxb/locationforecast/v1_9/ObjectFactory.java#L285-L288
test
Create an instance of the JAXBElement required to determine the highest temperature value for a LocationType.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "highestTemperature", scope = LocationType.class) public JAXBElement<Temperature> createLocationTypeHighestTemperature(Temperature value) { return new JAXBElement<Temperature>(_LocationTypeHighestTemperature_QNAM...
kiegroup/droolsjbpm-tools
drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/rete/ReteViewer.java
ReteViewer.zeroBaseDiagram
private void zeroBaseDiagram(ReteGraph graph) { Dimension dim = rootEditPart.getContentPane().getSize(); int minx = 0, miny = 0, maxx = 0, x = dim.width; final Iterator<BaseVertex> nodeIter = graph.getChildren().iterator(); while ( nodeIter.hasNext() ) { Point loc = nodeIt...
java
private void zeroBaseDiagram(ReteGraph graph) { Dimension dim = rootEditPart.getContentPane().getSize(); int minx = 0, miny = 0, maxx = 0, x = dim.width; final Iterator<BaseVertex> nodeIter = graph.getChildren().iterator(); while ( nodeIter.hasNext() ) { Point loc = nodeIt...
[ "private", "void", "zeroBaseDiagram", "(", "ReteGraph", "graph", ")", "{", "Dimension", "dim", "=", "rootEditPart", ".", "getContentPane", "(", ")", ".", "getSize", "(", ")", ";", "int", "minx", "=", "0", ",", "miny", "=", "0", ",", "maxx", "=", "0", ...
Moves all <code>diagram</code> nodes to upper left corner and shifting to right if neccessary to get rid of negative XY coordinates.
[ "Moves", "all", "<code", ">", "diagram<", "/", "code", ">", "nodes", "to", "upper", "left", "corner", "and", "shifting", "to", "right", "if", "neccessary", "to", "get", "rid", "of", "negative", "XY", "coordinates", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/rete/ReteViewer.java#L228-L255
test
Zero base diagram.
Of course, here is the Java code you requested: ```java private void zeroBaseDiagram(ReteGraph graph) { Dimension dim = rootEditPart.getContentPane().getSize(); int minx = 0, miny = 0, maxx = 0, x = dim.width; final Iterator<BaseVertex> nodeIter = graph.getChildren().iterator(); whil...
RestComm/jain-slee
api/jar/src/main/java/javax/slee/profile/query/Not.java
Not.checkForCycles
void checkForCycles(QueryExpression expr) throws IllegalArgumentException { // is the expression argument equal to this? if (expr == this) throw new IllegalArgumentException("Cyclic expression detected"); // recurse through nested expression if it's a composite expression QueryExpressio...
java
void checkForCycles(QueryExpression expr) throws IllegalArgumentException { // is the expression argument equal to this? if (expr == this) throw new IllegalArgumentException("Cyclic expression detected"); // recurse through nested expression if it's a composite expression QueryExpressio...
[ "void", "checkForCycles", "(", "QueryExpression", "expr", ")", "throws", "IllegalArgumentException", "{", "// is the expression argument equal to this?", "if", "(", "expr", "==", "this", ")", "throw", "new", "IllegalArgumentException", "(", "\"Cyclic expression detected\"", ...
Check whether the specified expression contains a reference, either direct or indirect, to this expression. @param expr the expression to check and possibly recurse through. @throws IllegalArgumentException if a cyclic expression is detected.
[ "Check", "whether", "the", "specified", "expression", "contains", "a", "reference", "either", "direct", "or", "indirect", "to", "this", "expression", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/profile/query/Not.java#L45-L57
test
Recursive method to check for cycles in a composite or not query expression.
Of course, here is the Java code you requested: ```java void checkForCycles(QueryExpression expr) throws IllegalArgumentException { // is the expression argument equal to this? if (expr == this) throw new IllegalArgumentException("Cyclic expression detected"); // recurse through nested express...
GojaFramework/goja
goja-core/src/main/java/goja/core/libs/IO.java
IO.write
public static void write(byte[] data, File file) { OutputStream os = null; try { os = new FileOutputStream(file); os.write(data); os.flush(); } catch (IOException e) { throw new UnexpectedException(e); } finally { try { ...
java
public static void write(byte[] data, File file) { OutputStream os = null; try { os = new FileOutputStream(file); os.write(data); os.flush(); } catch (IOException e) { throw new UnexpectedException(e); } finally { try { ...
[ "public", "static", "void", "write", "(", "byte", "[", "]", "data", ",", "File", "file", ")", "{", "OutputStream", "os", "=", "null", ";", "try", "{", "os", "=", "new", "FileOutputStream", "(", "file", ")", ";", "os", ".", "write", "(", "data", ")"...
Write binay data to a file @param data The binary data to write @param file The file to write
[ "Write", "binay", "data", "to", "a", "file" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/libs/IO.java#L272-L287
test
Write a byte array to a file.
Of course, here is the Java code you requested: ```java public static void write(byte[] data, File file) { OutputStream os = null; try { os = new FileOutputStream(file); os.write(data); os.flush(); } catch (IOException e) { throw new UnexpectedExc...
jcodec/jcodec
src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java
BlockInterpolator.getLuma22
void getLuma22(byte[] pic, int picW, byte[] blk, int blkOff, int blkStride, int x, int y, int blkW, int blkH) { getLuma20NoRound(pic, picW, tmp1, 0, blkW, x, y - 2, blkW, blkH + 7); getLuma02NoRoundInt(tmp1, blkW, tmp2, blkOff, blkStride, 0, 2, blkW, blkH); for (int j = 0; j < blkH; j++) { ...
java
void getLuma22(byte[] pic, int picW, byte[] blk, int blkOff, int blkStride, int x, int y, int blkW, int blkH) { getLuma20NoRound(pic, picW, tmp1, 0, blkW, x, y - 2, blkW, blkH + 7); getLuma02NoRoundInt(tmp1, blkW, tmp2, blkOff, blkStride, 0, 2, blkW, blkH); for (int j = 0; j < blkH; j++) { ...
[ "void", "getLuma22", "(", "byte", "[", "]", "pic", ",", "int", "picW", ",", "byte", "[", "]", "blk", ",", "int", "blkOff", ",", "int", "blkStride", ",", "int", "x", ",", "int", "y", ",", "int", "blkW", ",", "int", "blkH", ")", "{", "getLuma20NoRo...
Hpel horizontal, Hpel vertical (2, 2)
[ "Hpel", "horizontal", "Hpel", "vertical", "(", "2", "2", ")" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java#L508-L518
test
getLuma22 Method.
Of course, here is the Java code you requested: ```java void getLuma22(byte[] pic, int picW, byte[] blk, int blkOff, int blkStride, int x, int y, int blkW, int blkH) { getLuma20NoRound(pic, picW, tmp1, 0, blkW, x, y - 2, blkW, blkH + 7); getLuma02NoRoundInt(tmp1, blkW, tmp2, blkOff, blkStride, 0, 2, bl...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java
Parser.parseInclude
private void parseInclude(Node parent) throws JasperException { Attributes attrs = parseAttributes(); reader.skipSpaces(); Node includeNode = new Node.IncludeAction( attrs, start, parent ); parseOptionalBody(includeNode, "jsp:include", JAVAX_BODY_CONTENT_PARAM); }
java
private void parseInclude(Node parent) throws JasperException { Attributes attrs = parseAttributes(); reader.skipSpaces(); Node includeNode = new Node.IncludeAction( attrs, start, parent ); parseOptionalBody(includeNode, "jsp:include", JAVAX_BODY_CONTENT_PARAM); }
[ "private", "void", "parseInclude", "(", "Node", "parent", ")", "throws", "JasperException", "{", "Attributes", "attrs", "=", "parseAttributes", "(", ")", ";", "reader", ".", "skipSpaces", "(", ")", ";", "Node", "includeNode", "=", "new", "Node", ".", "Includ...
/* For Include: StdActionContent ::= Attributes ParamBody ParamBody ::= EmptyBody | ( '>' S? ( '<jsp:attribute' NamedAttributes )? '<jsp:body' (JspBodyParam | <TRANSLATION_ERROR> ) S? ETag ) | ( '>' S? Param* ETag ) EmptyBody ::= '/>' | ( '>' ETag ) | ( '>' S? '<jsp:attribute' NamedAttributes ETag ) JspBodyParam...
[ "/", "*", "For", "Include", ":", "StdActionContent", "::", "=", "Attributes", "ParamBody" ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java#L986-L994
test
Parse an include.
Of course, here is the Java code you requested: ```java private void parseInclude(Node parent) throws JasperException { Attributes attrs = parseAttributes(); reader.skipSpaces(); Node includeNode = new Node.IncludeAction( attrs, start, parent ); parseOptionalBody(includeNode, "jsp:include",...
LukeDeighton/WheelView
WheelViewLib/src/main/java/com/lukedeighton/wheelview/Circle.java
Circle.clamp
static int clamp(int value, int upperLimit) { if (value < 0) { return value + (-1 * (int) Math.floor(value / (float) upperLimit)) * upperLimit; } else { return value % upperLimit; } }
java
static int clamp(int value, int upperLimit) { if (value < 0) { return value + (-1 * (int) Math.floor(value / (float) upperLimit)) * upperLimit; } else { return value % upperLimit; } }
[ "static", "int", "clamp", "(", "int", "value", ",", "int", "upperLimit", ")", "{", "if", "(", "value", "<", "0", ")", "{", "return", "value", "+", "(", "-", "1", "*", "(", "int", ")", "Math", ".", "floor", "(", "value", "/", "(", "float", ")", ...
Clamps the value to a number between 0 and the upperLimit
[ "Clamps", "the", "value", "to", "a", "number", "between", "0", "and", "the", "upperLimit" ]
0949e04df02f7ad43e1c0384542fa4c9bebe5161
https://github.com/LukeDeighton/WheelView/blob/0949e04df02f7ad43e1c0384542fa4c9bebe5161/WheelViewLib/src/main/java/com/lukedeighton/wheelview/Circle.java#L55-L61
test
Clamp the value to the given upper limit.
Of course, here is the Java code you requested: ```java static int clamp(int value, int upperLimit) { if (value < 0) { return value + (-1 * (int) Math.floor(value / (float) upperLimit)) * upperLimit; } else { return value % upperLimit; } } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.timeInterval
@CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) // Supplied scheduler is only used for creating timestamps. public final Flowable<Timed<T>> timeInterval(TimeUnit unit, Scheduler scheduler) { ObjectHelper.requireNonNull(unit, "unit is nul...
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) // Supplied scheduler is only used for creating timestamps. public final Flowable<Timed<T>> timeInterval(TimeUnit unit, Scheduler scheduler) { ObjectHelper.requireNonNull(unit, "unit is nul...
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "PASS_THROUGH", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "// Supplied scheduler is only used for creating timestamps.", "public", "final", "Flowable", "<", "Ti...
Returns a Flowable that emits records of the time interval between consecutive items emitted by the source Publisher, where this interval is computed on a specified Scheduler. <p> <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeInterval.s.png" alt=""> <dl> <dt><b>...
[ "Returns", "a", "Flowable", "that", "emits", "records", "of", "the", "time", "interval", "between", "consecutive", "items", "emitted", "by", "the", "source", "Publisher", "where", "this", "interval", "is", "computed", "on", "a", "specified", "Scheduler", ".", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L16349-L16356
test
Creates an interval that emits timestamps in the specified time unit.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) // Supplied scheduler is only used for creating timestamps. public final Flowable<Timed<T>> timeInterval(TimeUnit unit, Scheduler scheduler)...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormContainerClient.java
FormContainerClient.getMostRecentFormAndFieldHistoricData
public FormHistoricData getMostRecentFormAndFieldHistoricData(Form formParam) { if(formParam != null && this.serviceTicket != null) { formParam.setServiceTicket(this.serviceTicket); } return new FormHistoricData(this.postJson( formParam, WS.Path.FormHistory.Version1....
java
public FormHistoricData getMostRecentFormAndFieldHistoricData(Form formParam) { if(formParam != null && this.serviceTicket != null) { formParam.setServiceTicket(this.serviceTicket); } return new FormHistoricData(this.postJson( formParam, WS.Path.FormHistory.Version1....
[ "public", "FormHistoricData", "getMostRecentFormAndFieldHistoricData", "(", "Form", "formParam", ")", "{", "if", "(", "formParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", "null", ")", "{", "formParam", ".", "setServiceTicket", "(", "this", ".", "...
Retrieves Electronic Form and Field historic information for the most recent modification. The Form Id must be provided. @param formParam The form to retrieve historic data for. @return Electronic Form and Field historic data.
[ "Retrieves", "Electronic", "Form", "and", "Field", "historic", "information", "for", "the", "most", "recent", "modification", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormContainerClient.java#L253-L260
test
Get the most recent form and field historic data for a form parameter.
Of course, here is the Java code you requested: ```java public FormHistoricData getMostRecentFormAndFieldHistoricData(Form formParam) { if(formParam != null && this.serviceTicket != null) { formParam.setServiceTicket(this.serviceTicket); } return new FormHistoricData(this.postJson(...
streamsets/datacollector
cluster-common/src/main/java/com/streamsets/pipeline/EmbeddedSDCPool.java
EmbeddedSDCPool.fastForward
private EmbeddedSDC fastForward(int id) throws Exception { if (id == sparkProcessorCount) { return null; } LOG.info("No SDC was found at ID: " + id + ". Fast-forwarding.."); EmbeddedSDC sdc; // If there are not SDCs that are just idling, create a new one, else return one from the not started p...
java
private EmbeddedSDC fastForward(int id) throws Exception { if (id == sparkProcessorCount) { return null; } LOG.info("No SDC was found at ID: " + id + ". Fast-forwarding.."); EmbeddedSDC sdc; // If there are not SDCs that are just idling, create a new one, else return one from the not started p...
[ "private", "EmbeddedSDC", "fastForward", "(", "int", "id", ")", "throws", "Exception", "{", "if", "(", "id", "==", "sparkProcessorCount", ")", "{", "return", "null", ";", "}", "LOG", ".", "info", "(", "\"No SDC was found at ID: \"", "+", "id", "+", "\". Fast...
What is this?! Spark could end up scheduling transformers to run on machines that may actually not have received the data, due to: - Non-local reads: Spark Locality is time-bound, so if local executor where the data is located is not available, Spark will tell another one to pick up the task. - Shuffle in the transform...
[ "What", "is", "this?!", "Spark", "could", "end", "up", "scheduling", "transformers", "to", "run", "on", "machines", "that", "may", "actually", "not", "have", "received", "the", "data", "due", "to", ":", "-", "Non", "-", "local", "reads", ":", "Spark", "L...
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/cluster-common/src/main/java/com/streamsets/pipeline/EmbeddedSDCPool.java#L209-L232
test
Fast - forward the SDC at the specified ID.
Of course, here is the Java code you requested: ```java private EmbeddedSDC fastForward(int id) throws Exception { if (id == sparkProcessorCount) { return null; } LOG.info("No SDC was found at ID: " + id + ". Fast-forwarding.."); EmbeddedSDC sdc; // If there are not SDCs that are just idling,...
Unidata/thredds
waterml/src/main/java/ucar/nc2/ogc/erddap/util/ErddapCalendar2.java
ErddapCalendar2.factorToGetSeconds
public static double factorToGetSeconds(String units) throws Exception { units = units.trim().toLowerCase(); if (units.equals("ms") || units.equals("msec") || units.equals("msecs") || units.equals("millis") || units.equals("millisec") || uni...
java
public static double factorToGetSeconds(String units) throws Exception { units = units.trim().toLowerCase(); if (units.equals("ms") || units.equals("msec") || units.equals("msecs") || units.equals("millis") || units.equals("millisec") || uni...
[ "public", "static", "double", "factorToGetSeconds", "(", "String", "units", ")", "throws", "Exception", "{", "units", "=", "units", ".", "trim", "(", ")", ".", "toLowerCase", "(", ")", ";", "if", "(", "units", ".", "equals", "(", "\"ms\"", ")", "||", "...
This returns the factor to multiply by 'units' data to get seconds data (e.g., "minutes" returns 60). This is used for part of dealing with udunits-style "minutes since 1970-01-01"-style strings. @param units @return the factor to multiply by 'units' data to get seconds data. Since there is no exact value for months o...
[ "This", "returns", "the", "factor", "to", "multiply", "by", "units", "data", "to", "get", "seconds", "data", "(", "e", ".", "g", ".", "minutes", "returns", "60", ")", ".", "This", "is", "used", "for", "part", "of", "dealing", "with", "udunits", "-", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/waterml/src/main/java/ucar/nc2/ogc/erddap/util/ErddapCalendar2.java#L110-L151
test
This method is used to get the seconds factor for a calendar.
Of course, here is the Java code you requested: ```java public static double factorToGetSeconds(String units) throws Exception { units = units.trim().toLowerCase(); if (units.equals("ms") || units.equals("msec") || units.equals("msecs") || units.equals("millis") |...
deeplearning4j/nd4j
nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java
BigDecimalMath.sqrt
static public BigDecimal sqrt(final BigDecimal x) { if (x.compareTo(BigDecimal.ZERO) < 0) { throw new ArithmeticException("negative argument " + x.toString() + " of square root"); } return root(2, x); }
java
static public BigDecimal sqrt(final BigDecimal x) { if (x.compareTo(BigDecimal.ZERO) < 0) { throw new ArithmeticException("negative argument " + x.toString() + " of square root"); } return root(2, x); }
[ "static", "public", "BigDecimal", "sqrt", "(", "final", "BigDecimal", "x", ")", "{", "if", "(", "x", ".", "compareTo", "(", "BigDecimal", ".", "ZERO", ")", "<", "0", ")", "{", "throw", "new", "ArithmeticException", "(", "\"negative argument \"", "+", "x", ...
The square root. @param x the non-negative argument. @return the square root of the BigDecimal rounded to the precision implied by x.
[ "The", "square", "root", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java#L209-L214
test
Square root of a number.
Of course, here is the Java code you requested: ```java static public BigDecimal sqrt(final BigDecimal x) { if (x.compareTo(BigDecimal.ZERO) < 0) { throw new ArithmeticException("negative argument " + x.toString() + " of square root"); } return root(2, x); } ``` Hope this helps...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/Path.java
Path.depth
public int depth() { int depth = 0; Path here = this; while (here != ROOT) { depth++; here = here.previous; } return depth; }
java
public int depth() { int depth = 0; Path here = this; while (here != ROOT) { depth++; here = here.previous; } return depth; }
[ "public", "int", "depth", "(", ")", "{", "int", "depth", "=", "0", ";", "Path", "here", "=", "this", ";", "while", "(", "here", "!=", "ROOT", ")", "{", "depth", "++", ";", "here", "=", "here", ".", "previous", ";", "}", "return", "depth", ";", ...
ROOT is 0, top level Entity properties are 1, embedded things are higher.
[ "ROOT", "is", "0", "top", "level", "Entity", "properties", "are", "1", "embedded", "things", "are", "higher", "." ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/Path.java#L118-L128
test
Returns the depth of this path.
Of course, here is the Java code you requested: ```java public int depth() { int depth = 0; Path here = this; while (here != ROOT) { depth++; here = here.previous; } return depth; } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/util/elasticsearch/ABaseESUtil.java
ABaseESUtil.searchWithHits
public final SearchHits searchWithHits( QueryBuilder qbParam, String indexParam, boolean withNoFieldsParam, int offsetParam, int limitParam, Long ... formTypesParam ) { if(this.client == null) { throw new ElasticsearchException("Elasticsearch client is not set."); } SearchRequestBuilder sea...
java
public final SearchHits searchWithHits( QueryBuilder qbParam, String indexParam, boolean withNoFieldsParam, int offsetParam, int limitParam, Long ... formTypesParam ) { if(this.client == null) { throw new ElasticsearchException("Elasticsearch client is not set."); } SearchRequestBuilder sea...
[ "public", "final", "SearchHits", "searchWithHits", "(", "QueryBuilder", "qbParam", ",", "String", "indexParam", ",", "boolean", "withNoFieldsParam", ",", "int", "offsetParam", ",", "int", "limitParam", ",", "Long", "...", "formTypesParam", ")", "{", "if", "(", "...
Performs a search against the Elasticsearch instance with the {@code qbParam}. @param qbParam The @{code QueryBuilder} to search with. @param indexParam The Elasticsearch Index to use {@code (document, folder or table_field)}. @param withNoFieldsParam Should fields be IGNORED returned. @param offsetParam The offset fo...
[ "Performs", "a", "search", "against", "the", "Elasticsearch", "instance", "with", "the", "{", "@code", "qbParam", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/elasticsearch/ABaseESUtil.java#L203-L268
test
Search with hits.
Of course, here is the Java code you requested: ```java public final SearchHits searchWithHits( QueryBuilder qbParam, String indexParam, boolean withNoFieldsParam, int offsetParam, int limitParam, Long ... formTypesParam ) { if(this.client == null) { throw new ElasticsearchException("Elasticsea...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/lang/LocaleUtils.java
LocaleUtils.decodeLocaleCode
public static String[] decodeLocaleCode(final String localeCode) { String[] data = StringUtils.split(localeCode, '_'); String[] result = new String[] { data[0], "", "" }; if (data.length >= 2) { result[1] = data[1]; if (data.length >= 3) { result[2] = data...
java
public static String[] decodeLocaleCode(final String localeCode) { String[] data = StringUtils.split(localeCode, '_'); String[] result = new String[] { data[0], "", "" }; if (data.length >= 2) { result[1] = data[1]; if (data.length >= 3) { result[2] = data...
[ "public", "static", "String", "[", "]", "decodeLocaleCode", "(", "final", "String", "localeCode", ")", "{", "String", "[", "]", "data", "=", "StringUtils", ".", "split", "(", "localeCode", ",", "'", "'", ")", ";", "String", "[", "]", "result", "=", "ne...
Decodes locale code in string array that can be used for <code>Locale</code> constructor.
[ "Decodes", "locale", "code", "in", "string", "array", "that", "can", "be", "used", "for", "<code", ">", "Locale<", "/", "code", ">", "constructor", "." ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/LocaleUtils.java#L76-L86
test
Decode a locale code into an array of strings.
Of course, here is the Java code you requested: ```java public static String[] decodeLocaleCode(final String localeCode) { String[] data = StringUtils.split(localeCode, '_'); String[] result = new String[] { data[0], "", "" }; if (data.length >= 2) { result[1] = data[1]; ...
ReactiveX/RxJava
src/main/java/io/reactivex/Maybe.java
Maybe.empty
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") public static <T> Maybe<T> empty() { return RxJavaPlugins.onAssembly((Maybe<T>)MaybeEmpty.INSTANCE); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") public static <T> Maybe<T> empty() { return RxJavaPlugins.onAssembly((Maybe<T>)MaybeEmpty.INSTANCE); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Maybe", "<", "T", ">", "empty", "(", ")", "{", "return", "RxJavaPlugins", "."...
Returns a (singleton) Maybe instance that calls {@link MaybeObserver#onComplete onComplete} immediately. <p> <img width="640" height="190" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/empty.png" alt=""> <dl> <dt><b>Scheduler:</b></dt> <dd>{@code empty} does not operate by default on a particula...
[ "Returns", "a", "(", "singleton", ")", "Maybe", "instance", "that", "calls", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L607-L612
test
Empty Maybe.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") public static <T> Maybe<T> empty() { return RxJavaPlugins.onAssembly((Maybe<T>)MaybeEmpty.INSTANCE); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/NetcdfFile.java
NetcdfFile.findGlobalAttribute
public Attribute findGlobalAttribute(String name) { for (Attribute a : gattributes) { if (name.equals(a.getShortName())) return a; } return null; }
java
public Attribute findGlobalAttribute(String name) { for (Attribute a : gattributes) { if (name.equals(a.getShortName())) return a; } return null; }
[ "public", "Attribute", "findGlobalAttribute", "(", "String", "name", ")", "{", "for", "(", "Attribute", "a", ":", "gattributes", ")", "{", "if", "(", "name", ".", "equals", "(", "a", ".", "getShortName", "(", ")", ")", ")", "return", "a", ";", "}", "...
Look up global Attribute by (full) name. @param name the name of the attribute @return the attribute, or null if not found
[ "Look", "up", "global", "Attribute", "by", "(", "full", ")", "name", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L1238-L1244
test
Find the global attribute with the given name.
Of course, here is the Java code you requested: ```java public Attribute findGlobalAttribute(String name) { for (Attribute a : gattributes) { if (name.equals(a.getShortName())) return a; } return null; } ``` Hope this helps!
rupertlssmith/lojix
lojix/search/src/main/com/thesett/aima/search/util/informed/GreedySearch.java
GreedySearch.createQueue
public Queue<SearchNode<O, T>> createQueue() { return new PriorityQueue<SearchNode<O, T>>(11, new GreedyComparator()); }
java
public Queue<SearchNode<O, T>> createQueue() { return new PriorityQueue<SearchNode<O, T>>(11, new GreedyComparator()); }
[ "public", "Queue", "<", "SearchNode", "<", "O", ",", "T", ">", ">", "createQueue", "(", ")", "{", "return", "new", "PriorityQueue", "<", "SearchNode", "<", "O", ",", "T", ">", ">", "(", "11", ",", "new", "GreedyComparator", "(", ")", ")", ";", "}" ...
Creates the correct type of queue for this search. This search uses a priority queue ordered by heuristic value. @return An empty priority queue with heuristic ordering.
[ "Creates", "the", "correct", "type", "of", "queue", "for", "this", "search", ".", "This", "search", "uses", "a", "priority", "queue", "ordered", "by", "heuristic", "value", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/util/informed/GreedySearch.java#L52-L55
test
Create a queue of nodes for a CID .
Of course, here is the Java code you requested: ```java public Queue<SearchNode<O, T>> createQueue() { return new PriorityQueue<SearchNode<O, T>>(11, new GreedyComparator()); } ``` Hope this helps!
arnohaase/a-foundation
a-foundation/src/main/java/com/ajjpj/afoundation/collection/ACollectionHelper.java
ACollectionHelper.asACollectionView
@SuppressWarnings("unchecked") public static <T> ACollectionWrapper<T> asACollectionView(Collection<T> c) { return new ACollectionWrapper(c); }
java
@SuppressWarnings("unchecked") public static <T> ACollectionWrapper<T> asACollectionView(Collection<T> c) { return new ACollectionWrapper(c); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "ACollectionWrapper", "<", "T", ">", "asACollectionView", "(", "Collection", "<", "T", ">", "c", ")", "{", "return", "new", "ACollectionWrapper", "(", "c", ")", ";", "}"...
Wraps the content of a <code>java.util.Collection</code> in an <code>ACollection</code> instance. While the returned instance itself has no mutator methods, changes to the underlying collection are reflected in the wrapping <code>ACollection</code> instance.<p> The returned collection has list semantics with regard to...
[ "Wraps", "the", "content", "of", "a", "<code", ">", "java", ".", "util", ".", "Collection<", "/", "code", ">", "in", "an", "<code", ">", "ACollection<", "/", "code", ">", "instance", ".", "While", "the", "returned", "instance", "itself", "has", "no", "...
f3eef2ca89d67775f202a4c28140230a6229291e
https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/collection/ACollectionHelper.java#L590-L593
test
ACollectionWrapper is a collection view of the given collection.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T> ACollectionWrapper<T> asACollectionView(Collection<T> c) { return new ACollectionWrapper(c); } ``` Hope this helps!
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/spi/AppenderAttachableImpl.java
AppenderAttachableImpl.detachAppender
public boolean detachAppender(String name) { if (name == null) { return false; } boolean removed = false; for (Appender<E> a : appenderList) { if (name.equals((a).getName())) { removed = appenderList.remove(a); break; } } return removed; }
java
public boolean detachAppender(String name) { if (name == null) { return false; } boolean removed = false; for (Appender<E> a : appenderList) { if (name.equals((a).getName())) { removed = appenderList.remove(a); break; } } return removed; }
[ "public", "boolean", "detachAppender", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "false", ";", "}", "boolean", "removed", "=", "false", ";", "for", "(", "Appender", "<", "E", ">", "a", ":", "appenderList", ...
Remove the appender with the name passed as parameter form the list of appenders.
[ "Remove", "the", "appender", "with", "the", "name", "passed", "as", "parameter", "form", "the", "list", "of", "appenders", "." ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/spi/AppenderAttachableImpl.java#L132-L144
test
Detach an appender from the list of appenders.
Of course, here is the Java code you requested: ```java public boolean detachAppender(String name) { if (name == null) { return false; } boolean removed = false; for (Appender<E> a : appenderList) { if (name.equals((a).getName())) { removed = appenderList.remove(a); ...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/JspWriterImpl.java
JspWriterImpl.write
public void write(String s, int off, int len) throws IOException { ensureOpen(); if (bufferSize == 0) { initOut(); out.write(s, off, len); return; } int b = off, t = off + len; while (b < t) { int d = min(getRemaining(), t - b); ...
java
public void write(String s, int off, int len) throws IOException { ensureOpen(); if (bufferSize == 0) { initOut(); out.write(s, off, len); return; } int b = off, t = off + len; while (b < t) { int d = min(getRemaining(), t - b); ...
[ "public", "void", "write", "(", "String", "s", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "ensureOpen", "(", ")", ";", "if", "(", "bufferSize", "==", "0", ")", "{", "initOut", "(", ")", ";", "out", ".", "write", "(", ...
Write a portion of a String. @param s String to be written @param off Offset from which to start reading characters @param len Number of characters to be written
[ "Write", "a", "portion", "of", "a", "String", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/JspWriterImpl.java#L448-L467
test
Write a String to the output stream.
Of course, here is the Java code you requested: ```java public void write(String s, int off, int len) throws IOException { ensureOpen(); if (bufferSize == 0) { initOut(); out.write(s, off, len); return; } int b = off, t = off + len; while (b <...
deeplearning4j/nd4j
nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/constant/ProtectedCudaConstantHandler.java
ProtectedCudaConstantHandler.moveToConstantSpace
@Override public synchronized long moveToConstantSpace(DataBuffer dataBuffer) { // now, we move things to constant memory Integer deviceId = AtomicAllocator.getInstance().getDeviceId(); ensureMaps(deviceId); AllocationPoint point = AtomicAllocator.getInstance().getAllocationPoint(da...
java
@Override public synchronized long moveToConstantSpace(DataBuffer dataBuffer) { // now, we move things to constant memory Integer deviceId = AtomicAllocator.getInstance().getDeviceId(); ensureMaps(deviceId); AllocationPoint point = AtomicAllocator.getInstance().getAllocationPoint(da...
[ "@", "Override", "public", "synchronized", "long", "moveToConstantSpace", "(", "DataBuffer", "dataBuffer", ")", "{", "// now, we move things to constant memory", "Integer", "deviceId", "=", "AtomicAllocator", ".", "getInstance", "(", ")", ".", "getDeviceId", "(", ")", ...
This method moves specified dataBuffer to CUDA constant memory space. PLEASE NOTE: CUDA constant memory is limited to 48KB per device. @param dataBuffer @return
[ "This", "method", "moves", "specified", "dataBuffer", "to", "CUDA", "constant", "memory", "space", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/constant/ProtectedCudaConstantHandler.java#L101-L217
test
Move the data buffer to constant memory.
Of course, here is the Java code you requested: ```java @Override public synchronized long moveToConstantSpace(DataBuffer dataBuffer) { // now, we move things to constant memory Integer deviceId = AtomicAllocator.getInstance().getDeviceId(); ensureMaps(deviceId); AllocationPoint po...
RestComm/jain-slee
container/common/src/main/java/org/mobicents/slee/runtime/facilities/ActivityContextNamingFacilityCacheData.java
ActivityContextNamingFacilityCacheData.getNameBindings
public Map getNameBindings() { Map result = new HashMap(); Node childNode = null; Object name = null; for (Object obj : getNode().getChildren()) { childNode = (Node) obj; name = childNode.getFqn().getLastElement(); result.put(name, childNode.get(CACHE_NODE_MAP_KEY)); } return result; }
java
public Map getNameBindings() { Map result = new HashMap(); Node childNode = null; Object name = null; for (Object obj : getNode().getChildren()) { childNode = (Node) obj; name = childNode.getFqn().getLastElement(); result.put(name, childNode.get(CACHE_NODE_MAP_KEY)); } return result; }
[ "public", "Map", "getNameBindings", "(", ")", "{", "Map", "result", "=", "new", "HashMap", "(", ")", ";", "Node", "childNode", "=", "null", ";", "Object", "name", "=", "null", ";", "for", "(", "Object", "obj", ":", "getNode", "(", ")", ".", "getChild...
Retrieves a map of the bindings. Key is the aci name and Value is the activity context handle @return
[ "Retrieves", "a", "map", "of", "the", "bindings", ".", "Key", "is", "the", "aci", "name", "and", "Value", "is", "the", "activity", "context", "handle" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/runtime/facilities/ActivityContextNamingFacilityCacheData.java#L114-L125
test
Returns a map of the name bindings of the node.
Of course, here is the Java code you requested: ```java public Map getNameBindings() { Map result = new HashMap(); Node childNode = null; Object name = null; for (Object obj : getNode().getChildren()) { childNode = (Node) obj; name = childNode.getFqn().getLastElement(); result.put(name, childNode.get...
truward/brikar
brikar-common/src/main/java/com/truward/brikar/common/log/LogUtil.java
LogUtil.propagate
@Nullable public static MetricsCollection propagate(Metrics metrics) { final MetricsCollection metricsCollection = getLocalMetricsCollection(); if (metricsCollection != null) { metricsCollection.add(metrics); } return metricsCollection; }
java
@Nullable public static MetricsCollection propagate(Metrics metrics) { final MetricsCollection metricsCollection = getLocalMetricsCollection(); if (metricsCollection != null) { metricsCollection.add(metrics); } return metricsCollection; }
[ "@", "Nullable", "public", "static", "MetricsCollection", "propagate", "(", "Metrics", "metrics", ")", "{", "final", "MetricsCollection", "metricsCollection", "=", "getLocalMetricsCollection", "(", ")", ";", "if", "(", "metricsCollection", "!=", "null", ")", "{", ...
Propagates metrics entry to the thread local metrics collection, does nothing if local metrics collection is missing. @param metrics Metrics to capture @return Local metrics collection or null
[ "Propagates", "metrics", "entry", "to", "the", "thread", "local", "metrics", "collection", "does", "nothing", "if", "local", "metrics", "collection", "is", "missing", "." ]
9a2f6d0149b281fff0f704f169021187f5f9115f
https://github.com/truward/brikar/blob/9a2f6d0149b281fff0f704f169021187f5f9115f/brikar-common/src/main/java/com/truward/brikar/common/log/LogUtil.java#L127-L135
test
Propagate a Metrics object to the local MetricsCollection.
Of course, here is the Java code you requested: ```java @Nullable public static MetricsCollection propagate(Metrics metrics) { final MetricsCollection metricsCollection = getLocalMetricsCollection(); if (metricsCollection != null) { metricsCollection.add(metrics); } return metricsCollection; ...
markhobson/microbrowser
jsoup/src/main/java/org/hobsoft/microbrowser/jsoup/JsoupMicrodataDocument.java
JsoupMicrodataDocument.unwrap
public <T> T unwrap(Class<T> type) { checkArgument(Document.class.equals(type), "Cannot unwrap to: %s", type); return type.cast(document); }
java
public <T> T unwrap(Class<T> type) { checkArgument(Document.class.equals(type), "Cannot unwrap to: %s", type); return type.cast(document); }
[ "public", "<", "T", ">", "T", "unwrap", "(", "Class", "<", "T", ">", "type", ")", "{", "checkArgument", "(", "Document", ".", "class", ".", "equals", "(", "type", ")", ",", "\"Cannot unwrap to: %s\"", ",", "type", ")", ";", "return", "type", ".", "ca...
----------------------------------------------------------------------------------------------------------------
[ "----------------------------------------------------------------------------------------------------------------" ]
732d2dadc1c3eaad688de31dc09f360df580faf1
https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/jsoup/src/main/java/org/hobsoft/microbrowser/jsoup/JsoupMicrodataDocument.java#L146-L151
test
Unwraps the document to the specified type.
Of course, here is the Java code you requested: ```java public <T> T unwrap(Class<T> type) { checkArgument(Document.class.equals(type), "Cannot unwrap to: %s", type); return type.cast(document); } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java
Parser.parseTemplateText
private void parseTemplateText(Node parent) throws JasperException { if (!reader.hasMoreInput()) return; CharArrayWriter ttext = new CharArrayWriter(); // Output the first character int ch = reader.nextChar(); if (ch == '\\') { reader.pushChar(); } else { ttext.write(c...
java
private void parseTemplateText(Node parent) throws JasperException { if (!reader.hasMoreInput()) return; CharArrayWriter ttext = new CharArrayWriter(); // Output the first character int ch = reader.nextChar(); if (ch == '\\') { reader.pushChar(); } else { ttext.write(c...
[ "private", "void", "parseTemplateText", "(", "Node", "parent", ")", "throws", "JasperException", "{", "if", "(", "!", "reader", ".", "hasMoreInput", "(", ")", ")", "return", ";", "CharArrayWriter", "ttext", "=", "new", "CharArrayWriter", "(", ")", ";", "// O...
/* Parse for a template text string until '<' or "${" is encountered, recognizing escape sequences "\%" ,"\$", and \#.
[ "/", "*", "Parse", "for", "a", "template", "text", "string", "until", "<", "or", "$", "{", "is", "encountered", "recognizing", "escape", "sequences", "\\", "%", "\\", "$", "and", "\\", "#", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java#L1490-L1543
test
Parse the template text.
Of course, here is the Java code you requested: ```java private void parseTemplateText(Node parent) throws JasperException { if (!reader.hasMoreInput()) return; CharArrayWriter ttext = new CharArrayWriter(); // Output the first character int ch = reader.nextChar(); if (ch == '\\') { read...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/CommandHandler.java
CommandHandler.setNextPreviousController
public void setNextPreviousController(Consumer<String> controller) { if (controller == null) return; nextPrevious = controller; capabilities.setNextPrevious(true); }
java
public void setNextPreviousController(Consumer<String> controller) { if (controller == null) return; nextPrevious = controller; capabilities.setNextPrevious(true); }
[ "public", "void", "setNextPreviousController", "(", "Consumer", "<", "String", ">", "controller", ")", "{", "if", "(", "controller", "==", "null", ")", "return", ";", "nextPrevious", "=", "controller", ";", "capabilities", ".", "setNextPrevious", "(", "true", ...
adds the ability to select the next/previous track @param controller the controller for callback
[ "adds", "the", "ability", "to", "select", "the", "next", "/", "previous", "track" ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/CommandHandler.java#L81-L86
test
Sets the next controller to use.
Of course, here is the Java code you requested: ```java public void setNextPreviousController(Consumer<String> controller) { if (controller == null) return; nextPrevious = controller; capabilities.setNextPrevious(true); } ``` Hope this helps!
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/serialization/types/ODateTimeSerializer.java
ODateTimeSerializer.serializeInByteBufferObject
@Override public void serializeInByteBufferObject(Date object, ByteBuffer buffer, Object... hints) { final Calendar calendar = Calendar.getInstance(); calendar.setTime(object); buffer.putLong(calendar.getTimeInMillis()); }
java
@Override public void serializeInByteBufferObject(Date object, ByteBuffer buffer, Object... hints) { final Calendar calendar = Calendar.getInstance(); calendar.setTime(object); buffer.putLong(calendar.getTimeInMillis()); }
[ "@", "Override", "public", "void", "serializeInByteBufferObject", "(", "Date", "object", ",", "ByteBuffer", "buffer", ",", "Object", "...", "hints", ")", "{", "final", "Calendar", "calendar", "=", "Calendar", ".", "getInstance", "(", ")", ";", "calendar", ".",...
{@inheritDoc}
[ "{" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/serialization/types/ODateTimeSerializer.java#L97-L102
test
Serialize in ByteBufferObject.
Of course, here is the Java code you requested: ```java @Override public void serializeInByteBufferObject(Date object, ByteBuffer buffer, Object... hints) { final Calendar calendar = Calendar.getInstance(); calendar.setTime(object); buffer.putLong(calendar.getTimeInMillis()); } ``` Hope this helps!
fabric8io/fabric8-maven-plugin
generator/api/src/main/java/io/fabric8/maven/generator/api/support/AbstractPortsExtractor.java
AbstractPortsExtractor.readConfig
private Map<String, String> readConfig(File f) throws IOException { Map<String, String> map; if (f.getName().endsWith(JSON_EXTENSION)) { map = flatten(JSON_MAPPER.readValue(f, Map.class)); } else if (f.getName().endsWith(YAML_EXTENSION) || f.getName().endsWith(YML_EXTENSION)) { ...
java
private Map<String, String> readConfig(File f) throws IOException { Map<String, String> map; if (f.getName().endsWith(JSON_EXTENSION)) { map = flatten(JSON_MAPPER.readValue(f, Map.class)); } else if (f.getName().endsWith(YAML_EXTENSION) || f.getName().endsWith(YML_EXTENSION)) { ...
[ "private", "Map", "<", "String", ",", "String", ">", "readConfig", "(", "File", "f", ")", "throws", "IOException", "{", "Map", "<", "String", ",", "String", ">", "map", ";", "if", "(", "f", ".", "getName", "(", ")", ".", "endsWith", "(", "JSON_EXTENS...
Reads the configuration from the file. @param f @return @throws IOException
[ "Reads", "the", "configuration", "from", "the", "file", "." ]
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/generator/api/src/main/java/io/fabric8/maven/generator/api/support/AbstractPortsExtractor.java#L122-L136
test
Read the configuration from a file.
Of course, here is the Java code you requested: ```java private Map<String, String> readConfig(File f) throws IOException { Map<String, String> map; if (f.getName().endsWith(JSON_EXTENSION)) { map = flatten(JSON_MAPPER.readValue(f, Map.class)); } else if (f.getName().endsWith(YAML_E...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib1/tables/NcepTables.java
NcepTables.getStatType
@Override public GribStatType getStatType(int timeRangeIndicator) { switch (timeRangeIndicator) { case 128: case 129: case 130: case 131: case 132: case 133: case 137: case 138: case 139: case 140: return GribStatType.Average; ...
java
@Override public GribStatType getStatType(int timeRangeIndicator) { switch (timeRangeIndicator) { case 128: case 129: case 130: case 131: case 132: case 133: case 137: case 138: case 139: case 140: return GribStatType.Average; ...
[ "@", "Override", "public", "GribStatType", "getStatType", "(", "int", "timeRangeIndicator", ")", "{", "switch", "(", "timeRangeIndicator", ")", "{", "case", "128", ":", "case", "129", ":", "case", "130", ":", "case", "131", ":", "case", "132", ":", "case",...
http://www.nco.ncep.noaa.gov/pmb/docs/on388/table5.html
[ "http", ":", "//", "www", ".", "nco", ".", "ncep", ".", "noaa", ".", "gov", "/", "pmb", "/", "docs", "/", "on388", "/", "table5", ".", "html" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib1/tables/NcepTables.java#L48-L71
test
Override the method to return the appropriate GribStatType for the CTag based on the timeRangeIndicator parameter.
Of course, here is the Java code you requested: ```java @Override public GribStatType getStatType(int timeRangeIndicator) { switch (timeRangeIndicator) { case 128: case 129: case 130: case 131: case 132: case 133: case 137: case 138: case 139: ...
RestComm/jain-slee
container/transaction/src/main/java/org/mobicents/slee/runtime/transaction/SleeTransactionManagerImpl.java
SleeTransactionManagerImpl.mandateTransaction
public void mandateTransaction() throws TransactionRequiredLocalException { try { final Transaction tx = getTransaction(); if (tx == null) throw new TransactionRequiredLocalException( "Transaction Mandatory"); final int status = tx.getStatus(); if (status != Status.STATUS_ACTIVE && status != ...
java
public void mandateTransaction() throws TransactionRequiredLocalException { try { final Transaction tx = getTransaction(); if (tx == null) throw new TransactionRequiredLocalException( "Transaction Mandatory"); final int status = tx.getStatus(); if (status != Status.STATUS_ACTIVE && status != ...
[ "public", "void", "mandateTransaction", "(", ")", "throws", "TransactionRequiredLocalException", "{", "try", "{", "final", "Transaction", "tx", "=", "getTransaction", "(", ")", ";", "if", "(", "tx", "==", "null", ")", "throw", "new", "TransactionRequiredLocalExcep...
/* (non-Javadoc) @see org.mobicents.slee.runtime.transaction.SleeTransactionManager#mandateTransaction()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/transaction/src/main/java/org/mobicents/slee/runtime/transaction/SleeTransactionManagerImpl.java#L118-L134
test
Mandate the active transaction.
Of course, here is the Java code you requested: ```java public void mandateTransaction() throws TransactionRequiredLocalException { try { final Transaction tx = getTransaction(); if (tx == null) throw new TransactionRequiredLocalException( "Transaction Mandatory"); final int status = tx.getStat...
myabc/markdownj
core/src/main/java/org/markdownj/TextEditor.java
TextEditor.indent
public TextEditor indent(int spaces) { StringBuilder sb = new StringBuilder(spaces); for (int i = 0; i < spaces; i++) { sb.append(' '); } return replaceAll("^", sb.toString()); }
java
public TextEditor indent(int spaces) { StringBuilder sb = new StringBuilder(spaces); for (int i = 0; i < spaces; i++) { sb.append(' '); } return replaceAll("^", sb.toString()); }
[ "public", "TextEditor", "indent", "(", "int", "spaces", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "spaces", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "spaces", ";", "i", "++", ")", "{", "sb", ".", "append",...
Introduce a number of spaces at the start of each line. @param spaces @return
[ "Introduce", "a", "number", "of", "spaces", "at", "the", "start", "of", "each", "line", "." ]
f8ed00caeb69fc602aa2209812d953c26c2a4263
https://github.com/myabc/markdownj/blob/f8ed00caeb69fc602aa2209812d953c26c2a4263/core/src/main/java/org/markdownj/TextEditor.java#L205-L211
test
Indent the result set by the given number of spaces.
Of course, here is the Java code you requested: ```java public TextEditor indent(int spaces) { StringBuilder sb = new StringBuilder(spaces); for (int i = 0; i < spaces; i++) { sb.append(' '); } return replaceAll("^", sb.toString()); } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java
BaseLevel2.hbmv
@Override public void hbmv(char order, char Uplo, IComplexNumber alpha, IComplexNDArray A, IComplexNDArray X, IComplexNumber beta, IComplexNDArray Y) { // FIXME: int cast if (A.data().dataType() == DataBuffer.Type.DOUBLE) zhbmv(order, Uplo, (int) X.length(), (int) A....
java
@Override public void hbmv(char order, char Uplo, IComplexNumber alpha, IComplexNDArray A, IComplexNDArray X, IComplexNumber beta, IComplexNDArray Y) { // FIXME: int cast if (A.data().dataType() == DataBuffer.Type.DOUBLE) zhbmv(order, Uplo, (int) X.length(), (int) A....
[ "@", "Override", "public", "void", "hbmv", "(", "char", "order", ",", "char", "Uplo", ",", "IComplexNumber", "alpha", ",", "IComplexNDArray", "A", ",", "IComplexNDArray", "X", ",", "IComplexNumber", "beta", ",", "IComplexNDArray", "Y", ")", "{", "// FIXME: int...
performs a rank-1 update of a general m-by-n matrix a, without conjugation: a := alpha*x*y' + a. @param order @param Uplo @param alpha @param A @param X @param beta @param Y
[ "performs", "a", "rank", "-", "1", "update", "of", "a", "general", "m", "-", "by", "-", "n", "matrix", "a", "without", "conjugation", ":", "a", ":", "=", "alpha", "*", "x", "*", "y", "+", "a", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel2.java#L231-L243
test
HBMV method.
Of course, here is the Java code you requested: ```java @Override public void hbmv(char order, char Uplo, IComplexNumber alpha, IComplexNDArray A, IComplexNDArray X, IComplexNumber beta, IComplexNDArray Y) { // FIXME: int cast if (A.data().dataType() == DataBuffer.Type.DOUBLE) ...
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createSonstigeAngaben
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "sonstige_angaben") public JAXBElement<String> createSonstigeAngaben(String value) { return new JAXBElement<String>(_SonstigeAngaben_QNAME, String.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "sonstige_angaben") public JAXBElement<String> createSonstigeAngaben(String value) { return new JAXBElement<String>(_SonstigeAngaben_QNAME, String.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"sonstige_angaben\"", ")", "public", "JAXBElement", "<", "String", ">", "createSonstigeAngaben", "(", "String", "value", ")", "{", "return", "new", "JAXBElement", "<", "...
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "String", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L2094-L2097
test
Create an instance of a SonstigeAngaben JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "sonstige_angaben") public JAXBElement<String> createSonstigeAngaben(String value) { return new JAXBElement<String>(_SonstigeAngaben_QNAME, String.class, null, value); } ``` Hope this he...
google/guice
core/src/com/google/inject/internal/ProviderMethod.java
ProviderMethod.create
static <T> ProviderMethod<T> create( Key<T> key, Method method, Object instance, ImmutableSet<Dependency<?>> dependencies, Class<? extends Annotation> scopeAnnotation, boolean skipFastClassGeneration, Annotation annotation) { int modifiers = method.getModifiers(); /*if[...
java
static <T> ProviderMethod<T> create( Key<T> key, Method method, Object instance, ImmutableSet<Dependency<?>> dependencies, Class<? extends Annotation> scopeAnnotation, boolean skipFastClassGeneration, Annotation annotation) { int modifiers = method.getModifiers(); /*if[...
[ "static", "<", "T", ">", "ProviderMethod", "<", "T", ">", "create", "(", "Key", "<", "T", ">", "key", ",", "Method", "method", ",", "Object", "instance", ",", "ImmutableSet", "<", "Dependency", "<", "?", ">", ">", "dependencies", ",", "Class", "<", "...
Creates a {@link ProviderMethod}. <p>Unless {@code skipFastClassGeneration} is set, this will use {@link net.sf.cglib.reflect.FastClass} to invoke the actual method, since it is significantly faster. However, this will fail if the method is {@code private} or {@code protected}, since fastclass is subject to java acces...
[ "Creates", "a", "{", "@link", "ProviderMethod", "}", "." ]
a0552a16d813ead98fe73737fb001db336650251
https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/ProviderMethod.java#L57-L87
test
Create a new instance of the provider class.
Of course, here is the Java code you requested: ```java static <T> ProviderMethod<T> create( Key<T> key, Method method, Object instance, ImmutableSet<Dependency<?>> dependencies, Class<? extends Annotation> scopeAnnotation, boolean skipFastClassGeneration, Annotation annotatio...
ieb/sparsemapcontent
extensions/memory/src/main/java/uk/co/tfd/sm/memory/ehcache/CacheImpl.java
CacheImpl.put
@SuppressWarnings("unchecked") public V put(String key, V payload) { V previous = null; if (cache.isKeyInCache(key)) { Element e = cache.get(key); if (e != null) { previous = (V) e.getObjectValue(); } } cache.put(new Element(key, payload)); return previous; }
java
@SuppressWarnings("unchecked") public V put(String key, V payload) { V previous = null; if (cache.isKeyInCache(key)) { Element e = cache.get(key); if (e != null) { previous = (V) e.getObjectValue(); } } cache.put(new Element(key, payload)); return previous; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "V", "put", "(", "String", "key", ",", "V", "payload", ")", "{", "V", "previous", "=", "null", ";", "if", "(", "cache", ".", "isKeyInCache", "(", "key", ")", ")", "{", "Element", "e", "=",...
{@inherit-doc} @see org.sakaiproject.nakamura.api.memory.Cache#put(java.lang.String, java.lang.Object)
[ "{", "@inherit", "-", "doc", "}" ]
0570fdf868adbbf7734790cbc09fe66480e5f2dc
https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/extensions/memory/src/main/java/uk/co/tfd/sm/memory/ehcache/CacheImpl.java#L118-L129
test
Put a new element into the cache.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public V put(String key, V payload) { V previous = null; if (cache.isKeyInCache(key)) { Element e = cache.get(key); if (e != null) { previous = (V) e.getObjectValue(); } } cache.put(new El...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractInterceptUrlConfigurer.java
AbstractInterceptUrlConfigurer.getAccessDecisionManager
private AccessDecisionManager getAccessDecisionManager(H http) { if (accessDecisionManager == null) { accessDecisionManager = createDefaultAccessDecisionManager(http); } return accessDecisionManager; }
java
private AccessDecisionManager getAccessDecisionManager(H http) { if (accessDecisionManager == null) { accessDecisionManager = createDefaultAccessDecisionManager(http); } return accessDecisionManager; }
[ "private", "AccessDecisionManager", "getAccessDecisionManager", "(", "H", "http", ")", "{", "if", "(", "accessDecisionManager", "==", "null", ")", "{", "accessDecisionManager", "=", "createDefaultAccessDecisionManager", "(", "http", ")", ";", "}", "return", "accessDec...
If currently null, creates a default {@link AccessDecisionManager} using {@link #createDefaultAccessDecisionManager(HttpSecurityBuilder)}. Otherwise returns the {@link AccessDecisionManager}. @param http the builder to use @return the {@link AccessDecisionManager} to use
[ "If", "currently", "null", "creates", "a", "default", "{", "@link", "AccessDecisionManager", "}", "using", "{", "@link", "#createDefaultAccessDecisionManager", "(", "HttpSecurityBuilder", ")", "}", ".", "Otherwise", "returns", "the", "{", "@link", "AccessDecisionManag...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractInterceptUrlConfigurer.java#L172-L177
test
Get the access decision manager.
Of course, here is the Java code you requested: ```java private AccessDecisionManager getAccessDecisionManager(H http) { if (accessDecisionManager == null) { accessDecisionManager = createDefaultAccessDecisionManager(http); } return accessDecisionManager; } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/table/JTableSorted.java
JTableSorted.setSelected
public void setSelected(int row) { if ((row < 0) || (row >= list.size())) return; if (debug) System.out.println("JTableSorted setSelected "+row); jtable.setRowSelectionInterval(row, row); ensureRowIsVisible(row); }
java
public void setSelected(int row) { if ((row < 0) || (row >= list.size())) return; if (debug) System.out.println("JTableSorted setSelected "+row); jtable.setRowSelectionInterval(row, row); ensureRowIsVisible(row); }
[ "public", "void", "setSelected", "(", "int", "row", ")", "{", "if", "(", "(", "row", "<", "0", ")", "||", "(", "row", ">=", "list", ".", "size", "(", ")", ")", ")", "return", ";", "if", "(", "debug", ")", "System", ".", "out", ".", "println", ...
Set the current selection to this row. @param row index into rowList
[ "Set", "the", "current", "selection", "to", "this", "row", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/table/JTableSorted.java#L361-L367
test
Sets the selected row.
Of course, here is the Java code you requested: ```java public void setSelected(int row) { if ((row < 0) || (row >= list.size())) return; if (debug) System.out.println("JTableSorted setSelected "+row); jtable.setRowSelectionInterval(row, row); ensureRowIsVisible(row); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.throttleLast
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<T> throttleLast(long intervalDuration, TimeUnit unit, Scheduler scheduler) { return sample(intervalDuration, unit, scheduler); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<T> throttleLast(long intervalDuration, TimeUnit unit, Scheduler scheduler) { return sample(intervalDuration, unit, scheduler); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Observable", "<", "T", ">", "throttleLast", "(", "long", "intervalDuration", ",", "TimeUnit", "unit", ",", "Scheduler", "scheduler", ")", "{", "ret...
Returns an Observable that emits only the last item emitted by the source ObservableSource during sequential time windows of a specified duration, where the duration is governed by a specified Scheduler. <p> This differs from {@link #throttleFirst} in that this ticks along at a scheduled interval whereas {@link #thrott...
[ "Returns", "an", "Observable", "that", "emits", "only", "the", "last", "item", "emitted", "by", "the", "source", "ObservableSource", "during", "sequential", "time", "windows", "of", "a", "specified", "duration", "where", "the", "duration", "is", "governed", "by"...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L13262-L13266
test
Throttle the last result of a sequence of tokens.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) public final Observable<T> throttleLast(long intervalDuration, TimeUnit unit, Scheduler scheduler) { return sample(intervalDuration, unit, scheduler); } ``` Hope this helps!
streamsets/datacollector
solr-protolib/src/main/java/com/streamsets/pipeline/stage/destination/solr/SolrTarget.java
SolrTarget.checkRecordContainsSolrFields
private boolean checkRecordContainsSolrFields( Map<String, Field> recordFieldMap, Record record, List<String> solrFieldsMap, Errors errorToThrow ) throws StageException { // for (Map.Entry<String, Field> recordFieldMapEntry : recordFieldMap.entrySet()) List<String> fieldsFound = new Ar...
java
private boolean checkRecordContainsSolrFields( Map<String, Field> recordFieldMap, Record record, List<String> solrFieldsMap, Errors errorToThrow ) throws StageException { // for (Map.Entry<String, Field> recordFieldMapEntry : recordFieldMap.entrySet()) List<String> fieldsFound = new Ar...
[ "private", "boolean", "checkRecordContainsSolrFields", "(", "Map", "<", "String", ",", "Field", ">", "recordFieldMap", ",", "Record", "record", ",", "List", "<", "String", ">", "solrFieldsMap", ",", "Errors", "errorToThrow", ")", "throws", "StageException", "{", ...
Checks whether the record contains solr fields in solrFieldsMap or not. @param recordFieldMap Fields contained in the reocrd @param record The whole record @param solrFieldsMap Solr fields that will be searched in record fields @param errorToThrow error to use if missing Solr fields are detected @return true if record...
[ "Checks", "whether", "the", "record", "contains", "solr", "fields", "in", "solrFieldsMap", "or", "not", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/solr-protolib/src/main/java/com/streamsets/pipeline/stage/destination/solr/SolrTarget.java#L346-L376
test
Check if the record contains the solr fields.
Of course, here is the Java code you requested: ```java private boolean checkRecordContainsSolrFields( Map<String, Field> recordFieldMap, Record record, List<String> solrFieldsMap, Errors errorToThrow ) throws StageException { // for (Map.Entry<String, Field> recordFieldMapEntry : recordF...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java
Transforms.greaterThanOrEqual
public static INDArray greaterThanOrEqual(INDArray first, INDArray ndArray, boolean dup) { return exec(dup ? new OldGreaterThanOrEqual(first.dup(), ndArray) : new OldGreaterThanOrEqual(first, ndArray)); }
java
public static INDArray greaterThanOrEqual(INDArray first, INDArray ndArray, boolean dup) { return exec(dup ? new OldGreaterThanOrEqual(first.dup(), ndArray) : new OldGreaterThanOrEqual(first, ndArray)); }
[ "public", "static", "INDArray", "greaterThanOrEqual", "(", "INDArray", "first", ",", "INDArray", "ndArray", ",", "boolean", "dup", ")", "{", "return", "exec", "(", "dup", "?", "new", "OldGreaterThanOrEqual", "(", "first", ".", "dup", "(", ")", ",", "ndArray"...
Eps function @param ndArray @return
[ "Eps", "function" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L744-L747
test
Create a greater than or equal to operation
Of course, here is the Java code you requested: ```java public static INDArray greaterThanOrEqual(INDArray first, INDArray ndArray, boolean dup) { return exec(dup ? new OldGreaterThanOrEqual(first.dup(), ndArray) : new OldGreaterThanOrEqual(first, ndArray)); } ``` Hope this helps!
oblac/jodd
jodd-servlet/src/main/java/jodd/servlet/DispatcherUtil.java
DispatcherUtil.includeNamed
public static boolean includeNamed(final ServletContext context, final ServletRequest request, final ServletResponse response, final String page) throws IOException, ServletException { RequestDispatcher dispatcher = context.getNamedDispatcher(page); if (dispatcher != null) { dispatcher.include(request, response)...
java
public static boolean includeNamed(final ServletContext context, final ServletRequest request, final ServletResponse response, final String page) throws IOException, ServletException { RequestDispatcher dispatcher = context.getNamedDispatcher(page); if (dispatcher != null) { dispatcher.include(request, response)...
[ "public", "static", "boolean", "includeNamed", "(", "final", "ServletContext", "context", ",", "final", "ServletRequest", "request", ",", "final", "ServletResponse", "response", ",", "final", "String", "page", ")", "throws", "IOException", ",", "ServletException", "...
Include named resource.
[ "Include", "named", "resource", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/DispatcherUtil.java#L69-L76
test
Include a named page in the servlet.
Of course, here is the Java code you requested: ```java public static boolean includeNamed(final ServletContext context, final ServletRequest request, final ServletResponse response, final String page) throws IOException, ServletException { RequestDispatcher dispatcher = context.getNamedDispatcher(page); if (dispa...
CloudI/cloudi_api_java
src/main/java/org/cloudi/API.java
API.recv_async
public Response recv_async(final Integer timeout, final byte[] trans_id, final boolean consume) throws InvalidInputException, MessageDecodingException, TerminateException { try { OtpOutput...
java
public Response recv_async(final Integer timeout, final byte[] trans_id, final boolean consume) throws InvalidInputException, MessageDecodingException, TerminateException { try { OtpOutput...
[ "public", "Response", "recv_async", "(", "final", "Integer", "timeout", ",", "final", "byte", "[", "]", "trans_id", ",", "final", "boolean", "consume", ")", "throws", "InvalidInputException", ",", "MessageDecodingException", ",", "TerminateException", "{", "try", ...
Asynchronously receive a response. @param timeout the receive timeout in milliseconds @param trans_id the transaction ID to receive @param consume if <code>true</code>, will consume the service request so it is not accessible with the same function call in the future @return the response @throws InvalidInpu...
[ "Asynchronously", "receive", "a", "response", "." ]
e8ccaeb9ad562c82d742dc31a5f06bcb1b637446
https://github.com/CloudI/cloudi_api_java/blob/e8ccaeb9ad562c82d742dc31a5f06bcb1b637446/src/main/java/org/cloudi/API.java#L955-L981
test
Send an async request to the server.
Of course, here is the Java code you requested: ```java public Response recv_async(final Integer timeout, final byte[] trans_id, final boolean consume) throws InvalidInputException, MessageDecodingException, TerminateEx...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createRichtpreisprom2
@XmlElementDecl(namespace = "", name = "richtpreisprom2") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createRichtpreisprom2(BigDecimal value) { return new JAXBElement<BigDecimal>(_Richtpreisprom2_QNAME, BigDecimal.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "richtpreisprom2") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createRichtpreisprom2(BigDecimal value) { return new JAXBElement<BigDecimal>(_Richtpreisprom2_QNAME, BigDecimal.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"richtpreisprom2\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter2", ".", "class", ")", "public", "JAXBElement", "<", "BigDecimal", ">", "createRichtpreisprom2", "(", "BigDecimal", "value",...
Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "BigDecimal", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L1715-L1719
test
Create an instance of an instance of a Richtpreisprom2 type.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "richtpreisprom2") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createRichtpreisprom2(BigDecimal value) { return new JAXBElement<BigDecimal>(_Richtpreisprom2_QNAME, BigDecimal.class, nu...
rest-assured/rest-assured
modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/specification/MockMvcRequestSpecBuilder.java
MockMvcRequestSpecBuilder.setBody
public MockMvcRequestSpecBuilder setBody(Object object, ObjectMapperType mapperType) { spec.body(object, mapperType); return this; }
java
public MockMvcRequestSpecBuilder setBody(Object object, ObjectMapperType mapperType) { spec.body(object, mapperType); return this; }
[ "public", "MockMvcRequestSpecBuilder", "setBody", "(", "Object", "object", ",", "ObjectMapperType", "mapperType", ")", "{", "spec", ".", "body", "(", "object", ",", "mapperType", ")", ";", "return", "this", ";", "}" ]
Specify an Object request content that will automatically be serialized to JSON or XML and sent with the request using a specific object mapper type. This works for the POST, PATCH and PUT methods only. Trying to do this for the other http methods will cause an exception to be thrown. <p> Example of use: <pre> Message ...
[ "Specify", "an", "Object", "request", "content", "that", "will", "automatically", "be", "serialized", "to", "JSON", "or", "XML", "and", "sent", "with", "the", "request", "using", "a", "specific", "object", "mapper", "type", ".", "This", "works", "for", "the"...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/specification/MockMvcRequestSpecBuilder.java#L175-L178
test
Sets the body of the request.
Of course, here is the Java code you requested: ```java public MockMvcRequestSpecBuilder setBody(Object object, ObjectMapperType mapperType) { spec.body(object, mapperType); return this; } ``` Hope this helps!
wildfly/wildfly
undertow/src/main/java/org/wildfly/extension/undertow/deployment/ServletResourceManager.java
ServletResourceManager.list
public List<Resource> list(String path) { try { final List<Resource> ret = new ArrayList<>(); Resource res = deploymentResourceManager.getResource(path); if (res != null) { for (Resource child : res.list()) { ret.add(new ServletResource(th...
java
public List<Resource> list(String path) { try { final List<Resource> ret = new ArrayList<>(); Resource res = deploymentResourceManager.getResource(path); if (res != null) { for (Resource child : res.list()) { ret.add(new ServletResource(th...
[ "public", "List", "<", "Resource", ">", "list", "(", "String", "path", ")", "{", "try", "{", "final", "List", "<", "Resource", ">", "ret", "=", "new", "ArrayList", "<>", "(", ")", ";", "Resource", "res", "=", "deploymentResourceManager", ".", "getResourc...
Lists all children of a particular path, taking overlays into account @param path The path @return The list of children
[ "Lists", "all", "children", "of", "a", "particular", "path", "taking", "overlays", "into", "account" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/undertow/src/main/java/org/wildfly/extension/undertow/deployment/ServletResourceManager.java#L149-L178
test
List all servlet resources in the path.
Of course, here is the Java code you requested: ```java public List<Resource> list(String path) { try { final List<Resource> ret = new ArrayList<>(); Resource res = deploymentResourceManager.getResource(path); if (res != null) { for (Resource child : res.lis...
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/dom/Node.java
Node.getNextSibling
public Node getNextSibling() { List<Node> siblings = parentNode.childNodes; int index = siblingIndex + 1; if (index >= siblings.size()) { return null; } return siblings.get(index); }
java
public Node getNextSibling() { List<Node> siblings = parentNode.childNodes; int index = siblingIndex + 1; if (index >= siblings.size()) { return null; } return siblings.get(index); }
[ "public", "Node", "getNextSibling", "(", ")", "{", "List", "<", "Node", ">", "siblings", "=", "parentNode", ".", "childNodes", ";", "int", "index", "=", "siblingIndex", "+", "1", ";", "if", "(", "index", ">=", "siblings", ".", "size", "(", ")", ")", ...
Returns this node's next sibling of <b>any</b> type or <code>null</code> if this is the last sibling.
[ "Returns", "this", "node", "s", "next", "sibling", "of", "<b", ">", "any<", "/", "b", ">", "type", "or", "<code", ">", "null<", "/", "code", ">", "if", "this", "is", "the", "last", "sibling", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/Node.java#L936-L943
test
Gets the next sibling node.
Of course, here is the Java code you requested: ```java public Node getNextSibling() { List<Node> siblings = parentNode.childNodes; int index = siblingIndex + 1; if (index >= siblings.size()) { return null; } return siblings.get(index); } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/io/FileUtil.java
FileUtil.streamOf
private static InputStream streamOf(final File file, final String encoding) throws IOException { InputStream in = new FileInputStream(file); if (encoding.startsWith("UTF")) { in = unicodeInputStreamOf(in, encoding); } return in; }
java
private static InputStream streamOf(final File file, final String encoding) throws IOException { InputStream in = new FileInputStream(file); if (encoding.startsWith("UTF")) { in = unicodeInputStreamOf(in, encoding); } return in; }
[ "private", "static", "InputStream", "streamOf", "(", "final", "File", "file", ",", "final", "String", "encoding", ")", "throws", "IOException", "{", "InputStream", "in", "=", "new", "FileInputStream", "(", "file", ")", ";", "if", "(", "encoding", ".", "start...
Returns either new {@link FileInputStream} or new {@link UnicodeInputStream}. @return either {@link FileInputStream} or {@link UnicodeInputStream}. @throws IOException if something went wrong. @see #unicodeInputStreamOf(InputStream, String)
[ "Returns", "either", "new", "{", "@link", "FileInputStream", "}", "or", "new", "{", "@link", "UnicodeInputStream", "}", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L1518-L1524
test
Returns an InputStream for the given file using the given encoding.
Of course, here is the Java code you requested: ```java private static InputStream streamOf(final File file, final String encoding) throws IOException { InputStream in = new FileInputStream(file); if (encoding.startsWith("UTF")) { in = unicodeInputStreamOf(in, encoding); } return in; } ``` Hope this helps...
blademainer/common_utils
commons-file/src/main/java/info/monitorenter/util/StringUtil.java
StringUtil.arrayToString
public static final String arrayToString(final Object isArr) { String result = StringUtil.arrayToString(isArr, ","); return result; }
java
public static final String arrayToString(final Object isArr) { String result = StringUtil.arrayToString(isArr, ","); return result; }
[ "public", "static", "final", "String", "arrayToString", "(", "final", "Object", "isArr", ")", "{", "String", "result", "=", "StringUtil", ".", "arrayToString", "(", "isArr", ",", "\",\"", ")", ";", "return", "result", ";", "}" ]
If the given Object is no Array, it's toString - method is invoked. Primitive type - Arrays and Object - Arrays are introspected using java.lang.reflect.Array. Convention for creation fo String - representation: <p> @see info.monitorenter.util.StringUtil#arrayToString(Object, String) @param isArr The Array to represe...
[ "If", "the", "given", "Object", "is", "no", "Array", "it", "s", "toString", "-", "method", "is", "invoked", ".", "Primitive", "type", "-", "Arrays", "and", "Object", "-", "Arrays", "are", "introspected", "using", "java", ".", "lang", ".", "reflect", ".",...
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/commons-file/src/main/java/info/monitorenter/util/StringUtil.java#L106-L109
test
Converts an array of objects to a string.
Of course, here is the Java code you requested: ```java public static final String arrayToString(final Object isArr) { String result = StringUtil.arrayToString(isArr, ","); return result; } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Maybe.java
Maybe.concatWith
@BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> concatWith(MaybeSource<? extends T> other) { ObjectHelper.requireNonNull(other, "other is null"); return concat(this, other); }
java
@BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> concatWith(MaybeSource<? extends T> other) { ObjectHelper.requireNonNull(other, "other is null"); return concat(this, other); }
[ "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "CheckReturnValue", "@", "NonNull", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "T", ">", "concatWith", "(", "MaybeSource", "<...
Returns a Flowable that emits the items emitted from the current MaybeSource, then the next, one after the other, without interleaving them. <p> <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt=""> <dl> <dt><b>Backpressure:</b></dt> <dd>The operator hon...
[ "Returns", "a", "Flowable", "that", "emits", "the", "items", "emitted", "from", "the", "current", "MaybeSource", "then", "the", "next", "one", "after", "the", "other", "without", "interleaving", "them", ".", "<p", ">", "<img", "width", "=", "640", "height", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L2458-L2465
test
Concatenates two sources of type T into one.
Of course, here is the Java code you requested: ```java @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> concatWith(MaybeSource<? extends T> other) { ObjectHelper.requireNonNull(other, "other is null"); ...
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/AbstractReasonerState.java
AbstractReasonerState.computeQuery
private boolean computeQuery(final ElkClassExpression classExpression, final boolean computeInstanceTaxonomy) throws ElkInconsistentOntologyException, ElkException { // Load the query classExpressionQueryState_.registerQuery(classExpression); ensureLoading(); // Complete all stages if (computeInstance...
java
private boolean computeQuery(final ElkClassExpression classExpression, final boolean computeInstanceTaxonomy) throws ElkInconsistentOntologyException, ElkException { // Load the query classExpressionQueryState_.registerQuery(classExpression); ensureLoading(); // Complete all stages if (computeInstance...
[ "private", "boolean", "computeQuery", "(", "final", "ElkClassExpression", "classExpression", ",", "final", "boolean", "computeInstanceTaxonomy", ")", "throws", "ElkInconsistentOntologyException", ",", "ElkException", "{", "// Load the query", "classExpressionQueryState_", ".", ...
If the query results are not cached yet, indexes the supplied class expression and, if successful, computes the query so that the results for this expressions are ready in {@link #classExpressionQueryState_}. @param classExpression @param computeInstanceTaxonomy if {@code false}, only class taxonomy is computed, if {@...
[ "If", "the", "query", "results", "are", "not", "cached", "yet", "indexes", "the", "supplied", "class", "expression", "and", "if", "successful", "computes", "the", "query", "so", "that", "the", "results", "for", "this", "expressions", "are", "ready", "in", "{...
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/stages/AbstractReasonerState.java#L772-L820
test
Computes the query result.
Of course, here is the Java code you requested: ```java private boolean computeQuery(final ElkClassExpression classExpression, final boolean computeInstanceTaxonomy) throws ElkInconsistentOntologyException, ElkException { // Load the query classExpressionQueryState_.registerQuery(classExpression); ensureL...
mbeiter/jaas
loginmodules/password/pwcommon/src/main/java/org/beiter/michael/authn/jaas/loginmodules/password/common/PasswordAuthenticatorFactory.java
PasswordAuthenticatorFactory.getSingleton
@SuppressWarnings("PMD.NonThreadSafeSingleton") public static PasswordAuthenticator getSingleton(final String className, final CommonProperties properties) throws FactoryException { Validate.notBlank(className, "The validated character sequence 'className' is null or empty"); Validate.n...
java
@SuppressWarnings("PMD.NonThreadSafeSingleton") public static PasswordAuthenticator getSingleton(final String className, final CommonProperties properties) throws FactoryException { Validate.notBlank(className, "The validated character sequence 'className' is null or empty"); Validate.n...
[ "@", "SuppressWarnings", "(", "\"PMD.NonThreadSafeSingleton\"", ")", "public", "static", "PasswordAuthenticator", "getSingleton", "(", "final", "String", "className", ",", "final", "CommonProperties", "properties", ")", "throws", "FactoryException", "{", "Validate", ".", ...
Return a singleton, fully initialized instance of an {@link PasswordAuthenticator} class to use for JAAS authentication. <p> Retrieving a singleton by this method will cause the factory to keep state, and store a reference to the singleton for later use. You may reset the factory state using the {@code reset()} method ...
[ "Return", "a", "singleton", "fully", "initialized", "instance", "of", "an", "{", "@link", "PasswordAuthenticator", "}", "class", "to", "use", "for", "JAAS", "authentication", ".", "<p", ">", "Retrieving", "a", "singleton", "by", "this", "method", "will", "caus...
540e78af91c73291fa0e57b0df352f4a22950772
https://github.com/mbeiter/jaas/blob/540e78af91c73291fa0e57b0df352f4a22950772/loginmodules/password/pwcommon/src/main/java/org/beiter/michael/authn/jaas/loginmodules/password/common/PasswordAuthenticatorFactory.java#L152-L169
test
Gets the singleton instance.
Of course, here is the Java code you requested: ```java @SuppressWarnings("PMD.NonThreadSafeSingleton") public static PasswordAuthenticator getSingleton(final String className, final CommonProperties properties) throws FactoryException { Validate.notBlank(className, "The validated character se...
alipay/sofa-bolt
src/main/java/com/alipay/remoting/rpc/RpcClient.java
RpcClient.invokeSync
public Object invokeSync(final Url url, final Object request, final int timeoutMillis) throws RemotingException, InterruptedException { ...
java
public Object invokeSync(final Url url, final Object request, final int timeoutMillis) throws RemotingException, InterruptedException { ...
[ "public", "Object", "invokeSync", "(", "final", "Url", "url", ",", "final", "Object", "request", ",", "final", "int", "timeoutMillis", ")", "throws", "RemotingException", ",", "InterruptedException", "{", "return", "this", ".", "invokeSync", "(", "url", ",", "...
Synchronous invocation using a parsed {@link Url} <br> <p> Notice:<br> <ol> <li><b>DO NOT modify the request object concurrently when this method is called.</b></li> <li>When do invocation, use the parsed {@link Url} to find a available connection, if none then create one.</li> <ul> <li>You can use {@link Url#setConnec...
[ "Synchronous", "invocation", "using", "a", "parsed", "{", "@link", "Url", "}", "<br", ">", "<p", ">", "Notice", ":", "<br", ">", "<ol", ">", "<li", ">", "<b", ">", "DO", "NOT", "modify", "the", "request", "object", "concurrently", "when", "this", "meth...
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcClient.java#L334-L338
test
Invoke the request asynchronously.
Of course, here is the Java code you requested: ```java public Object invokeSync(final Url url, final Object request, final int timeoutMillis) throws RemotingException, ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft/point/standard/plug/UnidataPointDatasetHelper.java
UnidataPointDatasetHelper.getCoordinateName
static public String getCoordinateName(NetcdfDataset ds, AxisType a, Dimension dim) { String name = getCoordinateName(ds, a); if (name == null) return null; Variable v = ds.findVariable(name); if (v == null) return null; if (v.isScalar()) return null; if (!v.getDimension(0).equals(dim)...
java
static public String getCoordinateName(NetcdfDataset ds, AxisType a, Dimension dim) { String name = getCoordinateName(ds, a); if (name == null) return null; Variable v = ds.findVariable(name); if (v == null) return null; if (v.isScalar()) return null; if (!v.getDimension(0).equals(dim)...
[ "static", "public", "String", "getCoordinateName", "(", "NetcdfDataset", "ds", ",", "AxisType", "a", ",", "Dimension", "dim", ")", "{", "String", "name", "=", "getCoordinateName", "(", "ds", ",", "a", ")", ";", "if", "(", "name", "==", "null", ")", "retu...
Tries to find the coordinate variable of the specified type, which has the specified dimension as its firsst dimension @param ds search in this dataset @param a AxisType.LAT, LON, HEIGHT, or TIME @param dim must use this dimension @return coordinate variable, or null if not found.
[ "Tries", "to", "find", "the", "coordinate", "variable", "of", "the", "specified", "type", "which", "has", "the", "specified", "dimension", "as", "its", "firsst", "dimension" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/UnidataPointDatasetHelper.java#L129-L140
test
Get the name of the homography element in the dataset
Of course, here is the Java code you requested: ```java static public String getCoordinateName(NetcdfDataset ds, AxisType a, Dimension dim) { String name = getCoordinateName(ds, a); if (name == null) return null; Variable v = ds.findVariable(name); if (v == null) return null; if (v.isScala...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java
SymbolTable.addConstantUtf8Reference
private void addConstantUtf8Reference(final int index, final int tag, final String value) { add(new Entry(index, tag, value, hash(tag, value))); }
java
private void addConstantUtf8Reference(final int index, final int tag, final String value) { add(new Entry(index, tag, value, hash(tag, value))); }
[ "private", "void", "addConstantUtf8Reference", "(", "final", "int", "index", ",", "final", "int", "tag", ",", "final", "String", "value", ")", "{", "add", "(", "new", "Entry", "(", "index", ",", "tag", ",", "value", ",", "hash", "(", "tag", ",", "value...
Adds a new CONSTANT_Class_info, CONSTANT_String_info, CONSTANT_MethodType_info, CONSTANT_Module_info or CONSTANT_Package_info to the constant pool of this symbol table. @param index the constant pool index of the new Symbol. @param tag one of {@link Symbol#CONSTANT_CLASS_TAG}, {@link Symbol#CONSTANT_STRING_TAG}, {@lin...
[ "Adds", "a", "new", "CONSTANT_Class_info", "CONSTANT_String_info", "CONSTANT_MethodType_info", "CONSTANT_Module_info", "or", "CONSTANT_Package_info", "to", "the", "constant", "pool", "of", "this", "symbol", "table", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java#L1022-L1024
test
Add a UTF - 8 reference to the SEM.
Of course, here is the Java code you requested: ```java private void addConstantUtf8Reference(final int index, final int tag, final String value) { add(new Entry(index, tag, value, hash(tag, value))); } ``` Hope this helps!
streamsets/datacollector
commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java
ProtobufTypeUtil.sdcFieldToProtobufMsg
private static DynamicMessage sdcFieldToProtobufMsg( Record record, Field field, String fieldPath, Descriptors.Descriptor desc, Map<String, Set<Descriptors.FieldDescriptor>> messageTypeToExtensionMap, Map<String, Object> defaultValueMap ) throws DataGeneratorException { if (fie...
java
private static DynamicMessage sdcFieldToProtobufMsg( Record record, Field field, String fieldPath, Descriptors.Descriptor desc, Map<String, Set<Descriptors.FieldDescriptor>> messageTypeToExtensionMap, Map<String, Object> defaultValueMap ) throws DataGeneratorException { if (fie...
[ "private", "static", "DynamicMessage", "sdcFieldToProtobufMsg", "(", "Record", "record", ",", "Field", "field", ",", "String", "fieldPath", ",", "Descriptors", ".", "Descriptor", "desc", ",", "Map", "<", "String", ",", "Set", "<", "Descriptors", ".", "FieldDescr...
Serializes a field path in a record to a protobuf message using the specified descriptor. @param record Record with the field to serialize @param field The field to serialize @param fieldPath The field path of the specified field @param desc P...
[ "Serializes", "a", "field", "path", "in", "a", "record", "to", "a", "protobuf", "message", "using", "the", "specified", "descriptor", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java#L651-L714
test
This method is used to convert a SDC field to a protobuf message.
Of course, here is the Java code you requested: ```java private static DynamicMessage sdcFieldToProtobufMsg( Record record, Field field, String fieldPath, Descriptors.Descriptor desc, Map<String, Set<Descriptors.FieldDescriptor>> messageTypeToExtensionMap, Map<String, Object> defaul...