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.jpa.container.core/src/com/ibm/ws/jpa/management/JPAIntrospection.java
JPAIntrospection.reflectObjValue
private static Object reflectObjValue(Object o, String field) throws Exception { """ /* Utility methods used for introspecting JPA Persistence Provider Implementation Data Structures """ final Class<?> c = o.getClass(); final Field f = findField(c, field); // c.getField(field); ...
java
private static Object reflectObjValue(Object o, String field) throws Exception { final Class<?> c = o.getClass(); final Field f = findField(c, field); // c.getField(field); if (f == null) { return null; } final boolean accessible = f.isAccessible(); try...
[ "private", "static", "Object", "reflectObjValue", "(", "Object", "o", ",", "String", "field", ")", "throws", "Exception", "{", "final", "Class", "<", "?", ">", "c", "=", "o", ".", "getClass", "(", ")", ";", "final", "Field", "f", "=", "findField", "(",...
/* Utility methods used for introspecting JPA Persistence Provider Implementation Data Structures
[ "/", "*", "Utility", "methods", "used", "for", "introspecting", "JPA", "Persistence", "Provider", "Implementation", "Data", "Structures" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAIntrospection.java#L747-L760
RuedigerMoeller/kontraktor
examples/REST/src/main/java/examples/rest/RESTActor.java
RESTActor.postStuff1
public IPromise postStuff1(JsonObject body, HeaderMap headerValues ) { """ curl -i -X POST --data "{ \"key\": \"value\", \"nkey\": 13 }" http://localhost:8080/api/stuff1 """ headerValues.forEach( hv -> { Log.Info(this,""+hv.getHeaderName()); hv.forEach( s -> { Lo...
java
public IPromise postStuff1(JsonObject body, HeaderMap headerValues ) { headerValues.forEach( hv -> { Log.Info(this,""+hv.getHeaderName()); hv.forEach( s -> { Log.Info(this," "+s); }); }); Log.Info(this,""+body); return resolve(new Pa...
[ "public", "IPromise", "postStuff1", "(", "JsonObject", "body", ",", "HeaderMap", "headerValues", ")", "{", "headerValues", ".", "forEach", "(", "hv", "->", "{", "Log", ".", "Info", "(", "this", ",", "\"\"", "+", "hv", ".", "getHeaderName", "(", ")", ")",...
curl -i -X POST --data "{ \"key\": \"value\", \"nkey\": 13 }" http://localhost:8080/api/stuff1
[ "curl", "-", "i", "-", "X", "POST", "--", "data", "{", "\\", "key", "\\", ":", "\\", "value", "\\", "\\", "nkey", "\\", ":", "13", "}", "http", ":", "//", "localhost", ":", "8080", "/", "api", "/", "stuff1" ]
train
https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/examples/REST/src/main/java/examples/rest/RESTActor.java#L35-L44
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.getAt
@SuppressWarnings("unchecked") public static List<Long> getAt(long[] array, IntRange range) { """ Support the subscript operator with an IntRange for a long array @param array a long array @param range an IntRange indicating the indices for the items to retrieve @return list of the retrieved longs @since...
java
@SuppressWarnings("unchecked") public static List<Long> getAt(long[] array, IntRange range) { RangeInfo info = subListBorders(array.length, range); List<Long> answer = primitiveArrayGet(array, new IntRange(true, info.from, info.to - 1)); return info.reverse ? reverse(answer) : answer; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "List", "<", "Long", ">", "getAt", "(", "long", "[", "]", "array", ",", "IntRange", "range", ")", "{", "RangeInfo", "info", "=", "subListBorders", "(", "array", ".", "length", ",", "...
Support the subscript operator with an IntRange for a long array @param array a long array @param range an IntRange indicating the indices for the items to retrieve @return list of the retrieved longs @since 1.0
[ "Support", "the", "subscript", "operator", "with", "an", "IntRange", "for", "a", "long", "array" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13774-L13779
elki-project/elki
elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/SimplifiedCoverTree.java
SimplifiedCoverTree.checkCoverTree
private void checkCoverTree(Node cur, int[] counts, int depth) { """ Collect some statistics on the tree. @param cur Current node @param counts Counter set @param depth Current depth """ counts[0] += 1; // Node count counts[1] += depth; // Sum of depth counts[2] = depth > counts[2] ? depth : c...
java
private void checkCoverTree(Node cur, int[] counts, int depth) { counts[0] += 1; // Node count counts[1] += depth; // Sum of depth counts[2] = depth > counts[2] ? depth : counts[2]; // Max depth counts[3] += cur.singletons.size() - 1; counts[4] += cur.singletons.size() - (cur.children == null ? 0 : ...
[ "private", "void", "checkCoverTree", "(", "Node", "cur", ",", "int", "[", "]", "counts", ",", "int", "depth", ")", "{", "counts", "[", "0", "]", "+=", "1", ";", "// Node count", "counts", "[", "1", "]", "+=", "depth", ";", "// Sum of depth", "counts", ...
Collect some statistics on the tree. @param cur Current node @param counts Counter set @param depth Current depth
[ "Collect", "some", "statistics", "on", "the", "tree", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/SimplifiedCoverTree.java#L269-L282
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/util/CompilerUtil.java
CompilerUtil.formatForDisplay
private static String formatForDisplay(String setterMethodName, List<Object> args) { """ Formats the specified setter method and parameters into a string for display. <p> For example: <code>setXXX(arg1, ar2)</code> @param setterMethodName the method name @param args the method arguments @return the format...
java
private static String formatForDisplay(String setterMethodName, List<Object> args) { StringBuilder sb = new StringBuilder(CompilerOptions.class.getName()); sb.append(".").append(setterMethodName).append("("); //$NON-NLS-1$ //$NON-NLS-2$ Joiner.on(",").appendTo(sb, args).append(")"); //$NON-NLS-1$ //$NON-NLS-2$...
[ "private", "static", "String", "formatForDisplay", "(", "String", "setterMethodName", ",", "List", "<", "Object", ">", "args", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "CompilerOptions", ".", "class", ".", "getName", "(", ")", ")", ...
Formats the specified setter method and parameters into a string for display. <p> For example: <code>setXXX(arg1, ar2)</code> @param setterMethodName the method name @param args the method arguments @return the formatted string
[ "Formats", "the", "specified", "setter", "method", "and", "parameters", "into", "a", "string", "for", "display", ".", "<p", ">", "For", "example", ":", "<code", ">", "setXXX", "(", "arg1", "ar2", ")", "<", "/", "code", ">" ]
train
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/CompilerUtil.java#L487-L492
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
HadoopUtils.renamePathHandleLocalFSRace
public static boolean renamePathHandleLocalFSRace(FileSystem fs, Path src, Path dst) throws IOException { """ Renames a src {@link Path} on fs {@link FileSystem} to a dst {@link Path}. If fs is a {@link LocalFileSystem} and src is a directory then {@link File#renameTo} is called directly to avoid a directory rena...
java
public static boolean renamePathHandleLocalFSRace(FileSystem fs, Path src, Path dst) throws IOException { if (DecoratorUtils.resolveUnderlyingObject(fs) instanceof LocalFileSystem && fs.isDirectory(src)) { LocalFileSystem localFs = (LocalFileSystem) DecoratorUtils.resolveUnderlyingObject(fs); File srcFi...
[ "public", "static", "boolean", "renamePathHandleLocalFSRace", "(", "FileSystem", "fs", ",", "Path", "src", ",", "Path", "dst", ")", "throws", "IOException", "{", "if", "(", "DecoratorUtils", ".", "resolveUnderlyingObject", "(", "fs", ")", "instanceof", "LocalFileS...
Renames a src {@link Path} on fs {@link FileSystem} to a dst {@link Path}. If fs is a {@link LocalFileSystem} and src is a directory then {@link File#renameTo} is called directly to avoid a directory rename race condition where {@link org.apache.hadoop.fs.RawLocalFileSystem#rename} copies the conflicting src directory ...
[ "Renames", "a", "src", "{", "@link", "Path", "}", "on", "fs", "{", "@link", "FileSystem", "}", "to", "a", "dst", "{", "@link", "Path", "}", ".", "If", "fs", "is", "a", "{", "@link", "LocalFileSystem", "}", "and", "src", "is", "a", "directory", "the...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L227-L238
undertow-io/undertow
core/src/main/java/io/undertow/websockets/core/WebSockets.java
WebSockets.sendText
public static void sendText(final String message, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) { """ Sends a complete text message, invoking the callback when complete @param message The text to send @param wsChannel The web socket channel @param callback The callback to invoke on...
java
public static void sendText(final String message, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) { sendText(message, wsChannel, callback, null); }
[ "public", "static", "void", "sendText", "(", "final", "String", "message", ",", "final", "WebSocketChannel", "wsChannel", ",", "final", "WebSocketCallback", "<", "Void", ">", "callback", ")", "{", "sendText", "(", "message", ",", "wsChannel", ",", "callback", ...
Sends a complete text message, invoking the callback when complete @param message The text to send @param wsChannel The web socket channel @param callback The callback to invoke on completion
[ "Sends", "a", "complete", "text", "message", "invoking", "the", "callback", "when", "complete" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L49-L51
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/PreferencesMngrImpl.java
PreferencesMngrImpl.updateProperties
@Override public void updateProperties( Dictionary<?,?> properties ) { """ Invoked by iPojo when one or several properties were updated from Config Admin. @param properties """ // Ignore iPojo properties final List<String> propertiesToSkip = Arrays.asList( "component", "felix.fileinstall.filenam...
java
@Override public void updateProperties( Dictionary<?,?> properties ) { // Ignore iPojo properties final List<String> propertiesToSkip = Arrays.asList( "component", "felix.fileinstall.filename" ); Map<String,String> map = new HashMap<> (); for( Enumeration<?> en = properties.keys(); en.hasMoreElements...
[ "@", "Override", "public", "void", "updateProperties", "(", "Dictionary", "<", "?", ",", "?", ">", "properties", ")", "{", "// Ignore iPojo properties", "final", "List", "<", "String", ">", "propertiesToSkip", "=", "Arrays", ".", "asList", "(", "\"component\"", ...
Invoked by iPojo when one or several properties were updated from Config Admin. @param properties
[ "Invoked", "by", "iPojo", "when", "one", "or", "several", "properties", "were", "updated", "from", "Config", "Admin", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/PreferencesMngrImpl.java#L87-L112
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-display/src/main/java/org/xwiki/diff/display/internal/DefaultUnifiedDiffDisplayer.java
DefaultUnifiedDiffDisplayer.maybeEndBlock
private <E, F> void maybeEndBlock(State<E, F> state, int contextSize) { """ Ends the last {@link UnifiedDiffBlock} by adding a number of unmodified elements. @param state the state of the displayer @param contextSize the number of unmodified elements to display at the end of a block @param <E> the type of com...
java
private <E, F> void maybeEndBlock(State<E, F> state, int contextSize) { if (!state.getBlocks().isEmpty()) { int start = state.getLastDelta().getPrevious().getLastIndex() + 1; int end = Math.min(start + contextSize, state.getPrevious().size()); state.getBlocks().peek().add...
[ "private", "<", "E", ",", "F", ">", "void", "maybeEndBlock", "(", "State", "<", "E", ",", "F", ">", "state", ",", "int", "contextSize", ")", "{", "if", "(", "!", "state", ".", "getBlocks", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "int", "s...
Ends the last {@link UnifiedDiffBlock} by adding a number of unmodified elements. @param state the state of the displayer @param contextSize the number of unmodified elements to display at the end of a block @param <E> the type of composite elements that are compared to produce the first level diff @param <F> the type...
[ "Ends", "the", "last", "{", "@link", "UnifiedDiffBlock", "}", "by", "adding", "a", "number", "of", "unmodified", "elements", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-diff/xwiki-commons-diff-display/src/main/java/org/xwiki/diff/display/internal/DefaultUnifiedDiffDisplayer.java#L289-L296
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java
InterfaceEndpointsInner.createOrUpdate
public InterfaceEndpointInner createOrUpdate(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { """ Creates or updates an interface endpoint in the specified resource group. @param resourceGroupName The name of the resource group. @param interfaceEndpointName The name ...
java
public InterfaceEndpointInner createOrUpdate(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).toBlocking().last().body(); }
[ "public", "InterfaceEndpointInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "interfaceEndpointName", ",", "InterfaceEndpointInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "interface...
Creates or updates an interface endpoint in the specified resource group. @param resourceGroupName The name of the resource group. @param interfaceEndpointName The name of the interface endpoint. @param parameters Parameters supplied to the create or update interface endpoint operation @throws IllegalArgumentException...
[ "Creates", "or", "updates", "an", "interface", "endpoint", "in", "the", "specified", "resource", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java#L433-L435
iron-io/iron_mq_java
src/main/java/io/iron/ironmq/Queues.java
Queues.getQueues
public static ArrayList<QueueModel> getQueues(Client client) throws IOException { """ Retrieves queues in alphabetical order. @throws HTTPException If the IronMQ service returns a status other than 200 OK. @throws java.io.IOException If there is an error accessing the IronMQ server. """ return getQ...
java
public static ArrayList<QueueModel> getQueues(Client client) throws IOException { return getQueues(client, null, null, null); }
[ "public", "static", "ArrayList", "<", "QueueModel", ">", "getQueues", "(", "Client", "client", ")", "throws", "IOException", "{", "return", "getQueues", "(", "client", ",", "null", ",", "null", ",", "null", ")", ";", "}" ]
Retrieves queues in alphabetical order. @throws HTTPException If the IronMQ service returns a status other than 200 OK. @throws java.io.IOException If there is an error accessing the IronMQ server.
[ "Retrieves", "queues", "in", "alphabetical", "order", "." ]
train
https://github.com/iron-io/iron_mq_java/blob/62d6a86545ca7ef31b7b4797aae0c5b31394a507/src/main/java/io/iron/ironmq/Queues.java#L36-L38
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/VfsOld.java
VfsOld.lookupNative
public static PathImpl lookupNative(String url, Map<String,Object> attr) { """ Returns a native filesystem path with attributes. @param url a relative path using the native filesystem conventions. @param attr attributes used in searching for the url """ return getPwd().lookupNative(url, attr); }
java
public static PathImpl lookupNative(String url, Map<String,Object> attr) { return getPwd().lookupNative(url, attr); }
[ "public", "static", "PathImpl", "lookupNative", "(", "String", "url", ",", "Map", "<", "String", ",", "Object", ">", "attr", ")", "{", "return", "getPwd", "(", ")", ".", "lookupNative", "(", "url", ",", "attr", ")", ";", "}" ]
Returns a native filesystem path with attributes. @param url a relative path using the native filesystem conventions. @param attr attributes used in searching for the url
[ "Returns", "a", "native", "filesystem", "path", "with", "attributes", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/VfsOld.java#L227-L230
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlLikeUtils.java
SqlLikeUtils.sqlToRegexSimilar
static String sqlToRegexSimilar( String sqlPattern, CharSequence escapeStr) { """ Translates a SQL SIMILAR pattern to Java regex pattern, with optional escape string. """ final char escapeChar; if (escapeStr != null) { if (escapeStr.length() != 1) { throw invalidEscapeCharacter(escapeStr.toStri...
java
static String sqlToRegexSimilar( String sqlPattern, CharSequence escapeStr) { final char escapeChar; if (escapeStr != null) { if (escapeStr.length() != 1) { throw invalidEscapeCharacter(escapeStr.toString()); } escapeChar = escapeStr.charAt(0); } else { escapeChar = 0; } return sqlToRegexS...
[ "static", "String", "sqlToRegexSimilar", "(", "String", "sqlPattern", ",", "CharSequence", "escapeStr", ")", "{", "final", "char", "escapeChar", ";", "if", "(", "escapeStr", "!=", "null", ")", "{", "if", "(", "escapeStr", ".", "length", "(", ")", "!=", "1"...
Translates a SQL SIMILAR pattern to Java regex pattern, with optional escape string.
[ "Translates", "a", "SQL", "SIMILAR", "pattern", "to", "Java", "regex", "pattern", "with", "optional", "escape", "string", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlLikeUtils.java#L213-L226
Netflix/conductor
core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java
ForkJoinDynamicTaskMapper.getDynamicForkTasksAndInput
@SuppressWarnings("unchecked") @VisibleForTesting Pair<List<WorkflowTask>, Map<String, Map<String, Object>>> getDynamicForkTasksAndInput(WorkflowTask taskToSchedule, Workflow workflowInstance, String dynamicForkTaskParam)...
java
@SuppressWarnings("unchecked") @VisibleForTesting Pair<List<WorkflowTask>, Map<String, Map<String, Object>>> getDynamicForkTasksAndInput(WorkflowTask taskToSchedule, Workflow workflowInstance, String dynamicForkTaskParam)...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "VisibleForTesting", "Pair", "<", "List", "<", "WorkflowTask", ">", ",", "Map", "<", "String", ",", "Map", "<", "String", ",", "Object", ">", ">", ">", "getDynamicForkTasksAndInput", "(", "WorkflowTask",...
This method is used to get the List of dynamic workflow tasks and their input based on the {@link WorkflowTask#getDynamicForkTasksParam()} @param taskToSchedule: The Task of type FORK_JOIN_DYNAMIC that needs to scheduled, which has the input parameters @param workflowInstance: The instance of the {@link Work...
[ "This", "method", "is", "used", "to", "get", "the", "List", "of", "dynamic", "workflow", "tasks", "and", "their", "input", "based", "on", "the", "{", "@link", "WorkflowTask#getDynamicForkTasksParam", "()", "}" ]
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java#L234-L252
dkpro/dkpro-argumentation
dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/WebArgumentMetadataHelper.java
WebArgumentMetadataHelper.copy
public static void copy(final JCas sourceView, final JCas targetView) throws IllegalArgumentException { """ Creates new {@linkplain WebArgumentMetadata} in the target and copies all meta data. @param sourceView source jCas @param targetView target jCas @throws IllegalArgumentException if the {@cod...
java
public static void copy(final JCas sourceView, final JCas targetView) throws IllegalArgumentException { if (hasWebArgumentMetadata(targetView)) { throw new IllegalArgumentException( "Target view already contains " + WebArgumentMetadata.class.getName()); } ...
[ "public", "static", "void", "copy", "(", "final", "JCas", "sourceView", ",", "final", "JCas", "targetView", ")", "throws", "IllegalArgumentException", "{", "if", "(", "hasWebArgumentMetadata", "(", "targetView", ")", ")", "{", "throw", "new", "IllegalArgumentExcep...
Creates new {@linkplain WebArgumentMetadata} in the target and copies all meta data. @param sourceView source jCas @param targetView target jCas @throws IllegalArgumentException if the {@code targetView} already contains {@linkplain WebArgumentMetadata}
[ "Creates", "new", "{", "@linkplain", "WebArgumentMetadata", "}", "in", "the", "target", "and", "copies", "all", "meta", "data", "." ]
train
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/WebArgumentMetadataHelper.java#L47-L70
gallandarakhneorg/afc
core/vmutils/src/main/java/org/arakhne/afc/vmutil/StringEscaper.java
StringEscaper.setValidCharRange
public void setValidCharRange(int minValidChar, int maxValidChar) { """ Change the range of the valid characters that should not be escaped. Any character outside the given range is automatically escaped. <p>If {@code maxValidChar} is lower or equal to zero, the invalid characters are not put within the resul...
java
public void setValidCharRange(int minValidChar, int maxValidChar) { if (minValidChar <= maxValidChar) { this.minValidChar = minValidChar; this.maxValidChar = maxValidChar; } else { this.maxValidChar = minValidChar; this.minValidChar = maxValidChar; } }
[ "public", "void", "setValidCharRange", "(", "int", "minValidChar", ",", "int", "maxValidChar", ")", "{", "if", "(", "minValidChar", "<=", "maxValidChar", ")", "{", "this", ".", "minValidChar", "=", "minValidChar", ";", "this", ".", "maxValidChar", "=", "maxVal...
Change the range of the valid characters that should not be escaped. Any character outside the given range is automatically escaped. <p>If {@code maxValidChar} is lower or equal to zero, the invalid characters are not put within the result of the escaping. @param minValidChar the code of the minimal valid character. ...
[ "Change", "the", "range", "of", "the", "valid", "characters", "that", "should", "not", "be", "escaped", ".", "Any", "character", "outside", "the", "given", "range", "is", "automatically", "escaped", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/StringEscaper.java#L135-L143
virgo47/javasimon
core/src/main/java/org/javasimon/callback/quantiles/Buckets.java
Buckets.computeQuantile
private double computeQuantile(double ration, int totalCount) throws IllegalStateException, IllegalArgumentException { """ Computes given quantile. @param ration Nth quantile: 0.5 is median @param totalCount Total count over all buckets @return Quantile @throws IllegalStateException Buckets are poorly config...
java
private double computeQuantile(double ration, int totalCount) throws IllegalStateException, IllegalArgumentException { if (ration <= 0.0D || ration >= 1.0D) { throw new IllegalArgumentException("Expected ratio between 0 and 1 excluded: " + ration); } final double expectedCount = ration * totalCount; // ...
[ "private", "double", "computeQuantile", "(", "double", "ration", ",", "int", "totalCount", ")", "throws", "IllegalStateException", ",", "IllegalArgumentException", "{", "if", "(", "ration", "<=", "0.0D", "||", "ration", ">=", "1.0D", ")", "{", "throw", "new", ...
Computes given quantile. @param ration Nth quantile: 0.5 is median @param totalCount Total count over all buckets @return Quantile @throws IllegalStateException Buckets are poorly configured and quantile can not be computed @throws IllegalArgumentException
[ "Computes", "given", "quantile", "." ]
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/quantiles/Buckets.java#L101-L126
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.unprojectRay
public Matrix4f unprojectRay(float winX, float winY, int[] viewport, Vector3f originDest, Vector3f dirDest) { """ /* (non-Javadoc) @see org.joml.Matrix4fc#unprojectRay(float, float, int[], org.joml.Vector3f, org.joml.Vector3f) """ float a = m00 * m11 - m01 * m10; float b = m00 * m12 - m02 * m1...
java
public Matrix4f unprojectRay(float winX, float winY, int[] viewport, Vector3f originDest, Vector3f dirDest) { float a = m00 * m11 - m01 * m10; float b = m00 * m12 - m02 * m10; float c = m00 * m13 - m03 * m10; float d = m01 * m12 - m02 * m11; float e = m01 * m13 - m03 * m11; ...
[ "public", "Matrix4f", "unprojectRay", "(", "float", "winX", ",", "float", "winY", ",", "int", "[", "]", "viewport", ",", "Vector3f", "originDest", ",", "Vector3f", "dirDest", ")", "{", "float", "a", "=", "m00", "*", "m11", "-", "m01", "*", "m10", ";", ...
/* (non-Javadoc) @see org.joml.Matrix4fc#unprojectRay(float, float, int[], org.joml.Vector3f, org.joml.Vector3f)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L11797-L11844
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Mail.java
Mail.setProxyport
public void setProxyport(double proxyport) throws ApplicationException { """ set the value proxyport The port number on the proxy server from which the object is requested. Default is 80. When used with resolveURL, the URLs of retrieved documents that specify a port number are automatically resolved to preserve ...
java
public void setProxyport(double proxyport) throws ApplicationException { try { smtp.getProxyData().setPort((int) proxyport); } catch (Exception e) { throw new ApplicationException("attribute [proxyport] of the tag [mail] is invalid", e.getMessage()); } }
[ "public", "void", "setProxyport", "(", "double", "proxyport", ")", "throws", "ApplicationException", "{", "try", "{", "smtp", ".", "getProxyData", "(", ")", ".", "setPort", "(", "(", "int", ")", "proxyport", ")", ";", "}", "catch", "(", "Exception", "e", ...
set the value proxyport The port number on the proxy server from which the object is requested. Default is 80. When used with resolveURL, the URLs of retrieved documents that specify a port number are automatically resolved to preserve links in the retrieved document. @param proxyport value to set @throws ApplicationE...
[ "set", "the", "value", "proxyport", "The", "port", "number", "on", "the", "proxy", "server", "from", "which", "the", "object", "is", "requested", ".", "Default", "is", "80", ".", "When", "used", "with", "resolveURL", "the", "URLs", "of", "retrieved", "docu...
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L140-L147
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/util/EventListenerListHelper.java
EventListenerListHelper.fire
public void fire(String methodName, Object[] args) { """ Invokes the method with the given name and number of formal parameters on each of the listeners registered with this list. @param methodName the name of the method to invoke. @param args an array of arguments to pass to each invocation. @throws Illeg...
java
public void fire(String methodName, Object[] args) { if (listeners != EMPTY_OBJECT_ARRAY) { fireEventByReflection(methodName, args); } }
[ "public", "void", "fire", "(", "String", "methodName", ",", "Object", "[", "]", "args", ")", "{", "if", "(", "listeners", "!=", "EMPTY_OBJECT_ARRAY", ")", "{", "fireEventByReflection", "(", "methodName", ",", "args", ")", ";", "}", "}" ]
Invokes the method with the given name and number of formal parameters on each of the listeners registered with this list. @param methodName the name of the method to invoke. @param args an array of arguments to pass to each invocation. @throws IllegalArgumentException if no method with the given name and number of f...
[ "Invokes", "the", "method", "with", "the", "given", "name", "and", "number", "of", "formal", "parameters", "on", "each", "of", "the", "listeners", "registered", "with", "this", "list", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/EventListenerListHelper.java#L266-L270
undertow-io/undertow
core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPHandler.java
MCMPHandler.processError
static void processError(String type, String errString, HttpServerExchange exchange) { """ Send an error message. @param type the error type @param errString the error string @param exchange the http server exchange """ exchange.setStatusCode(StatusCodes.INTERNAL_SERVER_ERROR); ...
java
static void processError(String type, String errString, HttpServerExchange exchange) { exchange.setStatusCode(StatusCodes.INTERNAL_SERVER_ERROR); exchange.getResponseHeaders().add(Headers.CONTENT_TYPE, CONTENT_TYPE); exchange.getResponseHeaders().add(new HttpString("Version"), VERSION_PROTOCOL);...
[ "static", "void", "processError", "(", "String", "type", ",", "String", "errString", ",", "HttpServerExchange", "exchange", ")", "{", "exchange", ".", "setStatusCode", "(", "StatusCodes", ".", "INTERNAL_SERVER_ERROR", ")", ";", "exchange", ".", "getResponseHeaders",...
Send an error message. @param type the error type @param errString the error string @param exchange the http server exchange
[ "Send", "an", "error", "message", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPHandler.java#L739-L747
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/ComputeFunction.java
ComputeFunction.sendMessageTo
public final void sendMessageTo(K target, Message m) { """ Sends the given message to the vertex identified by the given key. If the target vertex does not exist, the next superstep will cause an exception due to a non-deliverable message. @param target The key (id) of the target vertex to message. @param m T...
java
public final void sendMessageTo(K target, Message m) { outMsg.f0 = target; outMsg.f1 = m; out.collect(Either.Right(outMsg)); }
[ "public", "final", "void", "sendMessageTo", "(", "K", "target", ",", "Message", "m", ")", "{", "outMsg", ".", "f0", "=", "target", ";", "outMsg", ".", "f1", "=", "m", ";", "out", ".", "collect", "(", "Either", ".", "Right", "(", "outMsg", ")", ")",...
Sends the given message to the vertex identified by the given key. If the target vertex does not exist, the next superstep will cause an exception due to a non-deliverable message. @param target The key (id) of the target vertex to message. @param m The message.
[ "Sends", "the", "given", "message", "to", "the", "vertex", "identified", "by", "the", "given", "key", ".", "If", "the", "target", "vertex", "does", "not", "exist", "the", "next", "superstep", "will", "cause", "an", "exception", "due", "to", "a", "non", "...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/ComputeFunction.java#L115-L121
protostuff/protostuff
protostuff-api/src/main/java/io/protostuff/UnsignedNumberUtil.java
UnsignedNumberUtil.overflowInParse
private static boolean overflowInParse(long current, int digit, int radix) { """ Returns true if (current * radix) + digit is a number too large to be represented by an unsigned long. This is useful for detecting overflow while parsing a string representation of a number. Does not verify whether supplied radix i...
java
private static boolean overflowInParse(long current, int digit, int radix) { if (current >= 0) { if (current < maxValueDivs[radix]) { return false; } if (current > maxValueDivs[radix]) { return true; ...
[ "private", "static", "boolean", "overflowInParse", "(", "long", "current", ",", "int", "digit", ",", "int", "radix", ")", "{", "if", "(", "current", ">=", "0", ")", "{", "if", "(", "current", "<", "maxValueDivs", "[", "radix", "]", ")", "{", "return", ...
Returns true if (current * radix) + digit is a number too large to be represented by an unsigned long. This is useful for detecting overflow while parsing a string representation of a number. Does not verify whether supplied radix is valid, passing an invalid radix will give undefined results or an ArrayIndexOutOfBound...
[ "Returns", "true", "if", "(", "current", "*", "radix", ")", "+", "digit", "is", "a", "number", "too", "large", "to", "be", "represented", "by", "an", "unsigned", "long", ".", "This", "is", "useful", "for", "detecting", "overflow", "while", "parsing", "a"...
train
https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-api/src/main/java/io/protostuff/UnsignedNumberUtil.java#L317-L335
BlueBrain/bluima
modules/bluima_abbreviations/src/main/java/com/wcohen/ss/SourcedTFIDF.java
SourcedTFIDF.prepare
public StringWrapper prepare(String s) { """ Preprocess a string by finding tokens and giving them TFIDF weights """ System.out.println("unknown source for "+s); lastVector = new UnitVector(s, tokenizer.sourcedTokenize(s, "*UNKNOWN SOURCE*")); return lastVector; }
java
public StringWrapper prepare(String s) { System.out.println("unknown source for "+s); lastVector = new UnitVector(s, tokenizer.sourcedTokenize(s, "*UNKNOWN SOURCE*")); return lastVector; }
[ "public", "StringWrapper", "prepare", "(", "String", "s", ")", "{", "System", ".", "out", ".", "println", "(", "\"unknown source for \"", "+", "s", ")", ";", "lastVector", "=", "new", "UnitVector", "(", "s", ",", "tokenizer", ".", "sourcedTokenize", "(", "...
Preprocess a string by finding tokens and giving them TFIDF weights
[ "Preprocess", "a", "string", "by", "finding", "tokens", "and", "giving", "them", "TFIDF", "weights" ]
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/SourcedTFIDF.java#L45-L49
PistoiaHELM/HELM2NotationToolkit
src/main/java/org/helm/notation2/tools/WebService.java
WebService.convertMolFileSMILESWithAtomMapping
public String convertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws CTKException, ChemistryException { """ method to generate a smiles with atom mapping for a given molfile with the given attachments @param molfile given molfile @param attachments given attachments @return smi...
java
public String convertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws CTKException, ChemistryException{ return SMILES.convertMolToSMILESWithAtomMapping(molfile, attachments); }
[ "public", "String", "convertMolFileSMILESWithAtomMapping", "(", "String", "molfile", ",", "List", "<", "Attachment", ">", "attachments", ")", "throws", "CTKException", ",", "ChemistryException", "{", "return", "SMILES", ".", "convertMolToSMILESWithAtomMapping", "(", "mo...
method to generate a smiles with atom mapping for a given molfile with the given attachments @param molfile given molfile @param attachments given attachments @return smiles with atom mapping @throws CTKException general ChemToolKit exception passed to HELMToolKit @throws ChemistryException if the chemistry engine can ...
[ "method", "to", "generate", "a", "smiles", "with", "atom", "mapping", "for", "a", "given", "molfile", "with", "the", "given", "attachments" ]
train
https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/WebService.java#L676-L678
Lucas3oo/jicunit
src/jicunit-framework/src/main/java/org/jicunit/framework/internal/JicUnitServletClient.java
JicUnitServletClient.processResults
public void processResults(Document document) throws Throwable { """ Processes the actual XML result and generate exceptions in case there was an issue on the server side. @param document @throws Throwable """ Element root = document.getDocumentElement(); root.normalize(); // top element ...
java
public void processResults(Document document) throws Throwable { Element root = document.getDocumentElement(); root.normalize(); // top element should testcase which has attributes for the outcome of the test // e.g <testcase classname="TheClass" name="theName(TheClass)" status="Error"><exception m...
[ "public", "void", "processResults", "(", "Document", "document", ")", "throws", "Throwable", "{", "Element", "root", "=", "document", ".", "getDocumentElement", "(", ")", ";", "root", ".", "normalize", "(", ")", ";", "// top element should testcase which has attribu...
Processes the actual XML result and generate exceptions in case there was an issue on the server side. @param document @throws Throwable
[ "Processes", "the", "actual", "XML", "result", "and", "generate", "exceptions", "in", "case", "there", "was", "an", "issue", "on", "the", "server", "side", "." ]
train
https://github.com/Lucas3oo/jicunit/blob/1ed41891ccf8e5c6068c6b544d214280bb93945b/src/jicunit-framework/src/main/java/org/jicunit/framework/internal/JicUnitServletClient.java#L70-L82
Azure/azure-sdk-for-java
edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java
DevicesInner.scanForUpdatesAsync
public Observable<Void> scanForUpdatesAsync(String deviceName, String resourceGroupName) { """ Scans for updates on a data box edge/gateway device. @param deviceName The device name. @param resourceGroupName The resource group name. @throws IllegalArgumentException thrown if parameters fail the validation @r...
java
public Observable<Void> scanForUpdatesAsync(String deviceName, String resourceGroupName) { return scanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { ...
[ "public", "Observable", "<", "Void", ">", "scanForUpdatesAsync", "(", "String", "deviceName", ",", "String", "resourceGroupName", ")", "{", "return", "scanForUpdatesWithServiceResponseAsync", "(", "deviceName", ",", "resourceGroupName", ")", ".", "map", "(", "new", ...
Scans for updates on a data box edge/gateway device. @param deviceName The device name. @param resourceGroupName The resource group name. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable for the request
[ "Scans", "for", "updates", "on", "a", "data", "box", "edge", "/", "gateway", "device", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L1707-L1714
op4j/op4j
src/main/java/org/op4j/functions/FnString.java
FnString.toByte
public static final Function<String,Byte> toByte(final RoundingMode roundingMode, final Locale locale) { """ <p> Converts a String into a Byte, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must b...
java
public static final Function<String,Byte> toByte(final RoundingMode roundingMode, final Locale locale) { return new ToByte(roundingMode, locale); }
[ "public", "static", "final", "Function", "<", "String", ",", "Byte", ">", "toByte", "(", "final", "RoundingMode", "roundingMode", ",", "final", "Locale", "locale", ")", "{", "return", "new", "ToByte", "(", "roundingMode", ",", "locale", ")", ";", "}" ]
<p> Converts a String into a Byte, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between {@link Byte#MIN_VALUE} and {@link Byte#MAX_VALUE} </p> @param roundingMode the rounding mode to be used wh...
[ "<p", ">", "Converts", "a", "String", "into", "a", "Byte", "using", "the", "specified", "locale", "for", "determining", "decimal", "point", ".", "Rounding", "mode", "is", "used", "for", "removing", "the", "decimal", "part", "of", "the", "number", ".", "The...
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L1253-L1255
line/armeria
core/src/main/java/com/linecorp/armeria/server/file/HttpFileService.java
HttpFileService.forClassPath
public static HttpFileService forClassPath(ClassLoader classLoader, String rootDir) { """ Creates a new {@link HttpFileService} for the specified {@code rootDir} in the current class path. """ return HttpFileServiceBuilder.forClassPath(classLoader, rootDir).build(); }
java
public static HttpFileService forClassPath(ClassLoader classLoader, String rootDir) { return HttpFileServiceBuilder.forClassPath(classLoader, rootDir).build(); }
[ "public", "static", "HttpFileService", "forClassPath", "(", "ClassLoader", "classLoader", ",", "String", "rootDir", ")", "{", "return", "HttpFileServiceBuilder", ".", "forClassPath", "(", "classLoader", ",", "rootDir", ")", ".", "build", "(", ")", ";", "}" ]
Creates a new {@link HttpFileService} for the specified {@code rootDir} in the current class path.
[ "Creates", "a", "new", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/file/HttpFileService.java#L95-L97
indeedeng/util
util-core/src/main/java/com/indeed/util/core/ReleaseVersion.java
ReleaseVersion.fromStringSafely
public static ReleaseVersion fromStringSafely(String versionString, ReleaseVersion defaultVersion) { """ Turn a version string into an object. Does lenient parsing: "1.2.rc1" will turn into "1.2.0.0", for example. Will not throw {@link IllegalArgumentException}. @param versionString The version string that we...
java
public static ReleaseVersion fromStringSafely(String versionString, ReleaseVersion defaultVersion) { try { return new Builder().fromString(versionString, true).build(); } catch (Exception e) { return defaultVersion; } }
[ "public", "static", "ReleaseVersion", "fromStringSafely", "(", "String", "versionString", ",", "ReleaseVersion", "defaultVersion", ")", "{", "try", "{", "return", "new", "Builder", "(", ")", ".", "fromString", "(", "versionString", ",", "true", ")", ".", "build"...
Turn a version string into an object. Does lenient parsing: "1.2.rc1" will turn into "1.2.0.0", for example. Will not throw {@link IllegalArgumentException}. @param versionString The version string that we should attempt to parse into a release version. @param defaultVersion The default version to use in the event par...
[ "Turn", "a", "version", "string", "into", "an", "object", ".", "Does", "lenient", "parsing", ":", "1", ".", "2", ".", "rc1", "will", "turn", "into", "1", ".", "2", ".", "0", ".", "0", "for", "example", ".", "Will", "not", "throw", "{", "@link", "...
train
https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/ReleaseVersion.java#L170-L176
aol/cyclops
cyclops/src/main/java/cyclops/companion/Streams.java
Streams.forEach
public static <T, X extends Throwable> Subscription forEach(final Stream<T> stream, final long x, final Consumer<? super T> consumerElement, final Consumer<? super Throwable> consumerError, final Runnable onComplete) { """ Perform a forEach operation ...
java
public static <T, X extends Throwable> Subscription forEach(final Stream<T> stream, final long x, final Consumer<? super T> consumerElement, final Consumer<? super Throwable> consumerError, final Runnable onComplete) { val t2 = FutureStreamUtils.fo...
[ "public", "static", "<", "T", ",", "X", "extends", "Throwable", ">", "Subscription", "forEach", "(", "final", "Stream", "<", "T", ">", "stream", ",", "final", "long", "x", ",", "final", "Consumer", "<", "?", "super", "T", ">", "consumerElement", ",", "...
Perform a forEach operation over the Stream without closing it, capturing any elements and errors in the supplied consumers, but only consuming the specified number of elements from the Stream, at this time. More elements can be consumed later, by called request on the returned Subscription, when the entire Stream ha...
[ "Perform", "a", "forEach", "operation", "over", "the", "Stream", "without", "closing", "it", "capturing", "any", "elements", "and", "errors", "in", "the", "supplied", "consumers", "but", "only", "consuming", "the", "specified", "number", "of", "elements", "from"...
train
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L634-L639
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java
H2GISFunctions.unRegisterFunction
public static void unRegisterFunction(Statement st, Function function) throws SQLException { """ Remove the specified function from the provided DataBase connection @param st Active statement @param function function to remove @throws SQLException """ String functionAlias = getStringProperty(functio...
java
public static void unRegisterFunction(Statement st, Function function) throws SQLException { String functionAlias = getStringProperty(function, Function.PROP_NAME); if(functionAlias.isEmpty()) { functionAlias = function.getClass().getSimpleName(); } st.execute("DROP ALIAS IF ...
[ "public", "static", "void", "unRegisterFunction", "(", "Statement", "st", ",", "Function", "function", ")", "throws", "SQLException", "{", "String", "functionAlias", "=", "getStringProperty", "(", "function", ",", "Function", ".", "PROP_NAME", ")", ";", "if", "(...
Remove the specified function from the provided DataBase connection @param st Active statement @param function function to remove @throws SQLException
[ "Remove", "the", "specified", "function", "from", "the", "provided", "DataBase", "connection" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L518-L524
assertthat/selenium-shutterbug
src/main/java/com/assertthat/selenium_shutterbug/core/Shutterbug.java
Shutterbug.shootElement
public static ElementSnapshot shootElement(WebDriver driver, WebElement element, boolean useDevicePixelRatio) { """ To be used when need to screenshot particular element. @param driver WebDriver instance @param element WebElement instance to be screen shot @param useDevicePixelRatio whether or not take into ...
java
public static ElementSnapshot shootElement(WebDriver driver, WebElement element, boolean useDevicePixelRatio) { Browser browser = new Browser(driver, useDevicePixelRatio); ElementSnapshot elementSnapshot = new ElementSnapshot(driver, browser.getDevicePixelRatio()); browser.scrollToElement(elemen...
[ "public", "static", "ElementSnapshot", "shootElement", "(", "WebDriver", "driver", ",", "WebElement", "element", ",", "boolean", "useDevicePixelRatio", ")", "{", "Browser", "browser", "=", "new", "Browser", "(", "driver", ",", "useDevicePixelRatio", ")", ";", "Ele...
To be used when need to screenshot particular element. @param driver WebDriver instance @param element WebElement instance to be screen shot @param useDevicePixelRatio whether or not take into account device pixel ratio @return ElementSnapshot instance
[ "To", "be", "used", "when", "need", "to", "screenshot", "particular", "element", "." ]
train
https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/Shutterbug.java#L135-L141
JodaOrg/joda-time
src/main/java/org/joda/time/format/FormatUtils.java
FormatUtils.appendUnpaddedInteger
public static void appendUnpaddedInteger(StringBuffer buf, int value) { """ Converts an integer to a string, and appends it to the given buffer. <p>This method is optimized for converting small values to strings. @param buf receives integer converted to a string @param value value to convert to a string ...
java
public static void appendUnpaddedInteger(StringBuffer buf, int value) { try { appendUnpaddedInteger((Appendable) buf, value); } catch (IOException e) { // StringBuffer do not throw IOException } }
[ "public", "static", "void", "appendUnpaddedInteger", "(", "StringBuffer", "buf", ",", "int", "value", ")", "{", "try", "{", "appendUnpaddedInteger", "(", "(", "Appendable", ")", "buf", ",", "value", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{"...
Converts an integer to a string, and appends it to the given buffer. <p>This method is optimized for converting small values to strings. @param buf receives integer converted to a string @param value value to convert to a string
[ "Converts", "an", "integer", "to", "a", "string", "and", "appends", "it", "to", "the", "given", "buffer", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/FormatUtils.java#L273-L279
liferay/com-liferay-commerce
commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDisplayLayoutUtil.java
CPDisplayLayoutUtil.findByC_C
public static CPDisplayLayout findByC_C(long classNameId, long classPK) throws com.liferay.commerce.product.exception.NoSuchCPDisplayLayoutException { """ Returns the cp display layout where classNameId = &#63; and classPK = &#63; or throws a {@link NoSuchCPDisplayLayoutException} if it could not be found. @p...
java
public static CPDisplayLayout findByC_C(long classNameId, long classPK) throws com.liferay.commerce.product.exception.NoSuchCPDisplayLayoutException { return getPersistence().findByC_C(classNameId, classPK); }
[ "public", "static", "CPDisplayLayout", "findByC_C", "(", "long", "classNameId", ",", "long", "classPK", ")", "throws", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "exception", ".", "NoSuchCPDisplayLayoutException", "{", "return", "getPersistence", ...
Returns the cp display layout where classNameId = &#63; and classPK = &#63; or throws a {@link NoSuchCPDisplayLayoutException} if it could not be found. @param classNameId the class name ID @param classPK the class pk @return the matching cp display layout @throws NoSuchCPDisplayLayoutException if a matching cp displa...
[ "Returns", "the", "cp", "display", "layout", "where", "classNameId", "=", "&#63", ";", "and", "classPK", "=", "&#63", ";", "or", "throws", "a", "{", "@link", "NoSuchCPDisplayLayoutException", "}", "if", "it", "could", "not", "be", "found", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDisplayLayoutUtil.java#L513-L516
kevoree/kevoree-library
centralizedwsgroup/src/main/java/org/kevoree/library/server/ServerFragment.java
ServerFragment.kevsTpl
private String kevsTpl(String kevs, String nodeName) { """ Replaces {{groupName}} by the current group instance name and {{nodeName}} by the given nodeName in parameter @param kevs the KevScript to interpolate @param nodeName the value to replace {{nodeName}} with @return interpolated kevscript """ ...
java
private String kevsTpl(String kevs, String nodeName) { return kevs .replaceAll("\\{\\{nodeName\\}\\}", nodeName) .replaceAll("\\{\\{groupName\\}\\}", instance.getName()); }
[ "private", "String", "kevsTpl", "(", "String", "kevs", ",", "String", "nodeName", ")", "{", "return", "kevs", ".", "replaceAll", "(", "\"\\\\{\\\\{nodeName\\\\}\\\\}\"", ",", "nodeName", ")", ".", "replaceAll", "(", "\"\\\\{\\\\{groupName\\\\}\\\\}\"", ",", "instanc...
Replaces {{groupName}} by the current group instance name and {{nodeName}} by the given nodeName in parameter @param kevs the KevScript to interpolate @param nodeName the value to replace {{nodeName}} with @return interpolated kevscript
[ "Replaces", "{{", "groupName", "}}", "by", "the", "current", "group", "instance", "name", "and", "{{", "nodeName", "}}", "by", "the", "given", "nodeName", "in", "parameter" ]
train
https://github.com/kevoree/kevoree-library/blob/617460e6c5881902ebc488a31ecdea179024d8f1/centralizedwsgroup/src/main/java/org/kevoree/library/server/ServerFragment.java#L153-L157
app55/app55-java
src/support/java/com/googlecode/openbeans/beancontext/BeanContextSupport.java
BeanContextSupport.setLocale
public void setLocale(Locale newLocale) throws PropertyVetoException { """ Sets the locale of this context. <code>VetoableChangeListener</code>s and <code>PropertyChangeListener</code>s are notified. @param newLocale the new locale to set @throws PropertyVetoException if any <code>VetoableChangeListener</cod...
java
public void setLocale(Locale newLocale) throws PropertyVetoException { if (newLocale == null || newLocale == locale) { return; // ignore null locale } PropertyChangeEvent event = new PropertyChangeEvent(beanContextChildPeer, "locale", locale, newLocale); // apply change Locale oldLocale = locale; lo...
[ "public", "void", "setLocale", "(", "Locale", "newLocale", ")", "throws", "PropertyVetoException", "{", "if", "(", "newLocale", "==", "null", "||", "newLocale", "==", "locale", ")", "{", "return", ";", "// ignore null locale", "}", "PropertyChangeEvent", "event", ...
Sets the locale of this context. <code>VetoableChangeListener</code>s and <code>PropertyChangeListener</code>s are notified. @param newLocale the new locale to set @throws PropertyVetoException if any <code>VetoableChangeListener</code> vetos this change
[ "Sets", "the", "locale", "of", "this", "context", ".", "<code", ">", "VetoableChangeListener<", "/", "code", ">", "s", "and", "<code", ">", "PropertyChangeListener<", "/", "code", ">", "s", "are", "notified", "." ]
train
https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/com/googlecode/openbeans/beancontext/BeanContextSupport.java#L1240-L1266
lucee/Lucee
core/src/main/java/lucee/commons/date/DateTimeUtil.java
DateTimeUtil.toDateTime
public DateTime toDateTime(double days) { """ returns a date time instance by a number, the conversion from the double to date is o the base of the CFML rules. @param days double value to convert to a number @return DateTime Instance """ long utc = Math.round(days * DAY_MILLIS); utc -= CF_UNIX_OFFSET; ...
java
public DateTime toDateTime(double days) { long utc = Math.round(days * DAY_MILLIS); utc -= CF_UNIX_OFFSET; utc -= getLocalTimeZoneOffset(utc); return new DateTimeImpl(utc, false); }
[ "public", "DateTime", "toDateTime", "(", "double", "days", ")", "{", "long", "utc", "=", "Math", ".", "round", "(", "days", "*", "DAY_MILLIS", ")", ";", "utc", "-=", "CF_UNIX_OFFSET", ";", "utc", "-=", "getLocalTimeZoneOffset", "(", "utc", ")", ";", "ret...
returns a date time instance by a number, the conversion from the double to date is o the base of the CFML rules. @param days double value to convert to a number @return DateTime Instance
[ "returns", "a", "date", "time", "instance", "by", "a", "number", "the", "conversion", "from", "the", "double", "to", "date", "is", "o", "the", "base", "of", "the", "CFML", "rules", "." ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/date/DateTimeUtil.java#L91-L96
super-csv/super-csv
super-csv/src/main/java/org/supercsv/cellprocessor/ParseEnum.java
ParseEnum.execute
public Object execute(final Object value, final CsvContext context) { """ {@inheritDoc} @throws SuperCsvCellProcessorException if value is null or can't be parsed as an Enum """ validateInputNotNull(value, context); final String inputString = value.toString(); for( final Enum<?> enumConstant : ...
java
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); final String inputString = value.toString(); for( final Enum<?> enumConstant : enumClass.getEnumConstants() ) { String constantName = enumConstant.name(); if( ignoreCase ? constantName.equalsIgn...
[ "public", "Object", "execute", "(", "final", "Object", "value", ",", "final", "CsvContext", "context", ")", "{", "validateInputNotNull", "(", "value", ",", "context", ")", ";", "final", "String", "inputString", "=", "value", ".", "toString", "(", ")", ";", ...
{@inheritDoc} @throws SuperCsvCellProcessorException if value is null or can't be parsed as an Enum
[ "{", "@inheritDoc", "}" ]
train
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/ParseEnum.java#L134-L149
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/InstanceRequestMap.java
InstanceRequestMap.setNumberOfInstances
public void setNumberOfInstances(final InstanceType instanceType, final int number) { """ Sets both the minimum and the maximum number of instances to be requested from the given instance type. @param instanceType the type of instance to request @param number the minimum and the maximum number of instances t...
java
public void setNumberOfInstances(final InstanceType instanceType, final int number) { setMinimumNumberOfInstances(instanceType, number); setMaximumNumberOfInstances(instanceType, number); }
[ "public", "void", "setNumberOfInstances", "(", "final", "InstanceType", "instanceType", ",", "final", "int", "number", ")", "{", "setMinimumNumberOfInstances", "(", "instanceType", ",", "number", ")", ";", "setMaximumNumberOfInstances", "(", "instanceType", ",", "numb...
Sets both the minimum and the maximum number of instances to be requested from the given instance type. @param instanceType the type of instance to request @param number the minimum and the maximum number of instances to request
[ "Sets", "both", "the", "minimum", "and", "the", "maximum", "number", "of", "instances", "to", "be", "requested", "from", "the", "given", "instance", "type", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/InstanceRequestMap.java#L79-L83
anotheria/moskito
moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java
PageInBrowserStats.getDomMaxLoadTime
public long getDomMaxLoadTime(final String intervalName, final TimeUnit unit) { """ Returns DOM maximum load time for given interval and time unit. @param intervalName name of the interval @param unit {@link TimeUnit} @return DOM maximum load time """ final long max = domMaxLoadTime.getValueAsLo...
java
public long getDomMaxLoadTime(final String intervalName, final TimeUnit unit) { final long max = domMaxLoadTime.getValueAsLong(intervalName); return max == Constants.MAX_TIME_DEFAULT ? max : unit.transformMillis(max); }
[ "public", "long", "getDomMaxLoadTime", "(", "final", "String", "intervalName", ",", "final", "TimeUnit", "unit", ")", "{", "final", "long", "max", "=", "domMaxLoadTime", ".", "getValueAsLong", "(", "intervalName", ")", ";", "return", "max", "==", "Constants", ...
Returns DOM maximum load time for given interval and time unit. @param intervalName name of the interval @param unit {@link TimeUnit} @return DOM maximum load time
[ "Returns", "DOM", "maximum", "load", "time", "for", "given", "interval", "and", "time", "unit", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L141-L144
kiswanij/jk-util
src/main/java/com/jk/util/JKIOUtil.java
JKIOUtil.writeDataToFile
public static File writeDataToFile(final byte[] data, final File file, final boolean append) { """ Write data to file. @param data the data @param file the file @param append the append @return the file """ try (FileOutputStream out = new FileOutputStream(file, append)) { out.write(data); ...
java
public static File writeDataToFile(final byte[] data, final File file, final boolean append) { try (FileOutputStream out = new FileOutputStream(file, append)) { out.write(data); out.flush(); out.close(); return file; } catch (Exception e) { JKExceptionUtil.handle(e); return null; } }
[ "public", "static", "File", "writeDataToFile", "(", "final", "byte", "[", "]", "data", ",", "final", "File", "file", ",", "final", "boolean", "append", ")", "{", "try", "(", "FileOutputStream", "out", "=", "new", "FileOutputStream", "(", "file", ",", "appe...
Write data to file. @param data the data @param file the file @param append the append @return the file
[ "Write", "data", "to", "file", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L350-L360
Omertron/api-fanarttv
src/main/java/com/omertron/fanarttvapi/tools/ApiBuilder.java
ApiBuilder.getImageUrl
public URL getImageUrl(BaseType baseType, String id) throws FanartTvException { """ Generate the URL for the artwork requests @param baseType @param id @return @throws FanartTvException """ StringBuilder url = getBaseUrl(baseType); // Add the ID url.append(id); // Add th...
java
public URL getImageUrl(BaseType baseType, String id) throws FanartTvException { StringBuilder url = getBaseUrl(baseType); // Add the ID url.append(id); // Add the API Key url.append(DELIMITER_APIKEY).append(apiKey); // Add the client API Key if (StringUtils.isN...
[ "public", "URL", "getImageUrl", "(", "BaseType", "baseType", ",", "String", "id", ")", "throws", "FanartTvException", "{", "StringBuilder", "url", "=", "getBaseUrl", "(", "baseType", ")", ";", "// Add the ID", "url", ".", "append", "(", "id", ")", ";", "// A...
Generate the URL for the artwork requests @param baseType @param id @return @throws FanartTvException
[ "Generate", "the", "URL", "for", "the", "artwork", "requests" ]
train
https://github.com/Omertron/api-fanarttv/blob/2a1854c840d8111935d0f6abe5232e2c3c3f318b/src/main/java/com/omertron/fanarttvapi/tools/ApiBuilder.java#L103-L118
aws/aws-sdk-java
aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationResponseRequest.java
CreateIntegrationResponseRequest.withResponseTemplates
public CreateIntegrationResponseRequest withResponseTemplates(java.util.Map<String, String> responseTemplates) { """ <p> The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as th...
java
public CreateIntegrationResponseRequest withResponseTemplates(java.util.Map<String, String> responseTemplates) { setResponseTemplates(responseTemplates); return this; }
[ "public", "CreateIntegrationResponseRequest", "withResponseTemplates", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "responseTemplates", ")", "{", "setResponseTemplates", "(", "responseTemplates", ")", ";", "return", "this", ";", "}" ]
<p> The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value. </p> @param responseTemplates The collection of response templates for the integration r...
[ "<p", ">", "The", "collection", "of", "response", "templates", "for", "the", "integration", "response", "as", "a", "string", "-", "to", "-", "string", "map", "of", "key", "-", "value", "pairs", ".", "Response", "templates", "are", "represented", "as", "a",...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationResponseRequest.java#L497-L500
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java
PageFlowUtils.ensureGlobalApp
public static GlobalApp ensureGlobalApp( HttpServletRequest request, HttpServletResponse response ) { """ Get or create the current {@link GlobalApp} instance. @deprecated Use {@link #getGlobalApp} instead. @param request the current HttpServletRequest. @param response the current HttpServletResponse @return...
java
public static GlobalApp ensureGlobalApp( HttpServletRequest request, HttpServletResponse response ) { ServletContext servletContext = InternalUtils.getServletContext( request ); return ensureGlobalApp( request, response, servletContext ); }
[ "public", "static", "GlobalApp", "ensureGlobalApp", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "ServletContext", "servletContext", "=", "InternalUtils", ".", "getServletContext", "(", "request", ")", ";", "return", "ensureGlo...
Get or create the current {@link GlobalApp} instance. @deprecated Use {@link #getGlobalApp} instead. @param request the current HttpServletRequest. @param response the current HttpServletResponse @return the current {@link GlobalApp} from the user session, or a newly-instantiated one (based on the user's Global.app fi...
[ "Get", "or", "create", "the", "current", "{", "@link", "GlobalApp", "}", "instance", ".", "@deprecated", "Use", "{", "@link", "#getGlobalApp", "}", "instead", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L1250-L1254
acromusashi/acromusashi-stream
src/main/java/acromusashi/stream/entity/StreamMessageHeader.java
StreamMessageHeader.addAdditionalHeader
public void addAdditionalHeader(String key, String value) { """ Add value to additional header. @param key key @param value value """ if (this.additionalHeader == null) { this.additionalHeader = Maps.newLinkedHashMap(); } this.additionalHeader.put(key, value); ...
java
public void addAdditionalHeader(String key, String value) { if (this.additionalHeader == null) { this.additionalHeader = Maps.newLinkedHashMap(); } this.additionalHeader.put(key, value); }
[ "public", "void", "addAdditionalHeader", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "this", ".", "additionalHeader", "==", "null", ")", "{", "this", ".", "additionalHeader", "=", "Maps", ".", "newLinkedHashMap", "(", ")", ";", "}", ...
Add value to additional header. @param key key @param value value
[ "Add", "value", "to", "additional", "header", "." ]
train
https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/entity/StreamMessageHeader.java#L217-L225
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java
EJSContainer.preInvokeORBDispatch
@Override public Object preInvokeORBDispatch(Object object, String operation) { """ This method is driven when dispatch is called upon a server request. It should return a 'cookie' Object which uniquely identifies this preinvoke. This 'cookie' should be passed as a paramater when the corresponding postinvok...
java
@Override public Object preInvokeORBDispatch(Object object, String operation) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isDebugEnabled()) { // toString of 'object' can be quite large and can really bloat the // trace.... so just tra...
[ "@", "Override", "public", "Object", "preInvokeORBDispatch", "(", "Object", "object", ",", "String", "operation", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", "...
This method is driven when dispatch is called upon a server request. It should return a 'cookie' Object which uniquely identifies this preinvoke. This 'cookie' should be passed as a paramater when the corresponding postinvoke is called. @param object the IDL Servant or RMI Tie @param operation the operation being invo...
[ "This", "method", "is", "driven", "when", "dispatch", "is", "called", "upon", "a", "server", "request", ".", "It", "should", "return", "a", "cookie", "Object", "which", "uniquely", "identifies", "this", "preinvoke", ".", "This", "cookie", "should", "be", "pa...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java#L4444-L4486
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/TimeUtil.java
TimeUtil.timeInMsOrOneIfResultIsZero
public static long timeInMsOrOneIfResultIsZero(long time, TimeUnit timeUnit) { """ Convert time to milliseconds based on the given time unit. If conversion result is 0 and {@code time} was > 0, then 1 is returned. @param time The input time @param timeUnit The time unit to base the conversion on @throws Nu...
java
public static long timeInMsOrOneIfResultIsZero(long time, TimeUnit timeUnit) { long timeInMillis = timeUnit.toMillis(time); if (time > 0 && timeInMillis == 0) { timeInMillis = 1; } return timeInMillis; }
[ "public", "static", "long", "timeInMsOrOneIfResultIsZero", "(", "long", "time", ",", "TimeUnit", "timeUnit", ")", "{", "long", "timeInMillis", "=", "timeUnit", ".", "toMillis", "(", "time", ")", ";", "if", "(", "time", ">", "0", "&&", "timeInMillis", "==", ...
Convert time to milliseconds based on the given time unit. If conversion result is 0 and {@code time} was > 0, then 1 is returned. @param time The input time @param timeUnit The time unit to base the conversion on @throws NullPointerException if time unit is <code>null</code> @return The millisecond representation of...
[ "Convert", "time", "to", "milliseconds", "based", "on", "the", "given", "time", "unit", ".", "If", "conversion", "result", "is", "0", "and", "{", "@code", "time", "}", "was", ">", "0", "then", "1", "is", "returned", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/TimeUtil.java#L41-L48
adohe/etcd4j
src/main/java/com/xqbase/etcd4j/EtcdClient.java
EtcdClient.deleteDir
public void deleteDir(String key, boolean recursive) throws EtcdClientException { """ Deleting a directory @param key the dir key @param recursive set recursive=true if the directory holds keys // @return operation result @throws EtcdClientException """ Preconditions.checkNotNull(key); Map...
java
public void deleteDir(String key, boolean recursive) throws EtcdClientException { Preconditions.checkNotNull(key); Map<String, String> params = new HashMap<String, String>(); if (recursive) { params.put("recursive", String.valueOf(true)); } else { params.put("dir...
[ "public", "void", "deleteDir", "(", "String", "key", ",", "boolean", "recursive", ")", "throws", "EtcdClientException", "{", "Preconditions", ".", "checkNotNull", "(", "key", ")", ";", "Map", "<", "String", ",", "String", ">", "params", "=", "new", "HashMap"...
Deleting a directory @param key the dir key @param recursive set recursive=true if the directory holds keys // @return operation result @throws EtcdClientException
[ "Deleting", "a", "directory" ]
train
https://github.com/adohe/etcd4j/blob/8d30ae9aa5da32d8e78287d61e69861c63538629/src/main/java/com/xqbase/etcd4j/EtcdClient.java#L243-L257
Nexmo/nexmo-java
src/main/java/com/nexmo/client/redact/RedactClient.java
RedactClient.redactTransaction
public void redactTransaction(String id, RedactRequest.Product product) throws IOException, NexmoClientException { """ Submit a request to the Redact API to redact a transaction. @param id The transaction id to redact. @param product The {@link com.nexmo.client.redact.RedactRequest.Product} which correspo...
java
public void redactTransaction(String id, RedactRequest.Product product) throws IOException, NexmoClientException { this.redactTransaction(new RedactRequest(id, product)); }
[ "public", "void", "redactTransaction", "(", "String", "id", ",", "RedactRequest", ".", "Product", "product", ")", "throws", "IOException", ",", "NexmoClientException", "{", "this", ".", "redactTransaction", "(", "new", "RedactRequest", "(", "id", ",", "product", ...
Submit a request to the Redact API to redact a transaction. @param id The transaction id to redact. @param product The {@link com.nexmo.client.redact.RedactRequest.Product} which corresponds to the transaction. @throws IOException if a network error occurred contacting the Nexmo Redact API. @throws Nexm...
[ "Submit", "a", "request", "to", "the", "Redact", "API", "to", "redact", "a", "transaction", "." ]
train
https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/redact/RedactClient.java#L53-L55
mygreen/super-csv-annotation
src/main/java/com/github/mygreen/supercsv/builder/LazyBeanMappingFactory.java
LazyBeanMappingFactory.create
@Override public <T> BeanMapping<T> create(final Class<T> beanType, final Class<?>... groups) { """ Beanクラスから、CSVのマッピング情報を作成します。 @param <T> Beanのタイプ @param beanType 作成元のBeanクラス。 @param groups グループ情報。 アノテーションを指定したグループで切り替える際に指定します。 何も指定しない場合は、デフォルトグループの{@link DefaultGroup}のクラスが指定されたとして処理します。 @return CS...
java
@Override public <T> BeanMapping<T> create(final Class<T> beanType, final Class<?>... groups) { Objects.requireNonNull(beanType); final Configuration configuration = getConfiguration(); final BeanMapping<T> beanMapping = new BeanMapping<>(beanType); beanMappi...
[ "@", "Override", "public", "<", "T", ">", "BeanMapping", "<", "T", ">", "create", "(", "final", "Class", "<", "T", ">", "beanType", ",", "final", "Class", "<", "?", ">", "...", "groups", ")", "{", "Objects", ".", "requireNonNull", "(", "beanType", ")...
Beanクラスから、CSVのマッピング情報を作成します。 @param <T> Beanのタイプ @param beanType 作成元のBeanクラス。 @param groups グループ情報。 アノテーションを指定したグループで切り替える際に指定します。 何も指定しない場合は、デフォルトグループの{@link DefaultGroup}のクラスが指定されたとして処理します。 @return CSVのマッピング情報。 @throws NullPointerException {@literal beanType == null.} @throws SuperCsvInvalidAnnotationException アノテーシ...
[ "Beanクラスから、CSVのマッピング情報を作成します。" ]
train
https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/builder/LazyBeanMappingFactory.java#L42-L73
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/FileUtil.java
FileUtil.renameOverwrite
private boolean renameOverwrite(String oldname, String newname) { """ Rename the file with oldname to newname. If a file with newname already exists, it is deleted before the renaming operation proceeds. If a file with oldname does not exist, no file will exist after the operation. """ boolean de...
java
private boolean renameOverwrite(String oldname, String newname) { boolean deleted = delete(newname); if (exists(oldname)) { File file = new File(oldname); return file.renameTo(new File(newname)); } return deleted; }
[ "private", "boolean", "renameOverwrite", "(", "String", "oldname", ",", "String", "newname", ")", "{", "boolean", "deleted", "=", "delete", "(", "newname", ")", ";", "if", "(", "exists", "(", "oldname", ")", ")", "{", "File", "file", "=", "new", "File", ...
Rename the file with oldname to newname. If a file with newname already exists, it is deleted before the renaming operation proceeds. If a file with oldname does not exist, no file will exist after the operation.
[ "Rename", "the", "file", "with", "oldname", "to", "newname", ".", "If", "a", "file", "with", "newname", "already", "exists", "it", "is", "deleted", "before", "the", "renaming", "operation", "proceeds", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/FileUtil.java#L169-L180
alkacon/opencms-core
src/org/opencms/relations/CmsLink.java
CmsLink.setComponents
private void setComponents() { """ Sets the component member variables (target, anchor, query) by splitting the uri <code>scheme://authority/path#anchor?query</code>.<p> """ CmsUriSplitter splitter = new CmsUriSplitter(m_uri, true); m_target = splitter.getPrefix(); m_anchor = CmsLinkP...
java
private void setComponents() { CmsUriSplitter splitter = new CmsUriSplitter(m_uri, true); m_target = splitter.getPrefix(); m_anchor = CmsLinkProcessor.unescapeLink(splitter.getAnchor()); setQuery(splitter.getQuery()); }
[ "private", "void", "setComponents", "(", ")", "{", "CmsUriSplitter", "splitter", "=", "new", "CmsUriSplitter", "(", "m_uri", ",", "true", ")", ";", "m_target", "=", "splitter", ".", "getPrefix", "(", ")", ";", "m_anchor", "=", "CmsLinkProcessor", ".", "unesc...
Sets the component member variables (target, anchor, query) by splitting the uri <code>scheme://authority/path#anchor?query</code>.<p>
[ "Sets", "the", "component", "member", "variables", "(", "target", "anchor", "query", ")", "by", "splitting", "the", "uri", "<code", ">", "scheme", ":", "//", "authority", "/", "path#anchor?query<", "/", "code", ">", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsLink.java#L723-L729
grails/grails-core
grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java
CharSequences.writeCharSequence
public static void writeCharSequence(Writer target, CharSequence csq, int start, int end) throws IOException { """ Writes a CharSequence instance in the most optimal way to the target writer @param target writer @param csq source CharSequence instance @param start start/offset index @param end end index + ...
java
public static void writeCharSequence(Writer target, CharSequence csq, int start, int end) throws IOException { final Class<?> csqClass = csq.getClass(); if (csqClass == String.class) { target.write((String)csq, start, end - start); } else if (csqClass == StringBuffer.class) {...
[ "public", "static", "void", "writeCharSequence", "(", "Writer", "target", ",", "CharSequence", "csq", ",", "int", "start", ",", "int", "end", ")", "throws", "IOException", "{", "final", "Class", "<", "?", ">", "csqClass", "=", "csq", ".", "getClass", "(", ...
Writes a CharSequence instance in the most optimal way to the target writer @param target writer @param csq source CharSequence instance @param start start/offset index @param end end index + 1 @throws IOException
[ "Writes", "a", "CharSequence", "instance", "in", "the", "most", "optimal", "way", "to", "the", "target", "writer" ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java#L86-L110
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java
SwingBindingFactory.createBoundList
public Binding createBoundList(String selectionFormProperty, Object selectableItems) { """ Binds the values specified in the collection contained within <code>selectableItems</code> to a {@link JList}, with any user selection being placed in the form property referred to by <code>selectionFormProperty</code>. ...
java
public Binding createBoundList(String selectionFormProperty, Object selectableItems) { return createBoundList(selectionFormProperty, new ValueHolder(selectableItems)); }
[ "public", "Binding", "createBoundList", "(", "String", "selectionFormProperty", ",", "Object", "selectableItems", ")", "{", "return", "createBoundList", "(", "selectionFormProperty", ",", "new", "ValueHolder", "(", "selectableItems", ")", ")", ";", "}" ]
Binds the values specified in the collection contained within <code>selectableItems</code> to a {@link JList}, with any user selection being placed in the form property referred to by <code>selectionFormProperty</code>. Each item in the list will be rendered as a String. Note that the selection in the bound list will...
[ "Binds", "the", "values", "specified", "in", "the", "collection", "contained", "within", "<code", ">", "selectableItems<", "/", "code", ">", "to", "a", "{", "@link", "JList", "}", "with", "any", "user", "selection", "being", "placed", "in", "the", "form", ...
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java#L180-L182
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java
AbstractKMeans.nearestMeans
protected static void nearestMeans(double[][] cdist, int[][] cnum) { """ Recompute the separation of cluster means. <p> Used by sort, and our exponion implementation. @param cdist Center-to-Center distances @param cnum Center numbers """ final int k = cdist.length; double[] buf = new double[k - 1...
java
protected static void nearestMeans(double[][] cdist, int[][] cnum) { final int k = cdist.length; double[] buf = new double[k - 1]; for(int i = 0; i < k; i++) { System.arraycopy(cdist[i], 0, buf, 0, i); System.arraycopy(cdist[i], i + 1, buf, i, k - i - 1); for(int j = 0; j < buf.length; j++...
[ "protected", "static", "void", "nearestMeans", "(", "double", "[", "]", "[", "]", "cdist", ",", "int", "[", "]", "[", "]", "cnum", ")", "{", "final", "int", "k", "=", "cdist", ".", "length", ";", "double", "[", "]", "buf", "=", "new", "double", "...
Recompute the separation of cluster means. <p> Used by sort, and our exponion implementation. @param cdist Center-to-Center distances @param cnum Center numbers
[ "Recompute", "the", "separation", "of", "cluster", "means", ".", "<p", ">", "Used", "by", "sort", "and", "our", "exponion", "implementation", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java#L257-L268
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.credit_balance_balanceName_GET
public OvhBalance credit_balance_balanceName_GET(String balanceName) throws IOException { """ Retrieve a credit balance REST: GET /me/credit/balance/{balanceName} @param balanceName [required] Balance name """ String qPath = "/me/credit/balance/{balanceName}"; StringBuilder sb = path(qPath, balanceName...
java
public OvhBalance credit_balance_balanceName_GET(String balanceName) throws IOException { String qPath = "/me/credit/balance/{balanceName}"; StringBuilder sb = path(qPath, balanceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhBalance.class); }
[ "public", "OvhBalance", "credit_balance_balanceName_GET", "(", "String", "balanceName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/me/credit/balance/{balanceName}\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "balanceName", ")", "...
Retrieve a credit balance REST: GET /me/credit/balance/{balanceName} @param balanceName [required] Balance name
[ "Retrieve", "a", "credit", "balance" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L910-L915
landawn/AbacusUtil
src/com/landawn/abacus/util/Primitives.java
Primitives.box
@SafeVarargs public static Character[] box(final char... a) { """ <p> Converts an array of primitive chars to objects. </p> <p> This method returns {@code null} for a {@code null} input array. </p> @param a a {@code char} array @return a {@code Character} array, {@code null} if null array input ...
java
@SafeVarargs public static Character[] box(final char... a) { if (a == null) { return null; } return box(a, 0, a.length); }
[ "@", "SafeVarargs", "public", "static", "Character", "[", "]", "box", "(", "final", "char", "...", "a", ")", "{", "if", "(", "a", "==", "null", ")", "{", "return", "null", ";", "}", "return", "box", "(", "a", ",", "0", ",", "a", ".", "length", ...
<p> Converts an array of primitive chars to objects. </p> <p> This method returns {@code null} for a {@code null} input array. </p> @param a a {@code char} array @return a {@code Character} array, {@code null} if null array input
[ "<p", ">", "Converts", "an", "array", "of", "primitive", "chars", "to", "objects", ".", "<", "/", "p", ">" ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L161-L168
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/trustmanager/SigningPolicyChecker.java
SigningPolicyChecker.invoke
public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException { """ Validate DN against the signing policy @param cert The certificate to check. @param certType The type of certificate to check. @throws CertPathValidatorException if the certificate is in...
java
public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException { if (!requireSigningPolicyCheck(certType)) { return; } X500Principal caPrincipal = cert.getIssuerX500Principal(); SigningPolicy policy; try { ...
[ "public", "void", "invoke", "(", "X509Certificate", "cert", ",", "GSIConstants", ".", "CertificateType", "certType", ")", "throws", "CertPathValidatorException", "{", "if", "(", "!", "requireSigningPolicyCheck", "(", "certType", ")", ")", "{", "return", ";", "}", ...
Validate DN against the signing policy @param cert The certificate to check. @param certType The type of certificate to check. @throws CertPathValidatorException if the certificate is invalid according to the signing policy.
[ "Validate", "DN", "against", "the", "signing", "policy" ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/SigningPolicyChecker.java#L48-L70
alkacon/opencms-core
src/org/opencms/ui/dialogs/history/diff/CmsShowVersionButtons.java
CmsShowVersionButtons.createButton
public Button createButton(final CmsObject cms, final CmsHistoryResourceBean version) { """ Creates a 'show version' button.<p> @param cms the CMS context to use @param version the version @return the new button """ String label = CmsVaadinUtils.getMessageText( Messages.GUI_HISTORY_...
java
public Button createButton(final CmsObject cms, final CmsHistoryResourceBean version) { String label = CmsVaadinUtils.getMessageText( Messages.GUI_HISTORY_DIALOG_SHOW_VERSION_BUTTON_1, CmsHistoryRow.formatVersion(version)); Button result = new Button(label); result.addCl...
[ "public", "Button", "createButton", "(", "final", "CmsObject", "cms", ",", "final", "CmsHistoryResourceBean", "version", ")", "{", "String", "label", "=", "CmsVaadinUtils", ".", "getMessageText", "(", "Messages", ".", "GUI_HISTORY_DIALOG_SHOW_VERSION_BUTTON_1", ",", "...
Creates a 'show version' button.<p> @param cms the CMS context to use @param version the version @return the new button
[ "Creates", "a", "show", "version", "button", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/history/diff/CmsShowVersionButtons.java#L65-L87
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java
TypeConverter.convertToBoolean
public static boolean convertToBoolean (@Nullable final Object aSrcValue, final boolean bDefault) { """ Convert the passed source value to boolean @param aSrcValue The source value. May be <code>null</code>. @param bDefault The default value to be returned if an error occurs during type conversion. @return...
java
public static boolean convertToBoolean (@Nullable final Object aSrcValue, final boolean bDefault) { final Boolean aValue = convert (aSrcValue, Boolean.class, null); return aValue == null ? bDefault : aValue.booleanValue (); }
[ "public", "static", "boolean", "convertToBoolean", "(", "@", "Nullable", "final", "Object", "aSrcValue", ",", "final", "boolean", "bDefault", ")", "{", "final", "Boolean", "aValue", "=", "convert", "(", "aSrcValue", ",", "Boolean", ".", "class", ",", "null", ...
Convert the passed source value to boolean @param aSrcValue The source value. May be <code>null</code>. @param bDefault The default value to be returned if an error occurs during type conversion. @return <code>null</code> if the source value was <code>null</code>. @throws RuntimeException If the converter itself throw...
[ "Convert", "the", "passed", "source", "value", "to", "boolean" ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L135-L139
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.cdn_dedicated_serviceName_backend_duration_POST
public OvhOrder cdn_dedicated_serviceName_backend_duration_POST(String serviceName, String duration, Long backend) throws IOException { """ Create order REST: POST /order/cdn/dedicated/{serviceName}/backend/{duration} @param backend [required] Backend number that will be ordered @param serviceName [required] ...
java
public OvhOrder cdn_dedicated_serviceName_backend_duration_POST(String serviceName, String duration, Long backend) throws IOException { String qPath = "/order/cdn/dedicated/{serviceName}/backend/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); HashMap<String, Object>o = new HashMap<String, Obje...
[ "public", "OvhOrder", "cdn_dedicated_serviceName_backend_duration_POST", "(", "String", "serviceName", ",", "String", "duration", ",", "Long", "backend", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/cdn/dedicated/{serviceName}/backend/{duration}\"", ";...
Create order REST: POST /order/cdn/dedicated/{serviceName}/backend/{duration} @param backend [required] Backend number that will be ordered @param serviceName [required] The internal name of your CDN offer @param duration [required] Duration
[ "Create", "order" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5245-L5252
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/roles/PassiveRole.java
PassiveRole.appendEntry
private boolean appendEntry(long index, RaftLogEntry entry, RaftLogWriter writer, CompletableFuture<AppendResponse> future) { """ Attempts to append an entry, returning {@code false} if the append fails due to an {@link StorageException.OutOfDiskSpace} exception. """ try { Indexed<RaftLogEntry> index...
java
private boolean appendEntry(long index, RaftLogEntry entry, RaftLogWriter writer, CompletableFuture<AppendResponse> future) { try { Indexed<RaftLogEntry> indexed = writer.append(entry); log.trace("Appended {}", indexed); } catch (StorageException.TooLarge e) { log.warn("Entry size exceeds maxi...
[ "private", "boolean", "appendEntry", "(", "long", "index", ",", "RaftLogEntry", "entry", ",", "RaftLogWriter", "writer", ",", "CompletableFuture", "<", "AppendResponse", ">", "future", ")", "{", "try", "{", "Indexed", "<", "RaftLogEntry", ">", "indexed", "=", ...
Attempts to append an entry, returning {@code false} if the append fails due to an {@link StorageException.OutOfDiskSpace} exception.
[ "Attempts", "to", "append", "an", "entry", "returning", "{" ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/PassiveRole.java#L316-L330
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java
AttributesImpl.setValue
public void setValue (int index, String value) { """ Set the value of a specific attribute. @param index The index of the attribute (zero-based). @param value The attribute's value. @exception java.lang.ArrayIndexOutOfBoundsException When the supplied index does not point to an attribute in the list. ""...
java
public void setValue (int index, String value) { if (index >= 0 && index < length) { data[index*5+4] = value; } else { badIndex(index); } }
[ "public", "void", "setValue", "(", "int", "index", ",", "String", "value", ")", "{", "if", "(", "index", ">=", "0", "&&", "index", "<", "length", ")", "{", "data", "[", "index", "*", "5", "+", "4", "]", "=", "value", ";", "}", "else", "{", "bad...
Set the value of a specific attribute. @param index The index of the attribute (zero-based). @param value The attribute's value. @exception java.lang.ArrayIndexOutOfBoundsException When the supplied index does not point to an attribute in the list.
[ "Set", "the", "value", "of", "a", "specific", "attribute", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java#L544-L551
Squarespace/cldr
compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java
CalendarCodeGenerator.buildTypedPatternMethod
private MethodSpec buildTypedPatternMethod(String methodName, ClassName type, Format format) { """ The CLDR contains 4 standard pattern types for date and time: short, medium, long and full. This generates a switch statement to format patterns of this type. See CLDR "dateFormats" and "timeFormats" nodes. """...
java
private MethodSpec buildTypedPatternMethod(String methodName, ClassName type, Format format) { MethodSpec.Builder method = MethodSpec.methodBuilder(methodName) .addAnnotation(Override.class) .addModifiers(PUBLIC) .addParameter(CALENDAR_FORMAT, "type") .addParameter(ZonedDateTime.clas...
[ "private", "MethodSpec", "buildTypedPatternMethod", "(", "String", "methodName", ",", "ClassName", "type", ",", "Format", "format", ")", "{", "MethodSpec", ".", "Builder", "method", "=", "MethodSpec", ".", "methodBuilder", "(", "methodName", ")", ".", "addAnnotati...
The CLDR contains 4 standard pattern types for date and time: short, medium, long and full. This generates a switch statement to format patterns of this type. See CLDR "dateFormats" and "timeFormats" nodes.
[ "The", "CLDR", "contains", "4", "standard", "pattern", "types", "for", "date", "and", "time", ":", "short", "medium", "long", "and", "full", ".", "This", "generates", "a", "switch", "statement", "to", "format", "patterns", "of", "this", "type", ".", "See",...
train
https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java#L260-L280
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java
RoaringBitmap.flip
@Deprecated public static RoaringBitmap flip(RoaringBitmap rb, final int rangeStart, final int rangeEnd) { """ Complements the bits in the given range, from rangeStart (inclusive) rangeEnd (exclusive). The given bitmap is unchanged. @param rb bitmap being negated @param rangeStart inclusive beginning of ran...
java
@Deprecated public static RoaringBitmap flip(RoaringBitmap rb, final int rangeStart, final int rangeEnd) { if (rangeStart >= 0) { return flip(rb, (long) rangeStart, (long) rangeEnd); } // rangeStart being -ve and rangeEnd being positive is not expected) // so assume both -ve return flip(rb, ...
[ "@", "Deprecated", "public", "static", "RoaringBitmap", "flip", "(", "RoaringBitmap", "rb", ",", "final", "int", "rangeStart", ",", "final", "int", "rangeEnd", ")", "{", "if", "(", "rangeStart", ">=", "0", ")", "{", "return", "flip", "(", "rb", ",", "(",...
Complements the bits in the given range, from rangeStart (inclusive) rangeEnd (exclusive). The given bitmap is unchanged. @param rb bitmap being negated @param rangeStart inclusive beginning of range, in [0, 0xffffffff] @param rangeEnd exclusive ending of range, in [0, 0xffffffff + 1] @return a new Bitmap @deprecated ...
[ "Complements", "the", "bits", "in", "the", "given", "range", "from", "rangeStart", "(", "inclusive", ")", "rangeEnd", "(", "exclusive", ")", ".", "The", "given", "bitmap", "is", "unchanged", "." ]
train
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L603-L611
deeplearning4j/deeplearning4j
nd4j/nd4j-parameter-server-parent/nd4j-parameter-server/src/main/java/org/nd4j/parameterserver/updater/SynchronousParameterUpdater.java
SynchronousParameterUpdater.partialUpdate
@Override public void partialUpdate(INDArray arr, INDArray result, long idx, int... dimensions) { """ Updates result based on arr along a particular {@link INDArray#tensorAlongDimension(int, int...)} @param arr the array to update @param result the result ndarray to update @param idx t...
java
@Override public void partialUpdate(INDArray arr, INDArray result, long idx, int... dimensions) { result.tensorAlongDimension((int) idx, dimensions).addi(arr); }
[ "@", "Override", "public", "void", "partialUpdate", "(", "INDArray", "arr", ",", "INDArray", "result", ",", "long", "idx", ",", "int", "...", "dimensions", ")", "{", "result", ".", "tensorAlongDimension", "(", "(", "int", ")", "idx", ",", "dimensions", ")"...
Updates result based on arr along a particular {@link INDArray#tensorAlongDimension(int, int...)} @param arr the array to update @param result the result ndarray to update @param idx the index to update @param dimensions the dimensions to update
[ "Updates", "result", "based", "on", "arr", "along", "a", "particular", "{", "@link", "INDArray#tensorAlongDimension", "(", "int", "int", "...", ")", "}" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server/src/main/java/org/nd4j/parameterserver/updater/SynchronousParameterUpdater.java#L167-L170
restfb/restfb
src/main/java/com/restfb/exception/devicetoken/DeviceTokenExceptionFactory.java
DeviceTokenExceptionFactory.createFrom
public static void createFrom(FacebookOAuthException oauthException) throws FacebookDeviceTokenCodeExpiredException, FacebookDeviceTokenPendingException, FacebookDeviceTokenDeclinedException, FacebookDeviceTokenSlowdownException { """ Create a {@link FacebookDeviceTokenException} to a given {@link FacebookOA...
java
public static void createFrom(FacebookOAuthException oauthException) throws FacebookDeviceTokenCodeExpiredException, FacebookDeviceTokenPendingException, FacebookDeviceTokenDeclinedException, FacebookDeviceTokenSlowdownException { String errorMessage = oauthException.getErrorMessage(); if ("authorization...
[ "public", "static", "void", "createFrom", "(", "FacebookOAuthException", "oauthException", ")", "throws", "FacebookDeviceTokenCodeExpiredException", ",", "FacebookDeviceTokenPendingException", ",", "FacebookDeviceTokenDeclinedException", ",", "FacebookDeviceTokenSlowdownException", "...
Create a {@link FacebookDeviceTokenException} to a given {@link FacebookOAuthException}. @param oauthException @throws FacebookDeviceTokenCodeExpiredException @throws FacebookDeviceTokenPendingException @throws FacebookDeviceTokenDeclinedException @throws FacebookDeviceTokenSlowdownException
[ "Create", "a", "{", "@link", "FacebookDeviceTokenException", "}", "to", "a", "given", "{", "@link", "FacebookOAuthException", "}", "." ]
train
https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/exception/devicetoken/DeviceTokenExceptionFactory.java#L41-L59
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java
ImageMiscOps.insertBand
public static void insertBand( GrayS32 input, int band , InterleavedS32 output) { """ Inserts a single band into a multi-band image overwriting the original band @param input Single band image @param band Which band the image is to be inserted into @param output The multi-band image which the input image is t...
java
public static void insertBand( GrayS32 input, int band , InterleavedS32 output) { final int numBands = output.numBands; for (int y = 0; y < input.height; y++) { int indexIn = input.getStartIndex() + y * input.getStride(); int indexOut = output.getStartIndex() + y * output.getStride() + band; int end = ind...
[ "public", "static", "void", "insertBand", "(", "GrayS32", "input", ",", "int", "band", ",", "InterleavedS32", "output", ")", "{", "final", "int", "numBands", "=", "output", ".", "numBands", ";", "for", "(", "int", "y", "=", "0", ";", "y", "<", "input",...
Inserts a single band into a multi-band image overwriting the original band @param input Single band image @param band Which band the image is to be inserted into @param output The multi-band image which the input image is to be inserted into
[ "Inserts", "a", "single", "band", "into", "a", "multi", "-", "band", "image", "overwriting", "the", "original", "band" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L1252-L1263
52inc/android-52Kit
library/src/main/java/com/ftinc/kit/util/MediaUtils.java
MediaUtils.createTempFile
private static File createTempFile(File storageDir) throws IOException { """ Create a temporary file to use to handle selected images from the picker @return the temporary file in the given storage directory @throws IOException """ // Create an image file name String timeStamp = new Simp...
java
private static File createTempFile(File storageDir) throws IOException { // Create an image file name String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US).format(new Date()); String imageFileName = "JPEG_" + timeStamp + "_"; if(!storageDir.mkdir() && !storageDir.exists()...
[ "private", "static", "File", "createTempFile", "(", "File", "storageDir", ")", "throws", "IOException", "{", "// Create an image file name", "String", "timeStamp", "=", "new", "SimpleDateFormat", "(", "\"yyyyMMdd_HHmmss\"", ",", "Locale", ".", "US", ")", ".", "forma...
Create a temporary file to use to handle selected images from the picker @return the temporary file in the given storage directory @throws IOException
[ "Create", "a", "temporary", "file", "to", "use", "to", "handle", "selected", "images", "from", "the", "picker" ]
train
https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/MediaUtils.java#L284-L297
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
InternalUtils.addParam
public static String addParam( String url, String paramName, String paramVal ) { """ Add a parameter to the given URL. Assumes there is no trailing anchor/fragment indicated with a '#'. @param url the URL to which to append. @param paramName the name of the parameter to add. @param paramVal the value ...
java
public static String addParam( String url, String paramName, String paramVal ) { return url + ( url.indexOf( '?' ) != -1 ? '&' : '?' ) + paramName + '=' + paramVal; }
[ "public", "static", "String", "addParam", "(", "String", "url", ",", "String", "paramName", ",", "String", "paramVal", ")", "{", "return", "url", "+", "(", "url", ".", "indexOf", "(", "'", "'", ")", "!=", "-", "1", "?", "'", "'", ":", "'", "'", "...
Add a parameter to the given URL. Assumes there is no trailing anchor/fragment indicated with a '#'. @param url the URL to which to append. @param paramName the name of the parameter to add. @param paramVal the value of the parameter to add. @return the URL, with the given parameter added.
[ "Add", "a", "parameter", "to", "the", "given", "URL", ".", "Assumes", "there", "is", "no", "trailing", "anchor", "/", "fragment", "indicated", "with", "a", "#", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/InternalUtils.java#L897-L900
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.getAt
@SuppressWarnings("unchecked") public static List<Character> getAt(char[] array, ObjectRange range) { """ Support the subscript operator with an ObjectRange for a char array @param array a char array @param range an ObjectRange indicating the indices for the items to retrieve @return list of the retrieved...
java
@SuppressWarnings("unchecked") public static List<Character> getAt(char[] array, ObjectRange range) { return primitiveArrayGet(array, range); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "List", "<", "Character", ">", "getAt", "(", "char", "[", "]", "array", ",", "ObjectRange", "range", ")", "{", "return", "primitiveArrayGet", "(", "array", ",", "range", ")", ";", "}" ...
Support the subscript operator with an ObjectRange for a char array @param array a char array @param range an ObjectRange indicating the indices for the items to retrieve @return list of the retrieved chars @since 1.0
[ "Support", "the", "subscript", "operator", "with", "an", "ObjectRange", "for", "a", "char", "array" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13847-L13850
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
StringGroovyMethods.takeWhile
public static CharSequence takeWhile(CharSequence self, @ClosureParams(value=SimpleType.class, options="char") Closure condition) { """ Returns the longest prefix of this CharSequence where each element passed to the given closure evaluates to true. <p> <pre class="groovyTestCase"> def text = "Groovy" assert ...
java
public static CharSequence takeWhile(CharSequence self, @ClosureParams(value=SimpleType.class, options="char") Closure condition) { int num = 0; BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition); while (num < self.length()) { char value = self.charAt(num); ...
[ "public", "static", "CharSequence", "takeWhile", "(", "CharSequence", "self", ",", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"char\"", ")", "Closure", "condition", ")", "{", "int", "num", "=", "0", ";", "Bo...
Returns the longest prefix of this CharSequence where each element passed to the given closure evaluates to true. <p> <pre class="groovyTestCase"> def text = "Groovy" assert text.takeWhile{ it < 'A' } == '' assert text.takeWhile{ it < 'Z' } == 'G' assert text.takeWhile{ it != 'v' } == 'Groo' assert text.takeWhile{ it <...
[ "Returns", "the", "longest", "prefix", "of", "this", "CharSequence", "where", "each", "element", "passed", "to", "the", "given", "closure", "evaluates", "to", "true", ".", "<p", ">", "<pre", "class", "=", "groovyTestCase", ">", "def", "text", "=", "Groovy", ...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L3183-L3195
DDTH/ddth-redis
src/main/java/com/github/ddth/redis/RedisClientFactory.java
RedisClientFactory.createRedisClientPool
protected JedisClientPool createRedisClientPool(String host, int port, String username, String password) { """ Creates a new {@link JedisClientPool}. @param host @param port @param username @param password @return """ return createRedisClientPool(host, port, username, password, null)...
java
protected JedisClientPool createRedisClientPool(String host, int port, String username, String password) { return createRedisClientPool(host, port, username, password, null); }
[ "protected", "JedisClientPool", "createRedisClientPool", "(", "String", "host", ",", "int", "port", ",", "String", "username", ",", "String", "password", ")", "{", "return", "createRedisClientPool", "(", "host", ",", "port", ",", "username", ",", "password", ","...
Creates a new {@link JedisClientPool}. @param host @param port @param username @param password @return
[ "Creates", "a", "new", "{", "@link", "JedisClientPool", "}", "." ]
train
https://github.com/DDTH/ddth-redis/blob/7e6abc3e43c9efe7e9c293d421c94227253ded87/src/main/java/com/github/ddth/redis/RedisClientFactory.java#L127-L130
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/MergeRequestApi.java
MergeRequestApi.createMergeRequest
public MergeRequest createMergeRequest(Object projectIdOrPath, String sourceBranch, String targetBranch, String title, String description, Integer assigneeId, Integer targetProjectId, String[] labels, Integer milestoneId, Boolean removeSourceBranch) throws GitLabApiException { """ Creates a merge r...
java
public MergeRequest createMergeRequest(Object projectIdOrPath, String sourceBranch, String targetBranch, String title, String description, Integer assigneeId, Integer targetProjectId, String[] labels, Integer milestoneId, Boolean removeSourceBranch) throws GitLabApiException { return createMergeR...
[ "public", "MergeRequest", "createMergeRequest", "(", "Object", "projectIdOrPath", ",", "String", "sourceBranch", ",", "String", "targetBranch", ",", "String", "title", ",", "String", "description", ",", "Integer", "assigneeId", ",", "Integer", "targetProjectId", ",", ...
Creates a merge request and optionally assigns a reviewer to it. <pre><code>GitLab Endpoint: POST /projects/:id/merge_requests</code></pre> @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param sourceBranch the source branch, required @param targetBranch the target...
[ "Creates", "a", "merge", "request", "and", "optionally", "assigns", "a", "reviewer", "to", "it", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/MergeRequestApi.java#L396-L399
spring-projects/spring-hateoas
src/main/java/org/springframework/hateoas/server/mvc/WebMvcLinkBuilder.java
WebMvcLinkBuilder.linkTo
public static WebMvcLinkBuilder linkTo(Class<?> controller, Object... parameters) { """ Creates a new {@link WebMvcLinkBuilder} with a base of the mapping annotated to the given controller class. The additional parameters are used to fill up potentially available path variables in the class scop request mapping. ...
java
public static WebMvcLinkBuilder linkTo(Class<?> controller, Object... parameters) { Assert.notNull(controller, "Controller must not be null!"); Assert.notNull(parameters, "Parameters must not be null!"); String mapping = DISCOVERER.getMapping(controller); UriComponentsBuilder builder = UriComponentsBuilder.f...
[ "public", "static", "WebMvcLinkBuilder", "linkTo", "(", "Class", "<", "?", ">", "controller", ",", "Object", "...", "parameters", ")", "{", "Assert", ".", "notNull", "(", "controller", ",", "\"Controller must not be null!\"", ")", ";", "Assert", ".", "notNull", ...
Creates a new {@link WebMvcLinkBuilder} with a base of the mapping annotated to the given controller class. The additional parameters are used to fill up potentially available path variables in the class scop request mapping. @param controller the class to discover the annotation on, must not be {@literal null}. @para...
[ "Creates", "a", "new", "{", "@link", "WebMvcLinkBuilder", "}", "with", "a", "base", "of", "the", "mapping", "annotated", "to", "the", "given", "controller", "class", ".", "The", "additional", "parameters", "are", "used", "to", "fill", "up", "potentially", "a...
train
https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/server/mvc/WebMvcLinkBuilder.java#L95-L106
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/ui/SeaGlassRootPaneUI.java
SeaGlassRootPaneUI.installWindowListeners
private void installWindowListeners(JRootPane root, Component parent) { """ Installs the necessary Listeners on the parent <code>Window</code>, if there is one. <p>This takes the parent so that cleanup can be done from <code> removeNotify</code>, at which point the parent hasn't been reset yet.</p> @param ...
java
private void installWindowListeners(JRootPane root, Component parent) { if (parent instanceof Window) { window = (Window) parent; } else { window = SwingUtilities.getWindowAncestor(parent); } if (window != null) { if (mouseInputListener == null) { ...
[ "private", "void", "installWindowListeners", "(", "JRootPane", "root", ",", "Component", "parent", ")", "{", "if", "(", "parent", "instanceof", "Window", ")", "{", "window", "=", "(", "Window", ")", "parent", ";", "}", "else", "{", "window", "=", "SwingUti...
Installs the necessary Listeners on the parent <code>Window</code>, if there is one. <p>This takes the parent so that cleanup can be done from <code> removeNotify</code>, at which point the parent hasn't been reset yet.</p> @param root the JRootPane. @param parent The parent of the JRootPane
[ "Installs", "the", "necessary", "Listeners", "on", "the", "parent", "<code", ">", "Window<", "/", "code", ">", "if", "there", "is", "one", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassRootPaneUI.java#L347-L366
dbracewell/mango
src/main/java/com/davidbracewell/collection/Sorting.java
Sorting.sortMapEntriesByValue
public static <K, V extends Comparable<V>> List<Entry<K, V>> sortMapEntriesByValue(@NonNull final Map<K, V> map, final boolean ascending ) { """ ...
java
public static <K, V extends Comparable<V>> List<Entry<K, V>> sortMapEntriesByValue(@NonNull final Map<K, V> map, final boolean ascending ) { ret...
[ "public", "static", "<", "K", ",", "V", "extends", "Comparable", "<", "V", ">", ">", "List", "<", "Entry", "<", "K", ",", "V", ">", ">", "sortMapEntriesByValue", "(", "@", "NonNull", "final", "Map", "<", "K", ",", "V", ">", "map", ",", "final", "...
Sorts a <code>Map</code> by value. @param <K> the type parameter @param <V> the type parameter @param map The map to sort @param ascending True if in ascending (natural) order, False if in descending order @return A <code>List</code> of <code>Entry</code> containing the map entries in sorted order.
[ "Sorts", "a", "<code", ">", "Map<", "/", "code", ">", "by", "value", "." ]
train
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/collection/Sorting.java#L118-L122
alkacon/opencms-core
src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorOptions.java
CmsMessageBundleEditorOptions.initOptionsComponent
private void initOptionsComponent() { """ Creates the complete options component. It's a grid with two rows and two columns, styled like: || [language switch] [mode switch] File-Label || [file path display] -------------------------------------------||---------------------------------- New-Key-Label || [new...
java
private void initOptionsComponent() { // create and layout the component m_optionsComponent = new GridLayout(2, 2); m_optionsComponent.setHideEmptyRowsAndColumns(true); m_optionsComponent.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT); m_optionsComponent.setWidth("100%"); ...
[ "private", "void", "initOptionsComponent", "(", ")", "{", "// create and layout the component", "m_optionsComponent", "=", "new", "GridLayout", "(", "2", ",", "2", ")", ";", "m_optionsComponent", ".", "setHideEmptyRowsAndColumns", "(", "true", ")", ";", "m_optionsComp...
Creates the complete options component. It's a grid with two rows and two columns, styled like: || [language switch] [mode switch] File-Label || [file path display] -------------------------------------------||---------------------------------- New-Key-Label || [new key input] [add key button] || NOTE: The second row...
[ "Creates", "the", "complete", "options", "component", ".", "It", "s", "a", "grid", "with", "two", "rows", "and", "two", "columns", "styled", "like", ":" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorOptions.java#L491-L506
OpenLiberty/open-liberty
dev/com.ibm.ws.management.security/src/com/ibm/ws/management/security/internal/ManagementSecurityAuthorizationTable.java
ManagementSecurityAuthorizationTable.getRolesForSpecialSubject
@Override public RoleSet getRolesForSpecialSubject(String resName, String specialSubject) { """ {@inheritDoc}<p> This is a hardcoded mapping of the special subject ALL_AUTHENTICATED_USERS to the reserved internal role name "allAuthenticatedUsers" """ if (ManagementSecurityConstants.ADMIN_RESOURCE...
java
@Override public RoleSet getRolesForSpecialSubject(String resName, String specialSubject) { if (ManagementSecurityConstants.ADMIN_RESOURCE_NAME.equals(resName)) { if (specialSubject.equals(AuthorizationTableService.ALL_AUTHENTICATED_USERS)) { return ALL_AUTHENTICATED_USERS_ROLESE...
[ "@", "Override", "public", "RoleSet", "getRolesForSpecialSubject", "(", "String", "resName", ",", "String", "specialSubject", ")", "{", "if", "(", "ManagementSecurityConstants", ".", "ADMIN_RESOURCE_NAME", ".", "equals", "(", "resName", ")", ")", "{", "if", "(", ...
{@inheritDoc}<p> This is a hardcoded mapping of the special subject ALL_AUTHENTICATED_USERS to the reserved internal role name "allAuthenticatedUsers"
[ "{" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.security/src/com/ibm/ws/management/security/internal/ManagementSecurityAuthorizationTable.java#L132-L143
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
StringBuilders.appendKeyDqValue
public static StringBuilder appendKeyDqValue(final StringBuilder sb, final String key, final Object value) { """ Appends in the following format: key=double quoted value. @param sb a string builder @param key a key @param value a value @return the specified StringBuilder """ return sb.append(key)...
java
public static StringBuilder appendKeyDqValue(final StringBuilder sb, final String key, final Object value) { return sb.append(key).append(Chars.EQ).append(Chars.DQUOTE).append(value).append(Chars.DQUOTE); }
[ "public", "static", "StringBuilder", "appendKeyDqValue", "(", "final", "StringBuilder", "sb", ",", "final", "String", "key", ",", "final", "Object", "value", ")", "{", "return", "sb", ".", "append", "(", "key", ")", ".", "append", "(", "Chars", ".", "EQ", ...
Appends in the following format: key=double quoted value. @param sb a string builder @param key a key @param value a value @return the specified StringBuilder
[ "Appends", "in", "the", "following", "format", ":", "key", "=", "double", "quoted", "value", "." ]
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java#L60-L62
FXMisc/Flowless
src/main/java/org/fxmisc/flowless/CellPositioner.java
CellPositioner.placeEndFromEnd
public C placeEndFromEnd(int itemIndex, double endOffEnd) { """ Properly resizes the cell's node, and sets its "layoutY" value, so that is the last visible node in the viewport, and further offsets this value by {@code endOffStart}, so that the node's <em>bottom</em> edge appears (if negative) "above," (if 0) "a...
java
public C placeEndFromEnd(int itemIndex, double endOffEnd) { C cell = getSizedCell(itemIndex); double y = sizeTracker.getViewportLength() + endOffEnd - orientation.length(cell); relocate(cell, 0, y); cell.getNode().setVisible(true); return cell; }
[ "public", "C", "placeEndFromEnd", "(", "int", "itemIndex", ",", "double", "endOffEnd", ")", "{", "C", "cell", "=", "getSizedCell", "(", "itemIndex", ")", ";", "double", "y", "=", "sizeTracker", ".", "getViewportLength", "(", ")", "+", "endOffEnd", "-", "or...
Properly resizes the cell's node, and sets its "layoutY" value, so that is the last visible node in the viewport, and further offsets this value by {@code endOffStart}, so that the node's <em>bottom</em> edge appears (if negative) "above," (if 0) "at," or (if negative) "below" the viewport's "bottom" edge. See {@link O...
[ "Properly", "resizes", "the", "cell", "s", "node", "and", "sets", "its", "layoutY", "value", "so", "that", "is", "the", "last", "visible", "node", "in", "the", "viewport", "and", "further", "offsets", "this", "value", "by", "{", "@code", "endOffStart", "}"...
train
https://github.com/FXMisc/Flowless/blob/dce2269ebafed8f79203d00085af41f06f3083bc/src/main/java/org/fxmisc/flowless/CellPositioner.java#L177-L183
carewebframework/carewebframework-vista
org.carewebframework.vista.api-parent/org.carewebframework.vista.api.core/src/main/java/org/carewebframework/vista/api/property/PropertyCollection.java
PropertyCollection.getValue
public boolean getValue(String name, boolean dflt) { """ Returns a boolean property value. @param name Property name. @param dflt Default value if a property value is not found. @return Property value or default value if property value not found. """ try { String val = getValue(name, B...
java
public boolean getValue(String name, boolean dflt) { try { String val = getValue(name, Boolean.toString(dflt)).toLowerCase(); return val.startsWith("y") ? true : Boolean.parseBoolean(val); } catch (Exception e) { return false; } }
[ "public", "boolean", "getValue", "(", "String", "name", ",", "boolean", "dflt", ")", "{", "try", "{", "String", "val", "=", "getValue", "(", "name", ",", "Boolean", ".", "toString", "(", "dflt", ")", ")", ".", "toLowerCase", "(", ")", ";", "return", ...
Returns a boolean property value. @param name Property name. @param dflt Default value if a property value is not found. @return Property value or default value if property value not found.
[ "Returns", "a", "boolean", "property", "value", "." ]
train
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.core/src/main/java/org/carewebframework/vista/api/property/PropertyCollection.java#L146-L153
UrielCh/ovh-java-sdk
ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java
ApiOvhXdsl.serviceName_lines_number_statistics_GET
public OvhUnitAndValues<OvhTimestampAndValue> serviceName_lines_number_statistics_GET(String serviceName, String number, OvhStatisticsPeriodEnum period, OvhLineStatisticsTypeEnum type) throws IOException { """ Get various statistics about the line REST: GET /xdsl/{serviceName}/lines/{number}/statistics @param ...
java
public OvhUnitAndValues<OvhTimestampAndValue> serviceName_lines_number_statistics_GET(String serviceName, String number, OvhStatisticsPeriodEnum period, OvhLineStatisticsTypeEnum type) throws IOException { String qPath = "/xdsl/{serviceName}/lines/{number}/statistics"; StringBuilder sb = path(qPath, serviceName, nu...
[ "public", "OvhUnitAndValues", "<", "OvhTimestampAndValue", ">", "serviceName_lines_number_statistics_GET", "(", "String", "serviceName", ",", "String", "number", ",", "OvhStatisticsPeriodEnum", "period", ",", "OvhLineStatisticsTypeEnum", "type", ")", "throws", "IOException", ...
Get various statistics about the line REST: GET /xdsl/{serviceName}/lines/{number}/statistics @param type [required] @param period [required] @param serviceName [required] The internal name of your XDSL offer @param number [required] The number of the line
[ "Get", "various", "statistics", "about", "the", "line" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L459-L466
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java
Item.withString
public Item withString(String attrName, String val) { """ Sets the value of the specified attribute in the current item to the given string value. """ checkInvalidAttribute(attrName, val); attributes.put(attrName, val); return this; }
java
public Item withString(String attrName, String val) { checkInvalidAttribute(attrName, val); attributes.put(attrName, val); return this; }
[ "public", "Item", "withString", "(", "String", "attrName", ",", "String", "val", ")", "{", "checkInvalidAttribute", "(", "attrName", ",", "val", ")", ";", "attributes", ".", "put", "(", "attrName", ",", "val", ")", ";", "return", "this", ";", "}" ]
Sets the value of the specified attribute in the current item to the given string value.
[ "Sets", "the", "value", "of", "the", "specified", "attribute", "in", "the", "current", "item", "to", "the", "given", "string", "value", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java#L107-L111
arakelian/more-commons
src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java
XmlStreamReaderUtils.requiredShortAttribute
public static short requiredShortAttribute(final XMLStreamReader reader, final String localName) throws XMLStreamException { """ Returns the value of an attribute as a short. If the attribute is empty, this method throws an exception. @param reader <code>XMLStreamReader</code> that contains attrib...
java
public static short requiredShortAttribute(final XMLStreamReader reader, final String localName) throws XMLStreamException { return requiredShortAttribute(reader, null, localName); }
[ "public", "static", "short", "requiredShortAttribute", "(", "final", "XMLStreamReader", "reader", ",", "final", "String", "localName", ")", "throws", "XMLStreamException", "{", "return", "requiredShortAttribute", "(", "reader", ",", "null", ",", "localName", ")", ";...
Returns the value of an attribute as a short. If the attribute is empty, this method throws an exception. @param reader <code>XMLStreamReader</code> that contains attribute values. @param localName local name of attribute (the namespace is ignored). @return value of attribute as short @throws XMLStreamException if att...
[ "Returns", "the", "value", "of", "an", "attribute", "as", "a", "short", ".", "If", "the", "attribute", "is", "empty", "this", "method", "throws", "an", "exception", "." ]
train
https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L1303-L1306
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java
AbstractManagedType.onCheckSetAttribute
private <E> boolean onCheckSetAttribute(PluralAttribute<? super X, ?, ?> pluralAttribute, Class<E> paramClass) { """ On check set attribute. @param <E> the element type @param pluralAttribute the plural attribute @param paramClass the param class @return true, if successful """ if (pluralAttri...
java
private <E> boolean onCheckSetAttribute(PluralAttribute<? super X, ?, ?> pluralAttribute, Class<E> paramClass) { if (pluralAttribute != null) { if (isSetAttribute(pluralAttribute) && isBindable(pluralAttribute, paramClass)) { return true; } ...
[ "private", "<", "E", ">", "boolean", "onCheckSetAttribute", "(", "PluralAttribute", "<", "?", "super", "X", ",", "?", ",", "?", ">", "pluralAttribute", ",", "Class", "<", "E", ">", "paramClass", ")", "{", "if", "(", "pluralAttribute", "!=", "null", ")", ...
On check set attribute. @param <E> the element type @param pluralAttribute the plural attribute @param paramClass the param class @return true, if successful
[ "On", "check", "set", "attribute", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java#L956-L968
btrplace/scheduler
json/src/main/java/org/btrplace/json/model/view/network/NetworkConverter.java
NetworkConverter.linkFromJSON
public void linkFromJSON(Model mo, Network net, JSONObject o) throws JSONConverterException { """ Convert a JSON link object into a Java Link object. @param net the network to populate @param o the JSON object to convert """ net.connect(requiredInt(o, "id"), readCapacity(o), ...
java
public void linkFromJSON(Model mo, Network net, JSONObject o) throws JSONConverterException { net.connect(requiredInt(o, "id"), readCapacity(o), getSwitch(net, requiredInt(o, SWITCH_LABEL)), physicalElementFromJSON(mo, net, (JSONObject) o.get("physicalElement")) ...
[ "public", "void", "linkFromJSON", "(", "Model", "mo", ",", "Network", "net", ",", "JSONObject", "o", ")", "throws", "JSONConverterException", "{", "net", ".", "connect", "(", "requiredInt", "(", "o", ",", "\"id\"", ")", ",", "readCapacity", "(", "o", ")", ...
Convert a JSON link object into a Java Link object. @param net the network to populate @param o the JSON object to convert
[ "Convert", "a", "JSON", "link", "object", "into", "a", "Java", "Link", "object", "." ]
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/view/network/NetworkConverter.java#L288-L294
amzn/ion-java
src/com/amazon/ion/Timestamp.java
Timestamp.addSecond
public final Timestamp addSecond(int amount) { """ Returns a timestamp relative to this one by the given number of seconds. <p> This method always returns a Timestamp with SECOND precision. For example, adding one second to {@code 2011T} results in {@code 2011-01-01T00:00:01-00:00}. To receive a Timestamp that...
java
public final Timestamp addSecond(int amount) { long delta = (long) amount * 1000; return addMillisForPrecision(delta, Precision.SECOND, false); }
[ "public", "final", "Timestamp", "addSecond", "(", "int", "amount", ")", "{", "long", "delta", "=", "(", "long", ")", "amount", "*", "1000", ";", "return", "addMillisForPrecision", "(", "delta", ",", "Precision", ".", "SECOND", ",", "false", ")", ";", "}"...
Returns a timestamp relative to this one by the given number of seconds. <p> This method always returns a Timestamp with SECOND precision. For example, adding one second to {@code 2011T} results in {@code 2011-01-01T00:00:01-00:00}. To receive a Timestamp that always maintains the same precision as the original, use {@...
[ "Returns", "a", "timestamp", "relative", "to", "this", "one", "by", "the", "given", "number", "of", "seconds", ".", "<p", ">", "This", "method", "always", "returns", "a", "Timestamp", "with", "SECOND", "precision", ".", "For", "example", "adding", "one", "...
train
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/Timestamp.java#L2347-L2351
geomajas/geomajas-project-client-gwt2
impl/src/main/java/org/geomajas/gwt2/client/service/TileService.java
TileService.getTileCodeForLocation
public static TileCode getTileCodeForLocation(TileConfiguration tileConfiguration, Coordinate location, double resolution) { """ Given a certain location at a certain scale, what tile lies there? @param tileConfiguration The basic tile configuration. @param location The location to retrieve a tile ...
java
public static TileCode getTileCodeForLocation(TileConfiguration tileConfiguration, Coordinate location, double resolution) { int tileLevel = tileConfiguration.getResolutionIndex(resolution); double actualResolution = tileConfiguration.getResolution(tileLevel); double worldTileWidth = tileConfiguration.getTileW...
[ "public", "static", "TileCode", "getTileCodeForLocation", "(", "TileConfiguration", "tileConfiguration", ",", "Coordinate", "location", ",", "double", "resolution", ")", "{", "int", "tileLevel", "=", "tileConfiguration", ".", "getResolutionIndex", "(", "resolution", ")"...
Given a certain location at a certain scale, what tile lies there? @param tileConfiguration The basic tile configuration. @param location The location to retrieve a tile for. @param resolution The resolution at which to retrieve a tile. @return Returns the tile code for the requested location.
[ "Given", "a", "certain", "location", "at", "a", "certain", "scale", "what", "tile", "lies", "there?" ]
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/TileService.java#L101-L113
OpenLiberty/open-liberty
dev/com.ibm.ws.javamail.1.6/src/com/ibm/ws/javamail/internal/MailSessionService.java
MailSessionService.createResource
@Override public Object createResource(ResourceInfo info) throws Exception { """ The createResource uses the sessionProperties to create a javax.mail.Session object and return it to the caller. The caller uses JNDI look up with the JNDI name defined in the server.xml. """ Properties propertyNames...
java
@Override public Object createResource(ResourceInfo info) throws Exception { Properties propertyNames = createPropertyNames(); Properties props = createProperties(propertyNames); // The listOfPropMap is how the nested properties (name, value pairs) are // pulled from the Nester clas...
[ "@", "Override", "public", "Object", "createResource", "(", "ResourceInfo", "info", ")", "throws", "Exception", "{", "Properties", "propertyNames", "=", "createPropertyNames", "(", ")", ";", "Properties", "props", "=", "createProperties", "(", "propertyNames", ")", ...
The createResource uses the sessionProperties to create a javax.mail.Session object and return it to the caller. The caller uses JNDI look up with the JNDI name defined in the server.xml.
[ "The", "createResource", "uses", "the", "sessionProperties", "to", "create", "a", "javax", ".", "mail", ".", "Session", "object", "and", "return", "it", "to", "the", "caller", ".", "The", "caller", "uses", "JNDI", "look", "up", "with", "the", "JNDI", "name...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.javamail.1.6/src/com/ibm/ws/javamail/internal/MailSessionService.java#L159-L178
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/FilePathMappingUtils.java
FilePathMappingUtils.buildFilePathMapping
public static FilePathMapping buildFilePathMapping(String path, ResourceReaderHandler rsHandler) { """ Builds the File path mapping @param path the resource path @param rsHandler the resource reader handler @return the file path mapping """ return buildFilePathMapping(null, path, rsHandler); }
java
public static FilePathMapping buildFilePathMapping(String path, ResourceReaderHandler rsHandler) { return buildFilePathMapping(null, path, rsHandler); }
[ "public", "static", "FilePathMapping", "buildFilePathMapping", "(", "String", "path", ",", "ResourceReaderHandler", "rsHandler", ")", "{", "return", "buildFilePathMapping", "(", "null", ",", "path", ",", "rsHandler", ")", ";", "}" ]
Builds the File path mapping @param path the resource path @param rsHandler the resource reader handler @return the file path mapping
[ "Builds", "the", "File", "path", "mapping" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/FilePathMappingUtils.java#L42-L46
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.createWorker
private synchronized Worker createWorker(int i) throws IOException { """ Creates the specified worker without starting it. @param i the index of the worker to create """ Preconditions.checkState(mState == State.STARTED, "Must be in a started state to create workers"); File confDir = new File...
java
private synchronized Worker createWorker(int i) throws IOException { Preconditions.checkState(mState == State.STARTED, "Must be in a started state to create workers"); File confDir = new File(mWorkDir, "conf-worker" + i); File logsDir = new File(mWorkDir, "logs-worker" + i); File ramdisk = new F...
[ "private", "synchronized", "Worker", "createWorker", "(", "int", "i", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "mState", "==", "State", ".", "STARTED", ",", "\"Must be in a started state to create workers\"", ")", ";", "File", "con...
Creates the specified worker without starting it. @param i the index of the worker to create
[ "Creates", "the", "specified", "worker", "without", "starting", "it", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L578-L604
kaazing/gateway
mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java
ProxyFilter.sessionCreated
@Override public void sessionCreated(NextFilter nextFilter, IoSession session) throws Exception { """ Called when the session is created. Will create the handler able to handle the {@link ProxyIoSession#getRequest()} request stored in the session. Event is stored in an {@link IoSessionEventQueue}...
java
@Override public void sessionCreated(NextFilter nextFilter, IoSession session) throws Exception { LOGGER.debug("Session created: " + session); ProxyIoSession proxyIoSession = (ProxyIoSession) session .getAttribute(ProxyIoSession.PROXY_SESSION); LOGGER.debug(" get...
[ "@", "Override", "public", "void", "sessionCreated", "(", "NextFilter", "nextFilter", ",", "IoSession", "session", ")", "throws", "Exception", "{", "LOGGER", ".", "debug", "(", "\"Session created: \"", "+", "session", ")", ";", "ProxyIoSession", "proxyIoSession", ...
Called when the session is created. Will create the handler able to handle the {@link ProxyIoSession#getRequest()} request stored in the session. Event is stored in an {@link IoSessionEventQueue} for later delivery to the next filter in the chain when the handshake would have succeed. This will prevent the rest of the ...
[ "Called", "when", "the", "session", "is", "created", ".", "Will", "create", "the", "handler", "able", "to", "handle", "the", "{", "@link", "ProxyIoSession#getRequest", "()", "}", "request", "stored", "in", "the", "session", ".", "Event", "is", "stored", "in"...
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java#L271-L306
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java
MasterWorkerInfo.addLostStorage
public void addLostStorage(String tierAlias, String dirPath) { """ Adds a new worker lost storage path. @param tierAlias the tier alias @param dirPath the lost storage path """ List<String> paths = mLostStorage.getOrDefault(tierAlias, new ArrayList<>()); paths.add(dirPath); mLostStorage.put(tie...
java
public void addLostStorage(String tierAlias, String dirPath) { List<String> paths = mLostStorage.getOrDefault(tierAlias, new ArrayList<>()); paths.add(dirPath); mLostStorage.put(tierAlias, paths); }
[ "public", "void", "addLostStorage", "(", "String", "tierAlias", ",", "String", "dirPath", ")", "{", "List", "<", "String", ">", "paths", "=", "mLostStorage", ".", "getOrDefault", "(", "tierAlias", ",", "new", "ArrayList", "<>", "(", ")", ")", ";", "paths",...
Adds a new worker lost storage path. @param tierAlias the tier alias @param dirPath the lost storage path
[ "Adds", "a", "new", "worker", "lost", "storage", "path", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java#L188-L192
gitblit/fathom
fathom-x509/src/main/java/fathom/x509/X509Utils.java
X509Utils.openKeyStore
public static KeyStore openKeyStore(File storeFile, String storePassword) { """ Open a keystore. Store type is determined by file extension of name. If undetermined, JKS is assumed. The keystore does not need to exist. @param storeFile @param storePassword @return a KeyStore """ String lc = sto...
java
public static KeyStore openKeyStore(File storeFile, String storePassword) { String lc = storeFile.getName().toLowerCase(); String type = "JKS"; String provider = null; if (lc.endsWith(".p12") || lc.endsWith(".pfx")) { type = "PKCS12"; provider = BC; } ...
[ "public", "static", "KeyStore", "openKeyStore", "(", "File", "storeFile", ",", "String", "storePassword", ")", "{", "String", "lc", "=", "storeFile", ".", "getName", "(", ")", ".", "toLowerCase", "(", ")", ";", "String", "type", "=", "\"JKS\"", ";", "Strin...
Open a keystore. Store type is determined by file extension of name. If undetermined, JKS is assumed. The keystore does not need to exist. @param storeFile @param storePassword @return a KeyStore
[ "Open", "a", "keystore", ".", "Store", "type", "is", "determined", "by", "file", "extension", "of", "name", ".", "If", "undetermined", "JKS", "is", "assumed", ".", "The", "keystore", "does", "not", "need", "to", "exist", "." ]
train
https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L305-L339
dkmfbk/knowledgestore
ks-server-hbase/src/main/java/eu/fbk/knowledgestore/datastore/hbase/utils/AbstractHBaseUtils.java
AbstractHBaseUtils.getScan
public Scan getScan(String tableName, String famName) throws IOException { """ Creates a result scanner @param tableName @param famName @param conf @return @throws IOException """ return getResultScan(tableName, famName, null, null); }
java
public Scan getScan(String tableName, String famName) throws IOException { return getResultScan(tableName, famName, null, null); }
[ "public", "Scan", "getScan", "(", "String", "tableName", ",", "String", "famName", ")", "throws", "IOException", "{", "return", "getResultScan", "(", "tableName", ",", "famName", ",", "null", ",", "null", ")", ";", "}" ]
Creates a result scanner @param tableName @param famName @param conf @return @throws IOException
[ "Creates", "a", "result", "scanner" ]
train
https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-server-hbase/src/main/java/eu/fbk/knowledgestore/datastore/hbase/utils/AbstractHBaseUtils.java#L250-L253
paypal/SeLion
codegen/src/main/java/com/paypal/selion/plugins/CodeGeneratorHelper.java
CodeGeneratorHelper.generateJavaCode
private boolean generateJavaCode(File baseFile, File dataFile, File extendedFile) { """ 3. Last modified timestamp of the extended java file is greater than that of the corresponding yaml file. """ return (baseFile.lastModified() < dataFile.lastModified() || (extendedFile.exists() && baseFile.lastModif...
java
private boolean generateJavaCode(File baseFile, File dataFile, File extendedFile) { return (baseFile.lastModified() < dataFile.lastModified() || (extendedFile.exists() && baseFile.lastModified() < extendedFile .lastModified())); }
[ "private", "boolean", "generateJavaCode", "(", "File", "baseFile", ",", "File", "dataFile", ",", "File", "extendedFile", ")", "{", "return", "(", "baseFile", ".", "lastModified", "(", ")", "<", "dataFile", ".", "lastModified", "(", ")", "||", "(", "extendedF...
3. Last modified timestamp of the extended java file is greater than that of the corresponding yaml file.
[ "3", ".", "Last", "modified", "timestamp", "of", "the", "extended", "java", "file", "is", "greater", "than", "that", "of", "the", "corresponding", "yaml", "file", "." ]
train
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/codegen/src/main/java/com/paypal/selion/plugins/CodeGeneratorHelper.java#L162-L165
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java
ConditionMessage.andCondition
public Builder andCondition(String condition, Object... details) { """ Return a new builder to construct a new {@link ConditionMessage} based on the instance and a new condition outcome. @param condition the condition @param details details of the condition @return a {@link Builder} builder @see #andCondition...
java
public Builder andCondition(String condition, Object... details) { Assert.notNull(condition, "Condition must not be null"); String detail = StringUtils.arrayToDelimitedString(details, " "); if (StringUtils.hasLength(detail)) { return new Builder(condition + " " + detail); } return new Builder(condition); ...
[ "public", "Builder", "andCondition", "(", "String", "condition", ",", "Object", "...", "details", ")", "{", "Assert", ".", "notNull", "(", "condition", ",", "\"Condition must not be null\"", ")", ";", "String", "detail", "=", "StringUtils", ".", "arrayToDelimitedS...
Return a new builder to construct a new {@link ConditionMessage} based on the instance and a new condition outcome. @param condition the condition @param details details of the condition @return a {@link Builder} builder @see #andCondition(Class, Object...) @see #forCondition(String, Object...)
[ "Return", "a", "new", "builder", "to", "construct", "a", "new", "{" ]
train
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java#L124-L131
paoding-code/paoding-rose
paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/util/ExqlUtils.java
ExqlUtils.execExpr
public static Object execExpr(ExprResolver exprResolver, String expression) { """ 返回在语句输出的内容。 @param exprResolver - 使用的引擎 @param expression - 解释的表达式 @return 输出的内容 """ try { // 返回输出的内容 return exprResolver.executeExpr(expression); } catch (Exception e) { ...
java
public static Object execExpr(ExprResolver exprResolver, String expression) { try { // 返回输出的内容 return exprResolver.executeExpr(expression); } catch (Exception e) { // 输出日志 if (logger.isDebugEnabled()) { logger.debug("Can't resolving expr...
[ "public", "static", "Object", "execExpr", "(", "ExprResolver", "exprResolver", ",", "String", "expression", ")", "{", "try", "{", "// 返回输出的内容", "return", "exprResolver", ".", "executeExpr", "(", "expression", ")", ";", "}", "catch", "(", "Exception", "e", ")",...
返回在语句输出的内容。 @param exprResolver - 使用的引擎 @param expression - 解释的表达式 @return 输出的内容
[ "返回在语句输出的内容。" ]
train
https://github.com/paoding-code/paoding-rose/blob/8b512704174dd6cba95e544c7d6ab66105cb8ec4/paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/util/ExqlUtils.java#L33-L48