repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
OpenLiberty/open-liberty
dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java
ProbeManagerImpl.addListenersForMonitor
boolean addListenersForMonitor(Object monitor, Set<ProbeListener> listeners) { """ Register a {@link Set} of listeners with its associated monitor. The configuration of each of the registered listeners is evaluated each time a class is initialized in the JVM. @param monitor the monitor instance that owns the ...
java
boolean addListenersForMonitor(Object monitor, Set<ProbeListener> listeners) { listenersLock.writeLock().lock(); try { if (listenersForMonitor.containsKey(monitor)) { return false; } listenersForMonitor.put(monitor, listeners); allRegistere...
[ "boolean", "addListenersForMonitor", "(", "Object", "monitor", ",", "Set", "<", "ProbeListener", ">", "listeners", ")", "{", "listenersLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "listenersForMonitor", ".", "contains...
Register a {@link Set} of listeners with its associated monitor. The configuration of each of the registered listeners is evaluated each time a class is initialized in the JVM. @param monitor the monitor instance that owns the listeners @param listeners the listeners associated with the monitor @return true iff the l...
[ "Register", "a", "{", "@link", "Set", "}", "of", "listeners", "with", "its", "associated", "monitor", ".", "The", "configuration", "of", "each", "of", "the", "registered", "listeners", "is", "evaluated", "each", "time", "a", "class", "is", "initialized", "in...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java#L427-L440
rolfl/MicroBench
src/main/java/net/tuis/ubench/UUtils.java
UUtils.readResource
public static String readResource(String path) { """ Load a resource stored in the classpath, as a String. @param path the system resource to read @return the resource as a String. """ final long start = System.nanoTime(); try (InputStream is = UScale.class.getClassLoader().getResourceAsSt...
java
public static String readResource(String path) { final long start = System.nanoTime(); try (InputStream is = UScale.class.getClassLoader().getResourceAsStream(path);) { int len = 0; byte[] buffer = new byte[2048]; ByteArrayOutputStream baos = new ByteArrayOutputStream...
[ "public", "static", "String", "readResource", "(", "String", "path", ")", "{", "final", "long", "start", "=", "System", ".", "nanoTime", "(", ")", ";", "try", "(", "InputStream", "is", "=", "UScale", ".", "class", ".", "getClassLoader", "(", ")", ".", ...
Load a resource stored in the classpath, as a String. @param path the system resource to read @return the resource as a String.
[ "Load", "a", "resource", "stored", "in", "the", "classpath", "as", "a", "String", "." ]
train
https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UUtils.java#L138-L158
tomasbjerre/git-changelog-lib
src/main/java/se/bjurr/gitchangelog/api/GitChangelogApi.java
GitChangelogApi.withCustomIssue
public GitChangelogApi withCustomIssue( final String name, final String pattern, final String link, final String title) { """ Custom issues are added to support any kind of issue management, perhaps something that is internal to your project. See {@link SettingsIssue}. """ this.settings.addCustomIss...
java
public GitChangelogApi withCustomIssue( final String name, final String pattern, final String link, final String title) { this.settings.addCustomIssue(new SettingsIssue(name, pattern, link, title)); return this; }
[ "public", "GitChangelogApi", "withCustomIssue", "(", "final", "String", "name", ",", "final", "String", "pattern", ",", "final", "String", "link", ",", "final", "String", "title", ")", "{", "this", ".", "settings", ".", "addCustomIssue", "(", "new", "SettingsI...
Custom issues are added to support any kind of issue management, perhaps something that is internal to your project. See {@link SettingsIssue}.
[ "Custom", "issues", "are", "added", "to", "support", "any", "kind", "of", "issue", "management", "perhaps", "something", "that", "is", "internal", "to", "your", "project", ".", "See", "{" ]
train
https://github.com/tomasbjerre/git-changelog-lib/blob/e6b26d29592a57bd53fe98fbe4a56d8c2267a192/src/main/java/se/bjurr/gitchangelog/api/GitChangelogApi.java#L156-L160
xmlunit/xmlunit
xmlunit-core/src/main/java/org/xmlunit/diff/DOMDifferenceEngine.java
DOMDifferenceEngine.compareNodeLists
private ComparisonState compareNodeLists(Iterable<Node> controlSeq, final XPathContext controlContext, Iterable<Node> testSeq, final XPathContext testContext) { """ Matches nodes o...
java
private ComparisonState compareNodeLists(Iterable<Node> controlSeq, final XPathContext controlContext, Iterable<Node> testSeq, final XPathContext testContext) { ComparisonState ...
[ "private", "ComparisonState", "compareNodeLists", "(", "Iterable", "<", "Node", ">", "controlSeq", ",", "final", "XPathContext", "controlContext", ",", "Iterable", "<", "Node", ">", "testSeq", ",", "final", "XPathContext", "testContext", ")", "{", "ComparisonState",...
Matches nodes of two node lists and invokes compareNode on each pair. <p>Also performs CHILD_LOOKUP comparisons for each node that couldn't be matched to one of the "other" list.</p>
[ "Matches", "nodes", "of", "two", "node", "lists", "and", "invokes", "compareNode", "on", "each", "pair", "." ]
train
https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DOMDifferenceEngine.java#L537-L580
QSFT/Doradus
doradus-common/src/main/java/com/dell/doradus/common/Utils.java
Utils.requireEmptyText
public static void requireEmptyText(Node node, String errMsg) throws IllegalArgumentException { """ Assert that the given org.w3c.doc.Node is a comment element or a Text element and that it ontains whitespace only, otherwise throw an IllegalArgumentException using the given error message. This is he...
java
public static void requireEmptyText(Node node, String errMsg) throws IllegalArgumentException { require((node instanceof Text) || (node instanceof Comment), errMsg + ": " + node.toString()); if (node instanceof Text) { Text text = (Text)node; Str...
[ "public", "static", "void", "requireEmptyText", "(", "Node", "node", ",", "String", "errMsg", ")", "throws", "IllegalArgumentException", "{", "require", "(", "(", "node", "instanceof", "Text", ")", "||", "(", "node", "instanceof", "Comment", ")", ",", "errMsg"...
Assert that the given org.w3c.doc.Node is a comment element or a Text element and that it ontains whitespace only, otherwise throw an IllegalArgumentException using the given error message. This is helpful when nothing is expected at a certain place in a DOM tree, yet comments or whitespace text nodes can appear. @par...
[ "Assert", "that", "the", "given", "org", ".", "w3c", ".", "doc", ".", "Node", "is", "a", "comment", "element", "or", "a", "Text", "element", "and", "that", "it", "ontains", "whitespace", "only", "otherwise", "throw", "an", "IllegalArgumentException", "using"...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1510-L1519
cchantep/acolyte
jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java
PreparedStatement.createBytes
private byte[] createBytes(InputStream stream, long length) throws SQLException { """ Creates bytes array from input stream. @param stream Input stream @param length """ ByteArrayOutputStream buff = null; try { buff = new ByteArrayOutputStream(); if (leng...
java
private byte[] createBytes(InputStream stream, long length) throws SQLException { ByteArrayOutputStream buff = null; try { buff = new ByteArrayOutputStream(); if (length > 0) IOUtils.copyLarge(stream, buff, 0, length); else IOUtils.copy(stream, buff); ...
[ "private", "byte", "[", "]", "createBytes", "(", "InputStream", "stream", ",", "long", "length", ")", "throws", "SQLException", "{", "ByteArrayOutputStream", "buff", "=", "null", ";", "try", "{", "buff", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "i...
Creates bytes array from input stream. @param stream Input stream @param length
[ "Creates", "bytes", "array", "from", "input", "stream", "." ]
train
https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L1054-L1071
Azure/azure-sdk-for-java
datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java
AccountsInner.updateAsync
public Observable<DataLakeStoreAccountInner> updateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { """ Updates the specified Data Lake Store account information. @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. @param ...
java
public Observable<DataLakeStoreAccountInner> updateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<DataLakeStoreAccountInner>, DataLakeStoreAccountInner>() { ...
[ "public", "Observable", "<", "DataLakeStoreAccountInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "name", ",", "DataLakeStoreAccountInner", "parameters", ")", "{", "return", "updateWithServiceResponseAsync", "(", "resourceGroupName", ",", "n...
Updates the specified Data Lake Store account information. @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. @param name The name of the Data Lake Store account to update. @param parameters Parameters supplied to update the Data Lake Store account. @throws Illegal...
[ "Updates", "the", "specified", "Data", "Lake", "Store", "account", "information", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java#L759-L766
alipay/sofa-rpc
core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConfigs.java
RpcConfigs.unSubscribe
public static synchronized void unSubscribe(String key, RpcConfigListener listener) { """ 取消订阅配置变化 @param key 关键字 @param listener 配置监听器 @see RpcOptions """ List<RpcConfigListener> listeners = CFG_LISTENER.get(key); if (listeners != null) { listeners.remove(listener); ...
java
public static synchronized void unSubscribe(String key, RpcConfigListener listener) { List<RpcConfigListener> listeners = CFG_LISTENER.get(key); if (listeners != null) { listeners.remove(listener); if (listeners.size() == 0) { CFG_LISTENER.remove(key); ...
[ "public", "static", "synchronized", "void", "unSubscribe", "(", "String", "key", ",", "RpcConfigListener", "listener", ")", "{", "List", "<", "RpcConfigListener", ">", "listeners", "=", "CFG_LISTENER", ".", "get", "(", "key", ")", ";", "if", "(", "listeners", ...
取消订阅配置变化 @param key 关键字 @param listener 配置监听器 @see RpcOptions
[ "取消订阅配置变化" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConfigs.java#L332-L340
westnordost/osmapi
src/main/java/de/westnordost/osmapi/map/MapDataDao.java
MapDataDao.getRelationComplete
public void getRelationComplete(long id, MapDataHandler handler) { """ Queries the relation with the given id plus all it's members and all nodes of ways that are members of the relation.<br> If not logged in, the Changeset for each returned element will be null @param id the way's id @param handler map data...
java
public void getRelationComplete(long id, MapDataHandler handler) { boolean authenticate = osm.getOAuth() != null; osm.makeRequest(RELATION + "/" + id + "/" + FULL, authenticate, new MapDataParser(handler, factory)); }
[ "public", "void", "getRelationComplete", "(", "long", "id", ",", "MapDataHandler", "handler", ")", "{", "boolean", "authenticate", "=", "osm", ".", "getOAuth", "(", ")", "!=", "null", ";", "osm", ".", "makeRequest", "(", "RELATION", "+", "\"/\"", "+", "id"...
Queries the relation with the given id plus all it's members and all nodes of ways that are members of the relation.<br> If not logged in, the Changeset for each returned element will be null @param id the way's id @param handler map data handler that is fed the map data @throws OsmNotFoundException if the relation w...
[ "Queries", "the", "relation", "with", "the", "given", "id", "plus", "all", "it", "s", "members", "and", "all", "nodes", "of", "ways", "that", "are", "members", "of", "the", "relation", ".", "<br", ">", "If", "not", "logged", "in", "the", "Changeset", "...
train
https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/map/MapDataDao.java#L240-L244
OpenLiberty/open-liberty
dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/MonitoringProxyActivator.java
MonitoringProxyActivator.writeRemappedClass
private void writeRemappedClass(URL classUrl, JarOutputStream jarStream, String targetPackage) throws IOException { """ Transform the proxy template class that's in this package into a class that's in a package on the framework boot delegation package list. @return the byte array containing the updated class ...
java
private void writeRemappedClass(URL classUrl, JarOutputStream jarStream, String targetPackage) throws IOException { InputStream inputStream = classUrl.openStream(); String sourceInternalName = getClassInternalName(classUrl); String targetInternalName = getTargetInternalName(sourceInternalName, t...
[ "private", "void", "writeRemappedClass", "(", "URL", "classUrl", ",", "JarOutputStream", "jarStream", ",", "String", "targetPackage", ")", "throws", "IOException", "{", "InputStream", "inputStream", "=", "classUrl", ".", "openStream", "(", ")", ";", "String", "sou...
Transform the proxy template class that's in this package into a class that's in a package on the framework boot delegation package list. @return the byte array containing the updated class @throws IOException if an IO exception raised while processing the class
[ "Transform", "the", "proxy", "template", "class", "that", "s", "in", "this", "package", "into", "a", "class", "that", "s", "in", "a", "package", "on", "the", "framework", "boot", "delegation", "package", "list", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/MonitoringProxyActivator.java#L289-L304
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseUtil.java
BpmnParseUtil.parseCamundaScript
public static ExecutableScript parseCamundaScript(Element scriptElement) { """ Parses a camunda script element. @param scriptElement the script element ot parse @return the generated executable script @throws BpmnParseException if the a attribute is missing or the script cannot be processed """ String...
java
public static ExecutableScript parseCamundaScript(Element scriptElement) { String scriptLanguage = scriptElement.attribute("scriptFormat"); if (scriptLanguage == null || scriptLanguage.isEmpty()) { throw new BpmnParseException("Missing attribute 'scriptFormatAttribute' for 'script' element", scriptElement...
[ "public", "static", "ExecutableScript", "parseCamundaScript", "(", "Element", "scriptElement", ")", "{", "String", "scriptLanguage", "=", "scriptElement", ".", "attribute", "(", "\"scriptFormat\"", ")", ";", "if", "(", "scriptLanguage", "==", "null", "||", "scriptLa...
Parses a camunda script element. @param scriptElement the script element ot parse @return the generated executable script @throws BpmnParseException if the a attribute is missing or the script cannot be processed
[ "Parses", "a", "camunda", "script", "element", "." ]
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseUtil.java#L223-L238
pvanassen/ns-api
src/main/java/nl/pvanassen/ns/RequestBuilder.java
RequestBuilder.getPrijzen
public static ApiRequest<Prijzen> getPrijzen(String fromStation, String toStation, String viaStation, Date dateTime) { """ Builds a request to get all fares for a ride between station from, to station to. See <a href="http://www.ns.nl/api/api#api-documentatie-prij...
java
public static ApiRequest<Prijzen> getPrijzen(String fromStation, String toStation, String viaStation, Date dateTime) { return new PrijzenRequest(fromStation, toStation, viaStation, dateTime); }
[ "public", "static", "ApiRequest", "<", "Prijzen", ">", "getPrijzen", "(", "String", "fromStation", ",", "String", "toStation", ",", "String", "viaStation", ",", "Date", "dateTime", ")", "{", "return", "new", "PrijzenRequest", "(", "fromStation", ",", "toStation"...
Builds a request to get all fares for a ride between station from, to station to. See <a href="http://www.ns.nl/api/api#api-documentatie-prijzen">prijzen</a> @param fromStation Starting point of the trip @param toStation End point of the trip @param viaStation Also go to this station @param dateTime Date and time to u...
[ "Builds", "a", "request", "to", "get", "all", "fares", "for", "a", "ride", "between", "station", "from", "to", "station", "to", ".", "See", "<a", "href", "=", "http", ":", "//", "www", ".", "ns", ".", "nl", "/", "api", "/", "api#api", "-", "documen...
train
https://github.com/pvanassen/ns-api/blob/e90e01028a0eb24006e4fddd4c85e7a25c4fe0ae/src/main/java/nl/pvanassen/ns/RequestBuilder.java#L136-L139
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FileSystem.java
FileSystem.initialize
public void initialize(URI name, Configuration conf) throws IOException { """ Called after a new FileSystem instance is constructed. @param name a uri whose authority section names the host, port, etc. for this FileSystem @param conf the configuration """ statistics = getStatistics(name.getScheme(), get...
java
public void initialize(URI name, Configuration conf) throws IOException { statistics = getStatistics(name.getScheme(), getClass()); }
[ "public", "void", "initialize", "(", "URI", "name", ",", "Configuration", "conf", ")", "throws", "IOException", "{", "statistics", "=", "getStatistics", "(", "name", ".", "getScheme", "(", ")", ",", "getClass", "(", ")", ")", ";", "}" ]
Called after a new FileSystem instance is constructed. @param name a uri whose authority section names the host, port, etc. for this FileSystem @param conf the configuration
[ "Called", "after", "a", "new", "FileSystem", "instance", "is", "constructed", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L141-L143
tvesalainen/util
util/src/main/java/org/vesalainen/util/concurrent/TaggableThread.java
TaggableThread.addCompleter
public static void addCompleter(BiConsumer<Map<Object,Object>,Long> completer) { """ Add a completer whose parameters are tag map and elapsed time in milliseconds. After thread run completers are called. @param completer """ Thread currentThread = Thread.currentThread(); if (currentThread i...
java
public static void addCompleter(BiConsumer<Map<Object,Object>,Long> completer) { Thread currentThread = Thread.currentThread(); if (currentThread instanceof TaggableThread) { TaggableThread taggableThread = (TaggableThread) currentThread; taggableThread.addMe(co...
[ "public", "static", "void", "addCompleter", "(", "BiConsumer", "<", "Map", "<", "Object", ",", "Object", ">", ",", "Long", ">", "completer", ")", "{", "Thread", "currentThread", "=", "Thread", ".", "currentThread", "(", ")", ";", "if", "(", "currentThread"...
Add a completer whose parameters are tag map and elapsed time in milliseconds. After thread run completers are called. @param completer
[ "Add", "a", "completer", "whose", "parameters", "are", "tag", "map", "and", "elapsed", "time", "in", "milliseconds", ".", "After", "thread", "run", "completers", "are", "called", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/concurrent/TaggableThread.java#L46-L54
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/SerializationUtils.java
SerializationUtils.deserializeFromBytes
public static <T extends Serializable> T deserializeFromBytes(byte[] serialized, Class<T> clazz) throws IOException { """ Deserialize a String obtained via {@link #serializeIntoBytes(Serializable)} into an object. @param serialized The serialized bytes @param clazz The class the deserialized object shoul...
java
public static <T extends Serializable> T deserializeFromBytes(byte[] serialized, Class<T> clazz) throws IOException { try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(serialized))) { return clazz.cast(ois.readObject()); } catch (ClassNotFoundException e) { throw new...
[ "public", "static", "<", "T", "extends", "Serializable", ">", "T", "deserializeFromBytes", "(", "byte", "[", "]", "serialized", ",", "Class", "<", "T", ">", "clazz", ")", "throws", "IOException", "{", "try", "(", "ObjectInputStream", "ois", "=", "new", "Ob...
Deserialize a String obtained via {@link #serializeIntoBytes(Serializable)} into an object. @param serialized The serialized bytes @param clazz The class the deserialized object should be cast to. @return The deserialized object @throws IOException if it fails to deserialize the object
[ "Deserialize", "a", "String", "obtained", "via", "{", "@link", "#serializeIntoBytes", "(", "Serializable", ")", "}", "into", "an", "object", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/SerializationUtils.java#L122-L130
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java
StereoConsistencyCheck.checkPixel
public boolean checkPixel( Point2D_F64 left , Point2D_F64 right ) { """ Checks to see if the observations from the left and right camera are consistent. Observations are assumed to be in the original image pixel coordinates. @param left Left camera observation in original pixels @param right Right camera obs...
java
public boolean checkPixel( Point2D_F64 left , Point2D_F64 right ) { leftImageToRect.compute(left.x,left.y,rectLeft); rightImageToRect.compute(right.x, right.y, rectRight); return checkRectified(rectLeft,rectRight); }
[ "public", "boolean", "checkPixel", "(", "Point2D_F64", "left", ",", "Point2D_F64", "right", ")", "{", "leftImageToRect", ".", "compute", "(", "left", ".", "x", ",", "left", ".", "y", ",", "rectLeft", ")", ";", "rightImageToRect", ".", "compute", "(", "righ...
Checks to see if the observations from the left and right camera are consistent. Observations are assumed to be in the original image pixel coordinates. @param left Left camera observation in original pixels @param right Right camera observation in original pixels @return true for consistent
[ "Checks", "to", "see", "if", "the", "observations", "from", "the", "left", "and", "right", "camera", "are", "consistent", ".", "Observations", "are", "assumed", "to", "be", "in", "the", "original", "image", "pixel", "coordinates", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java#L87-L92
Azure/azure-sdk-for-java
policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java
PolicyStatesInner.summarizeForManagementGroupAsync
public Observable<SummarizeResultsInner> summarizeForManagementGroupAsync(String managementGroupName, QueryOptions queryOptions) { """ Summarizes policy states for the resources under the management group. @param managementGroupName Management group name. @param queryOptions Additional parameters for the opera...
java
public Observable<SummarizeResultsInner> summarizeForManagementGroupAsync(String managementGroupName, QueryOptions queryOptions) { return summarizeForManagementGroupWithServiceResponseAsync(managementGroupName, queryOptions).map(new Func1<ServiceResponse<SummarizeResultsInner>, SummarizeResultsInner>() { ...
[ "public", "Observable", "<", "SummarizeResultsInner", ">", "summarizeForManagementGroupAsync", "(", "String", "managementGroupName", ",", "QueryOptions", "queryOptions", ")", "{", "return", "summarizeForManagementGroupWithServiceResponseAsync", "(", "managementGroupName", ",", ...
Summarizes policy states for the resources under the management group. @param managementGroupName Management group name. @param queryOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the SummarizeResultsInner object
[ "Summarizes", "policy", "states", "for", "the", "resources", "under", "the", "management", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L442-L449
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Operation.java
Operation.setLeftRight
public void setLeftRight(Expression l, Expression r) { """ Set the left and right operand expressions for this operation. @param l The left expression operand. @param r The right expression operand. """ m_left = l; m_right = r; l.exprSetParent(this); r.exprSetParent(this); }
java
public void setLeftRight(Expression l, Expression r) { m_left = l; m_right = r; l.exprSetParent(this); r.exprSetParent(this); }
[ "public", "void", "setLeftRight", "(", "Expression", "l", ",", "Expression", "r", ")", "{", "m_left", "=", "l", ";", "m_right", "=", "r", ";", "l", ".", "exprSetParent", "(", "this", ")", ";", "r", ".", "exprSetParent", "(", "this", ")", ";", "}" ]
Set the left and right operand expressions for this operation. @param l The left expression operand. @param r The right expression operand.
[ "Set", "the", "left", "and", "right", "operand", "expressions", "for", "this", "operation", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Operation.java#L86-L92
alkacon/opencms-core
src/org/opencms/ui/apps/logfile/CmsLogFileApp.java
CmsLogFileApp.addDownloadButton
private void addDownloadButton(final CmsLogFileView view) { """ Adds the download button. @param view layout which displays the log file """ Button button = CmsToolBar.createButton( FontOpenCms.DOWNLOAD, CmsVaadinUtils.getMessageText(Messages.GUI_LOGFILE_DOWNLOAD_0)); ...
java
private void addDownloadButton(final CmsLogFileView view) { Button button = CmsToolBar.createButton( FontOpenCms.DOWNLOAD, CmsVaadinUtils.getMessageText(Messages.GUI_LOGFILE_DOWNLOAD_0)); button.addClickListener(new ClickListener() { private static final long serial...
[ "private", "void", "addDownloadButton", "(", "final", "CmsLogFileView", "view", ")", "{", "Button", "button", "=", "CmsToolBar", ".", "createButton", "(", "FontOpenCms", ".", "DOWNLOAD", ",", "CmsVaadinUtils", ".", "getMessageText", "(", "Messages", ".", "GUI_LOGF...
Adds the download button. @param view layout which displays the log file
[ "Adds", "the", "download", "button", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/logfile/CmsLogFileApp.java#L253-L271
javalite/activejdbc
activejdbc/src/main/java/org/javalite/activejdbc/Model.java
Model.setFloat
public <T extends Model> T setFloat(String attributeName, Object value) { """ Sets attribute value as <code>Float</code>. If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class <code>java.lang.Float</code>, given the value is an instance of <code>S</code>, t...
java
public <T extends Model> T setFloat(String attributeName, Object value) { Converter<Object, Float> converter = modelRegistryLocal.converterForValue(attributeName, value, Float.class); return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toFloat(value)); }
[ "public", "<", "T", "extends", "Model", ">", "T", "setFloat", "(", "String", "attributeName", ",", "Object", "value", ")", "{", "Converter", "<", "Object", ",", "Float", ">", "converter", "=", "modelRegistryLocal", ".", "converterForValue", "(", "attributeName...
Sets attribute value as <code>Float</code>. If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class <code>java.lang.Float</code>, given the value is an instance of <code>S</code>, then it will be used, otherwise performs a conversion using {@link Convert#toFloat(Obj...
[ "Sets", "attribute", "value", "as", "<code", ">", "Float<", "/", "code", ">", ".", "If", "there", "is", "a", "{", "@link", "Converter", "}", "registered", "for", "the", "attribute", "that", "converts", "from", "Class", "<code", ">", "S<", "/", "code", ...
train
https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1786-L1789
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/curves/PrecisionRecallCurve.java
PrecisionRecallCurve.getPointAtRecall
public Point getPointAtRecall(double recall) { """ Get the point (index, threshold, precision, recall) at the given recall.<br> Specifically, return the points at the highest threshold that has recall equal to or greater than the requested recall. @param recall Recall to get the point for @return point (inde...
java
public Point getPointAtRecall(double recall) { Point foundPoint = null; //Find the HIGHEST threshold that gives the specified recall for (int i = this.recall.length - 1; i >= 0; i--) { if (this.recall[i] >= recall) { if (foundPoint == null ||(this.recall[i...
[ "public", "Point", "getPointAtRecall", "(", "double", "recall", ")", "{", "Point", "foundPoint", "=", "null", ";", "//Find the HIGHEST threshold that gives the specified recall", "for", "(", "int", "i", "=", "this", ".", "recall", ".", "length", "-", "1", ";", "...
Get the point (index, threshold, precision, recall) at the given recall.<br> Specifically, return the points at the highest threshold that has recall equal to or greater than the requested recall. @param recall Recall to get the point for @return point (index, threshold, precision, recall) at (or closest exceeding) th...
[ "Get", "the", "point", "(", "index", "threshold", "precision", "recall", ")", "at", "the", "given", "recall", ".", "<br", ">", "Specifically", "return", "the", "points", "at", "the", "highest", "threshold", "that", "has", "recall", "equal", "to", "or", "gr...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/curves/PrecisionRecallCurve.java#L184-L199
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java
BaseAmqpService.convertMessage
@SuppressWarnings("unchecked") public <T> T convertMessage(@NotNull final Message message, final Class<T> clazz) { """ Is needed to convert a incoming message to is originally object type. @param message the message to convert. @param clazz the class of the originally object. @return the converted objec...
java
@SuppressWarnings("unchecked") public <T> T convertMessage(@NotNull final Message message, final Class<T> clazz) { checkMessageBody(message); message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME, clazz.getName()); return (T) rabbit...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "convertMessage", "(", "@", "NotNull", "final", "Message", "message", ",", "final", "Class", "<", "T", ">", "clazz", ")", "{", "checkMessageBody", "(", "message", ")", ";", ...
Is needed to convert a incoming message to is originally object type. @param message the message to convert. @param clazz the class of the originally object. @return the converted object
[ "Is", "needed", "to", "convert", "a", "incoming", "message", "to", "is", "originally", "object", "type", "." ]
train
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java#L60-L66
getsentry/sentry-java
sentry/src/main/java/io/sentry/connection/HttpConnection.java
HttpConnection.getConnection
protected HttpURLConnection getConnection() { """ Opens a connection to the Sentry API allowing to send new events. @return an HTTP connection to Sentry. """ try { HttpURLConnection connection; if (proxy != null) { connection = (HttpURLConnection) sentryUrl.op...
java
protected HttpURLConnection getConnection() { try { HttpURLConnection connection; if (proxy != null) { connection = (HttpURLConnection) sentryUrl.openConnection(proxy); } else { connection = (HttpURLConnection) sentryUrl.openConnection(); ...
[ "protected", "HttpURLConnection", "getConnection", "(", ")", "{", "try", "{", "HttpURLConnection", "connection", ";", "if", "(", "proxy", "!=", "null", ")", "{", "connection", "=", "(", "HttpURLConnection", ")", "sentryUrl", ".", "openConnection", "(", "proxy", ...
Opens a connection to the Sentry API allowing to send new events. @return an HTTP connection to Sentry.
[ "Opens", "a", "connection", "to", "the", "Sentry", "API", "allowing", "to", "send", "new", "events", "." ]
train
https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/connection/HttpConnection.java#L127-L158
davidmoten/geo
geo/src/main/java/com/github/davidmoten/geo/GeoHash.java
GeoHash.encodeHash
public static String encodeHash(LatLong p, int length) { """ Returns a geohash of given length for the given WGS84 point. @param p point @param length length of hash @return hash at point of given length """ return encodeHash(p.getLat(), p.getLon(), length); }
java
public static String encodeHash(LatLong p, int length) { return encodeHash(p.getLat(), p.getLon(), length); }
[ "public", "static", "String", "encodeHash", "(", "LatLong", "p", ",", "int", "length", ")", "{", "return", "encodeHash", "(", "p", ".", "getLat", "(", ")", ",", "p", ".", "getLon", "(", ")", ",", "length", ")", ";", "}" ]
Returns a geohash of given length for the given WGS84 point. @param p point @param length length of hash @return hash at point of given length
[ "Returns", "a", "geohash", "of", "given", "length", "for", "the", "given", "WGS84", "point", "." ]
train
https://github.com/davidmoten/geo/blob/e90d2f406133cd9b60d54a3e6bdb7423d7fcce37/geo/src/main/java/com/github/davidmoten/geo/GeoHash.java#L318-L320
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java
TransactionLocalMap.put
public void put(TransactionLocal key, Object value) { """ Set the value associated with key. @param key the thread local object @param value the value to be set """ // We don't use a fast path as with get() because it is at // least as common to use set() to create new entries as ...
java
public void put(TransactionLocal key, Object value) { // We don't use a fast path as with get() because it is at // least as common to use set() to create new entries as // it is to replace existing ones, in which case, a fast // path would fail more often than not. ...
[ "public", "void", "put", "(", "TransactionLocal", "key", ",", "Object", "value", ")", "{", "// We don't use a fast path as with get() because it is at\r", "// least as common to use set() to create new entries as\r", "// it is to replace existing ones, in which case, a fast\r", "// path ...
Set the value associated with key. @param key the thread local object @param value the value to be set
[ "Set", "the", "value", "associated", "with", "key", "." ]
train
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/transaction/TransactionLocalMap.java#L142-L169
baratine/baratine
web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java
Strategy2StartManualRedeployManual.startOnInit
@Override public void startOnInit(DeployService2Impl<I> deploy, Result<I> result) { """ Called at initialization time for automatic start. @param deploy the owning controller """ deploy.startImpl(result); }
java
@Override public void startOnInit(DeployService2Impl<I> deploy, Result<I> result) { deploy.startImpl(result); }
[ "@", "Override", "public", "void", "startOnInit", "(", "DeployService2Impl", "<", "I", ">", "deploy", ",", "Result", "<", "I", ">", "result", ")", "{", "deploy", ".", "startImpl", "(", "result", ")", ";", "}" ]
Called at initialization time for automatic start. @param deploy the owning controller
[ "Called", "at", "initialization", "time", "for", "automatic", "start", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java#L83-L87
SonarSource/sonarqube
server/sonar-db-core/src/main/java/org/sonar/db/DatabaseUtils.java
DatabaseUtils.executeLargeUpdates
public static <INPUT extends Comparable<INPUT>> void executeLargeUpdates(Collection<INPUT> inputs, Consumer<List<INPUT>> consumer) { """ Partition by 1000 elements a list of input and execute a consumer on each part. The goal is to prevent issue with ORACLE when there's more than 1000 elements in a 'in ('X', 'Y...
java
public static <INPUT extends Comparable<INPUT>> void executeLargeUpdates(Collection<INPUT> inputs, Consumer<List<INPUT>> consumer) { executeLargeUpdates(inputs, consumer, i -> i); }
[ "public", "static", "<", "INPUT", "extends", "Comparable", "<", "INPUT", ">", ">", "void", "executeLargeUpdates", "(", "Collection", "<", "INPUT", ">", "inputs", ",", "Consumer", "<", "List", "<", "INPUT", ">", ">", "consumer", ")", "{", "executeLargeUpdates...
Partition by 1000 elements a list of input and execute a consumer on each part. The goal is to prevent issue with ORACLE when there's more than 1000 elements in a 'in ('X', 'Y', ...)' and with MsSQL when there's more than 2000 parameters in a query
[ "Partition", "by", "1000", "elements", "a", "list", "of", "input", "and", "execute", "a", "consumer", "on", "each", "part", "." ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseUtils.java#L148-L150
intellimate/Izou
src/main/java/org/intellimate/izou/system/logger/IzouLogger.java
IzouLogger.createFileLogger
public synchronized ExtendedLogger createFileLogger(String addOnId, String level) { """ Creates a new file-logger for an addOn. The logger will log to a file with the addOnId as name in the logs folder of Izou @param addOnId the Id of the addOn the logger is created for @param level level of logger (at what l...
java
public synchronized ExtendedLogger createFileLogger(String addOnId, String level) { try { LoggerContext ctx = LogManager.getContext(false); Configuration config = ((org.apache.logging.log4j.core.LoggerContext) ctx).getConfiguration(); //creates a new pattern layout (what det...
[ "public", "synchronized", "ExtendedLogger", "createFileLogger", "(", "String", "addOnId", ",", "String", "level", ")", "{", "try", "{", "LoggerContext", "ctx", "=", "LogManager", ".", "getContext", "(", "false", ")", ";", "Configuration", "config", "=", "(", "...
Creates a new file-logger for an addOn. The logger will log to a file with the addOnId as name in the logs folder of Izou @param addOnId the Id of the addOn the logger is created for @param level level of logger (at what level of log the logger should be activated @return the new logger
[ "Creates", "a", "new", "file", "-", "logger", "for", "an", "addOn", ".", "The", "logger", "will", "log", "to", "a", "file", "with", "the", "addOnId", "as", "name", "in", "the", "logs", "folder", "of", "Izou" ]
train
https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/system/logger/IzouLogger.java#L33-L75
aws/aws-sdk-java
aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/DescribeProvisioningArtifactResult.java
DescribeProvisioningArtifactResult.withInfo
public DescribeProvisioningArtifactResult withInfo(java.util.Map<String, String> info) { """ <p> The URL of the CloudFormation template in Amazon S3. </p> @param info The URL of the CloudFormation template in Amazon S3. @return Returns a reference to this object so that method calls can be chained together....
java
public DescribeProvisioningArtifactResult withInfo(java.util.Map<String, String> info) { setInfo(info); return this; }
[ "public", "DescribeProvisioningArtifactResult", "withInfo", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "info", ")", "{", "setInfo", "(", "info", ")", ";", "return", "this", ";", "}" ]
<p> The URL of the CloudFormation template in Amazon S3. </p> @param info The URL of the CloudFormation template in Amazon S3. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "URL", "of", "the", "CloudFormation", "template", "in", "Amazon", "S3", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/DescribeProvisioningArtifactResult.java#L120-L123
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/lss/LssClient.java
LssClient.listAppStreams
public ListAppStreamsResponse listAppStreams(String app, String status) { """ list your streams by app name and stream status @param app app name @param status stream status @return the response """ ListAppStreamsRequest request = new ListAppStreamsRequest(); request.setApp(app); r...
java
public ListAppStreamsResponse listAppStreams(String app, String status) { ListAppStreamsRequest request = new ListAppStreamsRequest(); request.setApp(app); request.setStatus(status); return listAppStreams(request); }
[ "public", "ListAppStreamsResponse", "listAppStreams", "(", "String", "app", ",", "String", "status", ")", "{", "ListAppStreamsRequest", "request", "=", "new", "ListAppStreamsRequest", "(", ")", ";", "request", ".", "setApp", "(", "app", ")", ";", "request", ".",...
list your streams by app name and stream status @param app app name @param status stream status @return the response
[ "list", "your", "streams", "by", "app", "name", "and", "stream", "status" ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L863-L868
nmorel/gwt-jackson
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/ObjectMapperCreator.java
ObjectMapperCreator.extractMappedType
private JClassType extractMappedType( JClassType interfaceClass ) throws UnableToCompleteException { """ Extract the type to map from the interface. @param interfaceClass the interface @return the extracted type to map @throws UnableToCompleteException if we don't find the type """ JClassType in...
java
private JClassType extractMappedType( JClassType interfaceClass ) throws UnableToCompleteException { JClassType intf = interfaceClass.isInterface(); if ( intf == null ) { logger.log( TreeLogger.Type.ERROR, "Expected " + interfaceClass + " to be an interface." ); throw new UnableT...
[ "private", "JClassType", "extractMappedType", "(", "JClassType", "interfaceClass", ")", "throws", "UnableToCompleteException", "{", "JClassType", "intf", "=", "interfaceClass", ".", "isInterface", "(", ")", ";", "if", "(", "intf", "==", "null", ")", "{", "logger",...
Extract the type to map from the interface. @param interfaceClass the interface @return the extracted type to map @throws UnableToCompleteException if we don't find the type
[ "Extract", "the", "type", "to", "map", "from", "the", "interface", "." ]
train
https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/ObjectMapperCreator.java#L157-L177
languagetool-org/languagetool
languagetool-core/src/main/java/org/languagetool/rules/patterns/MatchState.java
MatchState.convertCase
String convertCase(String s, String sample, Language lang) { """ Converts case of the string token according to match element attributes. @param s Token to be converted. @param sample the sample string used to determine how the original string looks like (used only on case preservation) @return Converted string...
java
String convertCase(String s, String sample, Language lang) { return CaseConversionHelper.convertCase(match.getCaseConversionType(), s, sample, lang); }
[ "String", "convertCase", "(", "String", "s", ",", "String", "sample", ",", "Language", "lang", ")", "{", "return", "CaseConversionHelper", ".", "convertCase", "(", "match", ".", "getCaseConversionType", "(", ")", ",", "s", ",", "sample", ",", "lang", ")", ...
Converts case of the string token according to match element attributes. @param s Token to be converted. @param sample the sample string used to determine how the original string looks like (used only on case preservation) @return Converted string.
[ "Converts", "case", "of", "the", "string", "token", "according", "to", "match", "element", "attributes", "." ]
train
https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/MatchState.java#L181-L183
eclipse/xtext-extras
org.eclipse.xtext.xbase/xtend-gen/org/eclipse/xtext/xbase/validation/UniqueClassNameValidator.java
UniqueClassNameValidator.addIssue
protected void addIssue(final JvmDeclaredType type, final String fileName) { """ Marks a type as already defined. @param type - the type to mark already defined. @param fileName - a file where the type is already defined. If fileName is null this information will not be part of the message. """ String...
java
protected void addIssue(final JvmDeclaredType type, final String fileName) { StringConcatenation _builder = new StringConcatenation(); _builder.append("The type "); String _simpleName = type.getSimpleName(); _builder.append(_simpleName); _builder.append(" is already defined"); { if ((fileN...
[ "protected", "void", "addIssue", "(", "final", "JvmDeclaredType", "type", ",", "final", "String", "fileName", ")", "{", "StringConcatenation", "_builder", "=", "new", "StringConcatenation", "(", ")", ";", "_builder", ".", "append", "(", "\"The type \"", ")", ";"...
Marks a type as already defined. @param type - the type to mark already defined. @param fileName - a file where the type is already defined. If fileName is null this information will not be part of the message.
[ "Marks", "a", "type", "as", "already", "defined", "." ]
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/xtend-gen/org/eclipse/xtext/xbase/validation/UniqueClassNameValidator.java#L138-L159
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/IntStream.java
IntStream.peek
@NotNull public IntStream peek(@NotNull final IntConsumer action) { """ Returns a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream. Handy method for debugging purposes. <p>This is an intermediat...
java
@NotNull public IntStream peek(@NotNull final IntConsumer action) { return new IntStream(params, new IntPeek(iterator, action)); }
[ "@", "NotNull", "public", "IntStream", "peek", "(", "@", "NotNull", "final", "IntConsumer", "action", ")", "{", "return", "new", "IntStream", "(", "params", ",", "new", "IntPeek", "(", "iterator", ",", "action", ")", ")", ";", "}" ]
Returns a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream. Handy method for debugging purposes. <p>This is an intermediate operation. @param action the action to be performed on each element @return the ne...
[ "Returns", "a", "stream", "consisting", "of", "the", "elements", "of", "this", "stream", "additionally", "performing", "the", "provided", "action", "on", "each", "element", "as", "elements", "are", "consumed", "from", "the", "resulting", "stream", ".", "Handy", ...
train
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L680-L683
maxmind/geoip-api-java
src/main/java/com/maxmind/geoip/LookupService.java
LookupService.getCountry
public synchronized Country getCountry(long ipAddress) { """ Returns the country the IP address is in. @param ipAddress the IP address in long format. @return the country the IP address is from. """ if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateExce...
java
public synchronized Country getCountry(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - COUNTRY_BEGIN; if (ret == 0) { return UNKNOWN_C...
[ "public", "synchronized", "Country", "getCountry", "(", "long", "ipAddress", ")", "{", "if", "(", "file", "==", "null", "&&", "(", "dboptions", "&", "GEOIP_MEMORY_CACHE", ")", "==", "0", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Database has b...
Returns the country the IP address is in. @param ipAddress the IP address in long format. @return the country the IP address is from.
[ "Returns", "the", "country", "the", "IP", "address", "is", "in", "." ]
train
https://github.com/maxmind/geoip-api-java/blob/baae36617ba6c5004370642716bc6e526774ba87/src/main/java/com/maxmind/geoip/LookupService.java#L491-L501
HolmesNL/kafka-spout
src/main/java/nl/minvenj/nfi/storm/kafka/KafkaSpout.java
KafkaSpout.createConsumer
protected void createConsumer(final Map<String, Object> config) { """ Ensures an initialized kafka {@link ConsumerConnector} is present. @param config The storm configuration passed to {@link #open(Map, TopologyContext, SpoutOutputCollector)}. @throws IllegalArgumentException When a required configuration para...
java
protected void createConsumer(final Map<String, Object> config) { final Properties consumerConfig = createKafkaConfig(config); LOG.info("connecting kafka client to zookeeper at {} as client group {}", consumerConfig.getProperty("zookeeper.connect"), consumerConfig.getProperty("g...
[ "protected", "void", "createConsumer", "(", "final", "Map", "<", "String", ",", "Object", ">", "config", ")", "{", "final", "Properties", "consumerConfig", "=", "createKafkaConfig", "(", "config", ")", ";", "LOG", ".", "info", "(", "\"connecting kafka client to ...
Ensures an initialized kafka {@link ConsumerConnector} is present. @param config The storm configuration passed to {@link #open(Map, TopologyContext, SpoutOutputCollector)}. @throws IllegalArgumentException When a required configuration parameter is missing or a sanity check fails.
[ "Ensures", "an", "initialized", "kafka", "{", "@link", "ConsumerConnector", "}", "is", "present", "." ]
train
https://github.com/HolmesNL/kafka-spout/blob/bef626b9fab6946a7e0d3c85979ec36ae0870233/src/main/java/nl/minvenj/nfi/storm/kafka/KafkaSpout.java#L170-L177
xiancloud/xian
xian-core/src/main/java/info/xiancloud/core/thread_pool/SingleThreadExecutorGroup.java
SingleThreadExecutorGroup.execute
public void execute(int key, Runnable runnable) { """ sticky executor @param key sticky key @param runnable the task """ if (StringUtil.isEmpty(key)) { throw new IllegalArgumentException("入参key不允许为空!"); } int mod = Math.abs(key % map.size()); LOG.debug("_seq...
java
public void execute(int key, Runnable runnable) { if (StringUtil.isEmpty(key)) { throw new IllegalArgumentException("入参key不允许为空!"); } int mod = Math.abs(key % map.size()); LOG.debug("_sequential 选取第" + mod + "根线程执行任务,threadKey=" + key); ThreadPoolExecutor executor =...
[ "public", "void", "execute", "(", "int", "key", ",", "Runnable", "runnable", ")", "{", "if", "(", "StringUtil", ".", "isEmpty", "(", "key", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"入参key不允许为空!\");", "", "", "}", "int", "mod", "=...
sticky executor @param key sticky key @param runnable the task
[ "sticky", "executor" ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/thread_pool/SingleThreadExecutorGroup.java#L55-L63
qos-ch/slf4j
jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SLF4JLog.java
SLF4JLog.debug
public void debug(Object message, Throwable t) { """ Converts the first input parameter to String and then delegates to the wrapped <code>org.slf4j.Logger</code> instance. @param message the message to log. Converted to {@link String} @param t the exception to log """ logger.debug(String.valueOf...
java
public void debug(Object message, Throwable t) { logger.debug(String.valueOf(message), t); }
[ "public", "void", "debug", "(", "Object", "message", ",", "Throwable", "t", ")", "{", "logger", ".", "debug", "(", "String", ".", "valueOf", "(", "message", ")", ",", "t", ")", ";", "}" ]
Converts the first input parameter to String and then delegates to the wrapped <code>org.slf4j.Logger</code> instance. @param message the message to log. Converted to {@link String} @param t the exception to log
[ "Converts", "the", "first", "input", "parameter", "to", "String", "and", "then", "delegates", "to", "the", "wrapped", "<code", ">", "org", ".", "slf4j", ".", "Logger<", "/", "code", ">", "instance", "." ]
train
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SLF4JLog.java#L140-L142
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.copyResource
public void copyResource(String source, String destination, CmsResource.CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException { """ Copies a resource.<p> The copied resource will always be locked to the current user after the copy operation.<p> The <code>siblingMode</code> pa...
java
public void copyResource(String source, String destination, CmsResource.CmsResourceCopyMode siblingMode) throws CmsException, CmsIllegalArgumentException { CmsResource resource = readResource(source, CmsResourceFilter.IGNORE_EXPIRATION); getResourceType(resource).copyResource(this, m_securityManage...
[ "public", "void", "copyResource", "(", "String", "source", ",", "String", "destination", ",", "CmsResource", ".", "CmsResourceCopyMode", "siblingMode", ")", "throws", "CmsException", ",", "CmsIllegalArgumentException", "{", "CmsResource", "resource", "=", "readResource"...
Copies a resource.<p> The copied resource will always be locked to the current user after the copy operation.<p> The <code>siblingMode</code> parameter controls how to handle siblings during the copy operation.<br> Possible values for this parameter are: <br> <ul> <li><code>{@link CmsResource#COPY_AS_NEW}</code></li>...
[ "Copies", "a", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L573-L578
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/StringSearch.java
StringSearch.checkIdentical
private boolean checkIdentical(int start, int end) { """ Checks for identical match @param start offset of possible match @param end offset of possible match @return TRUE if identical match is found """ if (strength_ != Collator.IDENTICAL) { return true; } // Note: We cou...
java
private boolean checkIdentical(int start, int end) { if (strength_ != Collator.IDENTICAL) { return true; } // Note: We could use Normalizer::compare() or similar, but for short strings // which may not be in FCD it might be faster to just NFD them. String textstr = ge...
[ "private", "boolean", "checkIdentical", "(", "int", "start", ",", "int", "end", ")", "{", "if", "(", "strength_", "!=", "Collator", ".", "IDENTICAL", ")", "{", "return", "true", ";", "}", "// Note: We could use Normalizer::compare() or similar, but for short strings",...
Checks for identical match @param start offset of possible match @param end offset of possible match @return TRUE if identical match is found
[ "Checks", "for", "identical", "match" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/StringSearch.java#L856-L871
syphr42/prom
src/main/java/org/syphr/prom/PropertiesManager.java
PropertiesManager.saveProperty
public void saveProperty(T property, String value) throws IOException { """ Modify the value of the given property and save <b>only that change</b> to permanent storage. This method will not save other properties whose values may have been modified since the file was last loaded or saved. Any modifications that...
java
public void saveProperty(T property, String value) throws IOException { setProperty(property, value); saveProperty(property); }
[ "public", "void", "saveProperty", "(", "T", "property", ",", "String", "value", ")", "throws", "IOException", "{", "setProperty", "(", "property", ",", "value", ")", ";", "saveProperty", "(", "property", ")", ";", "}" ]
Modify the value of the given property and save <b>only that change</b> to permanent storage. This method will not save other properties whose values may have been modified since the file was last loaded or saved. Any modifications that have been made to other properties will still be set, but the file will not reflect...
[ "Modify", "the", "value", "of", "the", "given", "property", "and", "save", "<b", ">", "only", "that", "change<", "/", "b", ">", "to", "permanent", "storage", ".", "This", "method", "will", "not", "save", "other", "properties", "whose", "values", "may", "...
train
https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManager.java#L1013-L1017
FINRAOS/DataGenerator
dg-core/src/main/java/org/finra/datagenerator/engine/scxml/tags/InLineTransformerExtension.java
InLineTransformerExtension.pipelinePossibleStates
public List<Map<String, String>> pipelinePossibleStates(TransformTag action, List<Map<String, String>> possibleStateList) { """ Applies a stated DataTransformer (given by name in a TransformTag Action) against every possible state @param action a Tran...
java
public List<Map<String, String>> pipelinePossibleStates(TransformTag action, List<Map<String, String>> possibleStateList) { DataTransformer tr = transformers.get(action.getName()); DataPipe pipe = new DataPipe(0, null); for (Map<St...
[ "public", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "pipelinePossibleStates", "(", "TransformTag", "action", ",", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "possibleStateList", ")", "{", "DataTransformer", "tr", "=", "tr...
Applies a stated DataTransformer (given by name in a TransformTag Action) against every possible state @param action a TransformTag Action @param possibleStateList a current list of possible states produced so far from expanding a model state @return the same list of possible states, each processed with the stated Da...
[ "Applies", "a", "stated", "DataTransformer", "(", "given", "by", "name", "in", "a", "TransformTag", "Action", ")", "against", "every", "possible", "state" ]
train
https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/engine/scxml/tags/InLineTransformerExtension.java#L69-L81
spring-cloud/spring-cloud-netflix
spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonUtils.java
RibbonUtils.updateToHttpsIfNeeded
public static URI updateToHttpsIfNeeded(URI uri, IClientConfig config, ServerIntrospector serverIntrospector, Server server) { """ Replace the scheme to https if needed. If the uri doesn't start with https and {@link #isSecure(IClientConfig, ServerIntrospector, Server)} is true, update the scheme. This assume...
java
public static URI updateToHttpsIfNeeded(URI uri, IClientConfig config, ServerIntrospector serverIntrospector, Server server) { return updateToSecureConnectionIfNeeded(uri, config, serverIntrospector, server); }
[ "public", "static", "URI", "updateToHttpsIfNeeded", "(", "URI", "uri", ",", "IClientConfig", "config", ",", "ServerIntrospector", "serverIntrospector", ",", "Server", "server", ")", "{", "return", "updateToSecureConnectionIfNeeded", "(", "uri", ",", "config", ",", "...
Replace the scheme to https if needed. If the uri doesn't start with https and {@link #isSecure(IClientConfig, ServerIntrospector, Server)} is true, update the scheme. This assumes the uri is already encoded to avoid double encoding. @param uri to modify if required @param config Ribbon {@link IClientConfig} configurat...
[ "Replace", "the", "scheme", "to", "https", "if", "needed", ".", "If", "the", "uri", "doesn", "t", "start", "with", "https", "and", "{" ]
train
https://github.com/spring-cloud/spring-cloud-netflix/blob/03b1e326ce5971c41239890dc71cae616366cff8/spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonUtils.java#L120-L123
alkacon/opencms-core
src-modules/org/opencms/workplace/commons/CmsChacc.java
CmsChacc.checkNewEntry
protected boolean checkNewEntry(String name, int arrayPosition) { """ Validates the user input when creating a new access control entry.<p> @param name the name of the new user/group @param arrayPosition the position in the types array @return true if everything is ok, otherwise false """ m_err...
java
protected boolean checkNewEntry(String name, int arrayPosition) { m_errorMessages.clear(); boolean inArray = false; if (getTypes(false)[arrayPosition] != null) { inArray = true; } if (!inArray) { m_errorMessages.add(key(Messages.ERR_PERMISSION_SELECT_TYPE...
[ "protected", "boolean", "checkNewEntry", "(", "String", "name", ",", "int", "arrayPosition", ")", "{", "m_errorMessages", ".", "clear", "(", ")", ";", "boolean", "inArray", "=", "false", ";", "if", "(", "getTypes", "(", "false", ")", "[", "arrayPosition", ...
Validates the user input when creating a new access control entry.<p> @param name the name of the new user/group @param arrayPosition the position in the types array @return true if everything is ok, otherwise false
[ "Validates", "the", "user", "input", "when", "creating", "a", "new", "access", "control", "entry", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsChacc.java#L1012-L1029
apollographql/apollo-android
apollo-api/src/main/java/com/apollographql/apollo/api/ResponseField.java
ResponseField.forEnum
public static ResponseField forEnum(String responseName, String fieldName, Map<String, Object> arguments, boolean optional, List<Condition> conditions) { """ Factory method for creating a Field instance representing {@link Type#ENUM}. @param responseName alias for the result of a field @param fieldName ...
java
public static ResponseField forEnum(String responseName, String fieldName, Map<String, Object> arguments, boolean optional, List<Condition> conditions) { return new ResponseField(Type.ENUM, responseName, fieldName, arguments, optional, conditions); }
[ "public", "static", "ResponseField", "forEnum", "(", "String", "responseName", ",", "String", "fieldName", ",", "Map", "<", "String", ",", "Object", ">", "arguments", ",", "boolean", "optional", ",", "List", "<", "Condition", ">", "conditions", ")", "{", "re...
Factory method for creating a Field instance representing {@link Type#ENUM}. @param responseName alias for the result of a field @param fieldName name of the field in the GraphQL operation @param arguments arguments to be passed along with the field @param optional whether the arguments passed along are opti...
[ "Factory", "method", "for", "creating", "a", "Field", "instance", "representing", "{", "@link", "Type#ENUM", "}", "." ]
train
https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-api/src/main/java/com/apollographql/apollo/api/ResponseField.java#L115-L118
cybazeitalia/emaze-dysfunctional
src/main/java/net/emaze/dysfunctional/Spies.java
Spies.spyRes
public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spyRes(TriFunction<T1, T2, T3, R> function, Box<R> result) { """ Proxies a ternary function spying for result. @param <R> the function result type @param <T1> the function first parameter type @param <T2> the function second parameter type @param <T3> ...
java
public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spyRes(TriFunction<T1, T2, T3, R> function, Box<R> result) { return spy(function, result, Box.<T1>empty(), Box.<T2>empty(), Box.<T3>empty()); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ",", "R", ">", "TriFunction", "<", "T1", ",", "T2", ",", "T3", ",", "R", ">", "spyRes", "(", "TriFunction", "<", "T1", ",", "T2", ",", "T3", ",", "R", ">", "function", ",", "Box", "<", "R",...
Proxies a ternary function spying for result. @param <R> the function result type @param <T1> the function first parameter type @param <T2> the function second parameter type @param <T3> the function third parameter type @param function the function that will be spied @param result a box that will be containing spied ...
[ "Proxies", "a", "ternary", "function", "spying", "for", "result", "." ]
train
https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L194-L196
looly/hutool
hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java
BeanUtil.toBean
public static <T> T toBean(Class<T> beanClass, ValueProvider<String> valueProvider, CopyOptions copyOptions) { """ ServletRequest 参数转Bean @param <T> Bean类型 @param beanClass Bean Class @param valueProvider 值提供者 @param copyOptions 拷贝选项,见 {@link CopyOptions} @return Bean """ return fillBean(ReflectUtil....
java
public static <T> T toBean(Class<T> beanClass, ValueProvider<String> valueProvider, CopyOptions copyOptions) { return fillBean(ReflectUtil.newInstance(beanClass), valueProvider, copyOptions); }
[ "public", "static", "<", "T", ">", "T", "toBean", "(", "Class", "<", "T", ">", "beanClass", ",", "ValueProvider", "<", "String", ">", "valueProvider", ",", "CopyOptions", "copyOptions", ")", "{", "return", "fillBean", "(", "ReflectUtil", ".", "newInstance", ...
ServletRequest 参数转Bean @param <T> Bean类型 @param beanClass Bean Class @param valueProvider 值提供者 @param copyOptions 拷贝选项,见 {@link CopyOptions} @return Bean
[ "ServletRequest", "参数转Bean" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L457-L459
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java
HashUtils.getFileMD5String
public static String getFileMD5String(File file) throws IOException { """ Calculate MD5 hash of a File @param file - the File to hash @return the MD5 hash value @throws IOException """ MessageDigest messageDigest = getMessageDigest(MD5); return getFileHashString(file, messageDigest); }
java
public static String getFileMD5String(File file) throws IOException { MessageDigest messageDigest = getMessageDigest(MD5); return getFileHashString(file, messageDigest); }
[ "public", "static", "String", "getFileMD5String", "(", "File", "file", ")", "throws", "IOException", "{", "MessageDigest", "messageDigest", "=", "getMessageDigest", "(", "MD5", ")", ";", "return", "getFileHashString", "(", "file", ",", "messageDigest", ")", ";", ...
Calculate MD5 hash of a File @param file - the File to hash @return the MD5 hash value @throws IOException
[ "Calculate", "MD5", "hash", "of", "a", "File" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L47-L50
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/data/AnyValueMap.java
AnyValueMap.getAsBooleanWithDefault
public boolean getAsBooleanWithDefault(String key, boolean defaultValue) { """ Converts map element into a boolean or returns default value if conversion is not possible. @param key a key of element to get. @param defaultValue the default value @return boolean value of the element or default value i...
java
public boolean getAsBooleanWithDefault(String key, boolean defaultValue) { Object value = getAsObject(key); return BooleanConverter.toBooleanWithDefault(value, defaultValue); }
[ "public", "boolean", "getAsBooleanWithDefault", "(", "String", "key", ",", "boolean", "defaultValue", ")", "{", "Object", "value", "=", "getAsObject", "(", "key", ")", ";", "return", "BooleanConverter", ".", "toBooleanWithDefault", "(", "value", ",", "defaultValue...
Converts map element into a boolean or returns default value if conversion is not possible. @param key a key of element to get. @param defaultValue the default value @return boolean value of the element or default value if conversion is not supported. @see BooleanConverter#toBooleanWithDefault(Object, boolea...
[ "Converts", "map", "element", "into", "a", "boolean", "or", "returns", "default", "value", "if", "conversion", "is", "not", "possible", "." ]
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/data/AnyValueMap.java#L205-L208
jglobus/JGlobus
gss/src/main/java/org/globus/gsi/gssapi/GlobusGSSManagerImpl.java
GlobusGSSManagerImpl.createCredential
public GSSCredential createCredential(GSSName name, int lifetime, Oid mechs[], int usage) throws GSSException { """ Acquires GSI GSS credentials. @see #createCredential(GSSName, int, Oid, int) """ if (mechs == null || mechs.length == 0) { return createCredential(name, lifetime, (...
java
public GSSCredential createCredential(GSSName name, int lifetime, Oid mechs[], int usage) throws GSSException { if (mechs == null || mechs.length == 0) { return createCredential(name, lifetime, (Oid)null, usage); } else { // XXX: not sure this is correct GSSCredential cred = cre...
[ "public", "GSSCredential", "createCredential", "(", "GSSName", "name", ",", "int", "lifetime", ",", "Oid", "mechs", "[", "]", ",", "int", "usage", ")", "throws", "GSSException", "{", "if", "(", "mechs", "==", "null", "||", "mechs", ".", "length", "==", "...
Acquires GSI GSS credentials. @see #createCredential(GSSName, int, Oid, int)
[ "Acquires", "GSI", "GSS", "credentials", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/gsi/gssapi/GlobusGSSManagerImpl.java#L164-L180
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/LocalFileResource.java
LocalFileResource.newResource
public static LocalFileResource newResource(String normalizedPath, String repositoryPath, SymbolicRootResource root) { """ Create a new local resource @param normalizedPath Normalized file path for this resource; can not be null. @param repositoryPath An abstraction of the file location; may be null. @param...
java
public static LocalFileResource newResource(String normalizedPath, String repositoryPath, SymbolicRootResource root) { return new LocalFileResource(normalizedPath, repositoryPath, root); }
[ "public", "static", "LocalFileResource", "newResource", "(", "String", "normalizedPath", ",", "String", "repositoryPath", ",", "SymbolicRootResource", "root", ")", "{", "return", "new", "LocalFileResource", "(", "normalizedPath", ",", "repositoryPath", ",", "root", ")...
Create a new local resource @param normalizedPath Normalized file path for this resource; can not be null. @param repositoryPath An abstraction of the file location; may be null. @param root Symbolic root for resource
[ "Create", "a", "new", "local", "resource" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/LocalFileResource.java#L96-L98
googleads/googleads-java-lib
modules/ads_lib/src/main/java/com/google/api/ads/adwords/lib/utils/logging/ReportServiceLogger.java
ReportServiceLogger.logRequest
public void logRequest( @Nullable HttpRequest request, int statusCode, @Nullable String statusMessage) { """ Logs the specified request and response information. <p>Note that in order to avoid any temptation to consume the contents of the response, this does <em>not</em> take an {@link com.google.api.cli...
java
public void logRequest( @Nullable HttpRequest request, int statusCode, @Nullable String statusMessage) { boolean isSuccess = HttpStatusCodes.isSuccess(statusCode); if (!loggerDelegate.isSummaryLoggable(isSuccess) && !loggerDelegate.isDetailsLoggable(isSuccess)) { return; } // Popula...
[ "public", "void", "logRequest", "(", "@", "Nullable", "HttpRequest", "request", ",", "int", "statusCode", ",", "@", "Nullable", "String", "statusMessage", ")", "{", "boolean", "isSuccess", "=", "HttpStatusCodes", ".", "isSuccess", "(", "statusCode", ")", ";", ...
Logs the specified request and response information. <p>Note that in order to avoid any temptation to consume the contents of the response, this does <em>not</em> take an {@link com.google.api.client.http.HttpResponse} object, but instead accepts the status code and message from the response.
[ "Logs", "the", "specified", "request", "and", "response", "information", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/adwords/lib/utils/logging/ReportServiceLogger.java#L90-L113
lucee/Lucee
core/src/main/java/lucee/runtime/reflection/Reflector.java
Reflector.getProperty
public static Object getProperty(Object obj, String prop) throws PageException { """ to get a visible Propety (Field or Getter) of a object @param obj Object to invoke @param prop property to call @return property value @throws PageException """ Object rtn = getField(obj, prop, NULL);// NULL is used bec...
java
public static Object getProperty(Object obj, String prop) throws PageException { Object rtn = getField(obj, prop, NULL);// NULL is used because the field can contain null as well if (rtn != NULL) return rtn; char first = prop.charAt(0); if (first >= '0' && first <= '9') throw new ApplicationException("there is no ...
[ "public", "static", "Object", "getProperty", "(", "Object", "obj", ",", "String", "prop", ")", "throws", "PageException", "{", "Object", "rtn", "=", "getField", "(", "obj", ",", "prop", ",", "NULL", ")", ";", "// NULL is used because the field can contain null as ...
to get a visible Propety (Field or Getter) of a object @param obj Object to invoke @param prop property to call @return property value @throws PageException
[ "to", "get", "a", "visible", "Propety", "(", "Field", "or", "Getter", ")", "of", "a", "object" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L1197-L1205
Pi4J/pi4j
pi4j-core/src/main/java/com/pi4j/jni/Serial.java
Serial.write
public synchronized static void write(int fd, byte[] ... data) throws IOException { """ <p>Sends one of more bytes arrays to the serial device identified by the given file descriptor.</p> @param fd The file descriptor of the serial port/device. @param data One or more byte arrays of data to be transmitted. (...
java
public synchronized static void write(int fd, byte[] ... data) throws IOException { for(byte[] single : data) { // write the data contents to the serial port via JNI native method write(fd, single, single.length); } }
[ "public", "synchronized", "static", "void", "write", "(", "int", "fd", ",", "byte", "[", "]", "...", "data", ")", "throws", "IOException", "{", "for", "(", "byte", "[", "]", "single", ":", "data", ")", "{", "// write the data contents to the serial port via JN...
<p>Sends one of more bytes arrays to the serial device identified by the given file descriptor.</p> @param fd The file descriptor of the serial port/device. @param data One or more byte arrays of data to be transmitted. (variable-length-argument)
[ "<p", ">", "Sends", "one", "of", "more", "bytes", "arrays", "to", "the", "serial", "device", "identified", "by", "the", "given", "file", "descriptor", ".", "<", "/", "p", ">" ]
train
https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/jni/Serial.java#L708-L713
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/service/monitoring/FlowStatusGenerator.java
FlowStatusGenerator.getFlowStatus
public FlowStatus getFlowStatus(String flowName, String flowGroup, long flowExecutionId) { """ Get the flow status for a specific execution. @param flowName @param flowGroup @param flowExecutionId @return the flow status, null is returned if the flow status does not exist """ FlowStatus flowStatus = nu...
java
public FlowStatus getFlowStatus(String flowName, String flowGroup, long flowExecutionId) { FlowStatus flowStatus = null; Iterator<JobStatus> jobStatusIterator = jobStatusRetriever.getJobStatusesForFlowExecution(flowName, flowGroup, flowExecutionId); if (jobStatusIterator.hasNext()) { flowStat...
[ "public", "FlowStatus", "getFlowStatus", "(", "String", "flowName", ",", "String", "flowGroup", ",", "long", "flowExecutionId", ")", "{", "FlowStatus", "flowStatus", "=", "null", ";", "Iterator", "<", "JobStatus", ">", "jobStatusIterator", "=", "jobStatusRetriever",...
Get the flow status for a specific execution. @param flowName @param flowGroup @param flowExecutionId @return the flow status, null is returned if the flow status does not exist
[ "Get", "the", "flow", "status", "for", "a", "specific", "execution", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/service/monitoring/FlowStatusGenerator.java#L68-L78
jmxtrans/jmxtrans
jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java
Settings.getIntSetting
protected static int getIntSetting(Map<String, Object> settings, String key, int defaultVal) throws IllegalArgumentException { """ Gets an int value for the setting, returning the default value if not specified. @param settings @param key the key to get the int value for @param defaultVal default va...
java
protected static int getIntSetting(Map<String, Object> settings, String key, int defaultVal) throws IllegalArgumentException { if (settings.containsKey(key)) { final Object objectValue = settings.get(key); if (objectValue == null) { throw new IllegalArgumentException("Setting '" + key + " null"); } fi...
[ "protected", "static", "int", "getIntSetting", "(", "Map", "<", "String", ",", "Object", ">", "settings", ",", "String", "key", ",", "int", "defaultVal", ")", "throws", "IllegalArgumentException", "{", "if", "(", "settings", ".", "containsKey", "(", "key", "...
Gets an int value for the setting, returning the default value if not specified. @param settings @param key the key to get the int value for @param defaultVal default value if the setting was not specified @return the int value for the setting @throws IllegalArgumentException if setting does not contain an int
[ "Gets", "an", "int", "value", "for", "the", "setting", "returning", "the", "default", "value", "if", "not", "specified", "." ]
train
https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java#L133-L148
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
MultiBackgroundInitializer.addInitializer
public void addInitializer(final String name, final BackgroundInitializer<?> init) { """ Adds a new {@code BackgroundInitializer} to this object. When this {@code MultiBackgroundInitializer} is started, the given initializer will be processed. This method must not be called after {@link #start()} has been invok...
java
public void addInitializer(final String name, final BackgroundInitializer<?> init) { Validate.isTrue(name != null, "Name of child initializer must not be null!"); Validate.isTrue(init != null, "Child initializer must not be null!"); synchronized (this) { if (isStarted()) { ...
[ "public", "void", "addInitializer", "(", "final", "String", "name", ",", "final", "BackgroundInitializer", "<", "?", ">", "init", ")", "{", "Validate", ".", "isTrue", "(", "name", "!=", "null", ",", "\"Name of child initializer must not be null!\"", ")", ";", "V...
Adds a new {@code BackgroundInitializer} to this object. When this {@code MultiBackgroundInitializer} is started, the given initializer will be processed. This method must not be called after {@link #start()} has been invoked. @param name the name of the initializer (must not be <b>null</b>) @param init the {@code Bac...
[ "Adds", "a", "new", "{", "@code", "BackgroundInitializer", "}", "to", "this", "object", ".", "When", "this", "{", "@code", "MultiBackgroundInitializer", "}", "is", "started", "the", "given", "initializer", "will", "be", "processed", ".", "This", "method", "mus...
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java#L138-L149
trellis-ldp-archive/trellis-http
src/main/java/org/trellisldp/http/impl/OptionsHandler.java
OptionsHandler.ldpOptions
public ResponseBuilder ldpOptions(final Resource res) { """ Build the representation for the given resource @param res the resource @return the response builder """ final String identifier = getBaseUrl() + req.getPartition() + req.getPath(); LOGGER.debug("OPTIONS request for {}", identifier)...
java
public ResponseBuilder ldpOptions(final Resource res) { final String identifier = getBaseUrl() + req.getPartition() + req.getPath(); LOGGER.debug("OPTIONS request for {}", identifier); final IRI graphName = ACL.equals(req.getExt()) ? PreferAccessControl : PreferUserManaged; // Check i...
[ "public", "ResponseBuilder", "ldpOptions", "(", "final", "Resource", "res", ")", "{", "final", "String", "identifier", "=", "getBaseUrl", "(", ")", "+", "req", ".", "getPartition", "(", ")", "+", "req", ".", "getPath", "(", ")", ";", "LOGGER", ".", "debu...
Build the representation for the given resource @param res the resource @return the response builder
[ "Build", "the", "representation", "for", "the", "given", "resource" ]
train
https://github.com/trellis-ldp-archive/trellis-http/blob/bc762f88602c49c2b137a7adf68d576666e55fff/src/main/java/org/trellisldp/http/impl/OptionsHandler.java#L75-L108
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java
RotationAxis.calculateTranslationalAxis
private void calculateTranslationalAxis(Matrix rotation, Atom translation) { """ Handle cases with small angles of rotation @param rotation @param translation """ // set axis parallel to translation rotationAxis = Calc.scale(translation, 1./Calc.amount(translation)); // position is undefined rotatio...
java
private void calculateTranslationalAxis(Matrix rotation, Atom translation) { // set axis parallel to translation rotationAxis = Calc.scale(translation, 1./Calc.amount(translation)); // position is undefined rotationPos = null; screwTranslation = translation; otherTranslation = new AtomImpl(); otherTrans...
[ "private", "void", "calculateTranslationalAxis", "(", "Matrix", "rotation", ",", "Atom", "translation", ")", "{", "// set axis parallel to translation", "rotationAxis", "=", "Calc", ".", "scale", "(", "translation", ",", "1.", "/", "Calc", ".", "amount", "(", "tra...
Handle cases with small angles of rotation @param rotation @param translation
[ "Handle", "cases", "with", "small", "angles", "of", "rotation" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L352-L362
Javen205/IJPay
src/main/java/com/jpay/unionpay/AcpService.java
AcpService.encryptPin
public static String encryptPin(String accNo, String pin, String encoding) { """ 密码加密并做base64<br> @param accNo 卡号<br> @param pwd 密码<br> @param encoding<br> @return 加密的内容<br> """ return SecureUtil.encryptPin(accNo, pin, encoding, CertUtil .getEncryptCertPublicKey()); }
java
public static String encryptPin(String accNo, String pin, String encoding) { return SecureUtil.encryptPin(accNo, pin, encoding, CertUtil .getEncryptCertPublicKey()); }
[ "public", "static", "String", "encryptPin", "(", "String", "accNo", ",", "String", "pin", ",", "String", "encoding", ")", "{", "return", "SecureUtil", ".", "encryptPin", "(", "accNo", ",", "pin", ",", "encoding", ",", "CertUtil", ".", "getEncryptCertPublicKey"...
密码加密并做base64<br> @param accNo 卡号<br> @param pwd 密码<br> @param encoding<br> @return 加密的内容<br>
[ "密码加密并做base64<br", ">" ]
train
https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/unionpay/AcpService.java#L400-L403
ag-gipp/MathMLTools
mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/node/MathNodeGenerator.java
MathNodeGenerator.printMathNode
public static String printMathNode(MathNode node, String indent) { """ Converts a MathNode into a an simplistic indented tree representation of itself. @param node Node to begin with and onwards for all children of it. @param indent starting line used as an indent (e.g. start with "") @return return a tree...
java
public static String printMathNode(MathNode node, String indent) { StringBuilder sb = new StringBuilder(indent + node.toString() + "\n"); node.getChildren().forEach(n -> sb.append(printMathNode(n, indent + " "))); return sb.toString(); }
[ "public", "static", "String", "printMathNode", "(", "MathNode", "node", ",", "String", "indent", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "indent", "+", "node", ".", "toString", "(", ")", "+", "\"\\n\"", ")", ";", "node", ".", "...
Converts a MathNode into a an simplistic indented tree representation of itself. @param node Node to begin with and onwards for all children of it. @param indent starting line used as an indent (e.g. start with "") @return return a tree representation of itself
[ "Converts", "a", "MathNode", "into", "a", "an", "simplistic", "indented", "tree", "representation", "of", "itself", "." ]
train
https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/node/MathNodeGenerator.java#L124-L128
alkacon/opencms-core
src/org/opencms/workplace/CmsWorkplace.java
CmsWorkplace.buttonBarLabel
public String buttonBarLabel(String label, String className) { """ Generates a button bar label.<p> @param label the label to show @param className the css class name for the formatting @return a button bar label """ StringBuffer result = new StringBuffer(128); result.append("<td><span ...
java
public String buttonBarLabel(String label, String className) { StringBuffer result = new StringBuffer(128); result.append("<td><span class=\""); result.append(className); result.append("\"><span unselectable=\"on\" class=\"txtbutton\">"); result.append(key(label)); resul...
[ "public", "String", "buttonBarLabel", "(", "String", "label", ",", "String", "className", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", "128", ")", ";", "result", ".", "append", "(", "\"<td><span class=\\\"\"", ")", ";", "result", ".", ...
Generates a button bar label.<p> @param label the label to show @param className the css class name for the formatting @return a button bar label
[ "Generates", "a", "button", "bar", "label", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1330-L1339
pressgang-ccms/PressGangCCMSQuery
src/main/java/org/jboss/pressgang/ccms/filter/utils/JPAUtils.java
JPAUtils.findJoinedType
public static <T, K> Join<T, K> findJoinedType(CriteriaQuery<T> query, Class<T> rootClass, Class<K> joinClass) { """ Find Joined Root of type clazz @param <T> @param query the criteria query @param rootClass the root class @param joinClass the join class @return the Join """ Root<T> root = f...
java
public static <T, K> Join<T, K> findJoinedType(CriteriaQuery<T> query, Class<T> rootClass, Class<K> joinClass) { Root<T> root = findRoot(query, rootClass); return findJoinedType(root, rootClass, joinClass); }
[ "public", "static", "<", "T", ",", "K", ">", "Join", "<", "T", ",", "K", ">", "findJoinedType", "(", "CriteriaQuery", "<", "T", ">", "query", ",", "Class", "<", "T", ">", "rootClass", ",", "Class", "<", "K", ">", "joinClass", ")", "{", "Root", "<...
Find Joined Root of type clazz @param <T> @param query the criteria query @param rootClass the root class @param joinClass the join class @return the Join
[ "Find", "Joined", "Root", "of", "type", "clazz" ]
train
https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/utils/JPAUtils.java#L138-L141
mboudreau/Alternator
src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java
DynamoDBMapper.mergeConfig
private DynamoDBMapperConfig mergeConfig(DynamoDBMapperConfig config) { """ Merges the config object given with the one specified at construction and returns the result. """ if ( config != this.config ) config = new DynamoDBMapperConfig(this.config, config); return config; }
java
private DynamoDBMapperConfig mergeConfig(DynamoDBMapperConfig config) { if ( config != this.config ) config = new DynamoDBMapperConfig(this.config, config); return config; }
[ "private", "DynamoDBMapperConfig", "mergeConfig", "(", "DynamoDBMapperConfig", "config", ")", "{", "if", "(", "config", "!=", "this", ".", "config", ")", "config", "=", "new", "DynamoDBMapperConfig", "(", "this", ".", "config", ",", "config", ")", ";", "return...
Merges the config object given with the one specified at construction and returns the result.
[ "Merges", "the", "config", "object", "given", "with", "the", "one", "specified", "at", "construction", "and", "returns", "the", "result", "." ]
train
https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1312-L1316
lucee/Lucee
core/src/main/java/lucee/runtime/reflection/Reflector.java
Reflector.isInstaneOf
public static boolean isInstaneOf(String srcClassName, Class trg) { """ check if Class is instanceof a a other Class @param srcClassName Class name to check @param trg is Class of? @return is Class Class of... """ Class clazz = ClassUtil.loadClass(srcClassName, null); if (clazz == null) return false; r...
java
public static boolean isInstaneOf(String srcClassName, Class trg) { Class clazz = ClassUtil.loadClass(srcClassName, null); if (clazz == null) return false; return isInstaneOf(clazz, trg); }
[ "public", "static", "boolean", "isInstaneOf", "(", "String", "srcClassName", ",", "Class", "trg", ")", "{", "Class", "clazz", "=", "ClassUtil", ".", "loadClass", "(", "srcClassName", ",", "null", ")", ";", "if", "(", "clazz", "==", "null", ")", "return", ...
check if Class is instanceof a a other Class @param srcClassName Class name to check @param trg is Class of? @return is Class Class of...
[ "check", "if", "Class", "is", "instanceof", "a", "a", "other", "Class" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L97-L101
GoogleCloudPlatform/appengine-gcs-client
java/src/main/java/com/google/appengine/tools/cloudstorage/oauth/OauthRawGcsService.java
OauthRawGcsService.put
private RawGcsCreationToken put(final GcsRestCreationToken token, ByteBuffer chunk, final boolean isFinalChunk, long timeoutMillis) throws IOException { """ Write the provided chunk at the offset specified in the token. If finalChunk is set, the file will be closed. """ final int length = chunk.rema...
java
private RawGcsCreationToken put(final GcsRestCreationToken token, ByteBuffer chunk, final boolean isFinalChunk, long timeoutMillis) throws IOException { final int length = chunk.remaining(); HTTPRequest req = createPutRequest(token, chunk, isFinalChunk, timeoutMillis, length); HTTPRequestInfo info = n...
[ "private", "RawGcsCreationToken", "put", "(", "final", "GcsRestCreationToken", "token", ",", "ByteBuffer", "chunk", ",", "final", "boolean", "isFinalChunk", ",", "long", "timeoutMillis", ")", "throws", "IOException", "{", "final", "int", "length", "=", "chunk", "....
Write the provided chunk at the offset specified in the token. If finalChunk is set, the file will be closed.
[ "Write", "the", "provided", "chunk", "at", "the", "offset", "specified", "in", "the", "token", ".", "If", "finalChunk", "is", "set", "the", "file", "will", "be", "closed", "." ]
train
https://github.com/GoogleCloudPlatform/appengine-gcs-client/blob/d11078331ecd915d753c886e96a80133599f3f98/java/src/main/java/com/google/appengine/tools/cloudstorage/oauth/OauthRawGcsService.java#L405-L417
michael-rapp/AndroidMaterialDialog
example/src/main/java/de/mrapp/android/dialog/example/MainActivity.java
MainActivity.createScrollListener
private RecyclerView.OnScrollListener createScrollListener() { """ Creates and returns a listener, which allows to hide or show the activity's floating action button, when the preferences, which are shown by the activity's fragment, are scrolled. @return The listener, which has been created, as an instance of ...
java
private RecyclerView.OnScrollListener createScrollListener() { return new RecyclerView.OnScrollListener() { /** * True, if the view is currently scrolling up, false otherwise. */ private boolean scrollingUp; @Override public void onScro...
[ "private", "RecyclerView", ".", "OnScrollListener", "createScrollListener", "(", ")", "{", "return", "new", "RecyclerView", ".", "OnScrollListener", "(", ")", "{", "/**\n * True, if the view is currently scrolling up, false otherwise.\n */", "private", "bo...
Creates and returns a listener, which allows to hide or show the activity's floating action button, when the preferences, which are shown by the activity's fragment, are scrolled. @return The listener, which has been created, as an instance of the type {@link RecyclerView.OnScrollListener}
[ "Creates", "and", "returns", "a", "listener", "which", "allows", "to", "hide", "or", "show", "the", "activity", "s", "floating", "action", "button", "when", "the", "preferences", "which", "are", "shown", "by", "the", "activity", "s", "fragment", "are", "scro...
train
https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/example/src/main/java/de/mrapp/android/dialog/example/MainActivity.java#L93-L122
elastic/elasticsearch-hadoop
storm/src/main/java/org/elasticsearch/storm/security/AutoElasticsearch.java
AutoElasticsearch.populateCredentials
@Override public void populateCredentials(Map<String, String> credentials) { """ /* IAutoCredentials Interface that provides methods to pull credentials from the submission client (not a thing we do here) and add any credentials to a Subject on a worker. """ // This is run on the submission cl...
java
@Override public void populateCredentials(Map<String, String> credentials) { // This is run on the submission client. We won't end up doing anything here since everything important will run on Nimbus. if (LOG.isDebugEnabled()) { LOG.debug("Auto Credential Class Loaded on submission clien...
[ "@", "Override", "public", "void", "populateCredentials", "(", "Map", "<", "String", ",", "String", ">", "credentials", ")", "{", "// This is run on the submission client. We won't end up doing anything here since everything important will run on Nimbus.", "if", "(", "LOG", "."...
/* IAutoCredentials Interface that provides methods to pull credentials from the submission client (not a thing we do here) and add any credentials to a Subject on a worker.
[ "/", "*", "IAutoCredentials" ]
train
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/storm/src/main/java/org/elasticsearch/storm/security/AutoElasticsearch.java#L241-L248
arxanchain/java-common
src/main/java/com/arxanfintech/common/crypto/core/ECKey.java
ECKey.signatureToKey
public static ECKey signatureToKey(byte[] messageHash, ECDSASignature sig) throws SignatureException { """ Compute the key that signed the given signature. @param messageHash 32-byte hash of message @param sig sig @return ECKey @throws SignatureException SignatureException """ final byte[] key...
java
public static ECKey signatureToKey(byte[] messageHash, ECDSASignature sig) throws SignatureException { final byte[] keyBytes = signatureToKeyBytes(messageHash, sig); return ECKey.fromPublicOnly(keyBytes); }
[ "public", "static", "ECKey", "signatureToKey", "(", "byte", "[", "]", "messageHash", ",", "ECDSASignature", "sig", ")", "throws", "SignatureException", "{", "final", "byte", "[", "]", "keyBytes", "=", "signatureToKeyBytes", "(", "messageHash", ",", "sig", ")", ...
Compute the key that signed the given signature. @param messageHash 32-byte hash of message @param sig sig @return ECKey @throws SignatureException SignatureException
[ "Compute", "the", "key", "that", "signed", "the", "given", "signature", "." ]
train
https://github.com/arxanchain/java-common/blob/3ddfedfd948f5bab3fee0b74b85cdce4702ed84e/src/main/java/com/arxanfintech/common/crypto/core/ECKey.java#L918-L921
gwtbootstrap3/gwtbootstrap3
gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/base/helper/StyleHelper.java
StyleHelper.setHiddenOn
public static void setHiddenOn(final UIObject uiObject, final DeviceSize deviceSize) { """ Sets the ui object to be hidden on the device size @param uiObject object to be hidden on the device size @param deviceSize device size """ // Split the enum up by _ to ge...
java
public static void setHiddenOn(final UIObject uiObject, final DeviceSize deviceSize) { // Split the enum up by _ to get the different devices // Separates the SM_MD into [SM, MD] so we can add the right styles final String[] deviceString = deviceSize.name().spl...
[ "public", "static", "void", "setHiddenOn", "(", "final", "UIObject", "uiObject", ",", "final", "DeviceSize", "deviceSize", ")", "{", "// Split the enum up by _ to get the different devices", "// Separates the SM_MD into [SM, MD] so we can add the right styles", "final", "String", ...
Sets the ui object to be hidden on the device size @param uiObject object to be hidden on the device size @param deviceSize device size
[ "Sets", "the", "ui", "object", "to", "be", "hidden", "on", "the", "device", "size" ]
train
https://github.com/gwtbootstrap3/gwtbootstrap3/blob/54bdbd0b12ba7a436b278c007df960d1adf2e641/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/base/helper/StyleHelper.java#L145-L174
strator-dev/greenpepper-open
extensions-external/php/src/main/java/com/greenpepper/phpsud/PHPContainerFactory.java
PHPContainerFactory.createContainer
public static PHPContainer createContainer(String phpExec, String workingDirectory, String phpInitFile) throws PHPException { """ <p>createContainer.</p> @param phpExec a {@link java.lang.String} object. @param workingDirectory a {@link java.lang.String} object. @param phpInitFile a {@link java.lang.String} o...
java
public static PHPContainer createContainer(String phpExec, String workingDirectory, String phpInitFile) throws PHPException { PHPContainer container = new PHPContainer(phpExec, workingDirectory, phpInitFile); container.setObjectParser(new ObjectParser()); container.setClassCreatorFactory(new PHPJavaClassCreatorF...
[ "public", "static", "PHPContainer", "createContainer", "(", "String", "phpExec", ",", "String", "workingDirectory", ",", "String", "phpInitFile", ")", "throws", "PHPException", "{", "PHPContainer", "container", "=", "new", "PHPContainer", "(", "phpExec", ",", "worki...
<p>createContainer.</p> @param phpExec a {@link java.lang.String} object. @param workingDirectory a {@link java.lang.String} object. @param phpInitFile a {@link java.lang.String} object. @return a {@link com.greenpepper.phpsud.container.PHPContainer} object. @throws com.greenpepper.phpsud.exceptions.PHPException if an...
[ "<p", ">", "createContainer", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper-open/blob/71fd244b4989e9cd2d07ae62dd954a1f2a269a92/extensions-external/php/src/main/java/com/greenpepper/phpsud/PHPContainerFactory.java#L46-L51
huahang/crypto-utils
crypto-utils/src/main/java/im/chic/utils/crypto/DigestUtils.java
DigestUtils.dgstHex
public static String dgstHex(InputStream is, Digest digest) throws IOException { """ Calculates digest and returns the value as a hex string. @param is input stream @param digest digest algorithm @return digest as a hex string @throws IOException On error reading from the stream """ checkNotN...
java
public static String dgstHex(InputStream is, Digest digest) throws IOException { checkNotNull(is); byte[] dgstBytes = dgst(is, digest); return BaseEncoding.base16().encode(dgstBytes); }
[ "public", "static", "String", "dgstHex", "(", "InputStream", "is", ",", "Digest", "digest", ")", "throws", "IOException", "{", "checkNotNull", "(", "is", ")", ";", "byte", "[", "]", "dgstBytes", "=", "dgst", "(", "is", ",", "digest", ")", ";", "return", ...
Calculates digest and returns the value as a hex string. @param is input stream @param digest digest algorithm @return digest as a hex string @throws IOException On error reading from the stream
[ "Calculates", "digest", "and", "returns", "the", "value", "as", "a", "hex", "string", "." ]
train
https://github.com/huahang/crypto-utils/blob/5f158478612698ecfd65fb0a0f9862a54ca17a8d/crypto-utils/src/main/java/im/chic/utils/crypto/DigestUtils.java#L97-L101
apereo/cas
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/PolicyBasedAuthenticationManager.java
PolicyBasedAuthenticationManager.authenticateAndResolvePrincipal
protected void authenticateAndResolvePrincipal(final AuthenticationBuilder builder, final Credential credential, final PrincipalResolver resolver, final Authentication...
java
protected void authenticateAndResolvePrincipal(final AuthenticationBuilder builder, final Credential credential, final PrincipalResolver resolver, final Authentication...
[ "protected", "void", "authenticateAndResolvePrincipal", "(", "final", "AuthenticationBuilder", "builder", ",", "final", "Credential", "credential", ",", "final", "PrincipalResolver", "resolver", ",", "final", "AuthenticationHandler", "handler", ")", "throws", "GeneralSecuri...
Authenticate and resolve principal. @param builder the builder @param credential the credential @param resolver the resolver @param handler the handler @throws GeneralSecurityException the general security exception @throws PreventedException the prevented exception
[ "Authenticate", "and", "resolve", "principal", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/PolicyBasedAuthenticationManager.java#L191-L230
landawn/AbacusUtil
src/com/landawn/abacus/util/CSVUtil.java
CSVUtil.exportCSV
public static long exportCSV(final File out, final Connection conn, final String querySQL, final long offset, final long count, final boolean writeTitle, final boolean quoted) throws UncheckedSQLException, UncheckedIOException { """ Exports the data from database to CVS. @param out @param conn @p...
java
public static long exportCSV(final File out, final Connection conn, final String querySQL, final long offset, final long count, final boolean writeTitle, final boolean quoted) throws UncheckedSQLException, UncheckedIOException { return exportCSV(out, conn, querySQL, null, offset, count, writeTitle...
[ "public", "static", "long", "exportCSV", "(", "final", "File", "out", ",", "final", "Connection", "conn", ",", "final", "String", "querySQL", ",", "final", "long", "offset", ",", "final", "long", "count", ",", "final", "boolean", "writeTitle", ",", "final", ...
Exports the data from database to CVS. @param out @param conn @param querySQL @param offset @param count @param writeTitle @param quoted @return
[ "Exports", "the", "data", "from", "database", "to", "CVS", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L707-L710
atomix/atomix
core/src/main/java/io/atomix/core/map/impl/AbstractAtomicMapService.java
AbstractAtomicMapService.removeIf
private MapEntryUpdateResult<K, byte[]> removeIf(long index, K key, Predicate<MapEntryValue> predicate) { """ Handles a remove commit. @param index the commit index @param key the key to remove @param predicate predicate to determine whether to remove the entry @return map entry update result "...
java
private MapEntryUpdateResult<K, byte[]> removeIf(long index, K key, Predicate<MapEntryValue> predicate) { MapEntryValue value = entries().get(key); // If the value does not exist or doesn't match the predicate, return a PRECONDITION_FAILED error. if (valueIsNull(value) || !predicate.test(value)) { re...
[ "private", "MapEntryUpdateResult", "<", "K", ",", "byte", "[", "]", ">", "removeIf", "(", "long", "index", ",", "K", "key", ",", "Predicate", "<", "MapEntryValue", ">", "predicate", ")", "{", "MapEntryValue", "value", "=", "entries", "(", ")", ".", "get"...
Handles a remove commit. @param index the commit index @param key the key to remove @param predicate predicate to determine whether to remove the entry @return map entry update result
[ "Handles", "a", "remove", "commit", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/core/src/main/java/io/atomix/core/map/impl/AbstractAtomicMapService.java#L406-L432
UrielCh/ovh-java-sdk
ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java
ApiOvhHostingweb.serviceName_ovhConfig_GET
public ArrayList<Long> serviceName_ovhConfig_GET(String serviceName, Boolean historical, String path) throws IOException { """ Configuration used on your hosting REST: GET /hosting/web/{serviceName}/ovhConfig @param path [required] Filter the value of path property (like) @param historical [required] Filter t...
java
public ArrayList<Long> serviceName_ovhConfig_GET(String serviceName, Boolean historical, String path) throws IOException { String qPath = "/hosting/web/{serviceName}/ovhConfig"; StringBuilder sb = path(qPath, serviceName); query(sb, "historical", historical); query(sb, "path", path); String resp = exec(qPath,...
[ "public", "ArrayList", "<", "Long", ">", "serviceName_ovhConfig_GET", "(", "String", "serviceName", ",", "Boolean", "historical", ",", "String", "path", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/hosting/web/{serviceName}/ovhConfig\"", ";", "String...
Configuration used on your hosting REST: GET /hosting/web/{serviceName}/ovhConfig @param path [required] Filter the value of path property (like) @param historical [required] Filter the value of historical property (=) @param serviceName [required] The internal name of your hosting
[ "Configuration", "used", "on", "your", "hosting" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L214-L221
apache/groovy
src/main/groovy/groovy/ui/GroovyMain.java
GroovyMain.processArgs
@Deprecated static void processArgs(String[] args, final PrintStream out) { """ package-level visibility for testing purposes (just usage/errors at this stage) """ processArgs(args, out, out); }
java
@Deprecated static void processArgs(String[] args, final PrintStream out) { processArgs(args, out, out); }
[ "@", "Deprecated", "static", "void", "processArgs", "(", "String", "[", "]", "args", ",", "final", "PrintStream", "out", ")", "{", "processArgs", "(", "args", ",", "out", ",", "out", ")", ";", "}" ]
package-level visibility for testing purposes (just usage/errors at this stage)
[ "package", "-", "level", "visibility", "for", "testing", "purposes", "(", "just", "usage", "/", "errors", "at", "this", "stage", ")" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/ui/GroovyMain.java#L120-L123
sagiegurari/fax4j
src/main/java/org/fax4j/util/CloseableResourceManager.java
CloseableResourceManager.updateCloseable
private static void updateCloseable(boolean register,Closeable closeable) { """ Registers/Unregisters the provided closeable.<br> Will throw an error in case the manager is no longer active (due to JVM shutdown). @param register True to register, false to unregister @param closeable The closeable to re...
java
private static void updateCloseable(boolean register,Closeable closeable) { boolean updated=false; synchronized(CloseableResourceManager.class) { if(register) { if(CloseableResourceManager.active) { //update resource...
[ "private", "static", "void", "updateCloseable", "(", "boolean", "register", ",", "Closeable", "closeable", ")", "{", "boolean", "updated", "=", "false", ";", "synchronized", "(", "CloseableResourceManager", ".", "class", ")", "{", "if", "(", "register", ")", "...
Registers/Unregisters the provided closeable.<br> Will throw an error in case the manager is no longer active (due to JVM shutdown). @param register True to register, false to unregister @param closeable The closeable to register/unregister
[ "Registers", "/", "Unregisters", "the", "provided", "closeable", ".", "<br", ">", "Will", "throw", "an", "error", "in", "case", "the", "manager", "is", "no", "longer", "active", "(", "due", "to", "JVM", "shutdown", ")", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/CloseableResourceManager.java#L73-L103
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java
ConfigurationFile.findMainFileFromBackupSuffix
private String findMainFileFromBackupSuffix(File searchDir, String backupType) { """ Finds a single file in {@code searchDir} whose name ends with "{@code .backupType.xml}" and returns its name with {@code .backupType} removed. @param searchDir the directory to search @param backupType the backup type; {@lin...
java
private String findMainFileFromBackupSuffix(File searchDir, String backupType) { final String suffix = "." + backupType + ".xml"; File[] files = null; if (searchDir.exists() && searchDir.isDirectory()) { files = searchDir.listFiles(new FilenameFilter() { @Override ...
[ "private", "String", "findMainFileFromBackupSuffix", "(", "File", "searchDir", ",", "String", "backupType", ")", "{", "final", "String", "suffix", "=", "\".\"", "+", "backupType", "+", "\".xml\"", ";", "File", "[", "]", "files", "=", "null", ";", "if", "(", ...
Finds a single file in {@code searchDir} whose name ends with "{@code .backupType.xml}" and returns its name with {@code .backupType} removed. @param searchDir the directory to search @param backupType the backup type; {@link #LAST}, {@link #BOOT}, {@link #INITIAL} or {@code v\d+} @return the single file that meets t...
[ "Finds", "a", "single", "file", "in", "{", "@code", "searchDir", "}", "whose", "name", "ends", "with", "{", "@code", ".", "backupType", ".", "xml", "}", "and", "returns", "its", "name", "with", "{", "@code", ".", "backupType", "}", "removed", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L354-L380
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/ie/ner/CMMClassifier.java
CMMClassifier.classOf
protected String classOf(List<IN> lineInfos, int pos) { """ Returns the most likely class for the word at the given position. """ Datum<String, String> d = makeDatum(lineInfos, pos, featureFactory); return classifier.classOf(d); }
java
protected String classOf(List<IN> lineInfos, int pos) { Datum<String, String> d = makeDatum(lineInfos, pos, featureFactory); return classifier.classOf(d); }
[ "protected", "String", "classOf", "(", "List", "<", "IN", ">", "lineInfos", ",", "int", "pos", ")", "{", "Datum", "<", "String", ",", "String", ">", "d", "=", "makeDatum", "(", "lineInfos", ",", "pos", ",", "featureFactory", ")", ";", "return", "classi...
Returns the most likely class for the word at the given position.
[ "Returns", "the", "most", "likely", "class", "for", "the", "word", "at", "the", "given", "position", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/ner/CMMClassifier.java#L242-L245
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java
EnumConstantBuilder.buildEnumConstant
public void buildEnumConstant(XMLNode node, Content memberDetailsTree) throws DocletException { """ Build the enum constant documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added @throws DocletEx...
java
public void buildEnumConstant(XMLNode node, Content memberDetailsTree) throws DocletException { if (writer == null) { return; } if (hasMembersToDocument()) { Content enumConstantsDetailsTree = writer.getEnumConstantsDetailsTreeHeader(typeElement, membe...
[ "public", "void", "buildEnumConstant", "(", "XMLNode", "node", ",", "Content", "memberDetailsTree", ")", "throws", "DocletException", "{", "if", "(", "writer", "==", "null", ")", "{", "return", ";", "}", "if", "(", "hasMembersToDocument", "(", ")", ")", "{",...
Build the enum constant documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added @throws DocletException is there is a problem while building the documentation
[ "Build", "the", "enum", "constant", "documentation", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java#L135-L154
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java
ComputeNodesImpl.disableSchedulingAsync
public Observable<Void> disableSchedulingAsync(String poolId, String nodeId) { """ Disables task scheduling on the specified compute node. You can disable task scheduling on a node only if its current scheduling state is enabled. @param poolId The ID of the pool that contains the compute node. @param nodeId T...
java
public Observable<Void> disableSchedulingAsync(String poolId, String nodeId) { return disableSchedulingWithServiceResponseAsync(poolId, nodeId).map(new Func1<ServiceResponseWithHeaders<Void, ComputeNodeDisableSchedulingHeaders>, Void>() { @Override public Void call(ServiceResponseWithHea...
[ "public", "Observable", "<", "Void", ">", "disableSchedulingAsync", "(", "String", "poolId", ",", "String", "nodeId", ")", "{", "return", "disableSchedulingWithServiceResponseAsync", "(", "poolId", ",", "nodeId", ")", ".", "map", "(", "new", "Func1", "<", "Servi...
Disables task scheduling on the specified compute node. You can disable task scheduling on a node only if its current scheduling state is enabled. @param poolId The ID of the pool that contains the compute node. @param nodeId The ID of the compute node on which you want to disable task scheduling. @throws IllegalArgum...
[ "Disables", "task", "scheduling", "on", "the", "specified", "compute", "node", ".", "You", "can", "disable", "task", "scheduling", "on", "a", "node", "only", "if", "its", "current", "scheduling", "state", "is", "enabled", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1529-L1536
infinispan/infinispan
lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/TransactionalSharedLuceneLock.java
TransactionalSharedLuceneLock.commitTransactions
private void commitTransactions() throws IOException { """ Commits the existing transaction. It's illegal to call this if a transaction was not started. @throws IOException wraps Infinispan exceptions to adapt to Lucene's API """ try { tm.commit(); } catch (Exception e) { ...
java
private void commitTransactions() throws IOException { try { tm.commit(); } catch (Exception e) { log.unableToCommitTransaction(e); throw new IOException("SharedLuceneLock could not commit a transaction", e); } if (trace) { log.tracef("Batch transaction ...
[ "private", "void", "commitTransactions", "(", ")", "throws", "IOException", "{", "try", "{", "tm", ".", "commit", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "log", ".", "unableToCommitTransaction", "(", "e", ")", ";", "throw", "new", ...
Commits the existing transaction. It's illegal to call this if a transaction was not started. @throws IOException wraps Infinispan exceptions to adapt to Lucene's API
[ "Commits", "the", "existing", "transaction", ".", "It", "s", "illegal", "to", "call", "this", "if", "a", "transaction", "was", "not", "started", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/impl/TransactionalSharedLuceneLock.java#L128-L139
synchronoss/cpo-api
cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java
JdbcCpoAdapter.existsObject
@Override public <T> long existsObject(String name, T obj, Collection<CpoWhere> wheres) throws CpoException { """ The CpoAdapter will check to see if this object exists in the datasource. <p/> <pre>Example: <code> <p/> class SomeObject so = new SomeObject(); long count = 0; class CpoAdapter cpo = null; <...
java
@Override public <T> long existsObject(String name, T obj, Collection<CpoWhere> wheres) throws CpoException { Connection c = null; long objCount = -1; try { c = getReadConnection(); objCount = existsObject(name, obj, c, wheres); } catch (Exception e) { throw new CpoException("exist...
[ "@", "Override", "public", "<", "T", ">", "long", "existsObject", "(", "String", "name", ",", "T", "obj", ",", "Collection", "<", "CpoWhere", ">", "wheres", ")", "throws", "CpoException", "{", "Connection", "c", "=", "null", ";", "long", "objCount", "=",...
The CpoAdapter will check to see if this object exists in the datasource. <p/> <pre>Example: <code> <p/> class SomeObject so = new SomeObject(); long count = 0; class CpoAdapter cpo = null; <p/> <p/> try { cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false)); } catch (CpoException ce)...
[ "The", "CpoAdapter", "will", "check", "to", "see", "if", "this", "object", "exists", "in", "the", "datasource", ".", "<p", "/", ">", "<pre", ">", "Example", ":", "<code", ">", "<p", "/", ">", "class", "SomeObject", "so", "=", "new", "SomeObject", "()",...
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L1009-L1025
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
ImageIOHelper.mergeTiff
public static void mergeTiff(List<IIOImage> imageList, File outputTiff, String compressionType) throws IOException { """ Merges multiple images into one multi-page TIFF image. @param imageList a list of <code>IIOImage</code> objects @param outputTiff the output TIFF file @param compressionType valid values: L...
java
public static void mergeTiff(List<IIOImage> imageList, File outputTiff, String compressionType) throws IOException { if (imageList == null || imageList.isEmpty()) { // if no image return; } Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(TIFF_FORMAT);...
[ "public", "static", "void", "mergeTiff", "(", "List", "<", "IIOImage", ">", "imageList", ",", "File", "outputTiff", ",", "String", "compressionType", ")", "throws", "IOException", "{", "if", "(", "imageList", "==", "null", "||", "imageList", ".", "isEmpty", ...
Merges multiple images into one multi-page TIFF image. @param imageList a list of <code>IIOImage</code> objects @param outputTiff the output TIFF file @param compressionType valid values: LZW, CCITT T.6, PackBits @throws IOException
[ "Merges", "multiple", "images", "into", "one", "multi", "-", "page", "TIFF", "image", "." ]
train
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L546-L594
Azure/azure-sdk-for-java
containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java
ContainersInner.listLogs
public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { """ Get the logs for a specified container instance. Get the logs for a specified container instance in a specified resource group and container group. @param resourceGroupName The name of the r...
java
public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); }
[ "public", "LogsInner", "listLogs", "(", "String", "resourceGroupName", ",", "String", "containerGroupName", ",", "String", "containerName", ",", "Integer", "tail", ")", "{", "return", "listLogsWithServiceResponseAsync", "(", "resourceGroupName", ",", "containerGroupName",...
Get the logs for a specified container instance. Get the logs for a specified container instance in a specified resource group and container group. @param resourceGroupName The name of the resource group. @param containerGroupName The name of the container group. @param containerName The name of the container instance...
[ "Get", "the", "logs", "for", "a", "specified", "container", "instance", ".", "Get", "the", "logs", "for", "a", "specified", "container", "instance", "in", "a", "specified", "resource", "group", "and", "container", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java#L172-L174
powermock/powermock
powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java
PowerMock.expectNiceNew
public static synchronized <T> IExpectationSetters<T> expectNiceNew(Class<T> type, Object... arguments) throws Exception { """ Allows specifying expectations on new invocations. For example you might want to throw an exception or return a mock. <p/> This method allows any number of calls to a new co...
java
public static synchronized <T> IExpectationSetters<T> expectNiceNew(Class<T> type, Object... arguments) throws Exception { return doExpectNew(type, new NiceMockStrategy(), null, arguments); }
[ "public", "static", "synchronized", "<", "T", ">", "IExpectationSetters", "<", "T", ">", "expectNiceNew", "(", "Class", "<", "T", ">", "type", ",", "Object", "...", "arguments", ")", "throws", "Exception", "{", "return", "doExpectNew", "(", "type", ",", "n...
Allows specifying expectations on new invocations. For example you might want to throw an exception or return a mock. <p/> This method allows any number of calls to a new constructor without throwing an exception. <p/> Note that you must replay the class when using this method since this behavior is part of the class m...
[ "Allows", "specifying", "expectations", "on", "new", "invocations", ".", "For", "example", "you", "might", "want", "to", "throw", "an", "exception", "or", "return", "a", "mock", ".", "<p", "/", ">", "This", "method", "allows", "any", "number", "of", "calls...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1730-L1733
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/util/MapViewProjection.java
MapViewProjection.fromPixels
public LatLong fromPixels(double x, double y) { """ Computes the geographic coordinates of a screen point. @return the coordinates of the x/y point """ if (this.mapView.getWidth() <= 0 || this.mapView.getHeight() <= 0) { return null; } // this uses the framebuffer positi...
java
public LatLong fromPixels(double x, double y) { if (this.mapView.getWidth() <= 0 || this.mapView.getHeight() <= 0) { return null; } // this uses the framebuffer position, the mapview position can be out of sync with // what the user sees on the screen if an animation is in p...
[ "public", "LatLong", "fromPixels", "(", "double", "x", ",", "double", "y", ")", "{", "if", "(", "this", ".", "mapView", ".", "getWidth", "(", ")", "<=", "0", "||", "this", ".", "mapView", ".", "getHeight", "(", ")", "<=", "0", ")", "{", "return", ...
Computes the geographic coordinates of a screen point. @return the coordinates of the x/y point
[ "Computes", "the", "geographic", "coordinates", "of", "a", "screen", "point", "." ]
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/util/MapViewProjection.java#L39-L69
tipsy/javalin
src/main/java/io/javalin/Javalin.java
Javalin.createStandalone
public static Javalin createStandalone(Consumer<JavalinConfig> config) { """ Create a standalone (non-jetty dependent) Javalin with the supplied config """ Javalin app = new Javalin(null, null); JavalinConfig.applyUserConfig(app, app.config, config); // mutates app.config and app (adds http-han...
java
public static Javalin createStandalone(Consumer<JavalinConfig> config) { Javalin app = new Javalin(null, null); JavalinConfig.applyUserConfig(app, app.config, config); // mutates app.config and app (adds http-handlers) return app; }
[ "public", "static", "Javalin", "createStandalone", "(", "Consumer", "<", "JavalinConfig", ">", "config", ")", "{", "Javalin", "app", "=", "new", "Javalin", "(", "null", ",", "null", ")", ";", "JavalinConfig", ".", "applyUserConfig", "(", "app", ",", "app", ...
Create a standalone (non-jetty dependent) Javalin with the supplied config
[ "Create", "a", "standalone", "(", "non", "-", "jetty", "dependent", ")", "Javalin", "with", "the", "supplied", "config" ]
train
https://github.com/tipsy/javalin/blob/68b2f7592f237db1c2b597e645697eb75fdaee53/src/main/java/io/javalin/Javalin.java#L93-L97
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java
Pubsub.deleteTopic
public PubsubFuture<Void> deleteTopic(final String project, final String topic) { """ Delete a Pub/Sub topic. @param project The Google Cloud project. @param topic The name of the topic to delete. @return A future that is completed when this request is completed. The ...
java
public PubsubFuture<Void> deleteTopic(final String project, final String topic) { return deleteTopic(canonicalTopic(project, topic)); }
[ "public", "PubsubFuture", "<", "Void", ">", "deleteTopic", "(", "final", "String", "project", ",", "final", "String", "topic", ")", "{", "return", "deleteTopic", "(", "canonicalTopic", "(", "project", ",", "topic", ")", ")", ";", "}" ]
Delete a Pub/Sub topic. @param project The Google Cloud project. @param topic The name of the topic to delete. @return A future that is completed when this request is completed. The future will be completed with {@code null} if the response is 404.
[ "Delete", "a", "Pub", "/", "Sub", "topic", "." ]
train
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L330-L333
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfActions.java
MmtfActions.writeToFile
public static void writeToFile(Structure structure, Path path) throws IOException { """ Write a Structure object to a file. @param structure the Structure to write @param path the file to write @throws IOException """ // Set up this writer AdapterToStructureData writerToEncoder = new AdapterToStructureD...
java
public static void writeToFile(Structure structure, Path path) throws IOException { // Set up this writer AdapterToStructureData writerToEncoder = new AdapterToStructureData(); // Get the writer - this is what people implement new MmtfStructureWriter(structure, writerToEncoder); // Now write this data to file...
[ "public", "static", "void", "writeToFile", "(", "Structure", "structure", ",", "Path", "path", ")", "throws", "IOException", "{", "// Set up this writer", "AdapterToStructureData", "writerToEncoder", "=", "new", "AdapterToStructureData", "(", ")", ";", "// Get the write...
Write a Structure object to a file. @param structure the Structure to write @param path the file to write @throws IOException
[ "Write", "a", "Structure", "object", "to", "a", "file", "." ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfActions.java#L63-L70
hector-client/hector
core/src/main/java/me/prettyprint/cassandra/connection/security/KerberosHelper.java
KerberosHelper.loginService
public static Subject loginService(String serviceName) throws LoginException { """ Log in using the service name for jaas.conf file and .keytab instead of specifying username and password @param serviceName service name defined in jass.conf file @return the authenticated Subject or <code>null</code> is the aut...
java
public static Subject loginService(String serviceName) throws LoginException { LoginContext loginCtx = new LoginContext(serviceName, new CallbackHandler() { // as we use .keytab file there is no need to specify any options in callback public void handle(Callback[] callbacks) throws IOException, ...
[ "public", "static", "Subject", "loginService", "(", "String", "serviceName", ")", "throws", "LoginException", "{", "LoginContext", "loginCtx", "=", "new", "LoginContext", "(", "serviceName", ",", "new", "CallbackHandler", "(", ")", "{", "// as we use .keytab file ther...
Log in using the service name for jaas.conf file and .keytab instead of specifying username and password @param serviceName service name defined in jass.conf file @return the authenticated Subject or <code>null</code> is the authentication failed @throws LoginException if there is any error during the login
[ "Log", "in", "using", "the", "service", "name", "for", "jaas", ".", "conf", "file", "and", ".", "keytab", "instead", "of", "specifying", "username", "and", "password" ]
train
https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/cassandra/connection/security/KerberosHelper.java#L34-L44
jbundle/jbundle
thin/base/remote/src/main/java/org/jbundle/thin/base/message/remote/RemoteMessageSender.java
RemoteMessageSender.init
public void init(RemoteTask server, BaseMessageQueue baseMessageQueue) throws RemoteException { """ Creates new MessageSender. @param server The remote server. @param baseMessageQueue My parent message queue. """ super.init(baseMessageQueue); m_sendQueue = server.createRemoteSendQueue...
java
public void init(RemoteTask server, BaseMessageQueue baseMessageQueue) throws RemoteException { super.init(baseMessageQueue); m_sendQueue = server.createRemoteSendQueue(baseMessageQueue.getQueueName(), baseMessageQueue.getQueueType()); }
[ "public", "void", "init", "(", "RemoteTask", "server", ",", "BaseMessageQueue", "baseMessageQueue", ")", "throws", "RemoteException", "{", "super", ".", "init", "(", "baseMessageQueue", ")", ";", "m_sendQueue", "=", "server", ".", "createRemoteSendQueue", "(", "ba...
Creates new MessageSender. @param server The remote server. @param baseMessageQueue My parent message queue.
[ "Creates", "new", "MessageSender", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/message/remote/RemoteMessageSender.java#L55-L60
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/message/MessageBundleScriptCreator.java
MessageBundleScriptCreator.doCreateScript
protected Reader doCreateScript(Properties props) { """ Returns the JS script from the message properties @param props the message properties @return the JS script from the message properties """ BundleStringJsonifier bsj = new BundleStringJsonifier(props, addQuoteToMessageKey); String script = templa...
java
protected Reader doCreateScript(Properties props) { BundleStringJsonifier bsj = new BundleStringJsonifier(props, addQuoteToMessageKey); String script = template.toString(); String messages = bsj.serializeBundles().toString(); script = script.replaceFirst("@namespace", RegexUtil.adaptReplacementToMatcher(namespa...
[ "protected", "Reader", "doCreateScript", "(", "Properties", "props", ")", "{", "BundleStringJsonifier", "bsj", "=", "new", "BundleStringJsonifier", "(", "props", ",", "addQuoteToMessageKey", ")", ";", "String", "script", "=", "template", ".", "toString", "(", ")",...
Returns the JS script from the message properties @param props the message properties @return the JS script from the message properties
[ "Returns", "the", "JS", "script", "from", "the", "message", "properties" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/message/MessageBundleScriptCreator.java#L255-L263
awslabs/jsii
packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/Util.java
Util.javaScriptPropertyToJavaPropertyName
static String javaScriptPropertyToJavaPropertyName(final String prefix, final String jsPropertyName) { """ Converts a javascript property name (xxx) to a Java property method (setXxx/getXxx). @param prefix The prefix (get/set) @param jsPropertyName The javascript property name @return The java method name "...
java
static String javaScriptPropertyToJavaPropertyName(final String prefix, final String jsPropertyName) { if (jsPropertyName.isEmpty()) { throw new JsiiException("jsPropertyName must not be empty"); } StringBuilder sb = new StringBuilder(); sb.append(prefix); sb.append(...
[ "static", "String", "javaScriptPropertyToJavaPropertyName", "(", "final", "String", "prefix", ",", "final", "String", "jsPropertyName", ")", "{", "if", "(", "jsPropertyName", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "JsiiException", "(", "\"jsPropertyNa...
Converts a javascript property name (xxx) to a Java property method (setXxx/getXxx). @param prefix The prefix (get/set) @param jsPropertyName The javascript property name @return The java method name
[ "Converts", "a", "javascript", "property", "name", "(", "xxx", ")", "to", "a", "Java", "property", "method", "(", "setXxx", "/", "getXxx", ")", "." ]
train
https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/Util.java#L80-L92
biojava/biojava
biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java
NCBIQBlastService.sendAlignmentRequest
@Override public String sendAlignmentRequest(Sequence<Compound> seq, RemotePairwiseAlignmentProperties rpa) throws Exception { """ Converts given sequence to String and calls {@link #sendAlignmentRequest(String, RemotePairwiseAlignmentProperties)} """ return sendAlignmentRequest(seq.getSequenceAsString(), ...
java
@Override public String sendAlignmentRequest(Sequence<Compound> seq, RemotePairwiseAlignmentProperties rpa) throws Exception { return sendAlignmentRequest(seq.getSequenceAsString(), rpa); }
[ "@", "Override", "public", "String", "sendAlignmentRequest", "(", "Sequence", "<", "Compound", ">", "seq", ",", "RemotePairwiseAlignmentProperties", "rpa", ")", "throws", "Exception", "{", "return", "sendAlignmentRequest", "(", "seq", ".", "getSequenceAsString", "(", ...
Converts given sequence to String and calls {@link #sendAlignmentRequest(String, RemotePairwiseAlignmentProperties)}
[ "Converts", "given", "sequence", "to", "String", "and", "calls", "{" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java#L142-L145
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java
SARLEclipsePlugin.createMultiStatus
@SuppressWarnings("static-method") public IStatus createMultiStatus(Iterable<? extends IStatus> status) { """ Create a multistatus. @param status the status to put in the same status instance. @return the status. """ final IStatus max = findMax(status); final MultiStatus multiStatus; if (max == null...
java
@SuppressWarnings("static-method") public IStatus createMultiStatus(Iterable<? extends IStatus> status) { final IStatus max = findMax(status); final MultiStatus multiStatus; if (max == null) { multiStatus = new MultiStatus(PLUGIN_ID, 0, null, null); } else { multiStatus = new MultiStatus(PLUGIN_ID, 0, ma...
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "public", "IStatus", "createMultiStatus", "(", "Iterable", "<", "?", "extends", "IStatus", ">", "status", ")", "{", "final", "IStatus", "max", "=", "findMax", "(", "status", ")", ";", "final", "MultiStatu...
Create a multistatus. @param status the status to put in the same status instance. @return the status.
[ "Create", "a", "multistatus", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L256-L269
EdwardRaff/JSAT
JSAT/src/jsat/datatransform/featureselection/SFS.java
SFS.SFSSelectFeature
static protected int SFSSelectFeature(Set<Integer> available, DataSet dataSet, Set<Integer> catToRemove, Set<Integer> numToRemove, Set<Integer> catSelecteed, Set<Integer> numSelected, Object evaluater, int folds, Random rand, double[] PbestScore, int minFeatures) { ...
java
static protected int SFSSelectFeature(Set<Integer> available, DataSet dataSet, Set<Integer> catToRemove, Set<Integer> numToRemove, Set<Integer> catSelecteed, Set<Integer> numSelected, Object evaluater, int folds, Random rand, double[] PbestScore, int minFeatures) {...
[ "static", "protected", "int", "SFSSelectFeature", "(", "Set", "<", "Integer", ">", "available", ",", "DataSet", "dataSet", ",", "Set", "<", "Integer", ">", "catToRemove", ",", "Set", "<", "Integer", ">", "numToRemove", ",", "Set", "<", "Integer", ">", "cat...
Attempts to add one feature to the list of features while increasing or maintaining the current accuracy @param available the set of available features from [0, n) to consider for adding @param dataSet the original data set to perform feature selection from @param catToRemove the current set of categorical features to...
[ "Attempts", "to", "add", "one", "feature", "to", "the", "list", "of", "features", "while", "increasing", "or", "maintaining", "the", "current", "accuracy" ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/featureselection/SFS.java#L256-L297
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/DatabaseImpl.java
DatabaseImpl.deletePersistent
public void deletePersistent(Object object) { """ Deletes an object from the database. It must be executed in the context of an open transaction. If the object is not persistent, then ObjectNotPersistent is thrown. If the transaction in which this method is executed commits, then the object is removed from the...
java
public void deletePersistent(Object object) { if (!this.isOpen()) { throw new DatabaseClosedException("Database is not open"); } TransactionImpl tx = getTransaction(); if (tx == null || !tx.isOpen()) { throw new TransactionNotInProgres...
[ "public", "void", "deletePersistent", "(", "Object", "object", ")", "{", "if", "(", "!", "this", ".", "isOpen", "(", ")", ")", "{", "throw", "new", "DatabaseClosedException", "(", "\"Database is not open\"", ")", ";", "}", "TransactionImpl", "tx", "=", "getT...
Deletes an object from the database. It must be executed in the context of an open transaction. If the object is not persistent, then ObjectNotPersistent is thrown. If the transaction in which this method is executed commits, then the object is removed from the database. If the transaction aborts, then the deletePersis...
[ "Deletes", "an", "object", "from", "the", "database", ".", "It", "must", "be", "executed", "in", "the", "context", "of", "an", "open", "transaction", ".", "If", "the", "object", "is", "not", "persistent", "then", "ObjectNotPersistent", "is", "thrown", ".", ...
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/DatabaseImpl.java#L310-L324
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/MetricDto.java
MetricDto.transformToDto
public static MetricDto transformToDto(Metric metric) { """ Converts a metric entity to a DTO. @param metric The metric to convert. @return The corresponding DTO. @throws WebApplicationException If an error occurs. """ if (metric == null) { throw new WebApplicationException("...
java
public static MetricDto transformToDto(Metric metric) { if (metric == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } MetricDto result = createDtoObject(MetricDto.class, metric); return resu...
[ "public", "static", "MetricDto", "transformToDto", "(", "Metric", "metric", ")", "{", "if", "(", "metric", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Null entity object cannot be converted to Dto object.\"", ",", "Status", ".", "INTERNA...
Converts a metric entity to a DTO. @param metric The metric to convert. @return The corresponding DTO. @throws WebApplicationException If an error occurs.
[ "Converts", "a", "metric", "entity", "to", "a", "DTO", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/MetricDto.java#L72-L80