repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
201
func_name
stringlengths
4
126
whole_func_string
stringlengths
75
3.57k
language
stringclasses
1 value
func_code_string
stringlengths
75
3.57k
func_code_tokens
listlengths
21
599
func_documentation_string
stringlengths
61
1.95k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/CmsUndoRedoHandler.java
CmsUndoRedoHandler.addChange
public void addChange(String valuePath, String attributeName, int valueIndex, ChangeType changeType) { if (ChangeType.value.equals(changeType)) { if (m_changeTimer != null) { if (!m_changeTimer.matches(valuePath, attributeName, valueIndex)) { // only in case the change properties of the timer do not match the current change, // add the last change and start a new timer m_changeTimer.cancel(); m_changeTimer.run(); m_changeTimer = new ChangeTimer(valuePath, attributeName, valueIndex, changeType); m_changeTimer.schedule(CHANGE_TIMER_DELAY); } } else { m_changeTimer = new ChangeTimer(valuePath, attributeName, valueIndex, changeType); m_changeTimer.schedule(CHANGE_TIMER_DELAY); } } else { if (m_changeTimer != null) { m_changeTimer.cancel(); m_changeTimer.run(); } internalAddChange(valuePath, attributeName, valueIndex, changeType); } }
java
public void addChange(String valuePath, String attributeName, int valueIndex, ChangeType changeType) { if (ChangeType.value.equals(changeType)) { if (m_changeTimer != null) { if (!m_changeTimer.matches(valuePath, attributeName, valueIndex)) { // only in case the change properties of the timer do not match the current change, // add the last change and start a new timer m_changeTimer.cancel(); m_changeTimer.run(); m_changeTimer = new ChangeTimer(valuePath, attributeName, valueIndex, changeType); m_changeTimer.schedule(CHANGE_TIMER_DELAY); } } else { m_changeTimer = new ChangeTimer(valuePath, attributeName, valueIndex, changeType); m_changeTimer.schedule(CHANGE_TIMER_DELAY); } } else { if (m_changeTimer != null) { m_changeTimer.cancel(); m_changeTimer.run(); } internalAddChange(valuePath, attributeName, valueIndex, changeType); } }
[ "public", "void", "addChange", "(", "String", "valuePath", ",", "String", "attributeName", ",", "int", "valueIndex", ",", "ChangeType", "changeType", ")", "{", "if", "(", "ChangeType", ".", "value", ".", "equals", "(", "changeType", ")", ")", "{", "if", "(...
Adds a change to the undo stack.<p> @param valuePath the entity value path @param attributeName the attribute name @param valueIndex the value index @param changeType the change type
[ "Adds", "a", "change", "to", "the", "undo", "stack", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsUndoRedoHandler.java#L317-L340
actorapp/actor-platform
actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java
Messenger.sendDocument
@ObjectiveCName("sendDocumentWithPeer:withName:withMime:withDescriptor:") public void sendDocument(Peer peer, String fileName, String mimeType, String descriptor) { sendDocument(peer, fileName, mimeType, null, descriptor); }
java
@ObjectiveCName("sendDocumentWithPeer:withName:withMime:withDescriptor:") public void sendDocument(Peer peer, String fileName, String mimeType, String descriptor) { sendDocument(peer, fileName, mimeType, null, descriptor); }
[ "@", "ObjectiveCName", "(", "\"sendDocumentWithPeer:withName:withMime:withDescriptor:\"", ")", "public", "void", "sendDocument", "(", "Peer", "peer", ",", "String", "fileName", ",", "String", "mimeType", ",", "String", "descriptor", ")", "{", "sendDocument", "(", "pee...
Send document without preview @param peer destination peer @param fileName File name (without path) @param mimeType mimetype of document @param descriptor File Descriptor
[ "Send", "document", "without", "preview" ]
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L943-L946
Whiley/WhileyCompiler
src/main/java/wyc/io/WhileyFileParser.java
WhileyFileParser.parseFunctionOrMethodDeclaration
private Decl.FunctionOrMethod parseFunctionOrMethodDeclaration(Tuple<Modifier> modifiers, boolean isFunction) { int start = index; // Create appropriate enclosing scope EnclosingScope scope = new EnclosingScope(); // if (isFunction) { match(Function); } else { match(Method); } Identifier name = parseIdentifier(); // Parse template parameters Tuple<Template.Variable> template = parseOptionalTemplate(scope); // Parse function or method parameters Tuple<Decl.Variable> parameters = parseParameters(scope,RightBrace); // Parse (optional) return type Tuple<Decl.Variable> returns; // if (tryAndMatch(true, MinusGreater) != null) { // Explicit return type is given, so parse it! We first clone the // environent and create a special one only for use within ensures // clauses, since these are the only expressions which may refer to // variables declared in the return type. returns = parseOptionalParameters(scope); } else { // No returns provided returns = new Tuple<>(); } // Parse optional requires/ensures clauses Tuple<Expr> requires = parseInvariant(scope,Requires); Tuple<Expr> ensures = parseInvariant(scope,Ensures); // Parse function or method body (if not native) Stmt.Block body; int end; if(modifiers.match(Modifier.Native.class) == null) { // Not native function or method match(Colon); end = index; matchEndLine(); scope.declareThisLifetime(); body = parseBlock(scope, false); } else { end = index; matchEndLine(); // FIXME: having empty block seems wasteful body = new Stmt.Block(); } // WyilFile.Decl.FunctionOrMethod declaration; if (isFunction) { declaration = new Decl.Function(modifiers, name, template, parameters, returns, requires, ensures, body); } else { declaration = new Decl.Method(modifiers, name, template, parameters, returns, requires, ensures, body); } return annotateSourceLocation(declaration,start,end-1); }
java
private Decl.FunctionOrMethod parseFunctionOrMethodDeclaration(Tuple<Modifier> modifiers, boolean isFunction) { int start = index; // Create appropriate enclosing scope EnclosingScope scope = new EnclosingScope(); // if (isFunction) { match(Function); } else { match(Method); } Identifier name = parseIdentifier(); // Parse template parameters Tuple<Template.Variable> template = parseOptionalTemplate(scope); // Parse function or method parameters Tuple<Decl.Variable> parameters = parseParameters(scope,RightBrace); // Parse (optional) return type Tuple<Decl.Variable> returns; // if (tryAndMatch(true, MinusGreater) != null) { // Explicit return type is given, so parse it! We first clone the // environent and create a special one only for use within ensures // clauses, since these are the only expressions which may refer to // variables declared in the return type. returns = parseOptionalParameters(scope); } else { // No returns provided returns = new Tuple<>(); } // Parse optional requires/ensures clauses Tuple<Expr> requires = parseInvariant(scope,Requires); Tuple<Expr> ensures = parseInvariant(scope,Ensures); // Parse function or method body (if not native) Stmt.Block body; int end; if(modifiers.match(Modifier.Native.class) == null) { // Not native function or method match(Colon); end = index; matchEndLine(); scope.declareThisLifetime(); body = parseBlock(scope, false); } else { end = index; matchEndLine(); // FIXME: having empty block seems wasteful body = new Stmt.Block(); } // WyilFile.Decl.FunctionOrMethod declaration; if (isFunction) { declaration = new Decl.Function(modifiers, name, template, parameters, returns, requires, ensures, body); } else { declaration = new Decl.Method(modifiers, name, template, parameters, returns, requires, ensures, body); } return annotateSourceLocation(declaration,start,end-1); }
[ "private", "Decl", ".", "FunctionOrMethod", "parseFunctionOrMethodDeclaration", "(", "Tuple", "<", "Modifier", ">", "modifiers", ",", "boolean", "isFunction", ")", "{", "int", "start", "=", "index", ";", "// Create appropriate enclosing scope", "EnclosingScope", "scope"...
Parse a <i>function declaration</i> or <i>method declaration</i>, which have the form: <pre> FunctionDeclaration ::= "function" TypePattern "->" TypePattern (FunctionMethodClause)* ':' NewLine Block MethodDeclaration ::= "method" TypePattern "->" TypePattern (FunctionMethodClause)* ':' NewLine Block FunctionMethodClause ::= "requires" Expr | "ensures" Expr </pre> Here, the first type pattern (i.e. before "->") is referred to as the "parameter", whilst the second is referred to as the "return". There are two kinds of option clause: <ul> <li><b>Requires clause</b>. This defines a constraint on the permissible values of the parameters on entry to the function or method, and is often referred to as the "precondition". This expression may refer to any variables declared within the parameter type pattern. Multiple clauses may be given, and these are taken together as a conjunction. Furthermore, the convention is to specify the requires clause(s) before any ensure(s) clauses.</li> <li><b>Ensures clause</b>. This defines a constraint on the permissible values of the the function or method's return value, and is often referred to as the "postcondition". This expression may refer to any variables declared within either the parameter or return type pattern. Multiple clauses may be given, and these are taken together as a conjunction. Furthermore, the convention is to specify the requires clause(s) after the others.</li> </ul> <p> The following function declaration provides a small example to illustrate: </p> <pre> function max(int x, int y) -> (int z) // return must be greater than either parameter ensures x <= z && y <= z // return must equal one of the parmaeters ensures x == z || y == z: ... </pre> <p> Here, we see the specification for the well-known <code>max()</code> function which returns the largest of its parameters. This does not throw any exceptions, and does not enforce any preconditions on its parameters. </p>
[ "Parse", "a", "<i", ">", "function", "declaration<", "/", "i", ">", "or", "<i", ">", "method", "declaration<", "/", "i", ">", "which", "have", "the", "form", ":" ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L292-L349
knightliao/disconf
disconf-client/src/main/java/com/baidu/disconf/client/support/utils/StringUtil.java
StringUtil.bytesToString
public static String bytesToString(byte[] bytes, boolean noCase) { char[] digits = noCase ? DIGITS_NOCASE : DIGITS; int digitsLength = digits.length; if (ArrayUtils.isEmpty(bytes)) { return String.valueOf(digits[0]); } StringBuilder strValue = new StringBuilder(); int value = 0; int limit = Integer.MAX_VALUE >>> 8; int i = 0; do { while (i < bytes.length && value < limit) { value = (value << 8) + (0xFF & bytes[i++]); } while (value >= digitsLength) { strValue.append(digits[value % digitsLength]); value = value / digitsLength; } } while (i < bytes.length); if (value != 0 || strValue.length() == 0) { strValue.append(digits[value]); } return strValue.toString(); }
java
public static String bytesToString(byte[] bytes, boolean noCase) { char[] digits = noCase ? DIGITS_NOCASE : DIGITS; int digitsLength = digits.length; if (ArrayUtils.isEmpty(bytes)) { return String.valueOf(digits[0]); } StringBuilder strValue = new StringBuilder(); int value = 0; int limit = Integer.MAX_VALUE >>> 8; int i = 0; do { while (i < bytes.length && value < limit) { value = (value << 8) + (0xFF & bytes[i++]); } while (value >= digitsLength) { strValue.append(digits[value % digitsLength]); value = value / digitsLength; } } while (i < bytes.length); if (value != 0 || strValue.length() == 0) { strValue.append(digits[value]); } return strValue.toString(); }
[ "public", "static", "String", "bytesToString", "(", "byte", "[", "]", "bytes", ",", "boolean", "noCase", ")", "{", "char", "[", "]", "digits", "=", "noCase", "?", "DIGITS_NOCASE", ":", "DIGITS", ";", "int", "digitsLength", "=", "digits", ".", "length", "...
将一个byte数组转换成62进制的字符串。 @param bytes 二进制数组 @param noCase 区分大小写 @return 62进制的字符串
[ "将一个byte数组转换成62进制的字符串。" ]
train
https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-client/src/main/java/com/baidu/disconf/client/support/utils/StringUtil.java#L487-L516
inferred/FreeBuilder
src/main/java/org/inferred/freebuilder/processor/source/FunctionalType.java
FunctionalType.unboxedUnaryOperator
public static FunctionalType unboxedUnaryOperator(TypeMirror type, Types types) { switch (type.getKind()) { case INT: case LONG: case DOUBLE: return primitiveUnaryOperator((PrimitiveType) type); case BOOLEAN: case BYTE: case CHAR: case SHORT: case FLOAT: return unaryOperator(types.boxedClass((PrimitiveType) type).asType()); default: return unaryOperator(type); } }
java
public static FunctionalType unboxedUnaryOperator(TypeMirror type, Types types) { switch (type.getKind()) { case INT: case LONG: case DOUBLE: return primitiveUnaryOperator((PrimitiveType) type); case BOOLEAN: case BYTE: case CHAR: case SHORT: case FLOAT: return unaryOperator(types.boxedClass((PrimitiveType) type).asType()); default: return unaryOperator(type); } }
[ "public", "static", "FunctionalType", "unboxedUnaryOperator", "(", "TypeMirror", "type", ",", "Types", "types", ")", "{", "switch", "(", "type", ".", "getKind", "(", ")", ")", "{", "case", "INT", ":", "case", "LONG", ":", "case", "DOUBLE", ":", "return", ...
Returns a unary operator that will accept {@code type}, without autoboxing if possible.
[ "Returns", "a", "unary", "operator", "that", "will", "accept", "{" ]
train
https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/FunctionalType.java#L109-L126
OpenLiberty/open-liberty
dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixUtils.java
IFixUtils.equalsHashes
private static boolean equalsHashes(File fileToHash, String hashToCompare) throws IOException { boolean result = false; // Now calculate the new hash and compare the 2. If they are NOT the same the ifix needs to be re-applied. String fileHash = MD5Utils.getFileMD5String(fileToHash); if (fileHash.equals(hashToCompare)) result = true; return result; }
java
private static boolean equalsHashes(File fileToHash, String hashToCompare) throws IOException { boolean result = false; // Now calculate the new hash and compare the 2. If they are NOT the same the ifix needs to be re-applied. String fileHash = MD5Utils.getFileMD5String(fileToHash); if (fileHash.equals(hashToCompare)) result = true; return result; }
[ "private", "static", "boolean", "equalsHashes", "(", "File", "fileToHash", ",", "String", "hashToCompare", ")", "throws", "IOException", "{", "boolean", "result", "=", "false", ";", "// Now calculate the new hash and compare the 2. If they are NOT the same the ifix needs to be ...
This method calculates a hash of the required file and compares it against the supplied hash. It then returns true if both hashes are equals. @param fileToHash - The file to calculate the hash for. @param hashToCompare - The hash to compare. @return - A boolean indicating whether the hashes are equal.
[ "This", "method", "calculates", "a", "hash", "of", "the", "required", "file", "and", "compares", "it", "against", "the", "supplied", "hash", ".", "It", "then", "returns", "true", "if", "both", "hashes", "are", "equals", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixUtils.java#L305-L314
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/WebElementCreator.java
WebElementCreator.createWebElementAndSetLocation
private WebElement createWebElementAndSetLocation(String information, WebView webView){ String[] data = information.split(";,"); String[] elements = null; int x = 0; int y = 0; int width = 0; int height = 0; Hashtable<String, String> attributes = new Hashtable<String, String>(); try{ x = Math.round(Float.valueOf(data[5])); y = Math.round(Float.valueOf(data[6])); width = Math.round(Float.valueOf(data[7])); height = Math.round(Float.valueOf(data[8])); elements = data[9].split("\\#\\$"); }catch(Exception ignored){} if(elements != null) { for (int index = 0; index < elements.length; index++){ String[] element = elements[index].split("::"); if (element.length > 1) { attributes.put(element[0], element[1]); } else { attributes.put(element[0], element[0]); } } } WebElement webElement = null; try{ webElement = new WebElement(data[0], data[1], data[2], data[3], data[4], attributes); setLocation(webElement, webView, x, y, width, height); }catch(Exception ignored) {} return webElement; }
java
private WebElement createWebElementAndSetLocation(String information, WebView webView){ String[] data = information.split(";,"); String[] elements = null; int x = 0; int y = 0; int width = 0; int height = 0; Hashtable<String, String> attributes = new Hashtable<String, String>(); try{ x = Math.round(Float.valueOf(data[5])); y = Math.round(Float.valueOf(data[6])); width = Math.round(Float.valueOf(data[7])); height = Math.round(Float.valueOf(data[8])); elements = data[9].split("\\#\\$"); }catch(Exception ignored){} if(elements != null) { for (int index = 0; index < elements.length; index++){ String[] element = elements[index].split("::"); if (element.length > 1) { attributes.put(element[0], element[1]); } else { attributes.put(element[0], element[0]); } } } WebElement webElement = null; try{ webElement = new WebElement(data[0], data[1], data[2], data[3], data[4], attributes); setLocation(webElement, webView, x, y, width, height); }catch(Exception ignored) {} return webElement; }
[ "private", "WebElement", "createWebElementAndSetLocation", "(", "String", "information", ",", "WebView", "webView", ")", "{", "String", "[", "]", "data", "=", "information", ".", "split", "(", "\";,\"", ")", ";", "String", "[", "]", "elements", "=", "null", ...
Creates a {@code WebView} object @param information the data of the web element @param webView the web view the text is shown in @return a {@code WebElement} object with a given text and location
[ "Creates", "a", "{", "@code", "WebView", "}", "object" ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/WebElementCreator.java#L124-L159
puniverse/galaxy
src/main/java/co/paralleluniverse/galaxy/Grid.java
Grid.getInstance
public static Grid getInstance(String configFile, String propertiesFile) throws InterruptedException { return getInstance(configFile == null ? null : new FileSystemResource(configFile), propertiesFile); }
java
public static Grid getInstance(String configFile, String propertiesFile) throws InterruptedException { return getInstance(configFile == null ? null : new FileSystemResource(configFile), propertiesFile); }
[ "public", "static", "Grid", "getInstance", "(", "String", "configFile", ",", "String", "propertiesFile", ")", "throws", "InterruptedException", "{", "return", "getInstance", "(", "configFile", "==", "null", "?", "null", ":", "new", "FileSystemResource", "(", "conf...
Retrieves the grid instance, as defined in the given configuration file. @param configFile The name of the configuration file containing the grid definition. @param propertiesFile The name of the properties file containing the grid's properties. You may, of course use Spring's {@code <context:property-placeholder location="classpath:com/foo/bar.properties"/>} but this parameter is helpful when you want to use the same xml configuration with different properties for different instances. @return The grid instance.
[ "Retrieves", "the", "grid", "instance", "as", "defined", "in", "the", "given", "configuration", "file", "." ]
train
https://github.com/puniverse/galaxy/blob/1d077532c4a5bcd6c52ff670770c31e98420ff63/src/main/java/co/paralleluniverse/galaxy/Grid.java#L59-L61
banq/jdonframework
src/main/java/com/jdon/util/jdom/XMLProperties.java
XMLProperties.setProperty
public void setProperty(String name, String value) { // Set cache correctly with prop name and value. propertyCache.put(name, value); String[] propName = parsePropertyName(name); // Search for this property by traversing down the XML heirarchy. Element element = doc.getRootElement(); for (int i = 0; i < propName.length; i++) { // If we don't find this part of the property in the XML heirarchy // we add it as a new node if (element.getChild(propName[i]) == null) { element.addContent(new Element(propName[i])); } element = element.getChild(propName[i]); } // Set the value of the property in this node. element.setText(value); }
java
public void setProperty(String name, String value) { // Set cache correctly with prop name and value. propertyCache.put(name, value); String[] propName = parsePropertyName(name); // Search for this property by traversing down the XML heirarchy. Element element = doc.getRootElement(); for (int i = 0; i < propName.length; i++) { // If we don't find this part of the property in the XML heirarchy // we add it as a new node if (element.getChild(propName[i]) == null) { element.addContent(new Element(propName[i])); } element = element.getChild(propName[i]); } // Set the value of the property in this node. element.setText(value); }
[ "public", "void", "setProperty", "(", "String", "name", ",", "String", "value", ")", "{", "// Set cache correctly with prop name and value.\r", "propertyCache", ".", "put", "(", "name", ",", "value", ")", ";", "String", "[", "]", "propName", "=", "parsePropertyNam...
Sets the value of the specified property. If the property doesn't currently exist, it will be automatically created. @param name the name of the property to set. @param value the new value for the property.
[ "Sets", "the", "value", "of", "the", "specified", "property", ".", "If", "the", "property", "doesn", "t", "currently", "exist", "it", "will", "be", "automatically", "created", "." ]
train
https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/jdom/XMLProperties.java#L188-L206
apptentive/apptentive-android
apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java
Apptentive.queryCanShowInteraction
public static synchronized void queryCanShowInteraction(final String event, BooleanCallback callback) { dispatchConversationTask(new ConversationDispatchTask(callback, DispatchQueue.mainQueue()) { @Override protected boolean execute(Conversation conversation) { return canShowLocalAppInteraction(conversation, event); } }, "check if interaction can be shown"); }
java
public static synchronized void queryCanShowInteraction(final String event, BooleanCallback callback) { dispatchConversationTask(new ConversationDispatchTask(callback, DispatchQueue.mainQueue()) { @Override protected boolean execute(Conversation conversation) { return canShowLocalAppInteraction(conversation, event); } }, "check if interaction can be shown"); }
[ "public", "static", "synchronized", "void", "queryCanShowInteraction", "(", "final", "String", "event", ",", "BooleanCallback", "callback", ")", "{", "dispatchConversationTask", "(", "new", "ConversationDispatchTask", "(", "callback", ",", "DispatchQueue", ".", "mainQue...
This method can be used to determine if a call to one of the <strong><code>engage()</code></strong> methods such as {@link #engage(Context, String)} using the same event name will result in the display of an Interaction. This is useful if you need to know whether an Interaction will be displayed before you create a UI Button, etc. @param event A unique String representing the line this method is called on. For instance, you may want to have the ability to target interactions to run after the user uploads a file in your app. You may then call <strong><code>engage(activity, "finished_upload");</code></strong>
[ "This", "method", "can", "be", "used", "to", "determine", "if", "a", "call", "to", "one", "of", "the", "<strong", ">", "<code", ">", "engage", "()", "<", "/", "code", ">", "<", "/", "strong", ">", "methods", "such", "as", "{", "@link", "#engage", "...
train
https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L1378-L1385
HeidelTime/heideltime
src/jflexcrf/Feature.java
Feature.eFeature1Init
public void eFeature1Init(int y, int yp, Map fmap) { eFeature1Init(y, yp); strId2IdxAdd(fmap); }
java
public void eFeature1Init(int y, int yp, Map fmap) { eFeature1Init(y, yp); strId2IdxAdd(fmap); }
[ "public", "void", "eFeature1Init", "(", "int", "y", ",", "int", "yp", ",", "Map", "fmap", ")", "{", "eFeature1Init", "(", "y", ",", "yp", ")", ";", "strId2IdxAdd", "(", "fmap", ")", ";", "}" ]
E feature1 init. @param y the y @param yp the yp @param fmap the fmap
[ "E", "feature1", "init", "." ]
train
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jflexcrf/Feature.java#L96-L99
alkacon/opencms-core
src/org/opencms/ade/publish/CmsDirectPublishProject.java
CmsDirectPublishProject.shouldIncludeContents
protected boolean shouldIncludeContents(Map<String, String> params) { String includeContentsStr = params.get(CmsPublishOptions.PARAM_INCLUDE_CONTENTS); boolean includeContents = false; try { includeContents = Boolean.parseBoolean(includeContentsStr); } catch (Exception e) { // ignore; includeContents remains the default value } return includeContents; }
java
protected boolean shouldIncludeContents(Map<String, String> params) { String includeContentsStr = params.get(CmsPublishOptions.PARAM_INCLUDE_CONTENTS); boolean includeContents = false; try { includeContents = Boolean.parseBoolean(includeContentsStr); } catch (Exception e) { // ignore; includeContents remains the default value } return includeContents; }
[ "protected", "boolean", "shouldIncludeContents", "(", "Map", "<", "String", ",", "String", ">", "params", ")", "{", "String", "includeContentsStr", "=", "params", ".", "get", "(", "CmsPublishOptions", ".", "PARAM_INCLUDE_CONTENTS", ")", ";", "boolean", "includeCon...
Returns true if the folder contents should be included.<p> @param params the publish parameters @return true if the folder contents should be included
[ "Returns", "true", "if", "the", "folder", "contents", "should", "be", "included", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/publish/CmsDirectPublishProject.java#L173-L183
synchronoss/cpo-api
cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java
CassandraCpoAdapter.getWriteSession
protected Session getWriteSession() throws CpoException { Session session; try { session = getWriteDataSource().getSession(); } catch (Throwable t) { String msg = "getWriteConnection(): failed"; logger.error(msg, t); throw new CpoException(msg, t); } return session; }
java
protected Session getWriteSession() throws CpoException { Session session; try { session = getWriteDataSource().getSession(); } catch (Throwable t) { String msg = "getWriteConnection(): failed"; logger.error(msg, t); throw new CpoException(msg, t); } return session; }
[ "protected", "Session", "getWriteSession", "(", ")", "throws", "CpoException", "{", "Session", "session", ";", "try", "{", "session", "=", "getWriteDataSource", "(", ")", ".", "getSession", "(", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "Str...
getWriteSession returns the write session for Cassandra @return A Session object for writing @throws CpoException
[ "getWriteSession", "returns", "the", "write", "session", "for", "Cassandra" ]
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L1954-L1966
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWComponent.java
AbstractWComponent.switchFlag
private static int switchFlag(final int flags, final int mask, final boolean value) { int newFlags = value ? flags | mask : flags & ~mask; return newFlags; }
java
private static int switchFlag(final int flags, final int mask, final boolean value) { int newFlags = value ? flags | mask : flags & ~mask; return newFlags; }
[ "private", "static", "int", "switchFlag", "(", "final", "int", "flags", ",", "final", "int", "mask", ",", "final", "boolean", "value", ")", "{", "int", "newFlags", "=", "value", "?", "flags", "|", "mask", ":", "flags", "&", "~", "mask", ";", "return", ...
A utility method to set or clear one or more bits in the given set of flags. @param flags the current set of flags. @param mask the bit mask for the flags to set/clear. @param value true to set the flag(s), false to clear. @return the new set of flags.
[ "A", "utility", "method", "to", "set", "or", "clear", "one", "or", "more", "bits", "in", "the", "given", "set", "of", "flags", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWComponent.java#L993-L996
alkacon/opencms-core
src/org/opencms/ade/configuration/CmsConfigurationReader.java
CmsConfigurationReader.parseProperty
public static CmsPropertyConfig parseProperty(CmsObject cms, I_CmsXmlContentLocation field) { String name = getString(cms, field.getSubValue(N_PROPERTY_NAME)); String includeName = getString(cms, field.getSubValue(N_INCLUDE_NAME)); String widget = getString(cms, field.getSubValue(N_WIDGET)); String widgetConfig = getString(cms, field.getSubValue(N_WIDGET_CONFIG)); String ruleRegex = getString(cms, field.getSubValue(N_RULE_REGEX)); String ruleType = getString(cms, field.getSubValue(N_RULE_TYPE)); String default1 = getString(cms, field.getSubValue(N_DEFAULT)); String error = getString(cms, field.getSubValue(N_ERROR)); String niceName = getString(cms, field.getSubValue(N_DISPLAY_NAME)); String description = getString(cms, field.getSubValue(N_DESCRIPTION)); String preferFolder = getString(cms, field.getSubValue(N_PREFER_FOLDER)); String disabledStr = getString(cms, field.getSubValue(N_DISABLED)); boolean disabled = ((disabledStr != null) && Boolean.parseBoolean(disabledStr)); String orderStr = getString(cms, field.getSubValue(N_ORDER)); int order = I_CmsConfigurationObject.DEFAULT_ORDER; try { order = Integer.parseInt(orderStr); } catch (NumberFormatException e) { // noop } Visibility visibility; String visibilityStr = getString(cms, field.getSubValue(N_VISIBILITY)); try { // to stay compatible with former visibility option values if ("both".equals(visibilityStr)) { visibilityStr = Visibility.elementAndParentIndividual.name(); } else if ("parent".equals(visibilityStr)) { visibilityStr = Visibility.parentShared.name(); } visibility = Visibility.valueOf(visibilityStr); } catch (Exception e) { visibility = null; } CmsXmlContentProperty prop = new CmsXmlContentProperty( name, "string", visibility, widget, widgetConfig, ruleRegex, ruleType, default1, niceName, description, error, preferFolder).withIncludeName(includeName); // since these are real properties, using type vfslist makes no sense, so we always use the "string" type CmsPropertyConfig propConfig = new CmsPropertyConfig(prop, disabled, order); return propConfig; }
java
public static CmsPropertyConfig parseProperty(CmsObject cms, I_CmsXmlContentLocation field) { String name = getString(cms, field.getSubValue(N_PROPERTY_NAME)); String includeName = getString(cms, field.getSubValue(N_INCLUDE_NAME)); String widget = getString(cms, field.getSubValue(N_WIDGET)); String widgetConfig = getString(cms, field.getSubValue(N_WIDGET_CONFIG)); String ruleRegex = getString(cms, field.getSubValue(N_RULE_REGEX)); String ruleType = getString(cms, field.getSubValue(N_RULE_TYPE)); String default1 = getString(cms, field.getSubValue(N_DEFAULT)); String error = getString(cms, field.getSubValue(N_ERROR)); String niceName = getString(cms, field.getSubValue(N_DISPLAY_NAME)); String description = getString(cms, field.getSubValue(N_DESCRIPTION)); String preferFolder = getString(cms, field.getSubValue(N_PREFER_FOLDER)); String disabledStr = getString(cms, field.getSubValue(N_DISABLED)); boolean disabled = ((disabledStr != null) && Boolean.parseBoolean(disabledStr)); String orderStr = getString(cms, field.getSubValue(N_ORDER)); int order = I_CmsConfigurationObject.DEFAULT_ORDER; try { order = Integer.parseInt(orderStr); } catch (NumberFormatException e) { // noop } Visibility visibility; String visibilityStr = getString(cms, field.getSubValue(N_VISIBILITY)); try { // to stay compatible with former visibility option values if ("both".equals(visibilityStr)) { visibilityStr = Visibility.elementAndParentIndividual.name(); } else if ("parent".equals(visibilityStr)) { visibilityStr = Visibility.parentShared.name(); } visibility = Visibility.valueOf(visibilityStr); } catch (Exception e) { visibility = null; } CmsXmlContentProperty prop = new CmsXmlContentProperty( name, "string", visibility, widget, widgetConfig, ruleRegex, ruleType, default1, niceName, description, error, preferFolder).withIncludeName(includeName); // since these are real properties, using type vfslist makes no sense, so we always use the "string" type CmsPropertyConfig propConfig = new CmsPropertyConfig(prop, disabled, order); return propConfig; }
[ "public", "static", "CmsPropertyConfig", "parseProperty", "(", "CmsObject", "cms", ",", "I_CmsXmlContentLocation", "field", ")", "{", "String", "name", "=", "getString", "(", "cms", ",", "field", ".", "getSubValue", "(", "N_PROPERTY_NAME", ")", ")", ";", "String...
Helper method to parse a property.<p> @param cms the CMS context to use @param field the location of the parent value @return the parsed property configuration
[ "Helper", "method", "to", "parse", "a", "property", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsConfigurationReader.java#L297-L353
truward/metrics4j
metrics4j-json-log/src/main/java/com/truward/metrics/json/internal/appender/RollingJacksonMapAppender.java
RollingJacksonMapAppender.rollLog
private void rollLog() { final File file = currentFile; if (file == null) { throw new IllegalStateException("currentFile is null"); // shouldn't happen } final OutputStream stream = currentStream; if (stream == null) { throw new IllegalStateException("currentStream is null"); // shouldn't happen } // reset class members this.currentFile = null; this.currentStream = null; // compress file, if needed if (compressor == null) { return; // compression is not needed } // start new compression thread final Thread compressingThread = new Thread(new Runnable() { @Override public void run() { log.trace("Closing output stream of target file={}", file); // close old stream try { stream.close(); } catch (IOException e) { log.error("Unable to properly close output stream", e); } // compress file contents compressFileContents(compressor, file); // mark current thread as null currentCompressingThread = null; } }); compressingThread.run(); currentCompressingThread = compressingThread; }
java
private void rollLog() { final File file = currentFile; if (file == null) { throw new IllegalStateException("currentFile is null"); // shouldn't happen } final OutputStream stream = currentStream; if (stream == null) { throw new IllegalStateException("currentStream is null"); // shouldn't happen } // reset class members this.currentFile = null; this.currentStream = null; // compress file, if needed if (compressor == null) { return; // compression is not needed } // start new compression thread final Thread compressingThread = new Thread(new Runnable() { @Override public void run() { log.trace("Closing output stream of target file={}", file); // close old stream try { stream.close(); } catch (IOException e) { log.error("Unable to properly close output stream", e); } // compress file contents compressFileContents(compressor, file); // mark current thread as null currentCompressingThread = null; } }); compressingThread.run(); currentCompressingThread = compressingThread; }
[ "private", "void", "rollLog", "(", ")", "{", "final", "File", "file", "=", "currentFile", ";", "if", "(", "file", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"currentFile is null\"", ")", ";", "// shouldn't happen", "}", "final", ...
Writes older log into the file and updates current output stream
[ "Writes", "older", "log", "into", "the", "file", "and", "updates", "current", "output", "stream" ]
train
https://github.com/truward/metrics4j/blob/6e81c00ce24e008c029cce875d44f667e2bc978c/metrics4j-json-log/src/main/java/com/truward/metrics/json/internal/appender/RollingJacksonMapAppender.java#L142-L184
jbossws/jbossws-common
src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
ConfigHelper.setupConfigHandlers
@SuppressWarnings("rawtypes") public void setupConfigHandlers(Binding binding, CommonConfig config) { if (config != null) { //start with the use handlers only to remove the previously set configuration List<Handler> userHandlers = getNonConfigHandlers(binding.getHandlerChain()); List<Handler> handlers = convertToHandlers(config.getPreHandlerChains(), binding.getBindingID(), true); //PRE handlers.addAll(userHandlers); //ENDPOINT handlers.addAll(convertToHandlers(config.getPostHandlerChains(), binding.getBindingID(), false)); //POST binding.setHandlerChain(handlers); } }
java
@SuppressWarnings("rawtypes") public void setupConfigHandlers(Binding binding, CommonConfig config) { if (config != null) { //start with the use handlers only to remove the previously set configuration List<Handler> userHandlers = getNonConfigHandlers(binding.getHandlerChain()); List<Handler> handlers = convertToHandlers(config.getPreHandlerChains(), binding.getBindingID(), true); //PRE handlers.addAll(userHandlers); //ENDPOINT handlers.addAll(convertToHandlers(config.getPostHandlerChains(), binding.getBindingID(), false)); //POST binding.setHandlerChain(handlers); } }
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "void", "setupConfigHandlers", "(", "Binding", "binding", ",", "CommonConfig", "config", ")", "{", "if", "(", "config", "!=", "null", ")", "{", "//start with the use handlers only to remove the previously set ...
Setups a given Binding instance using a specified CommonConfig @param binding the Binding instance to setup @param config the CommonConfig with the input configuration
[ "Setups", "a", "given", "Binding", "instance", "using", "a", "specified", "CommonConfig" ]
train
https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java#L176-L187
apache/groovy
src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java
ClassNodeUtils.samePackageName
public static boolean samePackageName(ClassNode first, ClassNode second) { return Objects.equals(first.getPackageName(), second.getPackageName()); }
java
public static boolean samePackageName(ClassNode first, ClassNode second) { return Objects.equals(first.getPackageName(), second.getPackageName()); }
[ "public", "static", "boolean", "samePackageName", "(", "ClassNode", "first", ",", "ClassNode", "second", ")", "{", "return", "Objects", ".", "equals", "(", "first", ".", "getPackageName", "(", ")", ",", "second", ".", "getPackageName", "(", ")", ")", ";", ...
Determine if the given ClassNode values have the same package name. @param first a ClassNode @param second a ClassNode @return true if both given nodes have the same package name @throws NullPointerException if either of the given nodes are null
[ "Determine", "if", "the", "given", "ClassNode", "values", "have", "the", "same", "package", "name", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java#L385-L387
headius/invokebinder
src/main/java/com/headius/invokebinder/SmartBinder.java
SmartBinder.invokeVirtualQuiet
public SmartHandle invokeVirtualQuiet(Lookup lookup, String name) { return new SmartHandle(start, binder.invokeVirtualQuiet(lookup, name)); }
java
public SmartHandle invokeVirtualQuiet(Lookup lookup, String name) { return new SmartHandle(start, binder.invokeVirtualQuiet(lookup, name)); }
[ "public", "SmartHandle", "invokeVirtualQuiet", "(", "Lookup", "lookup", ",", "String", "name", ")", "{", "return", "new", "SmartHandle", "(", "start", ",", "binder", ".", "invokeVirtualQuiet", "(", "lookup", ",", "name", ")", ")", ";", "}" ]
Terminate this binder by looking up the named virtual method on the first argument's type. Perform the actual method lookup using the given Lookup object. If the lookup fails, a RuntimeException will be raised, containing the actual reason. This method is for convenience in (for example) field declarations, where checked exceptions noise up code that can't recover anyway. Use this in situations where you would not expect your library to be usable if the target method can't be acquired. @param lookup the Lookup to use for handle lookups @param name the name of the target virtual method @return a SmartHandle with this binder's starting signature, bound to the target method
[ "Terminate", "this", "binder", "by", "looking", "up", "the", "named", "virtual", "method", "on", "the", "first", "argument", "s", "type", ".", "Perform", "the", "actual", "method", "lookup", "using", "the", "given", "Lookup", "object", ".", "If", "the", "l...
train
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L1001-L1003
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java
RouteFiltersInner.createOrUpdate
public RouteFilterInner createOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); }
java
public RouteFilterInner createOrUpdate(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).toBlocking().last().body(); }
[ "public", "RouteFilterInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "routeFilterName", ",", "RouteFilterInner", "routeFilterParameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "routeFilterName"...
Creates or updates a route filter in a specified resource group. @param resourceGroupName The name of the resource group. @param routeFilterName The name of the route filter. @param routeFilterParameters Parameters supplied to the create or update route filter operation. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the RouteFilterInner object if successful.
[ "Creates", "or", "updates", "a", "route", "filter", "in", "a", "specified", "resource", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java#L443-L445
jbundle/jbundle
base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/BaseHttpTask.java
BaseHttpTask.getRealPath
public String getRealPath(HttpServletRequest request, String path) { if (m_servlet != null) return m_servlet.getRealPath(request, path); return path; }
java
public String getRealPath(HttpServletRequest request, String path) { if (m_servlet != null) return m_servlet.getRealPath(request, path); return path; }
[ "public", "String", "getRealPath", "(", "HttpServletRequest", "request", ",", "String", "path", ")", "{", "if", "(", "m_servlet", "!=", "null", ")", "return", "m_servlet", ".", "getRealPath", "(", "request", ",", "path", ")", ";", "return", "path", ";", "}...
Get the physical path for this internet path. @param request The request
[ "Get", "the", "physical", "path", "for", "this", "internet", "path", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/BaseHttpTask.java#L901-L906
UrielCh/ovh-java-sdk
ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java
ApiOvhIpLoadbalancing.serviceName_udp_frontend_POST
public OvhFrontendUdp serviceName_udp_frontend_POST(String serviceName, String[] dedicatedIpfo, Long defaultFarmId, Boolean disabled, String displayName, String port, String zone) throws IOException { String qPath = "/ipLoadbalancing/{serviceName}/udp/frontend"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "dedicatedIpfo", dedicatedIpfo); addBody(o, "defaultFarmId", defaultFarmId); addBody(o, "disabled", disabled); addBody(o, "displayName", displayName); addBody(o, "port", port); addBody(o, "zone", zone); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhFrontendUdp.class); }
java
public OvhFrontendUdp serviceName_udp_frontend_POST(String serviceName, String[] dedicatedIpfo, Long defaultFarmId, Boolean disabled, String displayName, String port, String zone) throws IOException { String qPath = "/ipLoadbalancing/{serviceName}/udp/frontend"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "dedicatedIpfo", dedicatedIpfo); addBody(o, "defaultFarmId", defaultFarmId); addBody(o, "disabled", disabled); addBody(o, "displayName", displayName); addBody(o, "port", port); addBody(o, "zone", zone); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhFrontendUdp.class); }
[ "public", "OvhFrontendUdp", "serviceName_udp_frontend_POST", "(", "String", "serviceName", ",", "String", "[", "]", "dedicatedIpfo", ",", "Long", "defaultFarmId", ",", "Boolean", "disabled", ",", "String", "displayName", ",", "String", "port", ",", "String", "zone",...
Add a new UDP frontend on your IP Load Balancing REST: POST /ipLoadbalancing/{serviceName}/udp/frontend @param zone [required] Zone of your frontend. Use "all" for all owned zone. @param dedicatedIpfo [required] Only attach frontend on these ip. No restriction if null @param disabled [required] Disable your frontend. Default: 'false' @param displayName [required] Human readable name for your frontend, this field is for you @param defaultFarmId [required] Default UDP Farm of your frontend @param port [required] Port(s) attached to your frontend. Supports single port (numerical value), range (2 dash-delimited increasing ports) and comma-separated list of 'single port' and/or 'range'. Each port must be in the [1;49151] range. @param serviceName [required] The internal name of your IP load balancing API beta
[ "Add", "a", "new", "UDP", "frontend", "on", "your", "IP", "Load", "Balancing" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L829-L841
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java
RobustLoaderWriterResilienceStrategy.removeFailure
@Override public boolean removeFailure(K key, V value, StoreAccessException e) { try { V loadedValue; try { loadedValue = loaderWriter.load(key); } catch (Exception e1) { throw ExceptionFactory.newCacheLoadingException(e1, e); } if (loadedValue == null) { return false; } if (!loadedValue.equals(value)) { return false; } try { loaderWriter.delete(key); } catch (Exception e1) { throw ExceptionFactory.newCacheWritingException(e1, e); } return true; } finally { cleanup(key, e); } }
java
@Override public boolean removeFailure(K key, V value, StoreAccessException e) { try { V loadedValue; try { loadedValue = loaderWriter.load(key); } catch (Exception e1) { throw ExceptionFactory.newCacheLoadingException(e1, e); } if (loadedValue == null) { return false; } if (!loadedValue.equals(value)) { return false; } try { loaderWriter.delete(key); } catch (Exception e1) { throw ExceptionFactory.newCacheWritingException(e1, e); } return true; } finally { cleanup(key, e); } }
[ "@", "Override", "public", "boolean", "removeFailure", "(", "K", "key", ",", "V", "value", ",", "StoreAccessException", "e", ")", "{", "try", "{", "V", "loadedValue", ";", "try", "{", "loadedValue", "=", "loaderWriter", ".", "load", "(", "key", ")", ";",...
Delete the key from the loader-writer if it is found with a matching value. Note that the load and write pair is not atomic. This atomicity, if needed, should be handled by the something else. @param key the key being removed @param value the value being removed @param e the triggered failure @return if the value was removed
[ "Delete", "the", "key", "from", "the", "loader", "-", "writer", "if", "it", "is", "found", "with", "a", "matching", "value", ".", "Note", "that", "the", "load", "and", "write", "pair", "is", "not", "atomic", ".", "This", "atomicity", "if", "needed", "s...
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L165-L192
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.checkSystemLocks
protected void checkSystemLocks(CmsDbContext dbc, CmsResource resource) throws CmsException { if (m_lockManager.hasSystemLocks(dbc, resource)) { throw new CmsLockException( Messages.get().container( Messages.ERR_RESOURCE_SYSTEM_LOCKED_1, dbc.removeSiteRoot(resource.getRootPath()))); } }
java
protected void checkSystemLocks(CmsDbContext dbc, CmsResource resource) throws CmsException { if (m_lockManager.hasSystemLocks(dbc, resource)) { throw new CmsLockException( Messages.get().container( Messages.ERR_RESOURCE_SYSTEM_LOCKED_1, dbc.removeSiteRoot(resource.getRootPath()))); } }
[ "protected", "void", "checkSystemLocks", "(", "CmsDbContext", "dbc", ",", "CmsResource", "resource", ")", "throws", "CmsException", "{", "if", "(", "m_lockManager", ".", "hasSystemLocks", "(", "dbc", ",", "resource", ")", ")", "{", "throw", "new", "CmsLockExcept...
Checks if the given resource contains a resource that has a system lock.<p> @param dbc the current database context @param resource the resource to check @throws CmsException in case there is a system lock contained in the given resource
[ "Checks", "if", "the", "given", "resource", "contains", "a", "resource", "that", "has", "a", "system", "lock", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L7123-L7131
geomajas/geomajas-project-hammer-gwt
hammer-gwt/src/main/java/org/geomajas/hammergwt/client/HammerGwt.java
HammerGwt.off
public static void off(HammerTime hammerTime, EventType eventType, NativeHammmerHandler callback) { off(hammerTime, callback, eventType.getText()); }
java
public static void off(HammerTime hammerTime, EventType eventType, NativeHammmerHandler callback) { off(hammerTime, callback, eventType.getText()); }
[ "public", "static", "void", "off", "(", "HammerTime", "hammerTime", ",", "EventType", "eventType", ",", "NativeHammmerHandler", "callback", ")", "{", "off", "(", "hammerTime", ",", "callback", ",", "eventType", ".", "getText", "(", ")", ")", ";", "}" ]
Unregister hammer event. @param hammerTime {@link HammerTime} hammer gwt instance. @param eventType {@link org.geomajas.hammergwt.client.event.EventType} @param callback {@link org.geomajas.hammergwt.client.handler.NativeHammmerHandler} of the event that needs to be unregistered.
[ "Unregister", "hammer", "event", "." ]
train
https://github.com/geomajas/geomajas-project-hammer-gwt/blob/bc764171bed55e5a9eced72f0078ec22b8105b62/hammer-gwt/src/main/java/org/geomajas/hammergwt/client/HammerGwt.java#L58-L60
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.mapToLong
public static <T, E extends Exception> LongList mapToLong(final T[] a, final int fromIndex, final int toIndex, final Try.ToLongFunction<? super T, E> func) throws E { checkFromToIndex(fromIndex, toIndex, len(a)); N.checkArgNotNull(func); if (N.isNullOrEmpty(a)) { return new LongList(); } final LongList result = new LongList(toIndex - fromIndex); for (int i = fromIndex; i < toIndex; i++) { result.add(func.applyAsLong(a[i])); } return result; }
java
public static <T, E extends Exception> LongList mapToLong(final T[] a, final int fromIndex, final int toIndex, final Try.ToLongFunction<? super T, E> func) throws E { checkFromToIndex(fromIndex, toIndex, len(a)); N.checkArgNotNull(func); if (N.isNullOrEmpty(a)) { return new LongList(); } final LongList result = new LongList(toIndex - fromIndex); for (int i = fromIndex; i < toIndex; i++) { result.add(func.applyAsLong(a[i])); } return result; }
[ "public", "static", "<", "T", ",", "E", "extends", "Exception", ">", "LongList", "mapToLong", "(", "final", "T", "[", "]", "a", ",", "final", "int", "fromIndex", ",", "final", "int", "toIndex", ",", "final", "Try", ".", "ToLongFunction", "<", "?", "sup...
Mostly it's designed for one-step operation to complete the operation in one step. <code>java.util.stream.Stream</code> is preferred for multiple phases operation. @param a @param fromIndex @param toIndex @param func @return
[ "Mostly", "it", "s", "designed", "for", "one", "-", "step", "operation", "to", "complete", "the", "operation", "in", "one", "step", ".", "<code", ">", "java", ".", "util", ".", "stream", ".", "Stream<", "/", "code", ">", "is", "preferred", "for", "mult...
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L14977-L14993
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/builder/ResourceUtils.java
ResourceUtils.mapResource
private static void mapResource(WorkItem resource, Map<IProject, List<WorkItem>> projectsMap, boolean checkJavaProject) { IProject project = resource.getProject(); if (checkJavaProject && !ProjectUtilities.isJavaProject(project)) { // non java projects: can happen only for changesets return; } List<WorkItem> resources = projectsMap.get(project); if (resources == null) { resources = new ArrayList<>(); projectsMap.put(project, resources); } // do not need to check for duplicates, cause user cannot select // the same element twice if (!containsParents(resources, resource)) { resources.add(resource); } }
java
private static void mapResource(WorkItem resource, Map<IProject, List<WorkItem>> projectsMap, boolean checkJavaProject) { IProject project = resource.getProject(); if (checkJavaProject && !ProjectUtilities.isJavaProject(project)) { // non java projects: can happen only for changesets return; } List<WorkItem> resources = projectsMap.get(project); if (resources == null) { resources = new ArrayList<>(); projectsMap.put(project, resources); } // do not need to check for duplicates, cause user cannot select // the same element twice if (!containsParents(resources, resource)) { resources.add(resource); } }
[ "private", "static", "void", "mapResource", "(", "WorkItem", "resource", ",", "Map", "<", "IProject", ",", "List", "<", "WorkItem", ">", ">", "projectsMap", ",", "boolean", "checkJavaProject", ")", "{", "IProject", "project", "=", "resource", ".", "getProject"...
Maps the resource into its project @param resource @param projectsMap
[ "Maps", "the", "resource", "into", "its", "project" ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/ResourceUtils.java#L257-L274
rundeck/rundeck
rundeck-storage/rundeck-storage-data/src/main/java/org/rundeck/storage/data/DataUtil.java
DataUtil.lazyStream
public static HasInputStream lazyStream(final InputStream data) { return new HasInputStream() { @Override public InputStream getInputStream() throws IOException { return data; } @Override public long writeContent(OutputStream outputStream) throws IOException { return copyStream(data, outputStream); } }; }
java
public static HasInputStream lazyStream(final InputStream data) { return new HasInputStream() { @Override public InputStream getInputStream() throws IOException { return data; } @Override public long writeContent(OutputStream outputStream) throws IOException { return copyStream(data, outputStream); } }; }
[ "public", "static", "HasInputStream", "lazyStream", "(", "final", "InputStream", "data", ")", "{", "return", "new", "HasInputStream", "(", ")", "{", "@", "Override", "public", "InputStream", "getInputStream", "(", ")", "throws", "IOException", "{", "return", "da...
Lazy mechanism for stream loading @param data file @return lazy stream
[ "Lazy", "mechanism", "for", "stream", "loading" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeck-storage/rundeck-storage-data/src/main/java/org/rundeck/storage/data/DataUtil.java#L113-L125
voldemort/voldemort
src/java/voldemort/tools/admin/AdminToolUtils.java
AdminToolUtils.assertServerInNormalState
public static void assertServerInNormalState(AdminClient adminClient, Integer nodeId) { assertServerInNormalState(adminClient, Lists.newArrayList(new Integer[]{nodeId})); }
java
public static void assertServerInNormalState(AdminClient adminClient, Integer nodeId) { assertServerInNormalState(adminClient, Lists.newArrayList(new Integer[]{nodeId})); }
[ "public", "static", "void", "assertServerInNormalState", "(", "AdminClient", "adminClient", ",", "Integer", "nodeId", ")", "{", "assertServerInNormalState", "(", "adminClient", ",", "Lists", ".", "newArrayList", "(", "new", "Integer", "[", "]", "{", "nodeId", "}",...
Utility function that checks the execution state of the server by checking the state of {@link VoldemortState} <br> This function checks if a node is in normal state ( {@link VoldemortState#NORMAL_SERVER}). @param adminClient An instance of AdminClient points to given cluster @param nodeId Node id to be checked @throws VoldemortException if any node is not in normal state
[ "Utility", "function", "that", "checks", "the", "execution", "state", "of", "the", "server", "by", "checking", "the", "state", "of", "{", "@link", "VoldemortState", "}", "<br", ">" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminToolUtils.java#L354-L356
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java
RotationAxisAligner.calcPrincipalRotationVector
private void calcPrincipalRotationVector() { Rotation rotation = rotationGroup.getRotation(0); // the rotation around the principal axis is the first rotation AxisAngle4d axisAngle = rotation.getAxisAngle(); principalRotationVector = new Vector3d(axisAngle.x, axisAngle.y, axisAngle.z); }
java
private void calcPrincipalRotationVector() { Rotation rotation = rotationGroup.getRotation(0); // the rotation around the principal axis is the first rotation AxisAngle4d axisAngle = rotation.getAxisAngle(); principalRotationVector = new Vector3d(axisAngle.x, axisAngle.y, axisAngle.z); }
[ "private", "void", "calcPrincipalRotationVector", "(", ")", "{", "Rotation", "rotation", "=", "rotationGroup", ".", "getRotation", "(", "0", ")", ";", "// the rotation around the principal axis is the first rotation", "AxisAngle4d", "axisAngle", "=", "rotation", ".", "get...
Returns a vector along the principal rotation axis for the alignment of structures along the z-axis @return principal rotation vector
[ "Returns", "a", "vector", "along", "the", "principal", "rotation", "axis", "for", "the", "alignment", "of", "structures", "along", "the", "z", "-", "axis" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/RotationAxisAligner.java#L661-L665
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java
Crypto.getPublicKeyFromString
public PublicKey getPublicKeyFromString(String key) throws MangooEncryptionException { Objects.requireNonNull(key, Required.KEY.toString()); try { return KeyFactory.getInstance(ALGORITHM).generatePublic(new X509EncodedKeySpec(decodeBase64(key))); } catch (InvalidKeySpecException | NoSuchAlgorithmException e) { throw new MangooEncryptionException("Failed to get pulbic key from string", e); } }
java
public PublicKey getPublicKeyFromString(String key) throws MangooEncryptionException { Objects.requireNonNull(key, Required.KEY.toString()); try { return KeyFactory.getInstance(ALGORITHM).generatePublic(new X509EncodedKeySpec(decodeBase64(key))); } catch (InvalidKeySpecException | NoSuchAlgorithmException e) { throw new MangooEncryptionException("Failed to get pulbic key from string", e); } }
[ "public", "PublicKey", "getPublicKeyFromString", "(", "String", "key", ")", "throws", "MangooEncryptionException", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "try", "{", "return", "KeyFa...
Generates Public Key from Base64 encoded string @param key Base64 encoded string which represents the key @return The PublicKey @throws MangooEncryptionException if getting public key from string fails
[ "Generates", "Public", "Key", "from", "Base64", "encoded", "string" ]
train
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L311-L319
hector-client/hector
object-mapper/src/main/java/me/prettyprint/hom/EntityManagerImpl.java
EntityManagerImpl.find
@Override public <T> T find(Class<T> clazz, Object id) { if (null == clazz) { throw new IllegalArgumentException("clazz cannot be null"); } if (null == id) { throw new IllegalArgumentException("id cannot be null"); } CFMappingDef<T> cfMapDef = cacheMgr.getCfMapDef(clazz, false); if (null == cfMapDef) { throw new HectorObjectMapperException("No class annotated with @" + Entity.class.getSimpleName() + " for type, " + clazz.getName()); } return objMapper.getObject(keyspace, cfMapDef.getEffectiveColFamName(), id); }
java
@Override public <T> T find(Class<T> clazz, Object id) { if (null == clazz) { throw new IllegalArgumentException("clazz cannot be null"); } if (null == id) { throw new IllegalArgumentException("id cannot be null"); } CFMappingDef<T> cfMapDef = cacheMgr.getCfMapDef(clazz, false); if (null == cfMapDef) { throw new HectorObjectMapperException("No class annotated with @" + Entity.class.getSimpleName() + " for type, " + clazz.getName()); } return objMapper.getObject(keyspace, cfMapDef.getEffectiveColFamName(), id); }
[ "@", "Override", "public", "<", "T", ">", "T", "find", "(", "Class", "<", "T", ">", "clazz", ",", "Object", "id", ")", "{", "if", "(", "null", "==", "clazz", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"clazz cannot be null\"", ")", ";...
Load an entity instance. If the ID does not map to a persisted entity, then null is returned. @param <T> The type of entity to load for compile time type checking @param clazz The type of entity to load for runtime instance creation @param id ID of the instance to load @return instance of Entity or null if can't be found
[ "Load", "an", "entity", "instance", ".", "If", "the", "ID", "does", "not", "map", "to", "a", "persisted", "entity", "then", "null", "is", "returned", "." ]
train
https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/object-mapper/src/main/java/me/prettyprint/hom/EntityManagerImpl.java#L147-L163
amaembo/streamex
src/main/java/one/util/streamex/LongStreamEx.java
LongStreamEx.of
public static LongStreamEx of(LongStream stream) { return stream instanceof LongStreamEx ? (LongStreamEx) stream : new LongStreamEx(stream, StreamContext.of(stream)); }
java
public static LongStreamEx of(LongStream stream) { return stream instanceof LongStreamEx ? (LongStreamEx) stream : new LongStreamEx(stream, StreamContext.of(stream)); }
[ "public", "static", "LongStreamEx", "of", "(", "LongStream", "stream", ")", "{", "return", "stream", "instanceof", "LongStreamEx", "?", "(", "LongStreamEx", ")", "stream", ":", "new", "LongStreamEx", "(", "stream", ",", "StreamContext", ".", "of", "(", "stream...
Returns a {@code LongStreamEx} object which wraps given {@link LongStream}. <p> The supplied stream must not be consumed or closed when this method is called. No operation must be performed on the supplied stream after it's wrapped. @param stream original stream @return the wrapped stream @since 0.0.8
[ "Returns", "a", "{", "@code", "LongStreamEx", "}", "object", "which", "wraps", "given", "{", "@link", "LongStream", "}", "." ]
train
https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/LongStreamEx.java#L1637-L1640
Netflix/karyon
karyon2-governator/src/main/java/netflix/karyon/Karyon.java
Karyon.forWebSocketServer
public static KaryonServer forWebSocketServer(RxServer<? extends WebSocketFrame, ? extends WebSocketFrame> server, BootstrapModule... bootstrapModules) { return new RxNettyServerBackedServer(server, bootstrapModules); }
java
public static KaryonServer forWebSocketServer(RxServer<? extends WebSocketFrame, ? extends WebSocketFrame> server, BootstrapModule... bootstrapModules) { return new RxNettyServerBackedServer(server, bootstrapModules); }
[ "public", "static", "KaryonServer", "forWebSocketServer", "(", "RxServer", "<", "?", "extends", "WebSocketFrame", ",", "?", "extends", "WebSocketFrame", ">", "server", ",", "BootstrapModule", "...", "bootstrapModules", ")", "{", "return", "new", "RxNettyServerBackedSe...
Creates a new {@link KaryonServer} which combines lifecycle of the passed WebSockets {@link RxServer} with it's own lifecycle. @param server WebSocket server @param bootstrapModules Additional bootstrapModules if any. @return {@link KaryonServer} which is to be used to start the created server.
[ "Creates", "a", "new", "{", "@link", "KaryonServer", "}", "which", "combines", "lifecycle", "of", "the", "passed", "WebSockets", "{", "@link", "RxServer", "}", "with", "it", "s", "own", "lifecycle", "." ]
train
https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-governator/src/main/java/netflix/karyon/Karyon.java#L217-L220
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java
JSONConverter.writeCreateMBean
public void writeCreateMBean(OutputStream out, CreateMBean value) throws IOException { writeStartObject(out); writeStringField(out, OM_CLASSNAME, value.className); writeObjectNameField(out, OM_OBJECTNAME, value.objectName); writeObjectNameField(out, OM_LOADERNAME, value.loaderName); writePOJOArrayField(out, OM_PARAMS, value.params); writeStringArrayField(out, OM_SIGNATURE, value.signature); writeBooleanField(out, OM_USELOADER, value.useLoader); writeBooleanField(out, OM_USESIGNATURE, value.useSignature); writeEndObject(out); }
java
public void writeCreateMBean(OutputStream out, CreateMBean value) throws IOException { writeStartObject(out); writeStringField(out, OM_CLASSNAME, value.className); writeObjectNameField(out, OM_OBJECTNAME, value.objectName); writeObjectNameField(out, OM_LOADERNAME, value.loaderName); writePOJOArrayField(out, OM_PARAMS, value.params); writeStringArrayField(out, OM_SIGNATURE, value.signature); writeBooleanField(out, OM_USELOADER, value.useLoader); writeBooleanField(out, OM_USESIGNATURE, value.useSignature); writeEndObject(out); }
[ "public", "void", "writeCreateMBean", "(", "OutputStream", "out", ",", "CreateMBean", "value", ")", "throws", "IOException", "{", "writeStartObject", "(", "out", ")", ";", "writeStringField", "(", "out", ",", "OM_CLASSNAME", ",", "value", ".", "className", ")", ...
Encode a CreateMBean instance as JSON: { "className" : String, "objectName" : ObjectName, "loaderName" : ObjectName, "params" : [ POJO* ], "signature" : [ String* ], "useLoader" : Boolean, "useSignatue" : Boolean } @param out The stream to write JSON to @param value The CreateMBean instance to encode. Can't be null. @throws IOException If an I/O error occurs @see #readCreateMBean(InputStream)
[ "Encode", "a", "CreateMBean", "instance", "as", "JSON", ":", "{", "className", ":", "String", "objectName", ":", "ObjectName", "loaderName", ":", "ObjectName", "params", ":", "[", "POJO", "*", "]", "signature", ":", "[", "String", "*", "]", "useLoader", ":...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1143-L1153
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java
DiagnosticsInner.listSiteDiagnosticCategoriesWithServiceResponseAsync
public Observable<ServiceResponse<Page<DiagnosticCategoryInner>>> listSiteDiagnosticCategoriesWithServiceResponseAsync(final String resourceGroupName, final String siteName) { return listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName) .concatMap(new Func1<ServiceResponse<Page<DiagnosticCategoryInner>>, Observable<ServiceResponse<Page<DiagnosticCategoryInner>>>>() { @Override public Observable<ServiceResponse<Page<DiagnosticCategoryInner>>> call(ServiceResponse<Page<DiagnosticCategoryInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listSiteDiagnosticCategoriesNextWithServiceResponseAsync(nextPageLink)); } }); }
java
public Observable<ServiceResponse<Page<DiagnosticCategoryInner>>> listSiteDiagnosticCategoriesWithServiceResponseAsync(final String resourceGroupName, final String siteName) { return listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName) .concatMap(new Func1<ServiceResponse<Page<DiagnosticCategoryInner>>, Observable<ServiceResponse<Page<DiagnosticCategoryInner>>>>() { @Override public Observable<ServiceResponse<Page<DiagnosticCategoryInner>>> call(ServiceResponse<Page<DiagnosticCategoryInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listSiteDiagnosticCategoriesNextWithServiceResponseAsync(nextPageLink)); } }); }
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "DiagnosticCategoryInner", ">", ">", ">", "listSiteDiagnosticCategoriesWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "siteName", ")", "{", "return", "list...
Get Diagnostics Categories. Get Diagnostics Categories. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;DiagnosticCategoryInner&gt; object
[ "Get", "Diagnostics", "Categories", ".", "Get", "Diagnostics", "Categories", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L231-L243
haraldk/TwelveMonkeys
imageio/imageio-jpeg/src/main/java/com/twelvemonkeys/imageio/plugins/jpeg/JPEGLosslessDecoderWrapper.java
JPEGLosslessDecoderWrapper.to24Bit3ComponentRGB
private BufferedImage to24Bit3ComponentRGB(int[][] decoded, int width, int height) { BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); byte[] imageBuffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData(); for (int i = 0; i < imageBuffer.length / 3; i++) { // Convert to RGB (BGR) imageBuffer[i * 3 + 2] = (byte) decoded[0][i]; imageBuffer[i * 3 + 1] = (byte) decoded[1][i]; imageBuffer[i * 3] = (byte) decoded[2][i]; } return image; }
java
private BufferedImage to24Bit3ComponentRGB(int[][] decoded, int width, int height) { BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); byte[] imageBuffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData(); for (int i = 0; i < imageBuffer.length / 3; i++) { // Convert to RGB (BGR) imageBuffer[i * 3 + 2] = (byte) decoded[0][i]; imageBuffer[i * 3 + 1] = (byte) decoded[1][i]; imageBuffer[i * 3] = (byte) decoded[2][i]; } return image; }
[ "private", "BufferedImage", "to24Bit3ComponentRGB", "(", "int", "[", "]", "[", "]", "decoded", ",", "int", "width", ",", "int", "height", ")", "{", "BufferedImage", "image", "=", "new", "BufferedImage", "(", "width", ",", "height", ",", "BufferedImage", ".",...
Converts the decoded buffer into a BufferedImage. precision: 8 bit, componentCount = 3 @param decoded data buffer @param width of the image @param height of the image @return a BufferedImage.TYPE_3BYTE_RGB
[ "Converts", "the", "decoded", "buffer", "into", "a", "BufferedImage", ".", "precision", ":", "8", "bit", "componentCount", "=", "3" ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-jpeg/src/main/java/com/twelvemonkeys/imageio/plugins/jpeg/JPEGLosslessDecoderWrapper.java#L180-L192
google/closure-compiler
src/com/google/javascript/rhino/jstype/UnionType.java
UnionType.anyMatch
private static boolean anyMatch(Predicate<JSType> predicate, ImmutableList<JSType> universe) { for (int i = 0; i < universe.size(); i++) { if (predicate.test(universe.get(i))) { return true; } } return false; }
java
private static boolean anyMatch(Predicate<JSType> predicate, ImmutableList<JSType> universe) { for (int i = 0; i < universe.size(); i++) { if (predicate.test(universe.get(i))) { return true; } } return false; }
[ "private", "static", "boolean", "anyMatch", "(", "Predicate", "<", "JSType", ">", "predicate", ",", "ImmutableList", "<", "JSType", ">", "universe", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "universe", ".", "size", "(", ")", ";", "i...
Returns whether anything in {@code universe} matches {@code predicate}. <p>This method is designed to minimize allocations since it is expected to be called <em>very</em> often. That's why is doesn't: <ul> <li>instantiate {@link Iterator}s <li>instantiate {@link Stream}s <li>(un)box primitives <li>expect closure generating lambdas </ul>
[ "Returns", "whether", "anything", "in", "{", "@code", "universe", "}", "matches", "{", "@code", "predicate", "}", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/UnionType.java#L675-L682
Waikato/jclasslocator
src/main/java/nz/ac/waikato/cms/locator/ClassLister.java
ClassLister.updateClasses
protected void updateClasses(HashMap<String,HashSet<Class>> cache, String superclass, HashSet<Class> names) { if (!cache.containsKey(superclass)) cache.put(superclass, names); else cache.get(superclass).addAll(names); }
java
protected void updateClasses(HashMap<String,HashSet<Class>> cache, String superclass, HashSet<Class> names) { if (!cache.containsKey(superclass)) cache.put(superclass, names); else cache.get(superclass).addAll(names); }
[ "protected", "void", "updateClasses", "(", "HashMap", "<", "String", ",", "HashSet", "<", "Class", ">", ">", "cache", ",", "String", "superclass", ",", "HashSet", "<", "Class", ">", "names", ")", "{", "if", "(", "!", "cache", ".", "containsKey", "(", "...
Updates cache for the superclass. @param cache the cache to update @param superclass the superclass @param names the names to add
[ "Updates", "cache", "for", "the", "superclass", "." ]
train
https://github.com/Waikato/jclasslocator/blob/c899072fff607a56ee7f8c2d01fbeb15157ad144/src/main/java/nz/ac/waikato/cms/locator/ClassLister.java#L252-L257
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.bucketSort
public static <T extends Comparable<T>> void bucketSort(final List<T> c, final int fromIndex, final int toIndex) { Array.bucketSort(c, fromIndex, toIndex); }
java
public static <T extends Comparable<T>> void bucketSort(final List<T> c, final int fromIndex, final int toIndex) { Array.bucketSort(c, fromIndex, toIndex); }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "T", ">", ">", "void", "bucketSort", "(", "final", "List", "<", "T", ">", "c", ",", "final", "int", "fromIndex", ",", "final", "int", "toIndex", ")", "{", "Array", ".", "bucketSort", "(", "c...
Note: All the objects with same value will be replaced with first element with the same value. @param c @param fromIndex @param toIndex
[ "Note", ":", "All", "the", "objects", "with", "same", "value", "will", "be", "replaced", "with", "first", "element", "with", "the", "same", "value", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L12044-L12046
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/thread/RemoteRecordOwner.java
RemoteRecordOwner.handleRemoteCommand
public Object handleRemoteCommand(String strCommand, Map<String,Object> properties, Object sourceSession) throws RemoteException, DBException { if (m_sessionObjectParent != null) if (m_sessionObjectParent != sourceSession) return ((RemoteRecordOwner)m_sessionObjectParent).handleRemoteCommand(strCommand, properties, this); return Boolean.FALSE; }
java
public Object handleRemoteCommand(String strCommand, Map<String,Object> properties, Object sourceSession) throws RemoteException, DBException { if (m_sessionObjectParent != null) if (m_sessionObjectParent != sourceSession) return ((RemoteRecordOwner)m_sessionObjectParent).handleRemoteCommand(strCommand, properties, this); return Boolean.FALSE; }
[ "public", "Object", "handleRemoteCommand", "(", "String", "strCommand", ",", "Map", "<", "String", ",", "Object", ">", "properties", ",", "Object", "sourceSession", ")", "throws", "RemoteException", ",", "DBException", "{", "if", "(", "m_sessionObjectParent", "!="...
Process the command. Step 1 - Process the command if possible and return true if processed. Step 2 - If I can't process, pass to all children (with me as the source). Step 3 - If children didn't process, pass to parent (with me as the source). Note: Never pass to a parent or child that matches the source (to avoid an endless loop). @param strCommand The command to process. @param sourceSField The source screen field (to avoid echos). @param bUseSameWindow If this command creates a new screen, create in a new window? @return true if success.
[ "Process", "the", "command", ".", "Step", "1", "-", "Process", "the", "command", "if", "possible", "and", "return", "true", "if", "processed", ".", "Step", "2", "-", "If", "I", "can", "t", "process", "pass", "to", "all", "children", "(", "with", "me", ...
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/thread/RemoteRecordOwner.java#L473-L479
Azure/azure-sdk-for-java
edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java
DevicesInner.getByResourceGroupAsync
public Observable<DataBoxEdgeDeviceInner> getByResourceGroupAsync(String deviceName, String resourceGroupName) { return getByResourceGroupWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1<ServiceResponse<DataBoxEdgeDeviceInner>, DataBoxEdgeDeviceInner>() { @Override public DataBoxEdgeDeviceInner call(ServiceResponse<DataBoxEdgeDeviceInner> response) { return response.body(); } }); }
java
public Observable<DataBoxEdgeDeviceInner> getByResourceGroupAsync(String deviceName, String resourceGroupName) { return getByResourceGroupWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1<ServiceResponse<DataBoxEdgeDeviceInner>, DataBoxEdgeDeviceInner>() { @Override public DataBoxEdgeDeviceInner call(ServiceResponse<DataBoxEdgeDeviceInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "DataBoxEdgeDeviceInner", ">", "getByResourceGroupAsync", "(", "String", "deviceName", ",", "String", "resourceGroupName", ")", "{", "return", "getByResourceGroupWithServiceResponseAsync", "(", "deviceName", ",", "resourceGroupName", ")", ".", ...
Gets the properties of the data box edge/gateway device. @param deviceName The device name. @param resourceGroupName The resource group name. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the DataBoxEdgeDeviceInner object
[ "Gets", "the", "properties", "of", "the", "data", "box", "edge", "/", "gateway", "device", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L641-L648
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.getMultiReadResultEntry
private CompletableReadResultEntry getMultiReadResultEntry(long resultStartOffset, int maxLength) { int readLength = 0; CompletableReadResultEntry nextEntry = getSingleReadResultEntry(resultStartOffset, maxLength); if (nextEntry == null || !(nextEntry instanceof CacheReadResultEntry)) { // We can only coalesce CacheReadResultEntries. return nextEntry; } // Collect the contents of congruent Index Entries into a list, as long as we still encounter data in the cache. ArrayList<InputStream> contents = new ArrayList<>(); do { assert Futures.isSuccessful(nextEntry.getContent()) : "Found CacheReadResultEntry that is not completed yet: " + nextEntry; val entryContents = nextEntry.getContent().join(); contents.add(entryContents.getData()); readLength += entryContents.getLength(); if (readLength >= this.config.getMemoryReadMinLength() || readLength >= maxLength) { break; } nextEntry = getSingleMemoryReadResultEntry(resultStartOffset + readLength, maxLength - readLength); } while (nextEntry != null); // Coalesce the results into a single InputStream and return the result. return new CacheReadResultEntry(resultStartOffset, new SequenceInputStream(Iterators.asEnumeration(contents.iterator())), readLength); }
java
private CompletableReadResultEntry getMultiReadResultEntry(long resultStartOffset, int maxLength) { int readLength = 0; CompletableReadResultEntry nextEntry = getSingleReadResultEntry(resultStartOffset, maxLength); if (nextEntry == null || !(nextEntry instanceof CacheReadResultEntry)) { // We can only coalesce CacheReadResultEntries. return nextEntry; } // Collect the contents of congruent Index Entries into a list, as long as we still encounter data in the cache. ArrayList<InputStream> contents = new ArrayList<>(); do { assert Futures.isSuccessful(nextEntry.getContent()) : "Found CacheReadResultEntry that is not completed yet: " + nextEntry; val entryContents = nextEntry.getContent().join(); contents.add(entryContents.getData()); readLength += entryContents.getLength(); if (readLength >= this.config.getMemoryReadMinLength() || readLength >= maxLength) { break; } nextEntry = getSingleMemoryReadResultEntry(resultStartOffset + readLength, maxLength - readLength); } while (nextEntry != null); // Coalesce the results into a single InputStream and return the result. return new CacheReadResultEntry(resultStartOffset, new SequenceInputStream(Iterators.asEnumeration(contents.iterator())), readLength); }
[ "private", "CompletableReadResultEntry", "getMultiReadResultEntry", "(", "long", "resultStartOffset", ",", "int", "maxLength", ")", "{", "int", "readLength", "=", "0", ";", "CompletableReadResultEntry", "nextEntry", "=", "getSingleReadResultEntry", "(", "resultStartOffset",...
Returns a ReadResultEntry that matches the specified search parameters. <p> Compared to getSingleMemoryReadResultEntry(), this method may return a direct entry or a collection of entries. If the first entry to be returned would constitute a cache hit, then this method will attempt to return data from subsequent (congruent) entries, as long as they are cache hits. If at any time a cache miss occurs, the data collected so far is returned as a single entry, excluding the cache miss entry (exception if the first entry is a miss, then that entry is returned). @param resultStartOffset The Offset within the StreamSegment where to start returning data from. @param maxLength The maximum number of bytes to return. @return A ReadResultEntry representing the data to return.
[ "Returns", "a", "ReadResultEntry", "that", "matches", "the", "specified", "search", "parameters", ".", "<p", ">", "Compared", "to", "getSingleMemoryReadResultEntry", "()", "this", "method", "may", "return", "a", "direct", "entry", "or", "a", "collection", "of", ...
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L799-L824
b3log/latke
latke-core/src/main/java/org/b3log/latke/servlet/renderer/AbstractFreeMarkerRenderer.java
AbstractFreeMarkerRenderer.genHTML
protected String genHTML(final HttpServletRequest request, final Map<String, Object> dataModel, final Template template) throws Exception { final StringWriter stringWriter = new StringWriter(); template.setOutputEncoding("UTF-8"); template.process(dataModel, stringWriter); final StringBuilder pageContentBuilder = new StringBuilder(stringWriter.toString()); final long endimeMillis = System.currentTimeMillis(); final String dateString = DateFormatUtils.format(endimeMillis, "yyyy/MM/dd HH:mm:ss"); final long startTimeMillis = (Long) request.getAttribute(Keys.HttpRequest.START_TIME_MILLIS); final String msg = String.format("\n<!-- Generated by Latke (https://github.com/b3log/latke) in %1$dms, %2$s -->", endimeMillis - startTimeMillis, dateString); pageContentBuilder.append(msg); return pageContentBuilder.toString(); }
java
protected String genHTML(final HttpServletRequest request, final Map<String, Object> dataModel, final Template template) throws Exception { final StringWriter stringWriter = new StringWriter(); template.setOutputEncoding("UTF-8"); template.process(dataModel, stringWriter); final StringBuilder pageContentBuilder = new StringBuilder(stringWriter.toString()); final long endimeMillis = System.currentTimeMillis(); final String dateString = DateFormatUtils.format(endimeMillis, "yyyy/MM/dd HH:mm:ss"); final long startTimeMillis = (Long) request.getAttribute(Keys.HttpRequest.START_TIME_MILLIS); final String msg = String.format("\n<!-- Generated by Latke (https://github.com/b3log/latke) in %1$dms, %2$s -->", endimeMillis - startTimeMillis, dateString); pageContentBuilder.append(msg); return pageContentBuilder.toString(); }
[ "protected", "String", "genHTML", "(", "final", "HttpServletRequest", "request", ",", "final", "Map", "<", "String", ",", "Object", ">", "dataModel", ",", "final", "Template", "template", ")", "throws", "Exception", "{", "final", "StringWriter", "stringWriter", ...
Processes the specified FreeMarker template with the specified request, data model. @param request the specified request @param dataModel the specified data model @param template the specified FreeMarker template @return generated HTML @throws Exception exception
[ "Processes", "the", "specified", "FreeMarker", "template", "with", "the", "specified", "request", "data", "model", "." ]
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/servlet/renderer/AbstractFreeMarkerRenderer.java#L150-L165
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/FileLister.java
FileLister.getListFilesToProcess
public static FileStatus[] getListFilesToProcess(long maxFileSize, boolean recurse, FileSystem hdfs, Path inputPath, JobFileModifiedRangePathFilter pathFilter) throws IOException { LOG.info(" in getListFilesToProcess maxFileSize=" + maxFileSize + " inputPath= " + inputPath.toUri()); FileStatus[] origList = listFiles(recurse, hdfs, inputPath, pathFilter); if (origList == null) { LOG.info(" No files found, orig list returning 0"); return new FileStatus[0]; } return pruneFileListBySize(maxFileSize, origList, hdfs, inputPath); }
java
public static FileStatus[] getListFilesToProcess(long maxFileSize, boolean recurse, FileSystem hdfs, Path inputPath, JobFileModifiedRangePathFilter pathFilter) throws IOException { LOG.info(" in getListFilesToProcess maxFileSize=" + maxFileSize + " inputPath= " + inputPath.toUri()); FileStatus[] origList = listFiles(recurse, hdfs, inputPath, pathFilter); if (origList == null) { LOG.info(" No files found, orig list returning 0"); return new FileStatus[0]; } return pruneFileListBySize(maxFileSize, origList, hdfs, inputPath); }
[ "public", "static", "FileStatus", "[", "]", "getListFilesToProcess", "(", "long", "maxFileSize", ",", "boolean", "recurse", ",", "FileSystem", "hdfs", ",", "Path", "inputPath", ",", "JobFileModifiedRangePathFilter", "pathFilter", ")", "throws", "IOException", "{", "...
looks at the src path and fetches the list of files to process confirms that the size of files is less than the maxFileSize hbase cell can't store files bigger than maxFileSize, hence no need to consider them for rawloading Reference: {@link https://github.com/twitter/hraven/issues/59} @param maxFileSize - max #bytes to be stored in an hbase cell @param recurse - whether to recurse or not @param hdfs - filesystem to be looked at @param inputPath - root dir of the path containing history files @param jobFileModifiedRangePathFilter - to filter out files @return - array of FileStatus of files to be processed @throws IOException
[ "looks", "at", "the", "src", "path", "and", "fetches", "the", "list", "of", "files", "to", "process", "confirms", "that", "the", "size", "of", "files", "is", "less", "than", "the", "maxFileSize", "hbase", "cell", "can", "t", "store", "files", "bigger", "...
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/FileLister.java#L115-L127
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/cr/crvserver_binding.java
crvserver_binding.get
public static crvserver_binding get(nitro_service service, String name) throws Exception{ crvserver_binding obj = new crvserver_binding(); obj.set_name(name); crvserver_binding response = (crvserver_binding) obj.get_resource(service); return response; }
java
public static crvserver_binding get(nitro_service service, String name) throws Exception{ crvserver_binding obj = new crvserver_binding(); obj.set_name(name); crvserver_binding response = (crvserver_binding) obj.get_resource(service); return response; }
[ "public", "static", "crvserver_binding", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "crvserver_binding", "obj", "=", "new", "crvserver_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", ...
Use this API to fetch crvserver_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "crvserver_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cr/crvserver_binding.java#L158-L163
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_line_serviceName_lastRegistrations_GET
public ArrayList<OvhRegistrationInformations> billingAccount_line_serviceName_lastRegistrations_GET(String billingAccount, String serviceName) throws IOException { String qPath = "/telephony/{billingAccount}/line/{serviceName}/lastRegistrations"; StringBuilder sb = path(qPath, billingAccount, serviceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t11); }
java
public ArrayList<OvhRegistrationInformations> billingAccount_line_serviceName_lastRegistrations_GET(String billingAccount, String serviceName) throws IOException { String qPath = "/telephony/{billingAccount}/line/{serviceName}/lastRegistrations"; StringBuilder sb = path(qPath, billingAccount, serviceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t11); }
[ "public", "ArrayList", "<", "OvhRegistrationInformations", ">", "billingAccount_line_serviceName_lastRegistrations_GET", "(", "String", "billingAccount", ",", "String", "serviceName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/line...
List the informations about the last registrations (i.e. IP, port, User-Agent...) REST: GET /telephony/{billingAccount}/line/{serviceName}/lastRegistrations @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "List", "the", "informations", "about", "the", "last", "registrations", "(", "i", ".", "e", ".", "IP", "port", "User", "-", "Agent", "...", ")" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L2145-L2150
datoin/http-requests
src/main/java/org/datoin/net/http/Request.java
Request.setHeader
public Request setHeader(String name, String value) { this.headers.put(name, value); return this; }
java
public Request setHeader(String name, String value) { this.headers.put(name, value); return this; }
[ "public", "Request", "setHeader", "(", "String", "name", ",", "String", "value", ")", "{", "this", ".", "headers", ".", "put", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
seat a header and return modified request @param name : header name @param value : header value @return : Request Object with header value set
[ "seat", "a", "header", "and", "return", "modified", "request" ]
train
https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L183-L186
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.setFrustumLH
public Matrix4f setFrustumLH(float left, float right, float bottom, float top, float zNear, float zFar, boolean zZeroToOne) { if ((properties & PROPERTY_IDENTITY) == 0) MemUtil.INSTANCE.identity(this); this._m00((zNear + zNear) / (right - left)); this._m11((zNear + zNear) / (top - bottom)); this._m20((right + left) / (right - left)); this._m21((top + bottom) / (top - bottom)); boolean farInf = zFar > 0 && Float.isInfinite(zFar); boolean nearInf = zNear > 0 && Float.isInfinite(zNear); if (farInf) { // See: "Infinite Projection Matrix" (http://www.terathon.com/gdc07_lengyel.pdf) float e = 1E-6f; this._m22(1.0f - e); this._m32((e - (zZeroToOne ? 1.0f : 2.0f)) * zNear); } else if (nearInf) { float e = 1E-6f; this._m22((zZeroToOne ? 0.0f : 1.0f) - e); this._m32(((zZeroToOne ? 1.0f : 2.0f) - e) * zFar); } else { this._m22((zZeroToOne ? zFar : zFar + zNear) / (zFar - zNear)); this._m32((zZeroToOne ? zFar : zFar + zFar) * zNear / (zNear - zFar)); } this._m23(1.0f); this._m33(0.0f); _properties(0); return this; }
java
public Matrix4f setFrustumLH(float left, float right, float bottom, float top, float zNear, float zFar, boolean zZeroToOne) { if ((properties & PROPERTY_IDENTITY) == 0) MemUtil.INSTANCE.identity(this); this._m00((zNear + zNear) / (right - left)); this._m11((zNear + zNear) / (top - bottom)); this._m20((right + left) / (right - left)); this._m21((top + bottom) / (top - bottom)); boolean farInf = zFar > 0 && Float.isInfinite(zFar); boolean nearInf = zNear > 0 && Float.isInfinite(zNear); if (farInf) { // See: "Infinite Projection Matrix" (http://www.terathon.com/gdc07_lengyel.pdf) float e = 1E-6f; this._m22(1.0f - e); this._m32((e - (zZeroToOne ? 1.0f : 2.0f)) * zNear); } else if (nearInf) { float e = 1E-6f; this._m22((zZeroToOne ? 0.0f : 1.0f) - e); this._m32(((zZeroToOne ? 1.0f : 2.0f) - e) * zFar); } else { this._m22((zZeroToOne ? zFar : zFar + zNear) / (zFar - zNear)); this._m32((zZeroToOne ? zFar : zFar + zFar) * zNear / (zNear - zFar)); } this._m23(1.0f); this._m33(0.0f); _properties(0); return this; }
[ "public", "Matrix4f", "setFrustumLH", "(", "float", "left", ",", "float", "right", ",", "float", "bottom", ",", "float", "top", ",", "float", "zNear", ",", "float", "zFar", ",", "boolean", "zZeroToOne", ")", "{", "if", "(", "(", "properties", "&", "PROPE...
Set this matrix to be an arbitrary perspective projection frustum transformation for a left-handed coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code>. <p> In order to apply the perspective frustum transformation to an existing transformation, use {@link #frustumLH(float, float, float, float, float, float, boolean) frustumLH()}. <p> Reference: <a href="http://www.songho.ca/opengl/gl_projectionmatrix.html#perspective">http://www.songho.ca</a> @see #frustumLH(float, float, float, float, float, float, boolean) @param left the distance along the x-axis to the left frustum edge @param right the distance along the x-axis to the right frustum edge @param bottom the distance along the y-axis to the bottom frustum edge @param top the distance along the y-axis to the top frustum edge @param zNear near clipping plane distance. If the special value {@link Float#POSITIVE_INFINITY} is used, the near clipping plane will be at positive infinity. In that case, <code>zFar</code> may not also be {@link Float#POSITIVE_INFINITY}. @param zFar far clipping plane distance. If the special value {@link Float#POSITIVE_INFINITY} is used, the far clipping plane will be at positive infinity. In that case, <code>zNear</code> may not also be {@link Float#POSITIVE_INFINITY}. @param zZeroToOne whether to use Vulkan's and Direct3D's NDC z range of <code>[0..+1]</code> when <code>true</code> or whether to use OpenGL's NDC z range of <code>[-1..+1]</code> when <code>false</code> @return this
[ "Set", "this", "matrix", "to", "be", "an", "arbitrary", "perspective", "projection", "frustum", "transformation", "for", "a", "left", "-", "handed", "coordinate", "system", "using", "OpenGL", "s", "NDC", "z", "range", "of", "<code", ">", "[", "-", "1", ".....
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L10818-L10844
neoremind/fluent-validator
fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/util/ReflectionUtil.java
ReflectionUtil.getMethod
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { if (clazz == null || methodName == null || methodName.length() == 0) { return null; } for (Class<?> itr = clazz; hasSuperClass(itr); ) { Method[] methods = itr.getDeclaredMethods(); for (Method method : methods) { if (method.getName().equals(methodName) && Arrays.equals(method.getParameterTypes(), parameterTypes)) { return method; } } itr = itr.getSuperclass(); } return null; }
java
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { if (clazz == null || methodName == null || methodName.length() == 0) { return null; } for (Class<?> itr = clazz; hasSuperClass(itr); ) { Method[] methods = itr.getDeclaredMethods(); for (Method method : methods) { if (method.getName().equals(methodName) && Arrays.equals(method.getParameterTypes(), parameterTypes)) { return method; } } itr = itr.getSuperclass(); } return null; }
[ "public", "static", "Method", "getMethod", "(", "Class", "<", "?", ">", "clazz", ",", "String", "methodName", ",", "Class", "<", "?", ">", "...", "parameterTypes", ")", "{", "if", "(", "clazz", "==", "null", "||", "methodName", "==", "null", "||", "met...
获取方法 @param clazz 类 @param methodName 方法名 @param parameterTypes 方法参数 @return 方法
[ "获取方法" ]
train
https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/util/ReflectionUtil.java#L142-L159
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java
NumberUtil.appendRange
public static Collection<Integer> appendRange(int start, int stop, Collection<Integer> values) { return appendRange(start, stop, 1, values); }
java
public static Collection<Integer> appendRange(int start, int stop, Collection<Integer> values) { return appendRange(start, stop, 1, values); }
[ "public", "static", "Collection", "<", "Integer", ">", "appendRange", "(", "int", "start", ",", "int", "stop", ",", "Collection", "<", "Integer", ">", "values", ")", "{", "return", "appendRange", "(", "start", ",", "stop", ",", "1", ",", "values", ")", ...
将给定范围内的整数添加到已有集合中,步进为1 @param start 开始(包含) @param stop 结束(包含) @param values 集合 @return 集合
[ "将给定范围内的整数添加到已有集合中,步进为1" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1343-L1345
btrplace/scheduler
json/src/main/java/org/btrplace/json/JSONs.java
JSONs.requiredBoolean
public static boolean requiredBoolean(JSONObject o, String id) throws JSONConverterException { checkKeys(o, id); Object x = o.get(id); if (!(x instanceof Boolean)) { throw new JSONConverterException("Boolean expected at key '" + id + "' but was '" + x.getClass() + "'."); } return (Boolean) x; }
java
public static boolean requiredBoolean(JSONObject o, String id) throws JSONConverterException { checkKeys(o, id); Object x = o.get(id); if (!(x instanceof Boolean)) { throw new JSONConverterException("Boolean expected at key '" + id + "' but was '" + x.getClass() + "'."); } return (Boolean) x; }
[ "public", "static", "boolean", "requiredBoolean", "(", "JSONObject", "o", ",", "String", "id", ")", "throws", "JSONConverterException", "{", "checkKeys", "(", "o", ",", "id", ")", ";", "Object", "x", "=", "o", ".", "get", "(", "id", ")", ";", "if", "("...
Read an expected boolean. @param o the object to parse @param id the id in the map that should point to the boolean @return the boolean @throws org.btrplace.json.JSONConverterException if the key does not point to a boolean
[ "Read", "an", "expected", "boolean", "." ]
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/JSONs.java#L175-L182
b3log/latke
latke-core/src/main/java/org/b3log/latke/servlet/RequestContext.java
RequestContext.renderJSONValue
public RequestContext renderJSONValue(final String name, final Object obj) { if (renderer instanceof JsonRenderer) { final JsonRenderer r = (JsonRenderer) renderer; final JSONObject ret = r.getJSONObject(); ret.put(name, obj); } return this; }
java
public RequestContext renderJSONValue(final String name, final Object obj) { if (renderer instanceof JsonRenderer) { final JsonRenderer r = (JsonRenderer) renderer; final JSONObject ret = r.getJSONObject(); ret.put(name, obj); } return this; }
[ "public", "RequestContext", "renderJSONValue", "(", "final", "String", "name", ",", "final", "Object", "obj", ")", "{", "if", "(", "renderer", "instanceof", "JsonRenderer", ")", "{", "final", "JsonRenderer", "r", "=", "(", "JsonRenderer", ")", "renderer", ";",...
Renders with {"name", obj}. @param name the specified name @param obj the specified object @return this context
[ "Renders", "with", "{", "name", "obj", "}", "." ]
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/servlet/RequestContext.java#L528-L537
awltech/org.parallelj
parallelj-launching-parent/parallelj-launching-api/src/main/java/org/parallelj/launching/Launcher.java
Launcher.newLaunch
public <T> Launch<T> newLaunch(Class<? extends T> programClass) throws LaunchException { return newLaunch(programClass, null); }
java
public <T> Launch<T> newLaunch(Class<? extends T> programClass) throws LaunchException { return newLaunch(programClass, null); }
[ "public", "<", "T", ">", "Launch", "<", "T", ">", "newLaunch", "(", "Class", "<", "?", "extends", "T", ">", "programClass", ")", "throws", "LaunchException", "{", "return", "newLaunch", "(", "programClass", ",", "null", ")", ";", "}" ]
Create a new instance of {@link Launch} for a {@link org.parallelj.Program Program} execution. @param programClass The class of the {@link org.parallelj.Program Program}. @return a {@link Launch} instance. @throws LaunchException
[ "Create", "a", "new", "instance", "of", "{", "@link", "Launch", "}", "for", "a", "{", "@link", "org", ".", "parallelj", ".", "Program", "Program", "}", "execution", "." ]
train
https://github.com/awltech/org.parallelj/blob/2a2498cc4ac6227df6f45d295ec568cad3cffbc4/parallelj-launching-parent/parallelj-launching-api/src/main/java/org/parallelj/launching/Launcher.java#L69-L72
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/property/PropertyAccessorHelper.java
PropertyAccessorHelper.getString
public static String getString(Object from, Field field) { PropertyAccessor<?> accessor = PropertyAccessorFactory.getPropertyAccessor(field); Object object = getObject(from, field); return object != null ? accessor.toString(object) : null; }
java
public static String getString(Object from, Field field) { PropertyAccessor<?> accessor = PropertyAccessorFactory.getPropertyAccessor(field); Object object = getObject(from, field); return object != null ? accessor.toString(object) : null; }
[ "public", "static", "String", "getString", "(", "Object", "from", ",", "Field", "field", ")", "{", "PropertyAccessor", "<", "?", ">", "accessor", "=", "PropertyAccessorFactory", ".", "getPropertyAccessor", "(", "field", ")", ";", "Object", "object", "=", "getO...
Gets the string. @param from the from @param field the field @return the string @throws PropertyAccessException the property access exception
[ "Gets", "the", "string", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/property/PropertyAccessorHelper.java#L193-L198
geomajas/geomajas-project-server
plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java
PdfContext.drawImage
public void drawImage(Image img, Rectangle rect, Rectangle clipRect) { drawImage(img, rect, clipRect, 1); }
java
public void drawImage(Image img, Rectangle rect, Rectangle clipRect) { drawImage(img, rect, clipRect, 1); }
[ "public", "void", "drawImage", "(", "Image", "img", ",", "Rectangle", "rect", ",", "Rectangle", "clipRect", ")", "{", "drawImage", "(", "img", ",", "rect", ",", "clipRect", ",", "1", ")", ";", "}" ]
Draws the specified image with the first rectangle's bounds, clipping with the second one and adding transparency. @param img image @param rect rectangle @param clipRect clipping bounds
[ "Draws", "the", "specified", "image", "with", "the", "first", "rectangle", "s", "bounds", "clipping", "with", "the", "second", "one", "and", "adding", "transparency", "." ]
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java#L389-L391
kite-sdk/kite
kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/HBaseUtils.java
HBaseUtils.mergePutActions
public static PutAction mergePutActions(byte[] keyBytes, List<PutAction> putActionList) { VersionCheckAction checkAction = null; List<Put> putsToMerge = new ArrayList<Put>(); for (PutAction putActionToMerge : putActionList) { putsToMerge.add(putActionToMerge.getPut()); VersionCheckAction checkActionToMerge = putActionToMerge.getVersionCheckAction(); if (checkActionToMerge != null) { checkAction = checkActionToMerge; } } Put put = mergePuts(keyBytes, putsToMerge); return new PutAction(put, checkAction); }
java
public static PutAction mergePutActions(byte[] keyBytes, List<PutAction> putActionList) { VersionCheckAction checkAction = null; List<Put> putsToMerge = new ArrayList<Put>(); for (PutAction putActionToMerge : putActionList) { putsToMerge.add(putActionToMerge.getPut()); VersionCheckAction checkActionToMerge = putActionToMerge.getVersionCheckAction(); if (checkActionToMerge != null) { checkAction = checkActionToMerge; } } Put put = mergePuts(keyBytes, putsToMerge); return new PutAction(put, checkAction); }
[ "public", "static", "PutAction", "mergePutActions", "(", "byte", "[", "]", "keyBytes", ",", "List", "<", "PutAction", ">", "putActionList", ")", "{", "VersionCheckAction", "checkAction", "=", "null", ";", "List", "<", "Put", ">", "putsToMerge", "=", "new", "...
Given a list of PutActions, create a new PutAction with the values in each put merged together. It is expected that no puts have a value for the same fully qualified column. Return the new PutAction. @param key The key of the new put. @param putActionList The list of PutActions to merge @return the new PutAction instance
[ "Given", "a", "list", "of", "PutActions", "create", "a", "new", "PutAction", "with", "the", "values", "in", "each", "put", "merged", "together", ".", "It", "is", "expected", "that", "no", "puts", "have", "a", "value", "for", "the", "same", "fully", "qual...
train
https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/HBaseUtils.java#L93-L106
Azure/azure-sdk-for-java
compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionsInner.java
VirtualMachineExtensionsInner.createOrUpdateAsync
public Observable<VirtualMachineExtensionInner> createOrUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).map(new Func1<ServiceResponse<VirtualMachineExtensionInner>, VirtualMachineExtensionInner>() { @Override public VirtualMachineExtensionInner call(ServiceResponse<VirtualMachineExtensionInner> response) { return response.body(); } }); }
java
public Observable<VirtualMachineExtensionInner> createOrUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).map(new Func1<ServiceResponse<VirtualMachineExtensionInner>, VirtualMachineExtensionInner>() { @Override public VirtualMachineExtensionInner call(ServiceResponse<VirtualMachineExtensionInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "VirtualMachineExtensionInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "vmName", ",", "String", "vmExtensionName", ",", "VirtualMachineExtensionInner", "extensionParameters", ")", "{", "return", "createOrU...
The operation to create or update the extension. @param resourceGroupName The name of the resource group. @param vmName The name of the virtual machine where the extension should be created or updated. @param vmExtensionName The name of the virtual machine extension. @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable for the request
[ "The", "operation", "to", "create", "or", "update", "the", "extension", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionsInner.java#L131-L138
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java
GraphUtils.swapVertices
public static <V> void swapVertices(DirectedGraph<V, DefaultEdge> graph, Map<V, Set<V>> alternates) { Objects.requireNonNull(graph,"graph"); Objects.requireNonNull(alternates, "alternates"); // add all of the new vertices to prep for linking addAllVertices(graph, alternates.keySet()); for (Entry<V, Set<V>> entry : alternates.entrySet()) { V alternateVertex = entry.getKey(); Set<V> dependencies = entry.getValue(); // make sure we can satisfy all dependencies before continuing // TODO: this should probably done outside so it can be handled better. if (!graph.vertexSet().containsAll(dependencies)) { continue; } // figure out which vertices depend on the incumbent vertex Set<V> dependents = Collections.emptySet(); if (graph.containsVertex(alternateVertex)) { dependents = getIncomingVertices(graph, alternateVertex); graph.removeVertex(alternateVertex); } // (re)insert the vertex and re-link the dependents graph.addVertex(alternateVertex); addIncomingEdges(graph, alternateVertex, dependents); // create the dependencies addOutgoingEdges(graph, alternateVertex, dependencies); } }
java
public static <V> void swapVertices(DirectedGraph<V, DefaultEdge> graph, Map<V, Set<V>> alternates) { Objects.requireNonNull(graph,"graph"); Objects.requireNonNull(alternates, "alternates"); // add all of the new vertices to prep for linking addAllVertices(graph, alternates.keySet()); for (Entry<V, Set<V>> entry : alternates.entrySet()) { V alternateVertex = entry.getKey(); Set<V> dependencies = entry.getValue(); // make sure we can satisfy all dependencies before continuing // TODO: this should probably done outside so it can be handled better. if (!graph.vertexSet().containsAll(dependencies)) { continue; } // figure out which vertices depend on the incumbent vertex Set<V> dependents = Collections.emptySet(); if (graph.containsVertex(alternateVertex)) { dependents = getIncomingVertices(graph, alternateVertex); graph.removeVertex(alternateVertex); } // (re)insert the vertex and re-link the dependents graph.addVertex(alternateVertex); addIncomingEdges(graph, alternateVertex, dependents); // create the dependencies addOutgoingEdges(graph, alternateVertex, dependencies); } }
[ "public", "static", "<", "V", ">", "void", "swapVertices", "(", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "graph", ",", "Map", "<", "V", ",", "Set", "<", "V", ">", ">", "alternates", ")", "{", "Objects", ".", "requireNonNull", "(", "graph", ...
replace the vertices in the graph with an alternate set of vertices. @param graph graph to be mutated @param alternates alternate vertices to insert into the graph. map of vertices to their direct dependents.
[ "replace", "the", "vertices", "in", "the", "graph", "with", "an", "alternate", "set", "of", "vertices", "." ]
train
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L43-L71
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java
TableWorks.setColDefaultExpression
void setColDefaultExpression(int colIndex, Expression def) { if (def == null) { table.checkColumnInFKConstraint(colIndex, Constraint.SET_DEFAULT); } table.setDefaultExpression(colIndex, def); }
java
void setColDefaultExpression(int colIndex, Expression def) { if (def == null) { table.checkColumnInFKConstraint(colIndex, Constraint.SET_DEFAULT); } table.setDefaultExpression(colIndex, def); }
[ "void", "setColDefaultExpression", "(", "int", "colIndex", ",", "Expression", "def", ")", "{", "if", "(", "def", "==", "null", ")", "{", "table", ".", "checkColumnInFKConstraint", "(", "colIndex", ",", "Constraint", ".", "SET_DEFAULT", ")", ";", "}", "table"...
performs the work for changing the default value of a column @param colIndex int @param def Expression
[ "performs", "the", "work", "for", "changing", "the", "default", "value", "of", "a", "column" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L1066-L1073
tvesalainen/util
util/src/main/java/org/vesalainen/util/AbstractProvisioner.java
AbstractProvisioner.setValue
public void setValue(String name, Object value) { map.get(name).stream().forEach((im) -> { im.invoke(value); }
java
public void setValue(String name, Object value) { map.get(name).stream().forEach((im) -> { im.invoke(value); }
[ "public", "void", "setValue", "(", "String", "name", ",", "Object", "value", ")", "{", "map", ".", "get", "(", "name", ")", ".", "stream", "(", ")", ".", "forEach", "(", "(", "im", ")", "-", ">", "{", "im", ".", "invoke", "(", "value", ")", "",...
Provides value for attached method @param name From @Setting @param value
[ "Provides", "value", "for", "attached", "method" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/AbstractProvisioner.java#L153-L158
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java
Options.putShort
public Options putShort(String key, IModel<Short> value) { putOption(key, new ShortOption(value)); return this; }
java
public Options putShort(String key, IModel<Short> value) { putOption(key, new ShortOption(value)); return this; }
[ "public", "Options", "putShort", "(", "String", "key", ",", "IModel", "<", "Short", ">", "value", ")", "{", "putOption", "(", "key", ",", "new", "ShortOption", "(", "value", ")", ")", ";", "return", "this", ";", "}" ]
<p> Puts an short value for the given option name. </p> @param key the option name. @param value the short value.
[ "<p", ">", "Puts", "an", "short", "value", "for", "the", "given", "option", "name", ".", "<", "/", "p", ">" ]
train
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java#L532-L536
Impetus/Kundera
src/kundera-couchbase/src/main/java/com/impetus/client/couchbase/CouchbaseClient.java
CouchbaseClient.validateQueryResults
private void validateQueryResults(String query, N1qlQueryResult result) { LOGGER.debug("Query output status: " + result.finalSuccess()); if (!result.finalSuccess()) { StringBuilder errorBuilder = new StringBuilder(); for (JsonObject obj : result.errors()) { errorBuilder.append(obj.toString()); errorBuilder.append("\n"); } errorBuilder.deleteCharAt(errorBuilder.length() - 1); String errors = errorBuilder.toString(); LOGGER.error(errors); throw new KunderaException("Not able to execute query/statement:" + query + ". More details : " + errors); } }
java
private void validateQueryResults(String query, N1qlQueryResult result) { LOGGER.debug("Query output status: " + result.finalSuccess()); if (!result.finalSuccess()) { StringBuilder errorBuilder = new StringBuilder(); for (JsonObject obj : result.errors()) { errorBuilder.append(obj.toString()); errorBuilder.append("\n"); } errorBuilder.deleteCharAt(errorBuilder.length() - 1); String errors = errorBuilder.toString(); LOGGER.error(errors); throw new KunderaException("Not able to execute query/statement:" + query + ". More details : " + errors); } }
[ "private", "void", "validateQueryResults", "(", "String", "query", ",", "N1qlQueryResult", "result", ")", "{", "LOGGER", ".", "debug", "(", "\"Query output status: \"", "+", "result", ".", "finalSuccess", "(", ")", ")", ";", "if", "(", "!", "result", ".", "f...
Validate query results. @param query the query @param result the result
[ "Validate", "query", "results", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchbase/src/main/java/com/impetus/client/couchbase/CouchbaseClient.java#L376-L393
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/BoardsApi.java
BoardsApi.deleteBoardList
public void deleteBoardList(Object projectIdOrPath, Integer boardId, Integer listId) throws GitLabApiException { delete(Response.Status.NO_CONTENT, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards", boardId, "lists", listId); }
java
public void deleteBoardList(Object projectIdOrPath, Integer boardId, Integer listId) throws GitLabApiException { delete(Response.Status.NO_CONTENT, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards", boardId, "lists", listId); }
[ "public", "void", "deleteBoardList", "(", "Object", "projectIdOrPath", ",", "Integer", "boardId", ",", "Integer", "listId", ")", "throws", "GitLabApiException", "{", "delete", "(", "Response", ".", "Status", ".", "NO_CONTENT", ",", "null", ",", "\"projects\"", "...
Soft deletes an existing Issue Board list. Only for admins and project owners. <pre><code>GitLab Endpoint: DELETE /projects/:id/boards/:board_id/lists/:list_id</code></pre> @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param boardId the ID of the board @param listId the ID of the list @throws GitLabApiException if any exception occurs
[ "Soft", "deletes", "an", "existing", "Issue", "Board", "list", ".", "Only", "for", "admins", "and", "project", "owners", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/BoardsApi.java#L326-L328
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java
GJGeometryReader.parsePoint
private Point parsePoint(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates String coordinatesField = jp.getText(); if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) { jp.nextToken(); // START_ARRAY [ to parse the coordinate Point point = GF.createPoint(parseCoordinate(jp)); jp.nextToken(); return point; } else { throw new SQLException("Malformed GeoJSON file. Expected 'coordinates', found '" + coordinatesField + "'"); } }
java
private Point parsePoint(JsonParser jp) throws IOException, SQLException { jp.nextToken(); // FIELD_NAME coordinates String coordinatesField = jp.getText(); if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) { jp.nextToken(); // START_ARRAY [ to parse the coordinate Point point = GF.createPoint(parseCoordinate(jp)); jp.nextToken(); return point; } else { throw new SQLException("Malformed GeoJSON file. Expected 'coordinates', found '" + coordinatesField + "'"); } }
[ "private", "Point", "parsePoint", "(", "JsonParser", "jp", ")", "throws", "IOException", ",", "SQLException", "{", "jp", ".", "nextToken", "(", ")", ";", "// FIELD_NAME coordinates ", "String", "coordinatesField", "=", "jp", ".", "getText", "(", ")", ";",...
Parses one position Syntax: { "type": "Point", "coordinates": [100.0, 0.0] } @param jsParser @throws IOException @return Point
[ "Parses", "one", "position" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java#L91-L102
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java
EthereumUtil.calculateChainId
public static Long calculateChainId(EthereumTransaction eTrans) { Long result=null; long rawResult=EthereumUtil.convertVarNumberToLong(new RLPElement(new byte[0],eTrans.getSig_v())); if (!((rawResult == EthereumUtil.LOWER_REAL_V) || (rawResult== (LOWER_REAL_V+1)))) { result = (rawResult-EthereumUtil.CHAIN_ID_INC)/2; } return result; }
java
public static Long calculateChainId(EthereumTransaction eTrans) { Long result=null; long rawResult=EthereumUtil.convertVarNumberToLong(new RLPElement(new byte[0],eTrans.getSig_v())); if (!((rawResult == EthereumUtil.LOWER_REAL_V) || (rawResult== (LOWER_REAL_V+1)))) { result = (rawResult-EthereumUtil.CHAIN_ID_INC)/2; } return result; }
[ "public", "static", "Long", "calculateChainId", "(", "EthereumTransaction", "eTrans", ")", "{", "Long", "result", "=", "null", ";", "long", "rawResult", "=", "EthereumUtil", ".", "convertVarNumberToLong", "(", "new", "RLPElement", "(", "new", "byte", "[", "0", ...
Calculates the chain Id @param eTrans Ethereum Transaction of which the chain id should be calculated @return chainId: 0, Ethereum testnet (aka Olympic); 1: Ethereum mainet (aka Frontier, Homestead, Metropolis) - also Classic (from fork) -also Expanse (alternative Ethereum implementation), 2 Morden (Ethereum testnet, now Ethereum classic testnet), 3 Ropsten public cross-client Ethereum testnet, 4: Rinkeby Geth Ethereum testnet, 42 Kovan, public Parity Ethereum testnet, 7762959 Musicoin, music blockchain
[ "Calculates", "the", "chain", "Id" ]
train
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L364-L371
jbehave/jbehave-core
jbehave-guice/src/main/java/org/jbehave/core/configuration/guice/GuiceAnnotationBuilder.java
GuiceAnnotationBuilder.findBinding
private boolean findBinding(Injector injector, Class<?> type) { boolean found = false; for (Key<?> key : injector.getBindings().keySet()) { if (key.getTypeLiteral().getRawType().equals(type)) { found = true; break; } } if (!found && injector.getParent() != null) { return findBinding(injector.getParent(), type); } return found; }
java
private boolean findBinding(Injector injector, Class<?> type) { boolean found = false; for (Key<?> key : injector.getBindings().keySet()) { if (key.getTypeLiteral().getRawType().equals(type)) { found = true; break; } } if (!found && injector.getParent() != null) { return findBinding(injector.getParent(), type); } return found; }
[ "private", "boolean", "findBinding", "(", "Injector", "injector", ",", "Class", "<", "?", ">", "type", ")", "{", "boolean", "found", "=", "false", ";", "for", "(", "Key", "<", "?", ">", "key", ":", "injector", ".", "getBindings", "(", ")", ".", "keyS...
Finds binding for a type in the given injector and, if not found, recurses to its parent @param injector the current Injector @param type the Class representing the type @return A boolean flag, <code>true</code> if binding found
[ "Finds", "binding", "for", "a", "type", "in", "the", "given", "injector", "and", "if", "not", "found", "recurses", "to", "its", "parent" ]
train
https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-guice/src/main/java/org/jbehave/core/configuration/guice/GuiceAnnotationBuilder.java#L165-L178
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java
JDBCResultSet.updateTime
public void updateTime(int columnIndex, Time x) throws SQLException { startUpdate(columnIndex); preparedStatement.setParameter(columnIndex, x); }
java
public void updateTime(int columnIndex, Time x) throws SQLException { startUpdate(columnIndex); preparedStatement.setParameter(columnIndex, x); }
[ "public", "void", "updateTime", "(", "int", "columnIndex", ",", "Time", "x", ")", "throws", "SQLException", "{", "startUpdate", "(", "columnIndex", ")", ";", "preparedStatement", ".", "setParameter", "(", "columnIndex", ",", "x", ")", ";", "}" ]
<!-- start generic documentation --> Updates the designated column with a <code>java.sql.Time</code> value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code> methods are called to update the database. <!-- end generic documentation --> <!-- start release-specific documentation --> <div class="ReleaseSpecificDocumentation"> <h3>HSQLDB-Specific Information:</h3> <p> HSQLDB supports this feature. <p> </div> <!-- end release-specific documentation --> @param columnIndex the first column is 1, the second is 2, ... @param x the new column value @exception SQLException if a database access error occurs, the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set @exception SQLFeatureNotSupportedException if the JDBC driver does not support this method @since JDK 1.2 (JDK 1.1.x developers: read the overview for JDBCResultSet)
[ "<!", "--", "start", "generic", "documentation", "--", ">", "Updates", "the", "designated", "column", "with", "a", "<code", ">", "java", ".", "sql", ".", "Time<", "/", "code", ">", "value", ".", "The", "updater", "methods", "are", "used", "to", "update",...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L3013-L3016
xdcrafts/flower
flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ClassApi.java
ClassApi.classDistance
private static int classDistance(Class<?> from, Class<?> to, int current) { return to.isAssignableFrom(from) ? to.equals(from) ? current : classDistance(findAssignableAncestor(from, to), to, current + 1) : -1; }
java
private static int classDistance(Class<?> from, Class<?> to, int current) { return to.isAssignableFrom(from) ? to.equals(from) ? current : classDistance(findAssignableAncestor(from, to), to, current + 1) : -1; }
[ "private", "static", "int", "classDistance", "(", "Class", "<", "?", ">", "from", ",", "Class", "<", "?", ">", "to", ",", "int", "current", ")", "{", "return", "to", ".", "isAssignableFrom", "(", "from", ")", "?", "to", ".", "equals", "(", "from", ...
Calculates distance between from and to classes, counting from current.
[ "Calculates", "distance", "between", "from", "and", "to", "classes", "counting", "from", "current", "." ]
train
https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ClassApi.java#L90-L94
carewebframework/carewebframework-core
org.carewebframework.messaging-parent/org.carewebframework.messaging.jms-parent/org.carewebframework.messaging.jms.core/src/main/java/org/carewebframework/messaging/jms/JMSUtil.java
JMSUtil.addRecipientSelector
private static void addRecipientSelector(String value, StringBuilder sb) { if (value != null) { sb.append(" OR Recipients LIKE '%,").append(value).append(",%'"); } }
java
private static void addRecipientSelector(String value, StringBuilder sb) { if (value != null) { sb.append(" OR Recipients LIKE '%,").append(value).append(",%'"); } }
[ "private", "static", "void", "addRecipientSelector", "(", "String", "value", ",", "StringBuilder", "sb", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "sb", ".", "append", "(", "\" OR Recipients LIKE '%,\"", ")", ".", "append", "(", "value", ")", "...
Add a recipient selector for the given value. @param value Recipient value. @param sb String builder to receive value.
[ "Add", "a", "recipient", "selector", "for", "the", "given", "value", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.messaging-parent/org.carewebframework.messaging.jms-parent/org.carewebframework.messaging.jms.core/src/main/java/org/carewebframework/messaging/jms/JMSUtil.java#L117-L121
lessthanoptimal/ddogleg
src/org/ddogleg/solver/PolynomialSolver.java
PolynomialSolver.createRootFinder
public static PolynomialRoots createRootFinder( RootFinderType type , int maxDegree ) { switch ( type ) { case EVD: return new RootFinderCompanion(); case STURM: FindRealRootsSturm sturm = new FindRealRootsSturm(maxDegree,-1,1e-10,30,20); return new WrapRealRootsSturm(sturm); } throw new IllegalArgumentException("Unknown type"); }
java
public static PolynomialRoots createRootFinder( RootFinderType type , int maxDegree ) { switch ( type ) { case EVD: return new RootFinderCompanion(); case STURM: FindRealRootsSturm sturm = new FindRealRootsSturm(maxDegree,-1,1e-10,30,20); return new WrapRealRootsSturm(sturm); } throw new IllegalArgumentException("Unknown type"); }
[ "public", "static", "PolynomialRoots", "createRootFinder", "(", "RootFinderType", "type", ",", "int", "maxDegree", ")", "{", "switch", "(", "type", ")", "{", "case", "EVD", ":", "return", "new", "RootFinderCompanion", "(", ")", ";", "case", "STURM", ":", "Fi...
Creates a generic polynomial root finding class which will return all real or all real and complex roots depending on the algorithm selected. @param type Which algorithm is to be returned. @param maxDegree Maximum degree of the polynomial being considered. @return Root finding algorithm.
[ "Creates", "a", "generic", "polynomial", "root", "finding", "class", "which", "will", "return", "all", "real", "or", "all", "real", "and", "complex", "roots", "depending", "on", "the", "algorithm", "selected", "." ]
train
https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/solver/PolynomialSolver.java#L44-L55
apache/incubator-heron
heron/api/src/java/org/apache/heron/api/topology/TopologyBuilder.java
TopologyBuilder.setBolt
public BoltDeclarer setBolt(String id, IWindowedBolt bolt, Number parallelismHint) throws IllegalArgumentException { return setBolt(id, new WindowedBoltExecutor(bolt), parallelismHint); }
java
public BoltDeclarer setBolt(String id, IWindowedBolt bolt, Number parallelismHint) throws IllegalArgumentException { return setBolt(id, new WindowedBoltExecutor(bolt), parallelismHint); }
[ "public", "BoltDeclarer", "setBolt", "(", "String", "id", ",", "IWindowedBolt", "bolt", ",", "Number", "parallelismHint", ")", "throws", "IllegalArgumentException", "{", "return", "setBolt", "(", "id", ",", "new", "WindowedBoltExecutor", "(", "bolt", ")", ",", "...
Define a new bolt in this topology. This defines a windowed bolt, intended for windowing operations. The {@link IWindowedBolt#execute(TupleWindow)} method is triggered for each window interval with the list of current events in the window. @param id the id of this component. This id is referenced by other components that want to consume this bolt's outputs. @param bolt the windowed bolt @param parallelismHint the number of tasks that should be assigned to execute this bolt. Each task will run on a thread in a process somwehere around the cluster. @return use the returned object to declare the inputs to this component @throws IllegalArgumentException if {@code parallelismHint} is not positive
[ "Define", "a", "new", "bolt", "in", "this", "topology", ".", "This", "defines", "a", "windowed", "bolt", "intended", "for", "windowing", "operations", ".", "The", "{", "@link", "IWindowedBolt#execute", "(", "TupleWindow", ")", "}", "method", "is", "triggered",...
train
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/api/src/java/org/apache/heron/api/topology/TopologyBuilder.java#L191-L194
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/std/FilteredJobLifecycleListener.java
FilteredJobLifecycleListener.onDeleteJob
@Override public void onDeleteJob(URI deletedJobURI, String deletedJobVersion) { JobSpec fakeJobSpec = JobSpec.builder(deletedJobURI).withVersion(deletedJobVersion).build(); if (this.filter.apply(fakeJobSpec)) { this.delegate.onDeleteJob(deletedJobURI, deletedJobVersion); } }
java
@Override public void onDeleteJob(URI deletedJobURI, String deletedJobVersion) { JobSpec fakeJobSpec = JobSpec.builder(deletedJobURI).withVersion(deletedJobVersion).build(); if (this.filter.apply(fakeJobSpec)) { this.delegate.onDeleteJob(deletedJobURI, deletedJobVersion); } }
[ "@", "Override", "public", "void", "onDeleteJob", "(", "URI", "deletedJobURI", ",", "String", "deletedJobVersion", ")", "{", "JobSpec", "fakeJobSpec", "=", "JobSpec", ".", "builder", "(", "deletedJobURI", ")", ".", "withVersion", "(", "deletedJobVersion", ")", "...
{@inheritDoc} NOTE: For this callback only conditions on the URI and version will be used.
[ "{", "@inheritDoc", "}" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/std/FilteredJobLifecycleListener.java#L54-L59
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java
BigtableTableAdminClient.getTableAsync
@SuppressWarnings("WeakerAccess") public ApiFuture<Table> getTableAsync(String tableId) { return getTableAsync(tableId, com.google.bigtable.admin.v2.Table.View.SCHEMA_VIEW); }
java
@SuppressWarnings("WeakerAccess") public ApiFuture<Table> getTableAsync(String tableId) { return getTableAsync(tableId, com.google.bigtable.admin.v2.Table.View.SCHEMA_VIEW); }
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "ApiFuture", "<", "Table", ">", "getTableAsync", "(", "String", "tableId", ")", "{", "return", "getTableAsync", "(", "tableId", ",", "com", ".", "google", ".", "bigtable", ".", "admin", ".", "v...
Asynchronously gets the table metadata by tableId. <p>Sample code: <pre>{@code ApiFuture<Table> tableFuture = client.getTableAsync("my-table"); ApiFutures.addCallback( tableFuture, new ApiFutureCallback<Table>() { public void onSuccess(Table table) { System.out.println("Got metadata for table: " + table.getId()); System.out.println("Column families:"); for (ColumnFamily cf : table.getColumnFamilies()) { System.out.println(cf.getId()); } } public void onFailure(Throwable t) { t.printStackTrace(); } }, MoreExecutors.directExecutor() ); }</pre>
[ "Asynchronously", "gets", "the", "table", "metadata", "by", "tableId", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java#L484-L487
alkacon/opencms-core
src/org/opencms/file/CmsLinkRewriter.java
CmsLinkRewriter.rewriteContentString
protected String rewriteContentString(String originalContent) { Pattern uuidPattern = Pattern.compile(CmsUUID.UUID_REGEX); I_CmsRegexSubstitution substitution = new I_CmsRegexSubstitution() { public String substituteMatch(String text, Matcher matcher) { String uuidString = text.substring(matcher.start(), matcher.end()); CmsUUID uuid = new CmsUUID(uuidString); String result = uuidString; if (m_translationsById.containsKey(uuid)) { result = m_translationsById.get(uuid).getStructureId().toString(); } return result; } }; return CmsStringUtil.substitute(uuidPattern, originalContent, substitution); }
java
protected String rewriteContentString(String originalContent) { Pattern uuidPattern = Pattern.compile(CmsUUID.UUID_REGEX); I_CmsRegexSubstitution substitution = new I_CmsRegexSubstitution() { public String substituteMatch(String text, Matcher matcher) { String uuidString = text.substring(matcher.start(), matcher.end()); CmsUUID uuid = new CmsUUID(uuidString); String result = uuidString; if (m_translationsById.containsKey(uuid)) { result = m_translationsById.get(uuid).getStructureId().toString(); } return result; } }; return CmsStringUtil.substitute(uuidPattern, originalContent, substitution); }
[ "protected", "String", "rewriteContentString", "(", "String", "originalContent", ")", "{", "Pattern", "uuidPattern", "=", "Pattern", ".", "compile", "(", "CmsUUID", ".", "UUID_REGEX", ")", ";", "I_CmsRegexSubstitution", "substitution", "=", "new", "I_CmsRegexSubstitut...
Replaces structure ids of resources in the source subtree with the structure ids of the corresponding resources in the target subtree inside a content string.<p> @param originalContent the original content @return the content with the new structure ids
[ "Replaces", "structure", "ids", "of", "resources", "in", "the", "source", "subtree", "with", "the", "structure", "ids", "of", "the", "corresponding", "resources", "in", "the", "target", "subtree", "inside", "a", "content", "string", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsLinkRewriter.java#L654-L671
sarl/sarl
main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java
MavenHelper.getPluginDependencyVersion
public String getPluginDependencyVersion(String groupId, String artifactId) throws MojoExecutionException { final Map<String, Dependency> deps = getPluginDependencies(); final String key = ArtifactUtils.versionlessKey(groupId, artifactId); this.log.debug("COMPONENT DEPENDENCIES(getPluginVersionFromDependencies):"); //$NON-NLS-1$ this.log.debug(deps.toString()); final Dependency dep = deps.get(key); if (dep != null) { final String version = dep.getVersion(); if (version != null && !version.isEmpty()) { return version; } throw new MojoExecutionException(MessageFormat.format(Messages.MavenHelper_2, key)); } throw new MojoExecutionException(MessageFormat.format(Messages.MavenHelper_3, key, deps)); }
java
public String getPluginDependencyVersion(String groupId, String artifactId) throws MojoExecutionException { final Map<String, Dependency> deps = getPluginDependencies(); final String key = ArtifactUtils.versionlessKey(groupId, artifactId); this.log.debug("COMPONENT DEPENDENCIES(getPluginVersionFromDependencies):"); //$NON-NLS-1$ this.log.debug(deps.toString()); final Dependency dep = deps.get(key); if (dep != null) { final String version = dep.getVersion(); if (version != null && !version.isEmpty()) { return version; } throw new MojoExecutionException(MessageFormat.format(Messages.MavenHelper_2, key)); } throw new MojoExecutionException(MessageFormat.format(Messages.MavenHelper_3, key, deps)); }
[ "public", "String", "getPluginDependencyVersion", "(", "String", "groupId", ",", "String", "artifactId", ")", "throws", "MojoExecutionException", "{", "final", "Map", "<", "String", ",", "Dependency", ">", "deps", "=", "getPluginDependencies", "(", ")", ";", "fina...
Replies the version of the given plugin that is specified in the POM of the plugin in which this mojo is located. @param groupId the identifier of the group. @param artifactId thidentifier of the artifact. @return the version, never <code>null</code> @throws MojoExecutionException if the plugin was not found.
[ "Replies", "the", "version", "of", "the", "given", "plugin", "that", "is", "specified", "in", "the", "POM", "of", "the", "plugin", "in", "which", "this", "mojo", "is", "located", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L349-L363
OpenLiberty/open-liberty
dev/com.ibm.ws.security.authorization.jacc.web/src/com/ibm/ws/security/authorization/jacc/web/impl/WebSecurityPropagatorImpl.java
WebSecurityPropagatorImpl.isUnqualified
private boolean isUnqualified(String url, String urlPattern) { boolean unqualified = false; if (urlPattern.indexOf(":") != -1) { int idx = urlPattern.indexOf(":"); StringTokenizer st = new StringTokenizer(urlPattern.substring(idx + 1), ":"); while (st.hasMoreTokens()) { if (urlPatternMatch(st.nextToken(), url)) { unqualified = true; break; } } } return unqualified; }
java
private boolean isUnqualified(String url, String urlPattern) { boolean unqualified = false; if (urlPattern.indexOf(":") != -1) { int idx = urlPattern.indexOf(":"); StringTokenizer st = new StringTokenizer(urlPattern.substring(idx + 1), ":"); while (st.hasMoreTokens()) { if (urlPatternMatch(st.nextToken(), url)) { unqualified = true; break; } } } return unqualified; }
[ "private", "boolean", "isUnqualified", "(", "String", "url", ",", "String", "urlPattern", ")", "{", "boolean", "unqualified", "=", "false", ";", "if", "(", "urlPattern", ".", "indexOf", "(", "\":\"", ")", "!=", "-", "1", ")", "{", "int", "idx", "=", "u...
*********************************************************************** Any pattern, qualified by a pattern that matches it, is overridden and made irrelevant (in the translation) by the qualifying pattern. Specifically, all extension patterns and the default pattern are made irrelevant by the presence of the path prefix pattern "/*" in a deployment descriptor. ************************************************************************
[ "***********************************************************************", "Any", "pattern", "qualified", "by", "a", "pattern", "that", "matches", "it", "is", "overridden", "and", "made", "irrelevant", "(", "in", "the", "translation", ")", "by", "the", "qualifying", "pa...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authorization.jacc.web/src/com/ibm/ws/security/authorization/jacc/web/impl/WebSecurityPropagatorImpl.java#L462-L475
diffplug/durian
src/com/diffplug/common/base/TreeComparison.java
TreeComparison.assertEqualMappedBy
public void assertEqualMappedBy(Function<? super E, ?> expectedMapper, Function<? super A, ?> actualMapper) { if (!isEqualMappedBy(expectedMapper, actualMapper)) { throwAssertionError(); } }
java
public void assertEqualMappedBy(Function<? super E, ?> expectedMapper, Function<? super A, ?> actualMapper) { if (!isEqualMappedBy(expectedMapper, actualMapper)) { throwAssertionError(); } }
[ "public", "void", "assertEqualMappedBy", "(", "Function", "<", "?", "super", "E", ",", "?", ">", "expectedMapper", ",", "Function", "<", "?", "super", "A", ",", "?", ">", "actualMapper", ")", "{", "if", "(", "!", "isEqualMappedBy", "(", "expectedMapper", ...
Asserts that the trees are equal, by calling {@link Objects#equals(Object, Object)} on the results of both mappers. @see #isEqualMappedBy(Function, Function)
[ "Asserts", "that", "the", "trees", "are", "equal", "by", "calling", "{", "@link", "Objects#equals", "(", "Object", "Object", ")", "}", "on", "the", "results", "of", "both", "mappers", "." ]
train
https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeComparison.java#L84-L88
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/olap/ParsedQuery.java
ParsedQuery.getBoolean
public boolean getBoolean(String key, boolean defaultValue) { String value = get(key); if(value == null) return defaultValue; return XType.getBoolean(value); }
java
public boolean getBoolean(String key, boolean defaultValue) { String value = get(key); if(value == null) return defaultValue; return XType.getBoolean(value); }
[ "public", "boolean", "getBoolean", "(", "String", "key", ",", "boolean", "defaultValue", ")", "{", "String", "value", "=", "get", "(", "key", ")", ";", "if", "(", "value", "==", "null", ")", "return", "defaultValue", ";", "return", "XType", ".", "getBool...
Returns a boolean value by the key specified or defaultValue if the key was not provided
[ "Returns", "a", "boolean", "value", "by", "the", "key", "specified", "or", "defaultValue", "if", "the", "key", "was", "not", "provided" ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/olap/ParsedQuery.java#L136-L140
amaembo/streamex
src/main/java/one/util/streamex/StreamEx.java
StreamEx.toNavigableMap
public <K, V> NavigableMap<K, V> toNavigableMap(Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valMapper, BinaryOperator<V> mergeFunction) { return rawCollect(Collectors.toMap(keyMapper, valMapper, mergeFunction, TreeMap::new)); }
java
public <K, V> NavigableMap<K, V> toNavigableMap(Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valMapper, BinaryOperator<V> mergeFunction) { return rawCollect(Collectors.toMap(keyMapper, valMapper, mergeFunction, TreeMap::new)); }
[ "public", "<", "K", ",", "V", ">", "NavigableMap", "<", "K", ",", "V", ">", "toNavigableMap", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "K", ">", "keyMapper", ",", "Function", "<", "?", "super", "T", ",", "?", "extends", "V", ...
Returns a {@link NavigableMap} whose keys and values are the result of applying the provided mapping functions to the input elements. <p> This is a <a href="package-summary.html#StreamOps">terminal</a> operation. <p> If the mapped keys contains duplicates (according to {@link Object#equals(Object)}), the value mapping function is applied to each equal element, and the results are merged using the provided merging function. <p> Returned {@code NavigableMap} is guaranteed to be modifiable. @param <K> the output type of the key mapping function @param <V> the output type of the value mapping function @param keyMapper a mapping function to produce keys @param valMapper a mapping function to produce values @param mergeFunction a merge function, used to resolve collisions between values associated with the same key, as supplied to {@link Map#merge(Object, Object, BiFunction)} @return a {@code NavigableMap} whose keys are the result of applying a key mapping function to the input elements, and whose values are the result of applying a value mapping function to all input elements equal to the key and combining them using the merge function @see Collectors#toMap(Function, Function, BinaryOperator) @see Collectors#toConcurrentMap(Function, Function, BinaryOperator) @see #toNavigableMap(Function, Function) @since 0.6.5
[ "Returns", "a", "{", "@link", "NavigableMap", "}", "whose", "keys", "and", "values", "are", "the", "result", "of", "applying", "the", "provided", "mapping", "functions", "to", "the", "input", "elements", "." ]
train
https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L1258-L1261
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/refer/Referencer.java
Referencer.setReferences
public static void setReferences(IReferences references, Iterable<Object> components) throws ReferenceException, ConfigException { for (Object component : components) setReferencesForOne(references, component); } /** * Unsets references in specific component. * * To unset references components must implement IUnreferenceable interface. If * they don't the call to this method has no effect. * * @param component the component to unset references. * * @see IUnreferenceable */ public static void unsetReferencesForOne(Object component) { if (component instanceof IUnreferenceable) ((IUnreferenceable) component).unsetReferences(); } /** * Unsets references in multiple components. * * To unset references components must implement IUnreferenceable interface. If * they don't the call to this method has no effect. * * @param components the list of components, whose references must be cleared. * * @see IUnreferenceable */ public static void unsetReferences(Iterable<Object> components) { for (Object component : components) unsetReferencesForOne(component); } }
java
public static void setReferences(IReferences references, Iterable<Object> components) throws ReferenceException, ConfigException { for (Object component : components) setReferencesForOne(references, component); } /** * Unsets references in specific component. * * To unset references components must implement IUnreferenceable interface. If * they don't the call to this method has no effect. * * @param component the component to unset references. * * @see IUnreferenceable */ public static void unsetReferencesForOne(Object component) { if (component instanceof IUnreferenceable) ((IUnreferenceable) component).unsetReferences(); } /** * Unsets references in multiple components. * * To unset references components must implement IUnreferenceable interface. If * they don't the call to this method has no effect. * * @param components the list of components, whose references must be cleared. * * @see IUnreferenceable */ public static void unsetReferences(Iterable<Object> components) { for (Object component : components) unsetReferencesForOne(component); } }
[ "public", "static", "void", "setReferences", "(", "IReferences", "references", ",", "Iterable", "<", "Object", ">", "components", ")", "throws", "ReferenceException", ",", "ConfigException", "{", "for", "(", "Object", "component", ":", "components", ")", "setRefer...
Sets references to multiple components. To set references components must implement IReferenceable interface. If they don't the call to this method has no effect. @param references the references to be set. @param components a list of components to set the references to. @throws ReferenceException when no references found. @throws ConfigException when configuration is wrong. @see IReferenceable
[ "Sets", "references", "to", "multiple", "components", "." ]
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/refer/Referencer.java#L45-L81
jeremylong/DependencyCheck
cli/src/main/java/org/owasp/dependencycheck/CliParser.java
CliParser.isNodeAuditDisabled
public boolean isNodeAuditDisabled() { if (hasDisableOption("disableNSP", Settings.KEYS.ANALYZER_NODE_AUDIT_ENABLED)) { LOGGER.error("The disableNSP argument has been deprecated and replaced by disableNodeAudit"); LOGGER.error("The disableNSP argument will be removed in the next version"); return true; } return hasDisableOption(ARGUMENT.DISABLE_NODE_AUDIT, Settings.KEYS.ANALYZER_NODE_AUDIT_ENABLED); }
java
public boolean isNodeAuditDisabled() { if (hasDisableOption("disableNSP", Settings.KEYS.ANALYZER_NODE_AUDIT_ENABLED)) { LOGGER.error("The disableNSP argument has been deprecated and replaced by disableNodeAudit"); LOGGER.error("The disableNSP argument will be removed in the next version"); return true; } return hasDisableOption(ARGUMENT.DISABLE_NODE_AUDIT, Settings.KEYS.ANALYZER_NODE_AUDIT_ENABLED); }
[ "public", "boolean", "isNodeAuditDisabled", "(", ")", "{", "if", "(", "hasDisableOption", "(", "\"disableNSP\"", ",", "Settings", ".", "KEYS", ".", "ANALYZER_NODE_AUDIT_ENABLED", ")", ")", "{", "LOGGER", ".", "error", "(", "\"The disableNSP argument has been deprecate...
Returns true if the disableNodeAudit command line argument was specified. @return true if the disableNodeAudit command line argument was specified; otherwise false
[ "Returns", "true", "if", "the", "disableNodeAudit", "command", "line", "argument", "was", "specified", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/cli/src/main/java/org/owasp/dependencycheck/CliParser.java#L766-L773
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializerHelper.java
DBInitializerHelper.prepareScripts
public static String prepareScripts(WorkspaceEntry wsEntry, String dialect) throws IOException, RepositoryConfigurationException { String itemTableSuffix = getItemTableSuffix(wsEntry); String valueTableSuffix = getValueTableSuffix(wsEntry); String refTableSuffix = getRefTableSuffix(wsEntry); DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsEntry); boolean isolatedDB = dbType == DatabaseStructureType.ISOLATED; String initScriptPath = DBInitializerHelper.scriptPath(dialect, dbType.isMultiDatabase()); return prepareScripts(initScriptPath, itemTableSuffix, valueTableSuffix, refTableSuffix, isolatedDB); }
java
public static String prepareScripts(WorkspaceEntry wsEntry, String dialect) throws IOException, RepositoryConfigurationException { String itemTableSuffix = getItemTableSuffix(wsEntry); String valueTableSuffix = getValueTableSuffix(wsEntry); String refTableSuffix = getRefTableSuffix(wsEntry); DatabaseStructureType dbType = DBInitializerHelper.getDatabaseType(wsEntry); boolean isolatedDB = dbType == DatabaseStructureType.ISOLATED; String initScriptPath = DBInitializerHelper.scriptPath(dialect, dbType.isMultiDatabase()); return prepareScripts(initScriptPath, itemTableSuffix, valueTableSuffix, refTableSuffix, isolatedDB); }
[ "public", "static", "String", "prepareScripts", "(", "WorkspaceEntry", "wsEntry", ",", "String", "dialect", ")", "throws", "IOException", ",", "RepositoryConfigurationException", "{", "String", "itemTableSuffix", "=", "getItemTableSuffix", "(", "wsEntry", ")", ";", "S...
Returns SQL scripts for initialization database for defined {@link WorkspaceEntry}. @param wsEntry workspace configuration @param dialect database dialect which is used, since {@link JDBCWorkspaceDataContainer#DB_DIALECT} parameter can contain {@link DialectConstants#DB_DIALECT_AUTO} value it is necessary to resolve dialect before based on database connection.
[ "Returns", "SQL", "scripts", "for", "initialization", "database", "for", "defined", "{", "@link", "WorkspaceEntry", "}", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializerHelper.java#L79-L92
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/user/UserCoreDao.java
UserCoreDao.queryForValueFieldValues
public TResult queryForValueFieldValues(Map<String, ColumnValue> fieldValues) { String where = buildValueWhere(fieldValues.entrySet()); String[] whereArgs = buildValueWhereArgs(fieldValues.values()); TResult result = userDb.query(getTableName(), table.getColumnNames(), where, whereArgs, null, null, null); prepareResult(result); return result; }
java
public TResult queryForValueFieldValues(Map<String, ColumnValue> fieldValues) { String where = buildValueWhere(fieldValues.entrySet()); String[] whereArgs = buildValueWhereArgs(fieldValues.values()); TResult result = userDb.query(getTableName(), table.getColumnNames(), where, whereArgs, null, null, null); prepareResult(result); return result; }
[ "public", "TResult", "queryForValueFieldValues", "(", "Map", "<", "String", ",", "ColumnValue", ">", "fieldValues", ")", "{", "String", "where", "=", "buildValueWhere", "(", "fieldValues", ".", "entrySet", "(", ")", ")", ";", "String", "[", "]", "whereArgs", ...
Query for the row where all fields match their values @param fieldValues field values @return result
[ "Query", "for", "the", "row", "where", "all", "fields", "match", "their", "values" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserCoreDao.java#L370-L377
alibaba/jstorm
jstorm-core/src/main/java/com/alibaba/jstorm/utils/LoadConf.java
LoadConf.dumpYaml
public static void dumpYaml(Map conf, String file) { Yaml yaml = new Yaml(); try { Writer writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); yaml.dump(conf, writer); } catch (Exception ex) { LOG.error("Error:", ex); } }
java
public static void dumpYaml(Map conf, String file) { Yaml yaml = new Yaml(); try { Writer writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); yaml.dump(conf, writer); } catch (Exception ex) { LOG.error("Error:", ex); } }
[ "public", "static", "void", "dumpYaml", "(", "Map", "conf", ",", "String", "file", ")", "{", "Yaml", "yaml", "=", "new", "Yaml", "(", ")", ";", "try", "{", "Writer", "writer", "=", "new", "OutputStreamWriter", "(", "new", "FileOutputStream", "(", "file",...
dumps a conf map into a file, note that the output yaml file uses a compact format e.g., for a list, it uses key: [xx, xx] instead of multiple lines.
[ "dumps", "a", "conf", "map", "into", "a", "file", "note", "that", "the", "output", "yaml", "file", "uses", "a", "compact", "format", "e", ".", "g", ".", "for", "a", "list", "it", "uses", "key", ":", "[", "xx", "xx", "]", "instead", "of", "multiple"...
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/LoadConf.java#L174-L182
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/UrlTool.java
UrlTool.getRestUrl
public String getRestUrl(String urlKey) throws UnsupportedEncodingException { return getRestUrl(urlKey, true, null, null); }
java
public String getRestUrl(String urlKey) throws UnsupportedEncodingException { return getRestUrl(urlKey, true, null, null); }
[ "public", "String", "getRestUrl", "(", "String", "urlKey", ")", "throws", "UnsupportedEncodingException", "{", "return", "getRestUrl", "(", "urlKey", ",", "true", ",", "null", ",", "null", ")", ";", "}" ]
Gets REST url. @param urlKey Url key. @return Final REST url. @throws UnsupportedEncodingException
[ "Gets", "REST", "url", "." ]
train
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/UrlTool.java#L46-L48
apereo/cas
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/authenticator/OAuth20CasAuthenticationBuilder.java
OAuth20CasAuthenticationBuilder.build
public Authentication build(final UserProfile profile, final OAuthRegisteredService registeredService, final J2EContext context, final Service service) { val profileAttributes = CoreAuthenticationUtils.convertAttributeValuesToMultiValuedObjects(profile.getAttributes()); val newPrincipal = this.principalFactory.createPrincipal(profile.getId(), profileAttributes); LOGGER.debug("Created final principal [{}] after filtering attributes based on [{}]", newPrincipal, registeredService); val authenticator = profile.getClass().getCanonicalName(); val metadata = new BasicCredentialMetaData(new BasicIdentifiableCredential(profile.getId())); val handlerResult = new DefaultAuthenticationHandlerExecutionResult(authenticator, metadata, newPrincipal, new ArrayList<>()); val scopes = CollectionUtils.toCollection(context.getRequest().getParameterValues(OAuth20Constants.SCOPE)); val state = StringUtils.defaultIfBlank(context.getRequestParameter(OAuth20Constants.STATE), StringUtils.EMPTY); val nonce = StringUtils.defaultIfBlank(context.getRequestParameter(OAuth20Constants.NONCE), StringUtils.EMPTY); LOGGER.debug("OAuth [{}] is [{}], and [{}] is [{}]", OAuth20Constants.STATE, state, OAuth20Constants.NONCE, nonce); /* * pac4j UserProfile.getPermissions() and getRoles() returns UnmodifiableSet which Jackson Serializer * happily serializes to json but is unable to deserialize. * We have to transform those to HashSet to avoid such a problem */ return DefaultAuthenticationBuilder.newInstance() .addAttribute("permissions", new LinkedHashSet<>(profile.getPermissions())) .addAttribute("roles", new LinkedHashSet<>(profile.getRoles())) .addAttribute("scopes", scopes) .addAttribute(OAuth20Constants.STATE, state) .addAttribute(OAuth20Constants.NONCE, nonce) .addAttribute(OAuth20Constants.CLIENT_ID, registeredService.getClientId()) .addCredential(metadata) .setPrincipal(newPrincipal) .setAuthenticationDate(ZonedDateTime.now(ZoneOffset.UTC)) .addSuccess(profile.getClass().getCanonicalName(), handlerResult) .build(); }
java
public Authentication build(final UserProfile profile, final OAuthRegisteredService registeredService, final J2EContext context, final Service service) { val profileAttributes = CoreAuthenticationUtils.convertAttributeValuesToMultiValuedObjects(profile.getAttributes()); val newPrincipal = this.principalFactory.createPrincipal(profile.getId(), profileAttributes); LOGGER.debug("Created final principal [{}] after filtering attributes based on [{}]", newPrincipal, registeredService); val authenticator = profile.getClass().getCanonicalName(); val metadata = new BasicCredentialMetaData(new BasicIdentifiableCredential(profile.getId())); val handlerResult = new DefaultAuthenticationHandlerExecutionResult(authenticator, metadata, newPrincipal, new ArrayList<>()); val scopes = CollectionUtils.toCollection(context.getRequest().getParameterValues(OAuth20Constants.SCOPE)); val state = StringUtils.defaultIfBlank(context.getRequestParameter(OAuth20Constants.STATE), StringUtils.EMPTY); val nonce = StringUtils.defaultIfBlank(context.getRequestParameter(OAuth20Constants.NONCE), StringUtils.EMPTY); LOGGER.debug("OAuth [{}] is [{}], and [{}] is [{}]", OAuth20Constants.STATE, state, OAuth20Constants.NONCE, nonce); /* * pac4j UserProfile.getPermissions() and getRoles() returns UnmodifiableSet which Jackson Serializer * happily serializes to json but is unable to deserialize. * We have to transform those to HashSet to avoid such a problem */ return DefaultAuthenticationBuilder.newInstance() .addAttribute("permissions", new LinkedHashSet<>(profile.getPermissions())) .addAttribute("roles", new LinkedHashSet<>(profile.getRoles())) .addAttribute("scopes", scopes) .addAttribute(OAuth20Constants.STATE, state) .addAttribute(OAuth20Constants.NONCE, nonce) .addAttribute(OAuth20Constants.CLIENT_ID, registeredService.getClientId()) .addCredential(metadata) .setPrincipal(newPrincipal) .setAuthenticationDate(ZonedDateTime.now(ZoneOffset.UTC)) .addSuccess(profile.getClass().getCanonicalName(), handlerResult) .build(); }
[ "public", "Authentication", "build", "(", "final", "UserProfile", "profile", ",", "final", "OAuthRegisteredService", "registeredService", ",", "final", "J2EContext", "context", ",", "final", "Service", "service", ")", "{", "val", "profileAttributes", "=", "CoreAuthent...
Create an authentication from a user profile. @param profile the given user profile @param registeredService the registered service @param context the context @param service the service @return the built authentication
[ "Create", "an", "authentication", "from", "a", "user", "profile", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/authenticator/OAuth20CasAuthenticationBuilder.java#L91-L126
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/parser/lexparser/Options.java
Options.setOptionsOrWarn
public void setOptionsOrWarn(final String[] flags, final int startIndex, final int endIndexPlusOne) { for (int i = startIndex; i < endIndexPlusOne;) { i = setOptionOrWarn(flags, i); } }
java
public void setOptionsOrWarn(final String[] flags, final int startIndex, final int endIndexPlusOne) { for (int i = startIndex; i < endIndexPlusOne;) { i = setOptionOrWarn(flags, i); } }
[ "public", "void", "setOptionsOrWarn", "(", "final", "String", "[", "]", "flags", ",", "final", "int", "startIndex", ",", "final", "int", "endIndexPlusOne", ")", "{", "for", "(", "int", "i", "=", "startIndex", ";", "i", "<", "endIndexPlusOne", ";", ")", "...
Set options based on a String array in the style of commandline flags. This method goes through the array until it ends, processing options, as for {@link #setOption}. @param flags Array of options. The options passed in should be specified like command-line arguments, including with an initial minus sign for example, {"-outputFormat", "typedDependencies", "-maxLength", "70"} @param startIndex The index in the array to begin processing options at @param endIndexPlusOne A number one greater than the last array index at which options should be processed @throws IllegalArgumentException If an unknown flag is passed in
[ "Set", "options", "based", "on", "a", "String", "array", "in", "the", "style", "of", "commandline", "flags", ".", "This", "method", "goes", "through", "the", "array", "until", "it", "ends", "processing", "options", "as", "for", "{", "@link", "#setOption", ...
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/Options.java#L100-L104
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ExtendedServerBlobAuditingPoliciesInner.java
ExtendedServerBlobAuditingPoliciesInner.beginCreateOrUpdateAsync
public Observable<ExtendedServerBlobAuditingPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ExtendedServerBlobAuditingPolicyInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ExtendedServerBlobAuditingPolicyInner>, ExtendedServerBlobAuditingPolicyInner>() { @Override public ExtendedServerBlobAuditingPolicyInner call(ServiceResponse<ExtendedServerBlobAuditingPolicyInner> response) { return response.body(); } }); }
java
public Observable<ExtendedServerBlobAuditingPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ExtendedServerBlobAuditingPolicyInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ExtendedServerBlobAuditingPolicyInner>, ExtendedServerBlobAuditingPolicyInner>() { @Override public ExtendedServerBlobAuditingPolicyInner call(ServiceResponse<ExtendedServerBlobAuditingPolicyInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "ExtendedServerBlobAuditingPolicyInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "ExtendedServerBlobAuditingPolicyInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceR...
Creates or updates an extended server's blob auditing policy. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param parameters Properties of extended blob auditing policy @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the ExtendedServerBlobAuditingPolicyInner object
[ "Creates", "or", "updates", "an", "extended", "server", "s", "blob", "auditing", "policy", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ExtendedServerBlobAuditingPoliciesInner.java#L274-L281
aws/aws-sdk-java
aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/model/DescribeStackResourceDriftsResult.java
DescribeStackResourceDriftsResult.getStackResourceDrifts
public java.util.List<StackResourceDrift> getStackResourceDrifts() { if (stackResourceDrifts == null) { stackResourceDrifts = new com.amazonaws.internal.SdkInternalList<StackResourceDrift>(); } return stackResourceDrifts; }
java
public java.util.List<StackResourceDrift> getStackResourceDrifts() { if (stackResourceDrifts == null) { stackResourceDrifts = new com.amazonaws.internal.SdkInternalList<StackResourceDrift>(); } return stackResourceDrifts; }
[ "public", "java", ".", "util", ".", "List", "<", "StackResourceDrift", ">", "getStackResourceDrifts", "(", ")", "{", "if", "(", "stackResourceDrifts", "==", "null", ")", "{", "stackResourceDrifts", "=", "new", "com", ".", "amazonaws", ".", "internal", ".", "...
<p> Drift information for the resources that have been checked for drift in the specified stack. This includes actual and expected configuration values for resources where AWS CloudFormation detects drift. </p> <p> For a given stack, there will be one <code>StackResourceDrift</code> for each stack resource that has been checked for drift. Resources that have not yet been checked for drift are not included. Resources that do not currently support drift detection are not checked, and so not included. For a list of resources that support drift detection, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html" >Resources that Support Drift Detection</a>. </p> @return Drift information for the resources that have been checked for drift in the specified stack. This includes actual and expected configuration values for resources where AWS CloudFormation detects drift.</p> <p> For a given stack, there will be one <code>StackResourceDrift</code> for each stack resource that has been checked for drift. Resources that have not yet been checked for drift are not included. Resources that do not currently support drift detection are not checked, and so not included. For a list of resources that support drift detection, see <a href= "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html" >Resources that Support Drift Detection</a>.
[ "<p", ">", "Drift", "information", "for", "the", "resources", "that", "have", "been", "checked", "for", "drift", "in", "the", "specified", "stack", ".", "This", "includes", "actual", "and", "expected", "configuration", "values", "for", "resources", "where", "A...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudformation/src/main/java/com/amazonaws/services/cloudformation/model/DescribeStackResourceDriftsResult.java#L77-L82
plaid/plaid-java
src/main/java/com/plaid/client/internal/Util.java
Util.arrayToMap
public static Map<String, String> arrayToMap(String[] args) { if (args.length % 2 != 0) { throw new IllegalArgumentException("Must pass in an even number of args, one key per value."); } Map<String, String> ret = new HashMap<>(); for (int i = 0; i < args.length; i += 2) { ret.put(args[i], args[i + 1]); } return ret; }
java
public static Map<String, String> arrayToMap(String[] args) { if (args.length % 2 != 0) { throw new IllegalArgumentException("Must pass in an even number of args, one key per value."); } Map<String, String> ret = new HashMap<>(); for (int i = 0; i < args.length; i += 2) { ret.put(args[i], args[i + 1]); } return ret; }
[ "public", "static", "Map", "<", "String", ",", "String", ">", "arrayToMap", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "%", "2", "!=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Must pass in an ev...
Helper to convert an alternating key1,value1,key2,value2,... array into a map. @param args Alternating arguments. @return Resulting map.
[ "Helper", "to", "convert", "an", "alternating", "key1", "value1", "key2", "value2", "...", "array", "into", "a", "map", "." ]
train
https://github.com/plaid/plaid-java/blob/360f1f8a5178fa0c3c2c2e07a58f8ccec5f33117/src/main/java/com/plaid/client/internal/Util.java#L107-L119
jbossws/jbossws-cxf
modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilder.java
CXFMAPBuilder.inboundMap
public MAP inboundMap(Map<String, Object> ctx) { AddressingProperties implementation = (AddressingProperties)ctx.get(CXFMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND); return newMap(implementation); }
java
public MAP inboundMap(Map<String, Object> ctx) { AddressingProperties implementation = (AddressingProperties)ctx.get(CXFMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND); return newMap(implementation); }
[ "public", "MAP", "inboundMap", "(", "Map", "<", "String", ",", "Object", ">", "ctx", ")", "{", "AddressingProperties", "implementation", "=", "(", "AddressingProperties", ")", "ctx", ".", "get", "(", "CXFMAPConstants", ".", "SERVER_ADDRESSING_PROPERTIES_INBOUND", ...
retrieve the inbound server message address properties attached to a message context @param ctx the server message context @return
[ "retrieve", "the", "inbound", "server", "message", "address", "properties", "attached", "to", "a", "message", "context" ]
train
https://github.com/jbossws/jbossws-cxf/blob/e1d5df3664cbc2482ebc83cafd355a4d60d12150/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAPBuilder.java#L71-L75
jenkinsci/artifactory-plugin
src/main/java/org/jfrog/hudson/util/IssuesTrackerHelper.java
IssuesTrackerHelper.setIssueTrackerInfo
public void setIssueTrackerInfo(BuildInfoBuilder builder) { Issues issues = new Issues(); issues.setAggregateBuildIssues(aggregateBuildIssues); issues.setAggregationBuildStatus(aggregationBuildStatus); issues.setTracker(new IssueTracker("JIRA", issueTrackerVersion)); Set<Issue> affectedIssuesSet = IssuesTrackerUtils.getAffectedIssuesSet(affectedIssues); if (!affectedIssuesSet.isEmpty()) { issues.setAffectedIssues(affectedIssuesSet); } builder.issues(issues); }
java
public void setIssueTrackerInfo(BuildInfoBuilder builder) { Issues issues = new Issues(); issues.setAggregateBuildIssues(aggregateBuildIssues); issues.setAggregationBuildStatus(aggregationBuildStatus); issues.setTracker(new IssueTracker("JIRA", issueTrackerVersion)); Set<Issue> affectedIssuesSet = IssuesTrackerUtils.getAffectedIssuesSet(affectedIssues); if (!affectedIssuesSet.isEmpty()) { issues.setAffectedIssues(affectedIssuesSet); } builder.issues(issues); }
[ "public", "void", "setIssueTrackerInfo", "(", "BuildInfoBuilder", "builder", ")", "{", "Issues", "issues", "=", "new", "Issues", "(", ")", ";", "issues", ".", "setAggregateBuildIssues", "(", "aggregateBuildIssues", ")", ";", "issues", ".", "setAggregationBuildStatus...
Apply issues tracker info to a build info builder (used by generic tasks and maven2 which doesn't use the extractor
[ "Apply", "issues", "tracker", "info", "to", "a", "build", "info", "builder", "(", "used", "by", "generic", "tasks", "and", "maven2", "which", "doesn", "t", "use", "the", "extractor" ]
train
https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/IssuesTrackerHelper.java#L103-L113
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java
Hierarchy.isSubtype
public static boolean isSubtype(@DottedClassName String clsName, @DottedClassName String possibleSupertypeClassName) throws ClassNotFoundException { Subtypes2 subtypes2 = Global.getAnalysisCache().getDatabase(Subtypes2.class); return subtypes2.isSubtype(DescriptorFactory.createClassDescriptorFromDottedClassName(clsName), DescriptorFactory.createClassDescriptorFromDottedClassName(possibleSupertypeClassName)); }
java
public static boolean isSubtype(@DottedClassName String clsName, @DottedClassName String possibleSupertypeClassName) throws ClassNotFoundException { Subtypes2 subtypes2 = Global.getAnalysisCache().getDatabase(Subtypes2.class); return subtypes2.isSubtype(DescriptorFactory.createClassDescriptorFromDottedClassName(clsName), DescriptorFactory.createClassDescriptorFromDottedClassName(possibleSupertypeClassName)); }
[ "public", "static", "boolean", "isSubtype", "(", "@", "DottedClassName", "String", "clsName", ",", "@", "DottedClassName", "String", "possibleSupertypeClassName", ")", "throws", "ClassNotFoundException", "{", "Subtypes2", "subtypes2", "=", "Global", ".", "getAnalysisCac...
Determine whether one class (or reference type) is a subtype of another. @param clsName the name of the class or reference type @param possibleSupertypeClassName the name of the possible superclass @return true if clsName is a subtype of possibleSupertypeClassName, false if not
[ "Determine", "whether", "one", "class", "(", "or", "reference", "type", ")", "is", "a", "subtype", "of", "another", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L95-L98
netty/netty
codec/src/main/java/io/netty/handler/codec/compression/Snappy.java
Snappy.encodeLiteral
static void encodeLiteral(ByteBuf in, ByteBuf out, int length) { if (length < 61) { out.writeByte(length - 1 << 2); } else { int bitLength = bitsToEncode(length - 1); int bytesToEncode = 1 + bitLength / 8; out.writeByte(59 + bytesToEncode << 2); for (int i = 0; i < bytesToEncode; i++) { out.writeByte(length - 1 >> i * 8 & 0x0ff); } } out.writeBytes(in, length); }
java
static void encodeLiteral(ByteBuf in, ByteBuf out, int length) { if (length < 61) { out.writeByte(length - 1 << 2); } else { int bitLength = bitsToEncode(length - 1); int bytesToEncode = 1 + bitLength / 8; out.writeByte(59 + bytesToEncode << 2); for (int i = 0; i < bytesToEncode; i++) { out.writeByte(length - 1 >> i * 8 & 0x0ff); } } out.writeBytes(in, length); }
[ "static", "void", "encodeLiteral", "(", "ByteBuf", "in", ",", "ByteBuf", "out", ",", "int", "length", ")", "{", "if", "(", "length", "<", "61", ")", "{", "out", ".", "writeByte", "(", "length", "-", "1", "<<", "2", ")", ";", "}", "else", "{", "in...
Writes a literal to the supplied output buffer by directly copying from the input buffer. The literal is taken from the current readerIndex up to the supplied length. @param in The input buffer to copy from @param out The output buffer to copy to @param length The length of the literal to copy
[ "Writes", "a", "literal", "to", "the", "supplied", "output", "buffer", "by", "directly", "copying", "from", "the", "input", "buffer", ".", "The", "literal", "is", "taken", "from", "the", "current", "readerIndex", "up", "to", "the", "supplied", "length", "." ...
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L223-L236
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.core.3.2/src/org/apache/cxf/staxutils/StaxUtils.java
StaxUtils.readQName
public static QName readQName(XMLStreamReader reader) throws XMLStreamException { String value = reader.getElementText(); if (value == null) { return null; } value = value.trim(); int index = value.indexOf(":"); if (index == -1) { return new QName(value); } String prefix = value.substring(0, index); String localName = value.substring(index + 1); String ns = reader.getNamespaceURI(prefix); if ((!StringUtils.isEmpty(prefix) && ns == null) || localName == null) { throw new RuntimeException("Invalid QName in mapping: " + value); } if (ns == null) { return new QName(localName); } return new QName(ns, localName, prefix); }
java
public static QName readQName(XMLStreamReader reader) throws XMLStreamException { String value = reader.getElementText(); if (value == null) { return null; } value = value.trim(); int index = value.indexOf(":"); if (index == -1) { return new QName(value); } String prefix = value.substring(0, index); String localName = value.substring(index + 1); String ns = reader.getNamespaceURI(prefix); if ((!StringUtils.isEmpty(prefix) && ns == null) || localName == null) { throw new RuntimeException("Invalid QName in mapping: " + value); } if (ns == null) { return new QName(localName); } return new QName(ns, localName, prefix); }
[ "public", "static", "QName", "readQName", "(", "XMLStreamReader", "reader", ")", "throws", "XMLStreamException", "{", "String", "value", "=", "reader", ".", "getElementText", "(", ")", ";", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", ...
Reads a QName from the element text. Reader must be positioned at the start tag.
[ "Reads", "a", "QName", "from", "the", "element", "text", ".", "Reader", "must", "be", "positioned", "at", "the", "start", "tag", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.core.3.2/src/org/apache/cxf/staxutils/StaxUtils.java#L1851-L1877
OpenLiberty/open-liberty
dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/AbstractRepositoryClient.java
AbstractRepositoryClient.getAssetsWithUnboundedMaxVersion
@Override public Collection<Asset> getAssetsWithUnboundedMaxVersion(final Collection<ResourceType> types, final Collection<String> rightProductIds, final Visibility visibility) throws IOException, RequestFailureException { return getFilteredAssets(types, rightProductIds, visibility, null, true); }
java
@Override public Collection<Asset> getAssetsWithUnboundedMaxVersion(final Collection<ResourceType> types, final Collection<String> rightProductIds, final Visibility visibility) throws IOException, RequestFailureException { return getFilteredAssets(types, rightProductIds, visibility, null, true); }
[ "@", "Override", "public", "Collection", "<", "Asset", ">", "getAssetsWithUnboundedMaxVersion", "(", "final", "Collection", "<", "ResourceType", ">", "types", ",", "final", "Collection", "<", "String", ">", "rightProductIds", ",", "final", "Visibility", "visibility"...
This method will return all of the assets matching specific filters in Massive that do not have a maximum version in their applies to filter info. It will just return a summary of each asset and not include any {@link Attachment}s. @param types The types to look for or <code>null</code> will return all types @param productIds The product IDs to look for. Should not be <code>null</code> although supplying this will return assets for any product ID @param visibility The visibility to look for or <code>null</code> will return all visibility values (or none) @return A collection of the assets of that type @throws IOException @throws RequestFailureException
[ "This", "method", "will", "return", "all", "of", "the", "assets", "matching", "specific", "filters", "in", "Massive", "that", "do", "not", "have", "a", "maximum", "version", "in", "their", "applies", "to", "filter", "info", ".", "It", "will", "just", "retu...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/AbstractRepositoryClient.java#L67-L71
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/ping.java
ping.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { ping_responses result = (ping_responses) service.get_payload_formatter().string_to_resource(ping_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.ping_response_array); } ping[] result_ping = new ping[result.ping_response_array.length]; for(int i = 0; i < result.ping_response_array.length; i++) { result_ping[i] = result.ping_response_array[i].ping[0]; } return result_ping; }
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { ping_responses result = (ping_responses) service.get_payload_formatter().string_to_resource(ping_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.ping_response_array); } ping[] result_ping = new ping[result.ping_response_array.length]; for(int i = 0; i < result.ping_response_array.length; i++) { result_ping[i] = result.ping_response_array[i].ping[0]; } return result_ping; }
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "ping_responses", "result", "=", "(", "ping_responses", ")", "service", ".", "get_payload_formatter", "(", ...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/ping.java#L203-L220
threerings/nenya
core/src/main/java/com/threerings/media/util/AStarPathUtil.java
AStarPathUtil.considerStep
protected static void considerStep (Info info, Node n, int x, int y, int cost) { // skip node if it's outside the map bounds or otherwise impassable if (!info.isStepValid(n.x, n.y, x, y)) { return; } // calculate the new cost for this node int newg = n.g + cost; // make sure the cost is reasonable if (newg > info.maxcost) { // Log.info("Rejected costly step."); return; } // retrieve the node corresponding to this location Node np = info.getNode(x, y); // skip if it's already in the open or closed list or if its // actual cost is less than the just-calculated cost if ((np.closed || info.open.contains(np)) && np.g <= newg) { return; } // remove the node from the open list since we're about to // modify its score which determines its placement in the list info.open.remove(np); // update the node's information np.parent = n; np.g = newg; np.h = getDistanceEstimate(np.x, np.y, info.destx, info.desty); np.f = np.g + np.h; // remove it from the closed list if it's present np.closed = false; // add it to the open list for further consideration info.open.add(np); _considered++; }
java
protected static void considerStep (Info info, Node n, int x, int y, int cost) { // skip node if it's outside the map bounds or otherwise impassable if (!info.isStepValid(n.x, n.y, x, y)) { return; } // calculate the new cost for this node int newg = n.g + cost; // make sure the cost is reasonable if (newg > info.maxcost) { // Log.info("Rejected costly step."); return; } // retrieve the node corresponding to this location Node np = info.getNode(x, y); // skip if it's already in the open or closed list or if its // actual cost is less than the just-calculated cost if ((np.closed || info.open.contains(np)) && np.g <= newg) { return; } // remove the node from the open list since we're about to // modify its score which determines its placement in the list info.open.remove(np); // update the node's information np.parent = n; np.g = newg; np.h = getDistanceEstimate(np.x, np.y, info.destx, info.desty); np.f = np.g + np.h; // remove it from the closed list if it's present np.closed = false; // add it to the open list for further consideration info.open.add(np); _considered++; }
[ "protected", "static", "void", "considerStep", "(", "Info", "info", ",", "Node", "n", ",", "int", "x", ",", "int", "y", ",", "int", "cost", ")", "{", "// skip node if it's outside the map bounds or otherwise impassable", "if", "(", "!", "info", ".", "isStepValid...
Consider the step <code>(n.x, n.y)</code> to <code>(x, y)</code> for possible inclusion in the path. @param info the info object. @param n the originating node for the step. @param x the x-coordinate for the destination step. @param y the y-coordinate for the destination step.
[ "Consider", "the", "step", "<code", ">", "(", "n", ".", "x", "n", ".", "y", ")", "<", "/", "code", ">", "to", "<code", ">", "(", "x", "y", ")", "<", "/", "code", ">", "for", "possible", "inclusion", "in", "the", "path", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/AStarPathUtil.java#L226-L267
alkacon/opencms-core
src/org/opencms/flex/CmsFlexCache.java
CmsFlexCache.getCachedKey
public CmsFlexCacheKey getCachedKey(String key, CmsObject cms) { if (!isEnabled() || !OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_MANAGER)) { return null; } Object o = m_keyCache.get(key); if (o != null) { return ((CmsFlexCacheVariation)o).m_key; } return null; }
java
public CmsFlexCacheKey getCachedKey(String key, CmsObject cms) { if (!isEnabled() || !OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_MANAGER)) { return null; } Object o = m_keyCache.get(key); if (o != null) { return ((CmsFlexCacheVariation)o).m_key; } return null; }
[ "public", "CmsFlexCacheKey", "getCachedKey", "(", "String", "key", ",", "CmsObject", "cms", ")", "{", "if", "(", "!", "isEnabled", "(", ")", "||", "!", "OpenCms", ".", "getRoleManager", "(", ")", ".", "hasRole", "(", "cms", ",", "CmsRole", ".", "WORKPLAC...
Returns the CmsFlexCacheKey data structure for a given key (i.e. resource name).<p> Useful if you want to show the cache key for a resources, like on the FlexCache administration page.<p> Only users with administrator permissions are allowed to perform this operation.<p> @param key the resource name for which to look up the variation for @param cms the CmsObject used for user authorization @return the CmsFlexCacheKey data structure found for the resource
[ "Returns", "the", "CmsFlexCacheKey", "data", "structure", "for", "a", "given", "key", "(", "i", ".", "e", ".", "resource", "name", ")", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexCache.java#L504-L514