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
gallandarakhneorg/afc
core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java
Sphere3d.setProperties
public void setProperties(Point3d center, DoubleProperty radius1) { """ Bind the frame of the sphere with center and radisu properties. @param center @param radius1 """ setProperties(center.xProperty,center.yProperty,center.zProperty, radius1); }
java
public void setProperties(Point3d center, DoubleProperty radius1) { setProperties(center.xProperty,center.yProperty,center.zProperty, radius1); }
[ "public", "void", "setProperties", "(", "Point3d", "center", ",", "DoubleProperty", "radius1", ")", "{", "setProperties", "(", "center", ".", "xProperty", ",", "center", ".", "yProperty", ",", "center", ".", "zProperty", ",", "radius1", ")", ";", "}" ]
Bind the frame of the sphere with center and radisu properties. @param center @param radius1
[ "Bind", "the", "frame", "of", "the", "sphere", "with", "center", "and", "radisu", "properties", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Sphere3d.java#L145-L147
spotify/async-google-pubsub-client
src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java
Pubsub.createSubscription
public PubsubFuture<Subscription> createSubscription(final String project, final String subscriptionName, final String topic) { """ Create a Pub/Sub subscription. @param project The Google Clou...
java
public PubsubFuture<Subscription> createSubscription(final String project, final String subscriptionName, final String topic) { return createSubscription(canonicalSubscription(project, subscriptionName), ca...
[ "public", "PubsubFuture", "<", "Subscription", ">", "createSubscription", "(", "final", "String", "project", ",", "final", "String", "subscriptionName", ",", "final", "String", "topic", ")", "{", "return", "createSubscription", "(", "canonicalSubscription", "(", "pr...
Create a Pub/Sub subscription. @param project The Google Cloud project. @param subscriptionName The name of the subscription to create. @param topic The name of the topic to subscribe to. @return A future that is completed when this request is completed.
[ "Create", "a", "Pub", "/", "Sub", "subscription", "." ]
train
https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L355-L359
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java
SimpleDateFormat.setNumberFormat
public void setNumberFormat(String fields, NumberFormat overrideNF) { """ allow the user to set the NumberFormat for several fields It can be a single field like: "y"(year) or "M"(month) It can be several field combined together: "yMd"(year, month and date) Note: 1 symbol field is enough for multiple symbol fi...
java
public void setNumberFormat(String fields, NumberFormat overrideNF) { overrideNF.setGroupingUsed(false); String nsName = "$" + UUID.randomUUID().toString(); // initialize mapping if not there if (numberFormatters == null) { numberFormatters = new HashMap<String, NumberFormat...
[ "public", "void", "setNumberFormat", "(", "String", "fields", ",", "NumberFormat", "overrideNF", ")", "{", "overrideNF", ".", "setGroupingUsed", "(", "false", ")", ";", "String", "nsName", "=", "\"$\"", "+", "UUID", ".", "randomUUID", "(", ")", ".", "toStrin...
allow the user to set the NumberFormat for several fields It can be a single field like: "y"(year) or "M"(month) It can be several field combined together: "yMd"(year, month and date) Note: 1 symbol field is enough for multiple symbol fields (so "y" will override "yy", "yyy") If the field is not numeric, then override ...
[ "allow", "the", "user", "to", "set", "the", "NumberFormat", "for", "several", "fields", "It", "can", "be", "a", "single", "field", "like", ":", "y", "(", "year", ")", "or", "M", "(", "month", ")", "It", "can", "be", "several", "field", "combined", "t...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L4373-L4398
alkacon/opencms-core
src/org/opencms/workplace/explorer/CmsExplorerTypeSettings.java
CmsExplorerTypeSettings.addIconRule
public void addIconRule(String extension, String icon, String bigIcon, String smallIconStyle, String bigIconStyle) { """ Adds a new icon rule to this explorer type.<p> @param extension the extension for the icon rule @param icon the small icon @param bigIcon the big icon @param smallIconStyle the small icon ...
java
public void addIconRule(String extension, String icon, String bigIcon, String smallIconStyle, String bigIconStyle) { CmsIconRule rule = new CmsIconRule(extension, icon, bigIcon, smallIconStyle, bigIconStyle); m_iconRules.put(extension, rule); }
[ "public", "void", "addIconRule", "(", "String", "extension", ",", "String", "icon", ",", "String", "bigIcon", ",", "String", "smallIconStyle", ",", "String", "bigIconStyle", ")", "{", "CmsIconRule", "rule", "=", "new", "CmsIconRule", "(", "extension", ",", "ic...
Adds a new icon rule to this explorer type.<p> @param extension the extension for the icon rule @param icon the small icon @param bigIcon the big icon @param smallIconStyle the small icon CSS style class @param bigIconStyle the big icon CSS style class
[ "Adds", "a", "new", "icon", "rule", "to", "this", "explorer", "type", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsExplorerTypeSettings.java#L237-L241
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/impl/RaftServiceManager.java
RaftServiceManager.snapshotService
private void snapshotService(SnapshotWriter writer, RaftServiceContext service) { """ Takes a snapshot of the given service. @param writer the snapshot writer @param service the service to snapshot """ writer.writeLong(service.serviceId().id()); writer.writeString(service.serviceType().name()); ...
java
private void snapshotService(SnapshotWriter writer, RaftServiceContext service) { writer.writeLong(service.serviceId().id()); writer.writeString(service.serviceType().name()); writer.writeString(service.serviceName()); byte[] config = Serializer.using(service.serviceType().namespace()).encode(service.se...
[ "private", "void", "snapshotService", "(", "SnapshotWriter", "writer", ",", "RaftServiceContext", "service", ")", "{", "writer", ".", "writeLong", "(", "service", ".", "serviceId", "(", ")", ".", "id", "(", ")", ")", ";", "writer", ".", "writeString", "(", ...
Takes a snapshot of the given service. @param writer the snapshot writer @param service the service to snapshot
[ "Takes", "a", "snapshot", "of", "the", "given", "service", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/impl/RaftServiceManager.java#L476-L487
google/closure-compiler
src/com/google/javascript/jscomp/NodeUtil.java
NodeUtil.evaluatesToLocalValue
static boolean evaluatesToLocalValue(Node value, Predicate<Node> locals) { """ @param locals A predicate to apply to unknown local values. @return Whether the result of the expression node is known to be a primitive value or an object that has not yet escaped. This guarantee is different than that provided by ...
java
static boolean evaluatesToLocalValue(Node value, Predicate<Node> locals) { switch (value.getToken()) { case ASSIGN: // A result that is aliased by a non-local name, is the effectively the // same as returning a non-local name, but this doesn't matter if the // value is immutable. ...
[ "static", "boolean", "evaluatesToLocalValue", "(", "Node", "value", ",", "Predicate", "<", "Node", ">", "locals", ")", "{", "switch", "(", "value", ".", "getToken", "(", ")", ")", "{", "case", "ASSIGN", ":", "// A result that is aliased by a non-local name, is the...
@param locals A predicate to apply to unknown local values. @return Whether the result of the expression node is known to be a primitive value or an object that has not yet escaped. This guarantee is different than that provided by isLiteralValue (where literal values are immune to side-effects if unescaped) or isImmu...
[ "@param", "locals", "A", "predicate", "to", "apply", "to", "unknown", "local", "values", ".", "@return", "Whether", "the", "result", "of", "the", "expression", "node", "is", "known", "to", "be", "a", "primitive", "value", "or", "an", "object", "that", "has...
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L5050-L5117
apache/incubator-gobblin
gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/TokenBucket.java
TokenBucket.getTokens
public boolean getTokens(long tokens, long timeout, TimeUnit timeoutUnit) throws InterruptedException { """ Attempt to get the specified amount of tokens within the specified timeout. If the tokens cannot be retrieved in the specified timeout, the call will return false immediately, otherwise, the call will block...
java
public boolean getTokens(long tokens, long timeout, TimeUnit timeoutUnit) throws InterruptedException { long timeoutMillis = timeoutUnit.toMillis(timeout); long wait = tryReserveTokens(tokens, timeoutMillis); if (wait < 0) { return false; } if (wait == 0) { return true; } Threa...
[ "public", "boolean", "getTokens", "(", "long", "tokens", ",", "long", "timeout", ",", "TimeUnit", "timeoutUnit", ")", "throws", "InterruptedException", "{", "long", "timeoutMillis", "=", "timeoutUnit", ".", "toMillis", "(", "timeout", ")", ";", "long", "wait", ...
Attempt to get the specified amount of tokens within the specified timeout. If the tokens cannot be retrieved in the specified timeout, the call will return false immediately, otherwise, the call will block until the tokens are available. @return true if the tokens are granted. @throws InterruptedException
[ "Attempt", "to", "get", "the", "specified", "amount", "of", "tokens", "within", "the", "specified", "timeout", ".", "If", "the", "tokens", "cannot", "be", "retrieved", "in", "the", "specified", "timeout", "the", "call", "will", "return", "false", "immediately"...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/TokenBucket.java#L69-L82
davidcarboni/restolino
src/main/java/com/github/davidcarboni/restolino/reload/ClassFinder.java
ClassFinder.createReflections
static Reflections createReflections(ClassLoader classLoader, String packagePrefix) { """ Builds a {@link Reflections} instance that will scan for classes in, and load them from, the given class loader. @param classLoader The class loader to scan and load from. @return A new {@link Reflections} instance. ...
java
static Reflections createReflections(ClassLoader classLoader, String packagePrefix) { // We set up reflections to use the classLoader for loading classes // and also to use the classLoader to determine the list of URLs: ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().addC...
[ "static", "Reflections", "createReflections", "(", "ClassLoader", "classLoader", ",", "String", "packagePrefix", ")", "{", "// We set up reflections to use the classLoader for loading classes", "// and also to use the classLoader to determine the list of URLs:", "ConfigurationBuilder", "...
Builds a {@link Reflections} instance that will scan for classes in, and load them from, the given class loader. @param classLoader The class loader to scan and load from. @return A new {@link Reflections} instance.
[ "Builds", "a", "{", "@link", "Reflections", "}", "instance", "that", "will", "scan", "for", "classes", "in", "and", "load", "them", "from", "the", "given", "class", "loader", "." ]
train
https://github.com/davidcarboni/restolino/blob/3f84ece1bd016fbb597c624d46fcca5a2580a33d/src/main/java/com/github/davidcarboni/restolino/reload/ClassFinder.java#L39-L56
atomix/atomix
core/src/main/java/io/atomix/core/impl/CoreTransactionService.java
CoreTransactionService.completeCommittingTransaction
private void completeCommittingTransaction(TransactionId transactionId) { """ Completes a transaction in the {@link TransactionState#PREPARING} state. @param transactionId the transaction identifier for the transaction to complete """ // Change ownership of the transaction to the local node and then com...
java
private void completeCommittingTransaction(TransactionId transactionId) { // Change ownership of the transaction to the local node and then commit it. completeTransaction( transactionId, TransactionState.COMMITTING, info -> new TransactionInfo(localMemberId, TransactionState.COMMITTING, ...
[ "private", "void", "completeCommittingTransaction", "(", "TransactionId", "transactionId", ")", "{", "// Change ownership of the transaction to the local node and then commit it.", "completeTransaction", "(", "transactionId", ",", "TransactionState", ".", "COMMITTING", ",", "info",...
Completes a transaction in the {@link TransactionState#PREPARING} state. @param transactionId the transaction identifier for the transaction to complete
[ "Completes", "a", "transaction", "in", "the", "{", "@link", "TransactionState#PREPARING", "}", "state", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/core/src/main/java/io/atomix/core/impl/CoreTransactionService.java#L258-L276
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/transform/RejectExpressionValuesTransformer.java
RejectExpressionValuesTransformer.checkModel
private Set<String> checkModel(final ModelNode model, TransformationContext context) throws OperationFailedException { """ Check the model for expression values. @param model the model @return the attribute containing an expression """ final Set<String> attributes = new HashSet<String>(); A...
java
private Set<String> checkModel(final ModelNode model, TransformationContext context) throws OperationFailedException { final Set<String> attributes = new HashSet<String>(); AttributeTransformationRequirementChecker checker; for (final String attribute : attributeNames) { if (model.ha...
[ "private", "Set", "<", "String", ">", "checkModel", "(", "final", "ModelNode", "model", ",", "TransformationContext", "context", ")", "throws", "OperationFailedException", "{", "final", "Set", "<", "String", ">", "attributes", "=", "new", "HashSet", "<", "String...
Check the model for expression values. @param model the model @return the attribute containing an expression
[ "Check", "the", "model", "for", "expression", "values", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/RejectExpressionValuesTransformer.java#L173-L188
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java
InternalUtilities.capitalizeFirstLetterOfString
static String capitalizeFirstLetterOfString(String text, Locale locale) { """ capitalizeFirstLetterOfString, This capitalizes the first letter of the supplied string, in a way that is sensitive to the specified locale. """ if (text == null || text.length() < 1) { return text; } ...
java
static String capitalizeFirstLetterOfString(String text, Locale locale) { if (text == null || text.length() < 1) { return text; } String textCapitalized = text.substring(0, 1).toUpperCase(locale) + text.substring(1); return textCapitalized; }
[ "static", "String", "capitalizeFirstLetterOfString", "(", "String", "text", ",", "Locale", "locale", ")", "{", "if", "(", "text", "==", "null", "||", "text", ".", "length", "(", ")", "<", "1", ")", "{", "return", "text", ";", "}", "String", "textCapitali...
capitalizeFirstLetterOfString, This capitalizes the first letter of the supplied string, in a way that is sensitive to the specified locale.
[ "capitalizeFirstLetterOfString", "This", "capitalizes", "the", "first", "letter", "of", "the", "supplied", "string", "in", "a", "way", "that", "is", "sensitive", "to", "the", "specified", "locale", "." ]
train
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java#L328-L334
VoltDB/voltdb
src/frontend/org/voltdb/utils/CatalogUtil.java
CatalogUtil.isSnapshotableStreamedTableView
public static boolean isSnapshotableStreamedTableView(Database db, Table table) { """ Test if a table is a streamed table view and should be included in the snapshot. @param db The database catalog @param table The table to test.</br> @return If the table is a streamed table view that should be snapshotted. ...
java
public static boolean isSnapshotableStreamedTableView(Database db, Table table) { Table materializer = table.getMaterializer(); if (materializer == null) { // Return false if it is not a materialized view. return false; } if (! CatalogUtil.isTableExportOnly(db, ma...
[ "public", "static", "boolean", "isSnapshotableStreamedTableView", "(", "Database", "db", ",", "Table", "table", ")", "{", "Table", "materializer", "=", "table", ".", "getMaterializer", "(", ")", ";", "if", "(", "materializer", "==", "null", ")", "{", "// Retur...
Test if a table is a streamed table view and should be included in the snapshot. @param db The database catalog @param table The table to test.</br> @return If the table is a streamed table view that should be snapshotted.
[ "Test", "if", "a", "table", "is", "a", "streamed", "table", "view", "and", "should", "be", "included", "in", "the", "snapshot", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L444-L466
structr/structr
structr-core/src/main/java/org/structr/common/MailHelper.java
MailHelper.replacePlaceHoldersInTemplate
public static String replacePlaceHoldersInTemplate(final String template, final Map<String, String> replacementMap) { """ Parse the template and replace any of the keys in the replacement map by the given values @param template @param replacementMap @return template string with included replacements """ ...
java
public static String replacePlaceHoldersInTemplate(final String template, final Map<String, String> replacementMap) { List<String> toReplace = new ArrayList<>(); List<String> replaceBy = new ArrayList<>(); for (Entry<String, String> property : replacementMap.entrySet()) { toReplace.add(property.getKey()); ...
[ "public", "static", "String", "replacePlaceHoldersInTemplate", "(", "final", "String", "template", ",", "final", "Map", "<", "String", ",", "String", ">", "replacementMap", ")", "{", "List", "<", "String", ">", "toReplace", "=", "new", "ArrayList", "<>", "(", ...
Parse the template and replace any of the keys in the replacement map by the given values @param template @param replacementMap @return template string with included replacements
[ "Parse", "the", "template", "and", "replace", "any", "of", "the", "keys", "in", "the", "replacement", "map", "by", "the", "given", "values" ]
train
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/common/MailHelper.java#L208-L222
lightblueseas/file-worker
src/main/java/de/alpharogroup/file/delete/DeleteFileExtensions.java
DeleteFileExtensions.deleteAllFilesWithSuffix
public static void deleteAllFilesWithSuffix(final File file, final String theSuffix) throws IOException { """ Deletes all files with the given suffix recursively. @param file The directory from where to delete the files wiht the given suffix. @param theSuffix The suffix from the files to delete. @throws...
java
public static void deleteAllFilesWithSuffix(final File file, final String theSuffix) throws IOException { final String filePath = file.getAbsolutePath(); final String suffix[] = { theSuffix }; final List<File> files = FileSearchExtensions.findFiles(filePath, suffix); final int fileCount = files.size(); for...
[ "public", "static", "void", "deleteAllFilesWithSuffix", "(", "final", "File", "file", ",", "final", "String", "theSuffix", ")", "throws", "IOException", "{", "final", "String", "filePath", "=", "file", ".", "getAbsolutePath", "(", ")", ";", "final", "String", ...
Deletes all files with the given suffix recursively. @param file The directory from where to delete the files wiht the given suffix. @param theSuffix The suffix from the files to delete. @throws IOException Signals that an I/O exception has occurred.
[ "Deletes", "all", "files", "with", "the", "given", "suffix", "recursively", "." ]
train
https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/delete/DeleteFileExtensions.java#L184-L195
overturetool/overture
ide/debug/src/main/java/org/overture/ide/debug/core/launching/VdmLaunchConfigurationDelegate.java
VdmLaunchConfigurationDelegate.abort
private static void abort(String message, Throwable e) throws CoreException { """ Throws an exception with a new status containing the given message and optional exception. @param message error message @param e underlying exception @throws CoreException """ throw new CoreException((IStatus) new Status...
java
private static void abort(String message, Throwable e) throws CoreException { throw new CoreException((IStatus) new Status(IStatus.ERROR, IDebugConstants.PLUGIN_ID, 0, message, e)); }
[ "private", "static", "void", "abort", "(", "String", "message", ",", "Throwable", "e", ")", "throws", "CoreException", "{", "throw", "new", "CoreException", "(", "(", "IStatus", ")", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "IDebugConstants", ".",...
Throws an exception with a new status containing the given message and optional exception. @param message error message @param e underlying exception @throws CoreException
[ "Throws", "an", "exception", "with", "a", "new", "status", "containing", "the", "given", "message", "and", "optional", "exception", "." ]
train
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/core/launching/VdmLaunchConfigurationDelegate.java#L621-L624
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java
PoolsImpl.getAsync
public Observable<CloudPool> getAsync(String poolId, PoolGetOptions poolGetOptions) { """ Gets information about the specified pool. @param poolId The ID of the pool to get. @param poolGetOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation ...
java
public Observable<CloudPool> getAsync(String poolId, PoolGetOptions poolGetOptions) { return getWithServiceResponseAsync(poolId, poolGetOptions).map(new Func1<ServiceResponseWithHeaders<CloudPool, PoolGetHeaders>, CloudPool>() { @Override public CloudPool call(ServiceResponseWithHeaders<...
[ "public", "Observable", "<", "CloudPool", ">", "getAsync", "(", "String", "poolId", ",", "PoolGetOptions", "poolGetOptions", ")", "{", "return", "getWithServiceResponseAsync", "(", "poolId", ",", "poolGetOptions", ")", ".", "map", "(", "new", "Func1", "<", "Serv...
Gets information about the specified pool. @param poolId The ID of the pool to get. @param poolGetOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the CloudPool object
[ "Gets", "information", "about", "the", "specified", "pool", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L1721-L1728
yavijava/yavijava
src/main/java/com/vmware/vim/cf/CacheInstance.java
CacheInstance.getCopy
public Object getCopy(ManagedObject mo, String propName) { """ Get a copy of the cached property. You can change the returned object as you like @param mo Managed object @param propName property name @return the data object identified by the propName. NullObject.NULL if the data object is really null """ ...
java
public Object getCopy(ManagedObject mo, String propName) { Object obj = get(mo.getMOR(), propName); try { obj = DeepCopier.deepCopy(obj); } catch(Exception e) { throw new RuntimeException(e); } return obj; }
[ "public", "Object", "getCopy", "(", "ManagedObject", "mo", ",", "String", "propName", ")", "{", "Object", "obj", "=", "get", "(", "mo", ".", "getMOR", "(", ")", ",", "propName", ")", ";", "try", "{", "obj", "=", "DeepCopier", ".", "deepCopy", "(", "o...
Get a copy of the cached property. You can change the returned object as you like @param mo Managed object @param propName property name @return the data object identified by the propName. NullObject.NULL if the data object is really null
[ "Get", "a", "copy", "of", "the", "cached", "property", ".", "You", "can", "change", "the", "returned", "object", "as", "you", "like" ]
train
https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim/cf/CacheInstance.java#L85-L96
ngageoint/geopackage-android-map
geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java
GoogleMapShapeConverter.toPolygon
public Polygon toPolygon(com.google.android.gms.maps.model.Polygon polygon) { """ Convert a {@link com.google.android.gms.maps.model.Polygon} to a {@link Polygon} @param polygon polygon @return polygon """ return toPolygon(polygon, false, false); }
java
public Polygon toPolygon(com.google.android.gms.maps.model.Polygon polygon) { return toPolygon(polygon, false, false); }
[ "public", "Polygon", "toPolygon", "(", "com", ".", "google", ".", "android", ".", "gms", ".", "maps", ".", "model", ".", "Polygon", "polygon", ")", "{", "return", "toPolygon", "(", "polygon", ",", "false", ",", "false", ")", ";", "}" ]
Convert a {@link com.google.android.gms.maps.model.Polygon} to a {@link Polygon} @param polygon polygon @return polygon
[ "Convert", "a", "{", "@link", "com", ".", "google", ".", "android", ".", "gms", ".", "maps", ".", "model", ".", "Polygon", "}", "to", "a", "{", "@link", "Polygon", "}" ]
train
https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L597-L599
alkacon/opencms-core
src/org/opencms/workplace/explorer/CmsExplorerTypeSettings.java
CmsExplorerTypeSettings.setPropertyDefaults
public void setPropertyDefaults(String enabled, String showNavigation) { """ Sets the default settings for the property display dialog.<p> @param enabled true, if this explorer type setting uses a special properties dialog @param showNavigation true, if this explorer type setting displays the navigation proper...
java
public void setPropertyDefaults(String enabled, String showNavigation) { setPropertiesEnabled(Boolean.valueOf(enabled).booleanValue()); setShowNavigation(Boolean.valueOf(showNavigation).booleanValue()); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LO...
[ "public", "void", "setPropertyDefaults", "(", "String", "enabled", ",", "String", "showNavigation", ")", "{", "setPropertiesEnabled", "(", "Boolean", ".", "valueOf", "(", "enabled", ")", ".", "booleanValue", "(", ")", ")", ";", "setShowNavigation", "(", "Boolean...
Sets the default settings for the property display dialog.<p> @param enabled true, if this explorer type setting uses a special properties dialog @param showNavigation true, if this explorer type setting displays the navigation properties in the special properties dialog
[ "Sets", "the", "default", "settings", "for", "the", "property", "display", "dialog", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsExplorerTypeSettings.java#L829-L836
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/filesystem/InstrumentedFileSystemUtils.java
InstrumentedFileSystemUtils.replaceScheme
public static Path replaceScheme(Path path, String replace, String replacement) { """ Replace the scheme of the input {@link Path} if it matches the string to replace. """ return new Path(replaceScheme(path.toUri(), replace, replacement)); }
java
public static Path replaceScheme(Path path, String replace, String replacement) { return new Path(replaceScheme(path.toUri(), replace, replacement)); }
[ "public", "static", "Path", "replaceScheme", "(", "Path", "path", ",", "String", "replace", ",", "String", "replacement", ")", "{", "return", "new", "Path", "(", "replaceScheme", "(", "path", ".", "toUri", "(", ")", ",", "replace", ",", "replacement", ")",...
Replace the scheme of the input {@link Path} if it matches the string to replace.
[ "Replace", "the", "scheme", "of", "the", "input", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/filesystem/InstrumentedFileSystemUtils.java#L54-L56
facebookarchive/hadoop-20
src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java
StreamKeyValUtil.readLine
public static int readLine(LineReader lineReader, Text out) throws IOException { """ Read a utf8 encoded line from a data input stream. @param lineReader LineReader to read the line from. @param out Text to read into @return number of bytes read @throws IOException """ out.clear(); return lineRe...
java
public static int readLine(LineReader lineReader, Text out) throws IOException { out.clear(); return lineReader.readLine(out); }
[ "public", "static", "int", "readLine", "(", "LineReader", "lineReader", ",", "Text", "out", ")", "throws", "IOException", "{", "out", ".", "clear", "(", ")", ";", "return", "lineReader", ".", "readLine", "(", "out", ")", ";", "}" ]
Read a utf8 encoded line from a data input stream. @param lineReader LineReader to read the line from. @param out Text to read into @return number of bytes read @throws IOException
[ "Read", "a", "utf8", "encoded", "line", "from", "a", "data", "input", "stream", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamKeyValUtil.java#L152-L156
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java
SARLImages.forSkill
public ImageDescriptor forSkill(JvmVisibility visibility, int flags) { """ Replies the image descriptor for the "skills". @param visibility the visibility of the skill. @param flags the mark flags. See {@link JavaElementImageDescriptor#setAdornments(int)} for a description of the available flags. @return the...
java
public ImageDescriptor forSkill(JvmVisibility visibility, int flags) { return getDecorated(getTypeImageDescriptor( SarlElementType.SKILL, false, false, toFlags(visibility), USE_LIGHT_ICONS), flags); }
[ "public", "ImageDescriptor", "forSkill", "(", "JvmVisibility", "visibility", ",", "int", "flags", ")", "{", "return", "getDecorated", "(", "getTypeImageDescriptor", "(", "SarlElementType", ".", "SKILL", ",", "false", ",", "false", ",", "toFlags", "(", "visibility"...
Replies the image descriptor for the "skills". @param visibility the visibility of the skill. @param flags the mark flags. See {@link JavaElementImageDescriptor#setAdornments(int)} for a description of the available flags. @return the image descriptor for the skills.
[ "Replies", "the", "image", "descriptor", "for", "the", "skills", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLImages.java#L163-L166
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/StageService.java
StageService.resolveStageOrder
private Integer resolveStageOrder(long pipelineId, String stageName) { """ stage order in current pipeline by 1, as current stage's order """ Integer order = getStageOrderInPipeline(pipelineId, stageName); if (order == null) { order = getMaxStageOrderInPipeline(pipelineId) + 1; ...
java
private Integer resolveStageOrder(long pipelineId, String stageName) { Integer order = getStageOrderInPipeline(pipelineId, stageName); if (order == null) { order = getMaxStageOrderInPipeline(pipelineId) + 1; } return order; }
[ "private", "Integer", "resolveStageOrder", "(", "long", "pipelineId", ",", "String", "stageName", ")", "{", "Integer", "order", "=", "getStageOrderInPipeline", "(", "pipelineId", ",", "stageName", ")", ";", "if", "(", "order", "==", "null", ")", "{", "order", ...
stage order in current pipeline by 1, as current stage's order
[ "stage", "order", "in", "current", "pipeline", "by", "1", "as", "current", "stage", "s", "order" ]
train
https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/server/src/main/java/com/thoughtworks/go/server/service/StageService.java#L279-L285
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/math/NumberUtils.java
NumberUtils.toInt
public static int toInt(final String str, final int defaultValue) { """ <p>Convert a <code>String</code> to an <code>int</code>, returning a default value if the conversion fails.</p> <p>If the string is <code>null</code>, the default value is returned.</p> <pre> NumberUtils.toInt(null, 1) = 1 NumberUtils...
java
public static int toInt(final String str, final int defaultValue) { if(str == null) { return defaultValue; } try { return Integer.parseInt(str); } catch (final NumberFormatException nfe) { return defaultValue; } }
[ "public", "static", "int", "toInt", "(", "final", "String", "str", ",", "final", "int", "defaultValue", ")", "{", "if", "(", "str", "==", "null", ")", "{", "return", "defaultValue", ";", "}", "try", "{", "return", "Integer", ".", "parseInt", "(", "str"...
<p>Convert a <code>String</code> to an <code>int</code>, returning a default value if the conversion fails.</p> <p>If the string is <code>null</code>, the default value is returned.</p> <pre> NumberUtils.toInt(null, 1) = 1 NumberUtils.toInt("", 1) = 1 NumberUtils.toInt("1", 0) = 1 </pre> @param str the string to...
[ "<p", ">", "Convert", "a", "<code", ">", "String<", "/", "code", ">", "to", "an", "<code", ">", "int<", "/", "code", ">", "returning", "a", "default", "value", "if", "the", "conversion", "fails", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/math/NumberUtils.java#L120-L129
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/context/RequestViewContext.java
RequestViewContext.refreshRequestViewContext
public void refreshRequestViewContext(FacesContext facesContext, UIViewRoot root) { """ Scans UIViewRoot facets with added component resources by the effect of @ResourceDependency annotation, and register the associated inspected classes so new component resources will not be added to the component tree again an...
java
public void refreshRequestViewContext(FacesContext facesContext, UIViewRoot root) { for (Map.Entry<String, UIComponent> entry : root.getFacets().entrySet()) { UIComponent facet = entry.getValue(); if (facet.getId() != null && facet.getId().startsWith("javax_faces_location_"))...
[ "public", "void", "refreshRequestViewContext", "(", "FacesContext", "facesContext", ",", "UIViewRoot", "root", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "UIComponent", ">", "entry", ":", "root", ".", "getFacets", "(", ")", ".", "entrySet...
Scans UIViewRoot facets with added component resources by the effect of @ResourceDependency annotation, and register the associated inspected classes so new component resources will not be added to the component tree again and again. @param facesContext @param root
[ "Scans", "UIViewRoot", "facets", "with", "added", "component", "resources", "by", "the", "effect", "of", "@ResourceDependency", "annotation", "and", "register", "the", "associated", "inspected", "classes", "so", "new", "component", "resources", "will", "not", "be", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/context/RequestViewContext.java#L189-L211
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java
ImageModerationsImpl.evaluateFileInputAsync
public Observable<Evaluate> evaluateFileInputAsync(byte[] imageStream, EvaluateFileInputOptionalParameter evaluateFileInputOptionalParameter) { """ Returns probabilities of the image containing racy or adult content. @param imageStream The image file. @param evaluateFileInputOptionalParameter the object repres...
java
public Observable<Evaluate> evaluateFileInputAsync(byte[] imageStream, EvaluateFileInputOptionalParameter evaluateFileInputOptionalParameter) { return evaluateFileInputWithServiceResponseAsync(imageStream, evaluateFileInputOptionalParameter).map(new Func1<ServiceResponse<Evaluate>, Evaluate>() { @Ov...
[ "public", "Observable", "<", "Evaluate", ">", "evaluateFileInputAsync", "(", "byte", "[", "]", "imageStream", ",", "EvaluateFileInputOptionalParameter", "evaluateFileInputOptionalParameter", ")", "{", "return", "evaluateFileInputWithServiceResponseAsync", "(", "imageStream", ...
Returns probabilities of the image containing racy or adult content. @param imageStream The image file. @param evaluateFileInputOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the obser...
[ "Returns", "probabilities", "of", "the", "image", "containing", "racy", "or", "adult", "content", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1451-L1458
liferay/com-liferay-commerce
commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountPersistenceImpl.java
CommerceAccountPersistenceImpl.findByCompanyId
@Override public List<CommerceAccount> findByCompanyId(long companyId, int start, int end) { """ Returns a range of all the commerce accounts where companyId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not ...
java
@Override public List<CommerceAccount> findByCompanyId(long companyId, int start, int end) { return findByCompanyId(companyId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceAccount", ">", "findByCompanyId", "(", "long", "companyId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCompanyId", "(", "companyId", ",", "start", ",", "end", ",", "null", ")", ";", ...
Returns a range of all the commerce accounts where companyId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "accounts", "where", "companyId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountPersistenceImpl.java#L147-L151
grpc/grpc-java
core/src/main/java/io/grpc/internal/ServiceConfigUtil.java
ServiceConfigUtil.getStickinessMetadataKeyFromServiceConfig
@Nullable public static String getStickinessMetadataKeyFromServiceConfig( Map<String, ?> serviceConfig) { """ Extracts the stickiness metadata key from a service config, or {@code null}. """ if (!serviceConfig.containsKey(SERVICE_CONFIG_STICKINESS_METADATA_KEY)) { return null; } retur...
java
@Nullable public static String getStickinessMetadataKeyFromServiceConfig( Map<String, ?> serviceConfig) { if (!serviceConfig.containsKey(SERVICE_CONFIG_STICKINESS_METADATA_KEY)) { return null; } return getString(serviceConfig, SERVICE_CONFIG_STICKINESS_METADATA_KEY); }
[ "@", "Nullable", "public", "static", "String", "getStickinessMetadataKeyFromServiceConfig", "(", "Map", "<", "String", ",", "?", ">", "serviceConfig", ")", "{", "if", "(", "!", "serviceConfig", ".", "containsKey", "(", "SERVICE_CONFIG_STICKINESS_METADATA_KEY", ")", ...
Extracts the stickiness metadata key from a service config, or {@code null}.
[ "Extracts", "the", "stickiness", "metadata", "key", "from", "a", "service", "config", "or", "{" ]
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/ServiceConfigUtil.java#L416-L423
hazelcast/hazelcast
hazelcast-client/src/main/java/com/hazelcast/client/config/ClientAwsConfig.java
ClientAwsConfig.setProperty
@Override public ClientAwsConfig setProperty(String name, String value) { """ Sets the property understood by the AWS SPI Discovery Strategy. <p> Note that it interprets the "inside-aws" property and maps it to the contrary of the generic "use-public-ip" property. @param name property name @param value ...
java
@Override public ClientAwsConfig setProperty(String name, String value) { if (INSIDE_AWS_PROPERTY.equals(name)) { setInsideAws(Boolean.parseBoolean(value)); } else { super.setProperty(name, value); } return this; }
[ "@", "Override", "public", "ClientAwsConfig", "setProperty", "(", "String", "name", ",", "String", "value", ")", "{", "if", "(", "INSIDE_AWS_PROPERTY", ".", "equals", "(", "name", ")", ")", "{", "setInsideAws", "(", "Boolean", ".", "parseBoolean", "(", "valu...
Sets the property understood by the AWS SPI Discovery Strategy. <p> Note that it interprets the "inside-aws" property and maps it to the contrary of the generic "use-public-ip" property. @param name property name @param value property value @return the updated Client Aws Config
[ "Sets", "the", "property", "understood", "by", "the", "AWS", "SPI", "Discovery", "Strategy", ".", "<p", ">", "Note", "that", "it", "interprets", "the", "inside", "-", "aws", "property", "and", "maps", "it", "to", "the", "contrary", "of", "the", "generic", ...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/config/ClientAwsConfig.java#L73-L81
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java
CmsListItemWidget.setAdditionalInfoValue
public void setAdditionalInfoValue(int index, String label) { """ Sets the additional info value label at the given position.<p> @param index the additional info index @param label the new value to set """ ((AdditionalInfoItem)m_additionalInfo.getWidget(index)).getValueLabel().setText(label); ...
java
public void setAdditionalInfoValue(int index, String label) { ((AdditionalInfoItem)m_additionalInfo.getWidget(index)).getValueLabel().setText(label); }
[ "public", "void", "setAdditionalInfoValue", "(", "int", "index", ",", "String", "label", ")", "{", "(", "(", "AdditionalInfoItem", ")", "m_additionalInfo", ".", "getWidget", "(", "index", ")", ")", ".", "getValueLabel", "(", ")", ".", "setText", "(", "label"...
Sets the additional info value label at the given position.<p> @param index the additional info index @param label the new value to set
[ "Sets", "the", "additional", "info", "value", "label", "at", "the", "given", "position", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java#L643-L646
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java
CmsDomUtil.getCurrentStyleFloat
public static double getCurrentStyleFloat(Element element, Style style) { """ Returns the computed style of the given element as floating point number.<p> @param element the element @param style the CSS property @return the currently computed style """ String currentStyle = getCurrentStyle(elem...
java
public static double getCurrentStyleFloat(Element element, Style style) { String currentStyle = getCurrentStyle(element, style); return CmsClientStringUtil.parseFloat(currentStyle); }
[ "public", "static", "double", "getCurrentStyleFloat", "(", "Element", "element", ",", "Style", "style", ")", "{", "String", "currentStyle", "=", "getCurrentStyle", "(", "element", ",", "style", ")", ";", "return", "CmsClientStringUtil", ".", "parseFloat", "(", "...
Returns the computed style of the given element as floating point number.<p> @param element the element @param style the CSS property @return the currently computed style
[ "Returns", "the", "computed", "style", "of", "the", "given", "element", "as", "floating", "point", "number", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L1218-L1222
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java
JobsImpl.listFromJobScheduleAsync
public ServiceFuture<List<CloudJob>> listFromJobScheduleAsync(final String jobScheduleId, final ListOperationCallback<CloudJob> serviceCallback) { """ Lists the jobs that have been created under the specified job schedule. @param jobScheduleId The ID of the job schedule from which you want to get a list of jobs...
java
public ServiceFuture<List<CloudJob>> listFromJobScheduleAsync(final String jobScheduleId, final ListOperationCallback<CloudJob> serviceCallback) { return AzureServiceFuture.fromHeaderPageResponse( listFromJobScheduleSinglePageAsync(jobScheduleId), new Func1<String, Observable<ServiceResp...
[ "public", "ServiceFuture", "<", "List", "<", "CloudJob", ">", ">", "listFromJobScheduleAsync", "(", "final", "String", "jobScheduleId", ",", "final", "ListOperationCallback", "<", "CloudJob", ">", "serviceCallback", ")", "{", "return", "AzureServiceFuture", ".", "fr...
Lists the jobs that have been created under the specified job schedule. @param jobScheduleId The ID of the job schedule from which you want to get a list of jobs. @param serviceCallback the async ServiceCallback to handle successful and failed responses. @throws IllegalArgumentException thrown if parameters fail the v...
[ "Lists", "the", "jobs", "that", "have", "been", "created", "under", "the", "specified", "job", "schedule", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L2530-L2540
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/stereo/FischerRecognition.java
FischerRecognition.isTerminal
private boolean isTerminal(IAtom atom, Map<IAtom, Integer> atomToIndex) { """ Is the atom terminal having only one connection. @param atom an atom @param atomToIndex a map of atoms to index @return the atom is terminal """ return graph[atomToIndex.get(atom)].length == 1; }
java
private boolean isTerminal(IAtom atom, Map<IAtom, Integer> atomToIndex) { return graph[atomToIndex.get(atom)].length == 1; }
[ "private", "boolean", "isTerminal", "(", "IAtom", "atom", ",", "Map", "<", "IAtom", ",", "Integer", ">", "atomToIndex", ")", "{", "return", "graph", "[", "atomToIndex", ".", "get", "(", "atom", ")", "]", ".", "length", "==", "1", ";", "}" ]
Is the atom terminal having only one connection. @param atom an atom @param atomToIndex a map of atoms to index @return the atom is terminal
[ "Is", "the", "atom", "terminal", "having", "only", "one", "connection", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/FischerRecognition.java#L288-L290
mgormley/optimize
src/main/java/edu/jhu/hlt/optimize/function/Bounds.java
Bounds.getSymmetricBounds
public static Bounds getSymmetricBounds(int dim, double l, double u) { """ Gets bounds which are identical for all dimensions. @param dim The number of dimensions. @param l The value of all lower bounds. @param u The value of all upper bounds. @return The new bounds. """ double [] L = new double[...
java
public static Bounds getSymmetricBounds(int dim, double l, double u) { double [] L = new double[dim]; double [] U = new double[dim]; for(int i=0; i<dim; i++) { L[i] = l; U[i] = u; } return new Bounds(L, U); }
[ "public", "static", "Bounds", "getSymmetricBounds", "(", "int", "dim", ",", "double", "l", ",", "double", "u", ")", "{", "double", "[", "]", "L", "=", "new", "double", "[", "dim", "]", ";", "double", "[", "]", "U", "=", "new", "double", "[", "dim",...
Gets bounds which are identical for all dimensions. @param dim The number of dimensions. @param l The value of all lower bounds. @param u The value of all upper bounds. @return The new bounds.
[ "Gets", "bounds", "which", "are", "identical", "for", "all", "dimensions", "." ]
train
https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/optimize/function/Bounds.java#L67-L75
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
Resolve.resolveImplicitThis
Type resolveImplicitThis(DiagnosticPosition pos, Env<AttrContext> env, Type t) { """ Resolve an appropriate implicit this instance for t's container. JLS 8.8.5.1 and 15.9.2 """ return resolveImplicitThis(pos, env, t, false); }
java
Type resolveImplicitThis(DiagnosticPosition pos, Env<AttrContext> env, Type t) { return resolveImplicitThis(pos, env, t, false); }
[ "Type", "resolveImplicitThis", "(", "DiagnosticPosition", "pos", ",", "Env", "<", "AttrContext", ">", "env", ",", "Type", "t", ")", "{", "return", "resolveImplicitThis", "(", "pos", ",", "env", ",", "t", ",", "false", ")", ";", "}" ]
Resolve an appropriate implicit this instance for t's container. JLS 8.8.5.1 and 15.9.2
[ "Resolve", "an", "appropriate", "implicit", "this", "instance", "for", "t", "s", "container", ".", "JLS", "8", ".", "8", ".", "5", ".", "1", "and", "15", ".", "9", ".", "2" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java#L3626-L3628
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMaterial.java
GVRMaterial.setSpecularColor
public void setSpecularColor(float r, float g, float b, float a) { """ Set the {@code specular_color} uniform for lighting. By convention, GVRF shaders can use a {@code vec4} uniform named {@code specular_color}. With the {@linkplain GVRShaderType.Texture hader,} this allows you to add an overlay specular lig...
java
public void setSpecularColor(float r, float g, float b, float a) { setVec4("specular_color", r, g, b, a); }
[ "public", "void", "setSpecularColor", "(", "float", "r", ",", "float", "g", ",", "float", "b", ",", "float", "a", ")", "{", "setVec4", "(", "\"specular_color\"", ",", "r", ",", "g", ",", "b", ",", "a", ")", ";", "}" ]
Set the {@code specular_color} uniform for lighting. By convention, GVRF shaders can use a {@code vec4} uniform named {@code specular_color}. With the {@linkplain GVRShaderType.Texture hader,} this allows you to add an overlay specular light color on top of the texture. Values are between {@code 0.0f} and {@code 1.0f}...
[ "Set", "the", "{", "@code", "specular_color", "}", "uniform", "for", "lighting", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMaterial.java#L483-L485
algolia/instantsearch-android
ui/src/main/java/com/algolia/instantsearch/ui/views/filters/OneValueToggle.java
OneValueToggle.setValue
public void setValue(String newValue, @Nullable String newName) { """ Changes the OneValueToggle's value, updating facet refinements accordingly. @param newValue the new value to refine with. @param newName an eventual new attribute name. """ if (isChecked()) { searcher.updateFacetRefi...
java
public void setValue(String newValue, @Nullable String newName) { if (isChecked()) { searcher.updateFacetRefinement(this.attribute, value, false) .updateFacetRefinement(newName != null ? newName : attribute, newValue, true) .search(); } this.va...
[ "public", "void", "setValue", "(", "String", "newValue", ",", "@", "Nullable", "String", "newName", ")", "{", "if", "(", "isChecked", "(", ")", ")", "{", "searcher", ".", "updateFacetRefinement", "(", "this", ".", "attribute", ",", "value", ",", "false", ...
Changes the OneValueToggle's value, updating facet refinements accordingly. @param newValue the new value to refine with. @param newName an eventual new attribute name.
[ "Changes", "the", "OneValueToggle", "s", "value", "updating", "facet", "refinements", "accordingly", "." ]
train
https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/views/filters/OneValueToggle.java#L48-L56
mapfish/mapfish-print
core/src/main/java/org/mapfish/print/processor/map/CreateMapPagesProcessor.java
CreateMapPagesProcessor.setAttribute
public void setAttribute(final String name, final Attribute attribute) { """ Set the map attribute. @param name the attribute name @param attribute the attribute """ if (name.equals(MAP_KEY)) { this.mapAttribute = (MapAttribute) attribute; } }
java
public void setAttribute(final String name, final Attribute attribute) { if (name.equals(MAP_KEY)) { this.mapAttribute = (MapAttribute) attribute; } }
[ "public", "void", "setAttribute", "(", "final", "String", "name", ",", "final", "Attribute", "attribute", ")", "{", "if", "(", "name", ".", "equals", "(", "MAP_KEY", ")", ")", "{", "this", ".", "mapAttribute", "=", "(", "MapAttribute", ")", "attribute", ...
Set the map attribute. @param name the attribute name @param attribute the attribute
[ "Set", "the", "map", "attribute", "." ]
train
https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/processor/map/CreateMapPagesProcessor.java#L214-L218
rwl/CSparseJ
src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_usolve.java
DZcs_usolve.cs_usolve
public static boolean cs_usolve(DZcs U, DZcsa x) { """ Solves an upper triangular system Ux=b, where x and b are dense vectors. The diagonal of U must be the last entry of each column. @param U upper triangular matrix in column-compressed form @param x size n, right hand side on input, solution on output @...
java
public static boolean cs_usolve(DZcs U, DZcsa x) { int p, j, n, Up[], Ui[] ; DZcsa Ux = new DZcsa() ; if (!CS_CSC(U) || x == null) return (false) ; /* check inputs */ n = U.n ; Up = U.p ; Ui = U.i ; Ux.x = U.x ; for (j = n - 1 ; j >= 0 ; j--) { x.set(j, cs_cdiv(x.get(j), Ux.get(Up [j+1] - 1))) ;...
[ "public", "static", "boolean", "cs_usolve", "(", "DZcs", "U", ",", "DZcsa", "x", ")", "{", "int", "p", ",", "j", ",", "n", ",", "Up", "[", "]", ",", "Ui", "[", "]", ";", "DZcsa", "Ux", "=", "new", "DZcsa", "(", ")", ";", "if", "(", "!", "CS...
Solves an upper triangular system Ux=b, where x and b are dense vectors. The diagonal of U must be the last entry of each column. @param U upper triangular matrix in column-compressed form @param x size n, right hand side on input, solution on output @return true if successful, false on error
[ "Solves", "an", "upper", "triangular", "system", "Ux", "=", "b", "where", "x", "and", "b", "are", "dense", "vectors", ".", "The", "diagonal", "of", "U", "must", "be", "the", "last", "entry", "of", "each", "column", "." ]
train
https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_usolve.java#L54-L69
google/closure-compiler
src/com/google/javascript/jscomp/JsMessageVisitor.java
JsMessageVisitor.checkIfMessageDuplicated
private void checkIfMessageDuplicated(String msgName, Node msgNode) { """ Checks if message already processed. If so - it generates 'message duplicated' compiler error. @param msgName the name of the message @param msgNode the node that represents JS message """ if (messageNames.containsKey(msgName)) ...
java
private void checkIfMessageDuplicated(String msgName, Node msgNode) { if (messageNames.containsKey(msgName)) { MessageLocation location = messageNames.get(msgName); compiler.report(JSError.make(msgNode, MESSAGE_DUPLICATE_KEY, msgName, location.messageNode.getSourceFileName(), Integer...
[ "private", "void", "checkIfMessageDuplicated", "(", "String", "msgName", ",", "Node", "msgNode", ")", "{", "if", "(", "messageNames", ".", "containsKey", "(", "msgName", ")", ")", "{", "MessageLocation", "location", "=", "messageNames", ".", "get", "(", "msgNa...
Checks if message already processed. If so - it generates 'message duplicated' compiler error. @param msgName the name of the message @param msgNode the node that represents JS message
[ "Checks", "if", "message", "already", "processed", ".", "If", "so", "-", "it", "generates", "message", "duplicated", "compiler", "error", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JsMessageVisitor.java#L418-L425
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java
SeaGlassLookAndFeel.defineArrowButtons
private void defineArrowButtons(UIDefaults d) { """ Initialize the arrow button settings. @param d the UI defaults map. """ String c = PAINTER_PREFIX + "ArrowButtonPainter"; String p = "ArrowButton"; d.put(p + ".States", "Enabled,MouseOver,Disabled,Pressed"); d.put(p + "[Dis...
java
private void defineArrowButtons(UIDefaults d) { String c = PAINTER_PREFIX + "ArrowButtonPainter"; String p = "ArrowButton"; d.put(p + ".States", "Enabled,MouseOver,Disabled,Pressed"); d.put(p + "[Disabled].foreground", new ColorUIResource(0x9ba8cf)); d.put(p + "[Enabled].foregro...
[ "private", "void", "defineArrowButtons", "(", "UIDefaults", "d", ")", "{", "String", "c", "=", "PAINTER_PREFIX", "+", "\"ArrowButtonPainter\"", ";", "String", "p", "=", "\"ArrowButton\"", ";", "d", ".", "put", "(", "p", "+", "\".States\"", ",", "\"Enabled,Mous...
Initialize the arrow button settings. @param d the UI defaults map.
[ "Initialize", "the", "arrow", "button", "settings", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L915-L928
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/parsers/URLParser.java
URLParser.toAbsolute
public static String toAbsolute(String base, String relative) { """ Converts a relative URL to absolute URL. @param base @param relative @return """ String absolute = null; base = base.trim(); relative = relative.trim(); if(relative.isEmpty()) { return ...
java
public static String toAbsolute(String base, String relative) { String absolute = null; base = base.trim(); relative = relative.trim(); if(relative.isEmpty()) { return absolute; } String rel2lowercase = relative.toLowerCase(Locale.ENGLISH); ...
[ "public", "static", "String", "toAbsolute", "(", "String", "base", ",", "String", "relative", ")", "{", "String", "absolute", "=", "null", ";", "base", "=", "base", ".", "trim", "(", ")", ";", "relative", "=", "relative", ".", "trim", "(", ")", ";", ...
Converts a relative URL to absolute URL. @param base @param relative @return
[ "Converts", "a", "relative", "URL", "to", "absolute", "URL", "." ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/parsers/URLParser.java#L131-L154
netty/netty
buffer/src/main/java/io/netty/buffer/ByteBufUtil.java
ByteBufUtil.readBytes
static void readBytes(ByteBufAllocator allocator, ByteBuffer buffer, int position, int length, OutputStream out) throws IOException { """ Read bytes from the given {@link ByteBuffer} into the given {@link OutputStream} using the {@code position} and {@code length}. The position and limit of the given ...
java
static void readBytes(ByteBufAllocator allocator, ByteBuffer buffer, int position, int length, OutputStream out) throws IOException { if (buffer.hasArray()) { out.write(buffer.array(), position + buffer.arrayOffset(), length); } else { int chunkLen = Math.min(length, ...
[ "static", "void", "readBytes", "(", "ByteBufAllocator", "allocator", ",", "ByteBuffer", "buffer", ",", "int", "position", ",", "int", "length", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "if", "(", "buffer", ".", "hasArray", "(", ")", ")"...
Read bytes from the given {@link ByteBuffer} into the given {@link OutputStream} using the {@code position} and {@code length}. The position and limit of the given {@link ByteBuffer} may be adjusted.
[ "Read", "bytes", "from", "the", "given", "{" ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L1398-L1420
xerial/larray
larray-buffer/src/main/java/xerial/larray/buffer/LBufferAPI.java
LBufferAPI.copyTo
public void copyTo(int srcOffset, byte[] destArray, int destOffset, int size) { """ Copy the contents of this buffer begginning from the srcOffset to a destination byte array @param srcOffset @param destArray @param destOffset @param size """ int cursor = destOffset; for (ByteBuffer bb : to...
java
public void copyTo(int srcOffset, byte[] destArray, int destOffset, int size) { int cursor = destOffset; for (ByteBuffer bb : toDirectByteBuffers(srcOffset, size)) { int bbSize = bb.remaining(); if ((cursor + bbSize) > destArray.length) throw new ArrayIndexOutOfBo...
[ "public", "void", "copyTo", "(", "int", "srcOffset", ",", "byte", "[", "]", "destArray", ",", "int", "destOffset", ",", "int", "size", ")", "{", "int", "cursor", "=", "destOffset", ";", "for", "(", "ByteBuffer", "bb", ":", "toDirectByteBuffers", "(", "sr...
Copy the contents of this buffer begginning from the srcOffset to a destination byte array @param srcOffset @param destArray @param destOffset @param size
[ "Copy", "the", "contents", "of", "this", "buffer", "begginning", "from", "the", "srcOffset", "to", "a", "destination", "byte", "array" ]
train
https://github.com/xerial/larray/blob/9a1462623c0e56ca67c5341ea29832963c29479f/larray-buffer/src/main/java/xerial/larray/buffer/LBufferAPI.java#L237-L246
gitblit/fathom
fathom-x509/src/main/java/fathom/x509/X509Utils.java
X509Utils.newCertificateAuthority
public static X509Certificate newCertificateAuthority(X509Metadata metadata, File storeFile, X509Log x509log) { """ Creates a new certificate authority PKCS#12 store. This function will destroy any existing CA store. @param metadata @param storeFile @param x509log @return """ try { ...
java
public static X509Certificate newCertificateAuthority(X509Metadata metadata, File storeFile, X509Log x509log) { try { KeyPair caPair = newKeyPair(); ContentSigner caSigner = new JcaContentSignerBuilder(SIGNING_ALGORITHM).setProvider(BC).build(caPair.getPrivate()); // clone ...
[ "public", "static", "X509Certificate", "newCertificateAuthority", "(", "X509Metadata", "metadata", ",", "File", "storeFile", ",", "X509Log", "x509log", ")", "{", "try", "{", "KeyPair", "caPair", "=", "newKeyPair", "(", ")", ";", "ContentSigner", "caSigner", "=", ...
Creates a new certificate authority PKCS#12 store. This function will destroy any existing CA store. @param metadata @param storeFile @param x509log @return
[ "Creates", "a", "new", "certificate", "authority", "PKCS#12", "store", ".", "This", "function", "will", "destroy", "any", "existing", "CA", "store", "." ]
train
https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L606-L658
apache/incubator-gobblin
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/FsJobStatusRetriever.java
FsJobStatusRetriever.shouldFilterJobStatus
private boolean shouldFilterJobStatus(List<String> tableNames, String tableName) { """ A helper method to determine if {@link JobStatus}es for jobs without a jobGroup/jobName should be filtered out. Once a job has been orchestrated, {@link JobStatus}es without a jobGroup/jobName can be filtered out. @param table...
java
private boolean shouldFilterJobStatus(List<String> tableNames, String tableName) { return tableNames.size() > 1 && JobStatusRetriever.NA_KEY .equals(Splitter.on(KafkaJobStatusMonitor.STATE_STORE_KEY_SEPARATION_CHARACTER).splitToList(tableName).get(1)); }
[ "private", "boolean", "shouldFilterJobStatus", "(", "List", "<", "String", ">", "tableNames", ",", "String", "tableName", ")", "{", "return", "tableNames", ".", "size", "(", ")", ">", "1", "&&", "JobStatusRetriever", ".", "NA_KEY", ".", "equals", "(", "Split...
A helper method to determine if {@link JobStatus}es for jobs without a jobGroup/jobName should be filtered out. Once a job has been orchestrated, {@link JobStatus}es without a jobGroup/jobName can be filtered out. @param tableNames @param tableName @return
[ "A", "helper", "method", "to", "determine", "if", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/FsJobStatusRetriever.java#L142-L145
beihaifeiwu/dolphin
dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/i18n/Resources.java
Resources.getFormatted
public String getFormatted(String key, String argument) { """ /* Gets a resource string formatted with MessageFormat. @param key the key @param argument the argument @return Formatted stirng. """ return MessageFormat.format(resource.getString(key), new Object[] {argument}); }
java
public String getFormatted(String key, String argument) { return MessageFormat.format(resource.getString(key), new Object[] {argument}); }
[ "public", "String", "getFormatted", "(", "String", "key", ",", "String", "argument", ")", "{", "return", "MessageFormat", ".", "format", "(", "resource", ".", "getString", "(", "key", ")", ",", "new", "Object", "[", "]", "{", "argument", "}", ")", ";", ...
/* Gets a resource string formatted with MessageFormat. @param key the key @param argument the argument @return Formatted stirng.
[ "/", "*", "Gets", "a", "resource", "string", "formatted", "with", "MessageFormat", "." ]
train
https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/i18n/Resources.java#L146-L148
nmdp-bioinformatics/ngs
range/src/main/java/org/nmdp/ngs/range/Ranges.java
Ranges.orderingByLowerEndpoint
public static <C extends Comparable> Ordering<Range<C>> orderingByLowerEndpoint() { """ Return an ordering by lower endpoint over ranges. @param <C> range endpoint type @return an ordering by lower endpoint over ranges """ return new Ordering<Range<C>>() { @Override public i...
java
public static <C extends Comparable> Ordering<Range<C>> orderingByLowerEndpoint() { return new Ordering<Range<C>>() { @Override public int compare(final Range<C> left, final Range<C> right) { return ComparisonChain.start() .compare(left.hasLowerBound()...
[ "public", "static", "<", "C", "extends", "Comparable", ">", "Ordering", "<", "Range", "<", "C", ">", ">", "orderingByLowerEndpoint", "(", ")", "{", "return", "new", "Ordering", "<", "Range", "<", "C", ">", ">", "(", ")", "{", "@", "Override", "public",...
Return an ordering by lower endpoint over ranges. @param <C> range endpoint type @return an ordering by lower endpoint over ranges
[ "Return", "an", "ordering", "by", "lower", "endpoint", "over", "ranges", "." ]
train
https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/range/src/main/java/org/nmdp/ngs/range/Ranges.java#L151-L161
googleads/googleads-java-lib
examples/admanager_axis/src/main/java/admanager/axis/v201811/orderservice/GetAllOrders.java
GetAllOrders.runExample
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException { """ Runs the example. @param adManagerServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws ...
java
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session) throws RemoteException { // Get the OrderService. OrderServiceInterface orderService = adManagerServices.get(session, OrderServiceInterface.class); // Create a statement to select all orders. Stat...
[ "public", "static", "void", "runExample", "(", "AdManagerServices", "adManagerServices", ",", "AdManagerSession", "session", ")", "throws", "RemoteException", "{", "// Get the OrderService.", "OrderServiceInterface", "orderService", "=", "adManagerServices", ".", "get", "("...
Runs the example. @param adManagerServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other errors.
[ "Runs", "the", "example", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201811/orderservice/GetAllOrders.java#L51-L82
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.getEntitySuggestions
public List<EntitiesSuggestionExample> getEntitySuggestions(UUID appId, String versionId, UUID entityId, GetEntitySuggestionsOptionalParameter getEntitySuggestionsOptionalParameter) { """ Get suggestion examples that would improve the accuracy of the entity model. @param appId The application ID. @param versio...
java
public List<EntitiesSuggestionExample> getEntitySuggestions(UUID appId, String versionId, UUID entityId, GetEntitySuggestionsOptionalParameter getEntitySuggestionsOptionalParameter) { return getEntitySuggestionsWithServiceResponseAsync(appId, versionId, entityId, getEntitySuggestionsOptionalParameter).toBlockin...
[ "public", "List", "<", "EntitiesSuggestionExample", ">", "getEntitySuggestions", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ",", "GetEntitySuggestionsOptionalParameter", "getEntitySuggestionsOptionalParameter", ")", "{", "return", "getEntityS...
Get suggestion examples that would improve the accuracy of the entity model. @param appId The application ID. @param versionId The version ID. @param entityId The target entity extractor model to enhance. @param getEntitySuggestionsOptionalParameter the object representing the optional parameters to be set before call...
[ "Get", "suggestion", "examples", "that", "would", "improve", "the", "accuracy", "of", "the", "entity", "model", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5258-L5260
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-text/src/main/java/org/xwiki/text/StringUtils.java
StringUtils.doubleChar
public static String doubleChar(final String str, final char c) { """ An attempt to make doubling a character (usually for escaping purposes) as fast as it can be. A lot faster than the usual <code>mystring.replace("a", "aa")</code> for example. @param str the string to modify @param c the character to double...
java
public static String doubleChar(final String str, final char c) { if (isEmpty(str)) { return str; } int start = 0; int end = str.indexOf(c, start); if (end == INDEX_NOT_FOUND) { return str; } final StringBuilder buf = new StringBuilde...
[ "public", "static", "String", "doubleChar", "(", "final", "String", "str", ",", "final", "char", "c", ")", "{", "if", "(", "isEmpty", "(", "str", ")", ")", "{", "return", "str", ";", "}", "int", "start", "=", "0", ";", "int", "end", "=", "str", "...
An attempt to make doubling a character (usually for escaping purposes) as fast as it can be. A lot faster than the usual <code>mystring.replace("a", "aa")</code> for example. @param str the string to modify @param c the character to double @return the modified string
[ "An", "attempt", "to", "make", "doubling", "a", "character", "(", "usually", "for", "escaping", "purposes", ")", "as", "fast", "as", "it", "can", "be", ".", "A", "lot", "faster", "than", "the", "usual", "<code", ">", "mystring", ".", "replace", "(", "a...
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-text/src/main/java/org/xwiki/text/StringUtils.java#L42-L67
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java
CamelCatalogHelper.isModelDefaultValue
public static boolean isModelDefaultValue(CamelCatalog camelCatalog, String modelName, String key, String value) { """ Checks whether the given value is matching the default value from the given model. @param modelName the model name @param key the option key @param value the option value @return <tt>tru...
java
public static boolean isModelDefaultValue(CamelCatalog camelCatalog, String modelName, String key, String value) { // use the camel catalog String json = camelCatalog.modelJSonSchema(modelName); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for ...
[ "public", "static", "boolean", "isModelDefaultValue", "(", "CamelCatalog", "camelCatalog", ",", "String", "modelName", ",", "String", "key", ",", "String", "value", ")", "{", "// use the camel catalog", "String", "json", "=", "camelCatalog", ".", "modelJSonSchema", ...
Checks whether the given value is matching the default value from the given model. @param modelName the model name @param key the option key @param value the option value @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
[ "Checks", "whether", "the", "given", "value", "is", "matching", "the", "default", "value", "from", "the", "given", "model", "." ]
train
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java#L352-L370
radkovo/CSSBox
src/main/java/org/fit/cssbox/layout/BlockBox.java
BlockBox.initFirstLine
public void initFirstLine(ElementBox box) { """ Initializes the first line box with the box properties. This may be used for considering special content such as list item markers. @param box the box that should be used for the initialization """ if (firstLine == null) firstLine = new Line...
java
public void initFirstLine(ElementBox box) { if (firstLine == null) firstLine = new LineBox(this, 0, 0); firstLine.considerBoxProperties(box); //recursively apply to the first in-flow box, when it is a block box for (int i = startChild; i < endChild; i++) { ...
[ "public", "void", "initFirstLine", "(", "ElementBox", "box", ")", "{", "if", "(", "firstLine", "==", "null", ")", "firstLine", "=", "new", "LineBox", "(", "this", ",", "0", ",", "0", ")", ";", "firstLine", ".", "considerBoxProperties", "(", "box", ")", ...
Initializes the first line box with the box properties. This may be used for considering special content such as list item markers. @param box the box that should be used for the initialization
[ "Initializes", "the", "first", "line", "box", "with", "the", "box", "properties", ".", "This", "may", "be", "used", "for", "considering", "special", "content", "such", "as", "list", "item", "markers", "." ]
train
https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/BlockBox.java#L1356-L1372
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/lwrecruitment/NetIndexComparator.java
NetIndexComparator.compare
@Override public int compare( SimpleFeature f1, SimpleFeature f2 ) { """ establish the position of each net point respect to the others """ int linkid1 = (Integer) f1.getAttribute(LINKID); int linkid2 = (Integer) f2.getAttribute(LINKID); if (linkid1 < linkid2) { return ...
java
@Override public int compare( SimpleFeature f1, SimpleFeature f2 ) { int linkid1 = (Integer) f1.getAttribute(LINKID); int linkid2 = (Integer) f2.getAttribute(LINKID); if (linkid1 < linkid2) { return -1; } else if (linkid1 > linkid2) { return 1; } else...
[ "@", "Override", "public", "int", "compare", "(", "SimpleFeature", "f1", ",", "SimpleFeature", "f2", ")", "{", "int", "linkid1", "=", "(", "Integer", ")", "f1", ".", "getAttribute", "(", "LINKID", ")", ";", "int", "linkid2", "=", "(", "Integer", ")", "...
establish the position of each net point respect to the others
[ "establish", "the", "position", "of", "each", "net", "point", "respect", "to", "the", "others" ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/lwrecruitment/NetIndexComparator.java#L28-L40
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4ExecutionFuture.java
JDBC4ExecutionFuture.get
@Override public ClientResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { """ Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. @param timeout the maximum time t...
java
@Override public ClientResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (!this.latch.await(timeout, unit)) { this.status.compareAndSet(STATUS_RUNNING, STATUS_TIMEOUT); throw new TimeoutException(); } ...
[ "@", "Override", "public", "ClientResponse", "get", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", ",", "ExecutionException", ",", "TimeoutException", "{", "if", "(", "!", "this", ".", "latch", ".", "await", "(", "timeo...
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. @param timeout the maximum time to wait. @param unit the time unit of the timeout argument . @return the computed result. @throws CancellationException if the computation was cancelled. @throws E...
[ "Waits", "if", "necessary", "for", "at", "most", "the", "given", "time", "for", "the", "computation", "to", "complete", "and", "then", "retrieves", "its", "result", "if", "available", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ExecutionFuture.java#L124-L140
apache/incubator-druid
server/src/main/java/org/apache/druid/segment/realtime/plumber/RealtimePlumber.java
RealtimePlumber.abandonSegment
protected void abandonSegment(final long truncatedTime, final Sink sink) { """ Unannounces a given sink and removes all local references to it. It is important that this is only called from the single-threaded mergeExecutor, since otherwise chaos may ensue if merged segments are deleted while being created. @...
java
protected void abandonSegment(final long truncatedTime, final Sink sink) { if (sinks.containsKey(truncatedTime)) { try { segmentAnnouncer.unannounceSegment(sink.getSegment()); removeSegment(sink, computePersistDir(schema, sink.getInterval())); log.info("Removing sinkKey %d for segmen...
[ "protected", "void", "abandonSegment", "(", "final", "long", "truncatedTime", ",", "final", "Sink", "sink", ")", "{", "if", "(", "sinks", ".", "containsKey", "(", "truncatedTime", ")", ")", "{", "try", "{", "segmentAnnouncer", ".", "unannounceSegment", "(", ...
Unannounces a given sink and removes all local references to it. It is important that this is only called from the single-threaded mergeExecutor, since otherwise chaos may ensue if merged segments are deleted while being created. @param truncatedTime sink key @param sink sink to unannounce
[ "Unannounces", "a", "given", "sink", "and", "removes", "all", "local", "references", "to", "it", ".", "It", "is", "important", "that", "this", "is", "only", "called", "from", "the", "single", "-", "threaded", "mergeExecutor", "since", "otherwise", "chaos", "...
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/segment/realtime/plumber/RealtimePlumber.java#L872-L900
lightbend/config
config/src/main/java/com/typesafe/config/ConfigFactory.java
ConfigFactory.parseResources
public static Config parseResources(String resource, ConfigParseOptions options) { """ Like {@link #parseResources(ClassLoader,String,ConfigParseOptions)} but uses thread's current context class loader if none is set in the ConfigParseOptions. @param resource the resource name @param options parse options @re...
java
public static Config parseResources(String resource, ConfigParseOptions options) { ConfigParseOptions withLoader = ensureClassLoader(options, "parseResources"); return Parseable.newResources(resource, withLoader).parse().toConfig(); }
[ "public", "static", "Config", "parseResources", "(", "String", "resource", ",", "ConfigParseOptions", "options", ")", "{", "ConfigParseOptions", "withLoader", "=", "ensureClassLoader", "(", "options", ",", "\"parseResources\"", ")", ";", "return", "Parseable", ".", ...
Like {@link #parseResources(ClassLoader,String,ConfigParseOptions)} but uses thread's current context class loader if none is set in the ConfigParseOptions. @param resource the resource name @param options parse options @return the parsed configuration
[ "Like", "{" ]
train
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigFactory.java#L1005-L1008
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java
RobustResilienceStrategy.removeFailure
@Override public boolean removeFailure(K key, V value, StoreAccessException e) { """ Do nothing and return false. @param key the key being removed @param value the value being removed @param e the triggered failure @return false """ cleanup(key, e); return false; }
java
@Override public boolean removeFailure(K key, V value, StoreAccessException e) { cleanup(key, e); return false; }
[ "@", "Override", "public", "boolean", "removeFailure", "(", "K", "key", ",", "V", "value", ",", "StoreAccessException", "e", ")", "{", "cleanup", "(", "key", ",", "e", ")", ";", "return", "false", ";", "}" ]
Do nothing and return false. @param key the key being removed @param value the value being removed @param e the triggered failure @return false
[ "Do", "nothing", "and", "return", "false", "." ]
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustResilienceStrategy.java#L128-L132
eurekaclinical/protempa
protempa-framework/src/main/java/org/protempa/PropositionDataStreamerProcessor.java
PropositionDataStreamerProcessor.fireKeyCompleted
@Override protected void fireKeyCompleted(String keyId, List<Proposition> data) throws DataSourceReadException { """ Called by {@link MultiplexingDataStreamingEventIterator} when a key id's propositions have been completely assembled. @param keyId a key id {@link String}. @param data @throws ...
java
@Override protected void fireKeyCompleted(String keyId, List<Proposition> data) throws DataSourceReadException { assert this.handler != null : "handler cannot be null"; this.handler.handle(keyId, data); }
[ "@", "Override", "protected", "void", "fireKeyCompleted", "(", "String", "keyId", ",", "List", "<", "Proposition", ">", "data", ")", "throws", "DataSourceReadException", "{", "assert", "this", ".", "handler", "!=", "null", ":", "\"handler cannot be null\"", ";", ...
Called by {@link MultiplexingDataStreamingEventIterator} when a key id's propositions have been completely assembled. @param keyId a key id {@link String}. @param data @throws DataSourceReadException
[ "Called", "by", "{", "@link", "MultiplexingDataStreamingEventIterator", "}", "when", "a", "key", "id", "s", "propositions", "have", "been", "completely", "assembled", "." ]
train
https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/PropositionDataStreamerProcessor.java#L70-L75
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.getCompositeEntityRolesAsync
public Observable<List<EntityRole>> getCompositeEntityRolesAsync(UUID appId, String versionId, UUID cEntityId) { """ Get All Entity Roles for a given entity. @param appId The application ID. @param versionId The version ID. @param cEntityId The composite entity extractor ID. @throws IllegalArgumentException ...
java
public Observable<List<EntityRole>> getCompositeEntityRolesAsync(UUID appId, String versionId, UUID cEntityId) { return getCompositeEntityRolesWithServiceResponseAsync(appId, versionId, cEntityId).map(new Func1<ServiceResponse<List<EntityRole>>, List<EntityRole>>() { @Override public Lis...
[ "public", "Observable", "<", "List", "<", "EntityRole", ">", ">", "getCompositeEntityRolesAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "cEntityId", ")", "{", "return", "getCompositeEntityRolesWithServiceResponseAsync", "(", "appId", ",", "v...
Get All Entity Roles for a given entity. @param appId The application ID. @param versionId The version ID. @param cEntityId The composite entity extractor ID. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the List&lt;EntityRole&gt; object
[ "Get", "All", "Entity", "Roles", "for", "a", "given", "entity", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L8806-L8813
cdk/cdk
storage/pdb/src/main/java/org/openscience/cdk/tools/ProteinBuilderTool.java
ProteinBuilderTool.createProtein
public static IBioPolymer createProtein(String sequence, IChemObjectBuilder builder) throws CDKException { """ Creates a BioPolymer from a sequence of amino acid as identified by a the sequence of their one letter codes. It uses the given {@link IChemObjectBuilder} to create a data model. <p>For example: <pr...
java
public static IBioPolymer createProtein(String sequence, IChemObjectBuilder builder) throws CDKException { Map<String, IAminoAcid> templates = AminoAcids.getHashMapBySingleCharCode(); IBioPolymer protein = builder.newInstance(IBioPolymer.class); IStrand strand = builder.newInstance(IStrand.class...
[ "public", "static", "IBioPolymer", "createProtein", "(", "String", "sequence", ",", "IChemObjectBuilder", "builder", ")", "throws", "CDKException", "{", "Map", "<", "String", ",", "IAminoAcid", ">", "templates", "=", "AminoAcids", ".", "getHashMapBySingleCharCode", ...
Creates a BioPolymer from a sequence of amino acid as identified by a the sequence of their one letter codes. It uses the given {@link IChemObjectBuilder} to create a data model. <p>For example: <pre> BioPolymer protein = ProteinBuilderTool.createProtein( "GAGA", SilentChemObjectBuilder.getInstance() ); </pre> @see #...
[ "Creates", "a", "BioPolymer", "from", "a", "sequence", "of", "amino", "acid", "as", "identified", "by", "a", "the", "sequence", "of", "their", "one", "letter", "codes", ".", "It", "uses", "the", "given", "{", "@link", "IChemObjectBuilder", "}", "to", "crea...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/pdb/src/main/java/org/openscience/cdk/tools/ProteinBuilderTool.java#L128-L165
Azure/azure-sdk-for-java
batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java
JobsInner.terminateAsync
public Observable<Void> terminateAsync(String resourceGroupName, String workspaceName, String experimentName, String jobName) { """ Terminates a job. @param resourceGroupName Name of the resource group to which the resource belongs. @param workspaceName The name of the workspace. Workspace names can only conta...
java
public Observable<Void> terminateAsync(String resourceGroupName, String workspaceName, String experimentName, String jobName) { return terminateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName, jobName).map(new Func1<ServiceResponse<Void>, Void>() { @Override pub...
[ "public", "Observable", "<", "Void", ">", "terminateAsync", "(", "String", "resourceGroupName", ",", "String", "workspaceName", ",", "String", "experimentName", ",", "String", "jobName", ")", "{", "return", "terminateWithServiceResponseAsync", "(", "resourceGroupName", ...
Terminates a job. @param resourceGroupName Name of the resource group to which the resource belongs. @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. @par...
[ "Terminates", "a", "job", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java#L1203-L1210
voldemort/voldemort
src/java/voldemort/rest/RestErrorHandler.java
RestErrorHandler.handleExceptions
protected void handleExceptions(MessageEvent messageEvent, Exception exception) { """ Exceptions specific to each operation is handled in the corresponding subclass. At this point we don't know the reason behind this exception. @param exception """ logger.error("Unknown exception. Internal Server E...
java
protected void handleExceptions(MessageEvent messageEvent, Exception exception) { logger.error("Unknown exception. Internal Server Error.", exception); writeErrorResponse(messageEvent, HttpResponseStatus.INTERNAL_SERVER_ERROR, "Internal Server Error"...
[ "protected", "void", "handleExceptions", "(", "MessageEvent", "messageEvent", ",", "Exception", "exception", ")", "{", "logger", ".", "error", "(", "\"Unknown exception. Internal Server Error.\"", ",", "exception", ")", ";", "writeErrorResponse", "(", "messageEvent", ",...
Exceptions specific to each operation is handled in the corresponding subclass. At this point we don't know the reason behind this exception. @param exception
[ "Exceptions", "specific", "to", "each", "operation", "is", "handled", "in", "the", "corresponding", "subclass", ".", "At", "this", "point", "we", "don", "t", "know", "the", "reason", "behind", "this", "exception", "." ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/RestErrorHandler.java#L25-L30
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-09/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java
KafkaKeyValueProducerPusher.pushMessages
public void pushMessages(List<Pair<K, V>> messages) { """ Push all keyed messages to the Kafka topic. @param messages List of keyed messages to push to Kakfa. """ for (Pair<K, V> message: messages) { this.producer.send(new ProducerRecord<>(topic, message.getKey(), message.getValue()), (recordMetadat...
java
public void pushMessages(List<Pair<K, V>> messages) { for (Pair<K, V> message: messages) { this.producer.send(new ProducerRecord<>(topic, message.getKey(), message.getValue()), (recordMetadata, e) -> { if (e != null) { log.error("Failed to send message to topic {} due to exception: ", topic,...
[ "public", "void", "pushMessages", "(", "List", "<", "Pair", "<", "K", ",", "V", ">", ">", "messages", ")", "{", "for", "(", "Pair", "<", "K", ",", "V", ">", "message", ":", "messages", ")", "{", "this", ".", "producer", ".", "send", "(", "new", ...
Push all keyed messages to the Kafka topic. @param messages List of keyed messages to push to Kakfa.
[ "Push", "all", "keyed", "messages", "to", "the", "Kafka", "topic", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-09/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java#L81-L89
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/ocr/OcrClient.java
OcrClient.idcardRecognition
public IdcardRecognitionResponse idcardRecognition(String image, String side, Boolean direction) { """ Gets the idcard recognition properties of specific image resource. <p> The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair. @param image The image data which needs to be base...
java
public IdcardRecognitionResponse idcardRecognition(String image, String side, Boolean direction) { IdcardRecognitionRequest request = new IdcardRecognitionRequest().withImage(image) .withSide(side).withDirection(direction); return idcardRecognition(request); ...
[ "public", "IdcardRecognitionResponse", "idcardRecognition", "(", "String", "image", ",", "String", "side", ",", "Boolean", "direction", ")", "{", "IdcardRecognitionRequest", "request", "=", "new", "IdcardRecognitionRequest", "(", ")", ".", "withImage", "(", "image", ...
Gets the idcard recognition properties of specific image resource. <p> The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair. @param image The image data which needs to be base64 @param side The side of idcard image. (front/back) @param direction Decide if the image has been rotated (true...
[ "Gets", "the", "idcard", "recognition", "properties", "of", "specific", "image", "resource", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/ocr/OcrClient.java#L139-L143
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/StreamHandler.java
StreamHandler.setOutputStream
protected synchronized void setOutputStream(OutputStream out) throws SecurityException { """ Change the output stream. <P> If there is a current output stream then the <tt>Formatter</tt>'s tail string is written and the stream is flushed and closed. Then the output stream is replaced with the new output stream...
java
protected synchronized void setOutputStream(OutputStream out) throws SecurityException { if (out == null) { throw new NullPointerException(); } flushAndClose(); output = out; doneHeader = false; String encoding = getEncoding(); if (encoding == null) { ...
[ "protected", "synchronized", "void", "setOutputStream", "(", "OutputStream", "out", ")", "throws", "SecurityException", "{", "if", "(", "out", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "flushAndClose", "(", ")", ";", ...
Change the output stream. <P> If there is a current output stream then the <tt>Formatter</tt>'s tail string is written and the stream is flushed and closed. Then the output stream is replaced with the new output stream. @param out New output stream. May not be null. @exception SecurityException if a security mana...
[ "Change", "the", "output", "stream", ".", "<P", ">", "If", "there", "is", "a", "current", "output", "stream", "then", "the", "<tt", ">", "Formatter<", "/", "tt", ">", "s", "tail", "string", "is", "written", "and", "the", "stream", "is", "flushed", "and...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/StreamHandler.java#L137-L156
Netflix/conductor
core/src/main/java/com/netflix/conductor/core/execution/mapper/DynamicTaskMapper.java
DynamicTaskMapper.getDynamicTaskName
@VisibleForTesting String getDynamicTaskName(Map<String, Object> taskInput, String taskNameParam) throws TerminateWorkflowException { """ Helper method that looks into the input params and returns the dynamic task name @param taskInput: a map which contains different input parameters and also contains ...
java
@VisibleForTesting String getDynamicTaskName(Map<String, Object> taskInput, String taskNameParam) throws TerminateWorkflowException { return Optional.ofNullable(taskInput.get(taskNameParam)) .map(String::valueOf) .orElseThrow(() -> { String reason = String...
[ "@", "VisibleForTesting", "String", "getDynamicTaskName", "(", "Map", "<", "String", ",", "Object", ">", "taskInput", ",", "String", "taskNameParam", ")", "throws", "TerminateWorkflowException", "{", "return", "Optional", ".", "ofNullable", "(", "taskInput", ".", ...
Helper method that looks into the input params and returns the dynamic task name @param taskInput: a map which contains different input parameters and also contains the mapping between the dynamic task name param and the actual name representing the dynamic task @param taskNameParam: the key that is used to look u...
[ "Helper", "method", "that", "looks", "into", "the", "input", "params", "and", "returns", "the", "dynamic", "task", "name" ]
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/execution/mapper/DynamicTaskMapper.java#L106-L115
Cornutum/tcases
tcases-ant/src/main/java/org/cornutum/tcases/ant/TcasesTask.java
TcasesTask.execute
public void execute() throws BuildException { """ Runs {@link TcasesCommand Tcases} with the specified options. """ try { log( "Generating test cases for inputDef=" + options_.getInputDef()); File logFile = getLogFile(); if( logFile != null) { System.setProperty( "t...
java
public void execute() throws BuildException { try { log( "Generating test cases for inputDef=" + options_.getInputDef()); File logFile = getLogFile(); if( logFile != null) { System.setProperty( "tcases.log.file", logFile.getAbsolutePath()); log( "For details, see...
[ "public", "void", "execute", "(", ")", "throws", "BuildException", "{", "try", "{", "log", "(", "\"Generating test cases for inputDef=\"", "+", "options_", ".", "getInputDef", "(", ")", ")", ";", "File", "logFile", "=", "getLogFile", "(", ")", ";", "if", "("...
Runs {@link TcasesCommand Tcases} with the specified options.
[ "Runs", "{" ]
train
https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-ant/src/main/java/org/cornutum/tcases/ant/TcasesTask.java#L32-L51
igniterealtime/Smack
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java
JingleManager.createIncomingJingleSession
public JingleSession createIncomingJingleSession(JingleSessionRequest request) throws XMPPException { """ When the session request is acceptable, this method should be invoked. It will create an JingleSession which allows the negotiation to procede. @param request the remote request that is being accepted...
java
public JingleSession createIncomingJingleSession(JingleSessionRequest request) throws XMPPException { if (request == null) { throw new NullPointerException("Received request cannot be null"); } JingleSession session = new JingleSession(connection, request, request.getFrom(), connect...
[ "public", "JingleSession", "createIncomingJingleSession", "(", "JingleSessionRequest", "request", ")", "throws", "XMPPException", "{", "if", "(", "request", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Received request cannot be null\"", ")", ...
When the session request is acceptable, this method should be invoked. It will create an JingleSession which allows the negotiation to procede. @param request the remote request that is being accepted. @return the session which manages the rest of the negotiation.
[ "When", "the", "session", "request", "is", "acceptable", "this", "method", "should", "be", "invoked", ".", "It", "will", "create", "an", "JingleSession", "which", "allows", "the", "negotiation", "to", "procede", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java#L547-L557
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java
SubItemUtil.countItems
public static int countItems(final IItemAdapter adapter, IPredicate predicate) { """ counts the items in the adapter, respecting subitems regardless of there current visibility @param adapter the adapter instance @param predicate predicate against which each item will be checked before counting it @return n...
java
public static int countItems(final IItemAdapter adapter, IPredicate predicate) { return countItems(adapter.getAdapterItems(), true, false, predicate); }
[ "public", "static", "int", "countItems", "(", "final", "IItemAdapter", "adapter", ",", "IPredicate", "predicate", ")", "{", "return", "countItems", "(", "adapter", ".", "getAdapterItems", "(", ")", ",", "true", ",", "false", ",", "predicate", ")", ";", "}" ]
counts the items in the adapter, respecting subitems regardless of there current visibility @param adapter the adapter instance @param predicate predicate against which each item will be checked before counting it @return number of items in the adapter that apply to the predicate
[ "counts", "the", "items", "in", "the", "adapter", "respecting", "subitems", "regardless", "of", "there", "current", "visibility" ]
train
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L67-L69
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java
ProjectedCentroid.make
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation, DBIDs ids) { """ Static Constructor from a relation. @param dims Dimensions to use (indexed with 0) @param relation Relation to process @param ids IDs to process @return Centroid """ ProjectedCentroid c = new...
java
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation, DBIDs ids) { ProjectedCentroid c = new ProjectedCentroid(dims, RelationUtil.dimensionality(relation)); for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { c.put(relation.get(iter)); } return c;...
[ "public", "static", "ProjectedCentroid", "make", "(", "long", "[", "]", "dims", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ",", "DBIDs", "ids", ")", "{", "ProjectedCentroid", "c", "=", "new", "ProjectedCentroid", "(", "dims", ",",...
Static Constructor from a relation. @param dims Dimensions to use (indexed with 0) @param relation Relation to process @param ids IDs to process @return Centroid
[ "Static", "Constructor", "from", "a", "relation", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java#L154-L160
mygreen/super-csv-annotation
src/main/java/com/github/mygreen/supercsv/builder/joda/AbstractJodaProcessorBuilder.java
AbstractJodaProcessorBuilder.createFormatter
protected DateTimeFormatter createFormatter(final FieldAccessor field, final Configuration config) { """ 変換規則から、{@link DateTimeFormatter}のインスタンスを作成する。 <p>アノテーション{@link CsvDateTimeFormat}が付与されていない場合は、各種タイプごとの標準の書式で作成する。</p> @param field フィールド情報 @param config システム設定 @return {@link DateTimeFormatter}のインスタンス。 ...
java
protected DateTimeFormatter createFormatter(final FieldAccessor field, final Configuration config) { final Optional<CsvDateTimeFormat> formatAnno = field.getAnnotation(CsvDateTimeFormat.class); if(!formatAnno.isPresent()) { return DateTimeFormat.forPattern(getDefaultPattern()); ...
[ "protected", "DateTimeFormatter", "createFormatter", "(", "final", "FieldAccessor", "field", ",", "final", "Configuration", "config", ")", "{", "final", "Optional", "<", "CsvDateTimeFormat", ">", "formatAnno", "=", "field", ".", "getAnnotation", "(", "CsvDateTimeForma...
変換規則から、{@link DateTimeFormatter}のインスタンスを作成する。 <p>アノテーション{@link CsvDateTimeFormat}が付与されていない場合は、各種タイプごとの標準の書式で作成する。</p> @param field フィールド情報 @param config システム設定 @return {@link DateTimeFormatter}のインスタンス。
[ "変換規則から、", "{" ]
train
https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/builder/joda/AbstractJodaProcessorBuilder.java#L64-L93
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiFileWidgetRenderer.java
WMultiFileWidgetRenderer.handleFileUploadRequest
protected void handleFileUploadRequest(final WMultiFileWidget widget, final XmlStringBuilder xml, final String uploadId) { """ Paint the response for the file uploaded in this request. @param widget the file widget to render @param xml the XML string builder @param uploadId the file id uploaded in this reques...
java
protected void handleFileUploadRequest(final WMultiFileWidget widget, final XmlStringBuilder xml, final String uploadId) { FileWidgetUpload file = widget.getFile(uploadId); if (file == null) { throw new SystemException("Invalid file id [" + uploadId + "] to render uploaded response."); } int idx = widget.ge...
[ "protected", "void", "handleFileUploadRequest", "(", "final", "WMultiFileWidget", "widget", ",", "final", "XmlStringBuilder", "xml", ",", "final", "String", "uploadId", ")", "{", "FileWidgetUpload", "file", "=", "widget", ".", "getFile", "(", "uploadId", ")", ";",...
Paint the response for the file uploaded in this request. @param widget the file widget to render @param xml the XML string builder @param uploadId the file id uploaded in this request
[ "Paint", "the", "response", "for", "the", "file", "uploaded", "in", "this", "request", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiFileWidgetRenderer.java#L112-L120
CloudSlang/cs-actions
cs-ssh/src/main/java/io/cloudslang/content/ssh/utils/CacheUtils.java
CacheUtils.removeSshSession
public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) { """ Remove the SSH session (and associated channel if any) from the cache. @param sessionParam The cache. @param sessionId The key to the session in the cache map. """ if (sessio...
java
public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) { if (sessionParam != null) { SessionResource<Map<String, SSHConnection>> resource = sessionParam.getResource(); if (resource != null) { Map<String, SSHConn...
[ "public", "static", "void", "removeSshSession", "(", "GlobalSessionObject", "<", "Map", "<", "String", ",", "SSHConnection", ">", ">", "sessionParam", ",", "String", "sessionId", ")", "{", "if", "(", "sessionParam", "!=", "null", ")", "{", "SessionResource", "...
Remove the SSH session (and associated channel if any) from the cache. @param sessionParam The cache. @param sessionId The key to the session in the cache map.
[ "Remove", "the", "SSH", "session", "(", "and", "associated", "channel", "if", "any", ")", "from", "the", "cache", "." ]
train
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-ssh/src/main/java/io/cloudslang/content/ssh/utils/CacheUtils.java#L105-L115
jcuda/jcuda
JCudaJava/src/main/java/jcuda/runtime/JCuda.java
JCuda.cudaMallocPitch
public static int cudaMallocPitch(Pointer devPtr, long pitch[], long width, long height) { """ Allocates pitched memory on the device. <pre> cudaError_t cudaMallocPitch ( void** devPtr, size_t* pitch, size_t width, size_t height ) </pre> <div> <p>Allocates pitched memory on the device. Allocates at lea...
java
public static int cudaMallocPitch(Pointer devPtr, long pitch[], long width, long height) { return checkResult(cudaMallocPitchNative(devPtr, pitch, width, height)); }
[ "public", "static", "int", "cudaMallocPitch", "(", "Pointer", "devPtr", ",", "long", "pitch", "[", "]", ",", "long", "width", ",", "long", "height", ")", "{", "return", "checkResult", "(", "cudaMallocPitchNative", "(", "devPtr", ",", "pitch", ",", "width", ...
Allocates pitched memory on the device. <pre> cudaError_t cudaMallocPitch ( void** devPtr, size_t* pitch, size_t width, size_t height ) </pre> <div> <p>Allocates pitched memory on the device. Allocates at least <tt>width</tt> (in bytes) * <tt>height</tt> bytes of linear memory on the device and returns in <tt>*devPtr<...
[ "Allocates", "pitched", "memory", "on", "the", "device", "." ]
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L4187-L4190
Alluxio/alluxio
underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AUnderFileSystem.java
S3AUnderFileSystem.getPermissionsInternal
private ObjectPermissions getPermissionsInternal() { """ Since there is no group in S3 acl, the owner is reused as the group. This method calls the S3 API and requires additional permissions aside from just read only. This method is best effort and will continue with default permissions (no owner, no group, 0700...
java
private ObjectPermissions getPermissionsInternal() { short bucketMode = ModeUtils.getUMask(mUfsConf.get(PropertyKey.UNDERFS_S3A_DEFAULT_MODE)).toShort(); String accountOwner = DEFAULT_OWNER; // if ACL enabled try to inherit bucket acl for all the objects. if (Boolean.parseBoolean(mConf.get(Prop...
[ "private", "ObjectPermissions", "getPermissionsInternal", "(", ")", "{", "short", "bucketMode", "=", "ModeUtils", ".", "getUMask", "(", "mUfsConf", ".", "get", "(", "PropertyKey", ".", "UNDERFS_S3A_DEFAULT_MODE", ")", ")", ".", "toShort", "(", ")", ";", "String"...
Since there is no group in S3 acl, the owner is reused as the group. This method calls the S3 API and requires additional permissions aside from just read only. This method is best effort and will continue with default permissions (no owner, no group, 0700). @return the permissions associated with this under storage s...
[ "Since", "there", "is", "no", "group", "in", "S3", "acl", "the", "owner", "is", "reused", "as", "the", "group", ".", "This", "method", "calls", "the", "S3", "API", "and", "requires", "additional", "permissions", "aside", "from", "just", "read", "only", "...
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AUnderFileSystem.java#L564-L589
btrplace/scheduler
json/src/main/java/org/btrplace/json/JSONs.java
JSONs.optInt
public static int optInt(JSONObject o, String id, int def) throws JSONConverterException { """ Read an optional integer. @param o the object to parse @param id the key in the map that points to an integer @param def the default integer value if the key is absent @return the resulting integer @throws JSONCo...
java
public static int optInt(JSONObject o, String id, int def) throws JSONConverterException { if (o.containsKey(id)) { try { return (Integer) o.get(id); } catch (ClassCastException e) { throw new JSONConverterException("Unable to read a int from string '" + i...
[ "public", "static", "int", "optInt", "(", "JSONObject", "o", ",", "String", "id", ",", "int", "def", ")", "throws", "JSONConverterException", "{", "if", "(", "o", ".", "containsKey", "(", "id", ")", ")", "{", "try", "{", "return", "(", "Integer", ")", ...
Read an optional integer. @param o the object to parse @param id the key in the map that points to an integer @param def the default integer value if the key is absent @return the resulting integer @throws JSONConverterException if the key does not point to a int
[ "Read", "an", "optional", "integer", "." ]
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/JSONs.java#L110-L119
bazaarvoice/emodb
cachemgr/src/main/java/com/bazaarvoice/emodb/cachemgr/CacheManagerModule.java
CacheManagerModule.provideOstrichRegistration
@Provides @Singleton @InvalidationService ManagedRegistration provideOstrichRegistration(ServiceRegistry serviceRegistry, ServiceEndPoint endPoint) { """ Integrates {@link CacheRegistry} life cycle events with Dropwizard. """ return new ManagedRegistration(serviceRegistry, endPoint); }
java
@Provides @Singleton @InvalidationService ManagedRegistration provideOstrichRegistration(ServiceRegistry serviceRegistry, ServiceEndPoint endPoint) { return new ManagedRegistration(serviceRegistry, endPoint); }
[ "@", "Provides", "@", "Singleton", "@", "InvalidationService", "ManagedRegistration", "provideOstrichRegistration", "(", "ServiceRegistry", "serviceRegistry", ",", "ServiceEndPoint", "endPoint", ")", "{", "return", "new", "ManagedRegistration", "(", "serviceRegistry", ",", ...
Integrates {@link CacheRegistry} life cycle events with Dropwizard.
[ "Integrates", "{" ]
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/cachemgr/src/main/java/com/bazaarvoice/emodb/cachemgr/CacheManagerModule.java#L80-L83
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.unprojectInv
public Vector4d unprojectInv(double winX, double winY, double winZ, int[] viewport, Vector4d dest) { """ /* (non-Javadoc) @see org.joml.Matrix4dc#unprojectInv(double, double, double, int[], org.joml.Vector4d) """ double ndcX = (winX-viewport[0])/viewport[2]*2.0-1.0; double ndcY = (winY-viewpor...
java
public Vector4d unprojectInv(double winX, double winY, double winZ, int[] viewport, Vector4d dest) { double ndcX = (winX-viewport[0])/viewport[2]*2.0-1.0; double ndcY = (winY-viewport[1])/viewport[3]*2.0-1.0; double ndcZ = winZ+winZ-1.0; double invW = 1.0 / (m03 * ndcX + m13 * ndcY + m23...
[ "public", "Vector4d", "unprojectInv", "(", "double", "winX", ",", "double", "winY", ",", "double", "winZ", ",", "int", "[", "]", "viewport", ",", "Vector4d", "dest", ")", "{", "double", "ndcX", "=", "(", "winX", "-", "viewport", "[", "0", "]", ")", "...
/* (non-Javadoc) @see org.joml.Matrix4dc#unprojectInv(double, double, double, int[], org.joml.Vector4d)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L9129-L9139
schallee/alib4j
core/src/main/java/net/darkmist/alib/res/PkgRes.java
PkgRes.getFor
public static InputStream getFor(String name, Object obj) { """ Gets a InputStream for a objects's package. @param name The name of the resource. @param obj The obj to use for the package name @return InputStream for the resource. @throws NullPointerException if name or obj are null. ResourceException if the ...
java
public static InputStream getFor(String name, Object obj) { if(obj == null) throw new NullPointerException("obj is null"); return getFor(name,obj.getClass()); }
[ "public", "static", "InputStream", "getFor", "(", "String", "name", ",", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"obj is null\"", ")", ";", "return", "getFor", "(", "name", ",", "obj", ...
Gets a InputStream for a objects's package. @param name The name of the resource. @param obj The obj to use for the package name @return InputStream for the resource. @throws NullPointerException if name or obj are null. ResourceException if the resource cannot be found.
[ "Gets", "a", "InputStream", "for", "a", "objects", "s", "package", "." ]
train
https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/res/PkgRes.java#L250-L255
alipay/sofa-rpc
core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConfigs.java
RpcConfigs.getEnumValue
public static <T extends Enum<T>> T getEnumValue(String primaryKey, Class<T> enumClazz) { """ Gets enum value. @param <T> the type parameter @param primaryKey the primary key @param enumClazz the enum clazz @return the enum value """ String val = (String) CFG.get(primaryKey); if (...
java
public static <T extends Enum<T>> T getEnumValue(String primaryKey, Class<T> enumClazz) { String val = (String) CFG.get(primaryKey); if (val == null) { throw new SofaRpcRuntimeException("Not Found Key: " + primaryKey); } else { return Enum.valueOf(enumClazz, val); ...
[ "public", "static", "<", "T", "extends", "Enum", "<", "T", ">", ">", "T", "getEnumValue", "(", "String", "primaryKey", ",", "Class", "<", "T", ">", "enumClazz", ")", "{", "String", "val", "=", "(", "String", ")", "CFG", ".", "get", "(", "primaryKey",...
Gets enum value. @param <T> the type parameter @param primaryKey the primary key @param enumClazz the enum clazz @return the enum value
[ "Gets", "enum", "value", "." ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConfigs.java#L236-L243
mapfish/mapfish-print
core/src/main/java/org/mapfish/print/URIUtils.java
URIUtils.setPath
public static URI setPath(final URI initialUri, final String path) { """ Set the replace of the uri and return the new URI. @param initialUri the starting URI, the URI to update @param path the path to set on the baeURI """ String finalPath = path; if (!finalPath.startsWith("/")) { ...
java
public static URI setPath(final URI initialUri, final String path) { String finalPath = path; if (!finalPath.startsWith("/")) { finalPath = '/' + path; } try { if (initialUri.getHost() == null && initialUri.getAuthority() != null) { return new URI(...
[ "public", "static", "URI", "setPath", "(", "final", "URI", "initialUri", ",", "final", "String", "path", ")", "{", "String", "finalPath", "=", "path", ";", "if", "(", "!", "finalPath", ".", "startsWith", "(", "\"/\"", ")", ")", "{", "finalPath", "=", "...
Set the replace of the uri and return the new URI. @param initialUri the starting URI, the URI to update @param path the path to set on the baeURI
[ "Set", "the", "replace", "of", "the", "uri", "and", "return", "the", "new", "URI", "." ]
train
https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/URIUtils.java#L260-L278
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThemeUtil.java
ThemeUtil.getResId
public static int getResId(@NonNull final Context context, @AttrRes final int resourceId, final int defaultValue) { """ Obtains the resource id, which corresponds to a specific resource id, from a context's theme. @param context The context, which should be used, as an instance ...
java
public static int getResId(@NonNull final Context context, @AttrRes final int resourceId, final int defaultValue) { return getResId(context, -1, resourceId, defaultValue); }
[ "public", "static", "int", "getResId", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "AttrRes", "final", "int", "resourceId", ",", "final", "int", "defaultValue", ")", "{", "return", "getResId", "(", "context", ",", "-", "1", ",", "resource...
Obtains the resource id, which corresponds to a specific resource id, from a context's theme. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param resourceId The resource id of the attribute, which should be obtained, as an {@link Integer} va...
[ "Obtains", "the", "resource", "id", "which", "corresponds", "to", "a", "specific", "resource", "id", "from", "a", "context", "s", "theme", "." ]
train
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L867-L870
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/JSONAssert.java
JSONAssert.assertEquals
public static void assertEquals(String message, String expectedStr, String actualStr, boolean strict) throws JSONException { """ Asserts that the JSONArray provided matches the expected string. If it isn't it throws an {@link AssertionError}. @param message Error message to be displayed in case of ass...
java
public static void assertEquals(String message, String expectedStr, String actualStr, boolean strict) throws JSONException { assertEquals(message, expectedStr, actualStr, strict ? JSONCompareMode.STRICT : JSONCompareMode.LENIENT); }
[ "public", "static", "void", "assertEquals", "(", "String", "message", ",", "String", "expectedStr", ",", "String", "actualStr", ",", "boolean", "strict", ")", "throws", "JSONException", "{", "assertEquals", "(", "message", ",", "expectedStr", ",", "actualStr", "...
Asserts that the JSONArray provided matches the expected string. If it isn't it throws an {@link AssertionError}. @param message Error message to be displayed in case of assertion failure @param expectedStr Expected JSON string @param actualStr String to compare @param strict Enables strict checking @throws JSONExcep...
[ "Asserts", "that", "the", "JSONArray", "provided", "matches", "the", "expected", "string", ".", "If", "it", "isn", "t", "it", "throws", "an", "{", "@link", "AssertionError", "}", "." ]
train
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java#L349-L352
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java
RegistriesInner.listCredentialsAsync
public Observable<RegistryListCredentialsResultInner> listCredentialsAsync(String resourceGroupName, String registryName) { """ Lists the login credentials for the specified container registry. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName ...
java
public Observable<RegistryListCredentialsResultInner> listCredentialsAsync(String resourceGroupName, String registryName) { return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1<ServiceResponse<RegistryListCredentialsResultInner>, RegistryListCredentialsResultInner>() { ...
[ "public", "Observable", "<", "RegistryListCredentialsResultInner", ">", "listCredentialsAsync", "(", "String", "resourceGroupName", ",", "String", "registryName", ")", "{", "return", "listCredentialsWithServiceResponseAsync", "(", "resourceGroupName", ",", "registryName", ")"...
Lists the login credentials for the specified container registry. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to ...
[ "Lists", "the", "login", "credentials", "for", "the", "specified", "container", "registry", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java#L900-L907
rhuss/jolokia
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
HttpRequestHandler.getErrorJSON
public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) { """ Get the JSON representation for a an exception @param pErrorCode the HTTP error code to return @param pExp the exception or error occured @param pJmxReq request from where to get processing options @return the json rep...
java
public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) { JSONObject jsonObject = new JSONObject(); jsonObject.put("status",pErrorCode); jsonObject.put("error",getExceptionMessage(pExp)); jsonObject.put("error_type", pExp.getClass().getName()); addError...
[ "public", "JSONObject", "getErrorJSON", "(", "int", "pErrorCode", ",", "Throwable", "pExp", ",", "JmxRequest", "pJmxReq", ")", "{", "JSONObject", "jsonObject", "=", "new", "JSONObject", "(", ")", ";", "jsonObject", ".", "put", "(", "\"status\"", ",", "pErrorCo...
Get the JSON representation for a an exception @param pErrorCode the HTTP error code to return @param pExp the exception or error occured @param pJmxReq request from where to get processing options @return the json representation
[ "Get", "the", "JSON", "representation", "for", "a", "an", "exception" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L258-L271
alkacon/opencms-core
src-setup/org/opencms/setup/CmsSetupDb.java
CmsSetupDb.executeSql
private void executeSql(String databaseKey, String sqlScript, Map<String, String> replacers, boolean abortOnError) { """ Internal method to parse and execute a setup script.<p> @param databaseKey the database variant of the script @param sqlScript the name of the script @param replacers the replacements to pe...
java
private void executeSql(String databaseKey, String sqlScript, Map<String, String> replacers, boolean abortOnError) { String filename = null; try { filename = m_basePath + CmsSetupBean.FOLDER_SETUP + "database" + File.separator ...
[ "private", "void", "executeSql", "(", "String", "databaseKey", ",", "String", "sqlScript", ",", "Map", "<", "String", ",", "String", ">", "replacers", ",", "boolean", "abortOnError", ")", "{", "String", "filename", "=", "null", ";", "try", "{", "filename", ...
Internal method to parse and execute a setup script.<p> @param databaseKey the database variant of the script @param sqlScript the name of the script @param replacers the replacements to perform in the script @param abortOnError if a error occurs this flag indicates if to continue or to abort
[ "Internal", "method", "to", "parse", "and", "execute", "a", "setup", "script", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupDb.java#L726-L744
belaban/JGroups
src/org/jgroups/util/Bits.java
Bits.writeLongSequence
public static void writeLongSequence(long hd, long hr, ByteBuffer buf) { """ Writes 2 sequence numbers (seqnos) in compressed format to buf. The seqnos are non-negative and hr is guaranteed to be &gt;= hd. <p/> Once variable-length encoding has been implemented, this method will probably get dropped as we can s...
java
public static void writeLongSequence(long hd, long hr, ByteBuffer buf) { if(hr < hd) throw new IllegalArgumentException("hr (" + hr + ") has to be >= hd (" + hd + ")"); if(hd == 0 && hr == 0) { buf.put((byte)0); return; } long delta=hr - hd; ...
[ "public", "static", "void", "writeLongSequence", "(", "long", "hd", ",", "long", "hr", ",", "ByteBuffer", "buf", ")", "{", "if", "(", "hr", "<", "hd", ")", "throw", "new", "IllegalArgumentException", "(", "\"hr (\"", "+", "hr", "+", "\") has to be >= hd (\""...
Writes 2 sequence numbers (seqnos) in compressed format to buf. The seqnos are non-negative and hr is guaranteed to be &gt;= hd. <p/> Once variable-length encoding has been implemented, this method will probably get dropped as we can simply write the 2 longs individually. @param hd the highest delivered seqno. Guarante...
[ "Writes", "2", "sequence", "numbers", "(", "seqnos", ")", "in", "compressed", "format", "to", "buf", ".", "The", "seqnos", "are", "non", "-", "negative", "and", "hr", "is", "guaranteed", "to", "be", "&gt", ";", "=", "hd", ".", "<p", "/", ">", "Once",...
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L313-L334
ThreeTen/threeten-extra
src/main/java/org/threeten/extra/LocalDateRange.java
LocalDateRange.ofEmpty
public static LocalDateRange ofEmpty(LocalDate date) { """ Obtains an empty date range located at the specified date. <p> The empty range has zero length and contains no other dates or ranges. An empty range cannot be located at {@code LocalDate.MIN}, {@code LocalDate.MIN.plusDays(1)}, {@code LocalDate.MAX} or...
java
public static LocalDateRange ofEmpty(LocalDate date) { Objects.requireNonNull(date, "date"); return new LocalDateRange(date, date); }
[ "public", "static", "LocalDateRange", "ofEmpty", "(", "LocalDate", "date", ")", "{", "Objects", ".", "requireNonNull", "(", "date", ",", "\"date\"", ")", ";", "return", "new", "LocalDateRange", "(", "date", ",", "date", ")", ";", "}" ]
Obtains an empty date range located at the specified date. <p> The empty range has zero length and contains no other dates or ranges. An empty range cannot be located at {@code LocalDate.MIN}, {@code LocalDate.MIN.plusDays(1)}, {@code LocalDate.MAX} or {@code LocalDate.MAX.minusDays(1)}. @param date the date where th...
[ "Obtains", "an", "empty", "date", "range", "located", "at", "the", "specified", "date", ".", "<p", ">", "The", "empty", "range", "has", "zero", "length", "and", "contains", "no", "other", "dates", "or", "ranges", ".", "An", "empty", "range", "cannot", "b...
train
https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/LocalDateRange.java#L203-L206
overturetool/overture
ide/ui/src/main/java/org/overture/ide/ui/commands/ToggleComment.java
ToggleComment.isBlockCommented
private boolean isBlockCommented(int startLine, int endLine, String[] prefixes, IDocument document) { """ Determines whether each line is prefixed by one of the prefixes. @param startLine Start line in document @param endLine End line in document @param prefixes Possible comment prefixes @param document The ...
java
private boolean isBlockCommented(int startLine, int endLine, String[] prefixes, IDocument document) { try { // check for occurrences of prefixes in the given lines for (int i= startLine; i <= endLine; i++) { IRegion line= document.getLineInformation(i); String text= document.get(line.getOffset(), lin...
[ "private", "boolean", "isBlockCommented", "(", "int", "startLine", ",", "int", "endLine", ",", "String", "[", "]", "prefixes", ",", "IDocument", "document", ")", "{", "try", "{", "// check for occurrences of prefixes in the given lines", "for", "(", "int", "i", "=...
Determines whether each line is prefixed by one of the prefixes. @param startLine Start line in document @param endLine End line in document @param prefixes Possible comment prefixes @param document The document @return <code>true</code> iff each line from <code>startLine</code> to and including <code>endLine</code> i...
[ "Determines", "whether", "each", "line", "is", "prefixed", "by", "one", "of", "the", "prefixes", "." ]
train
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/ui/src/main/java/org/overture/ide/ui/commands/ToggleComment.java#L254-L286
windy1/google-places-api-java
src/main/java/se/walkercrou/places/exception/GooglePlacesException.java
GooglePlacesException.parse
public static GooglePlacesException parse(String statusCode, String errorMessage) { """ Returns the correct exception from a server-given status code and error message. @param statusCode to find exception for @param errorMessage error message from server @return exception that matches the specified status cod...
java
public static GooglePlacesException parse(String statusCode, String errorMessage) { Class<?> clazz = statusClassMap.get(statusCode); if (clazz == null) return null; try { if (errorMessage == null || errorMessage.isEmpty()) return (GooglePlacesException) cl...
[ "public", "static", "GooglePlacesException", "parse", "(", "String", "statusCode", ",", "String", "errorMessage", ")", "{", "Class", "<", "?", ">", "clazz", "=", "statusClassMap", ".", "get", "(", "statusCode", ")", ";", "if", "(", "clazz", "==", "null", "...
Returns the correct exception from a server-given status code and error message. @param statusCode to find exception for @param errorMessage error message from server @return exception that matches the specified status code
[ "Returns", "the", "correct", "exception", "from", "a", "server", "-", "given", "status", "code", "and", "error", "message", "." ]
train
https://github.com/windy1/google-places-api-java/blob/a5f2a18a7d1ca03fc0480637eae255fe92fc8b86/src/main/java/se/walkercrou/places/exception/GooglePlacesException.java#L81-L96
alkacon/opencms-core
src/org/opencms/importexport/CmsImportExportManager.java
CmsImportExportManager.createExportPointDriver
public I_CmsExportPointDriver createExportPointDriver(Set<CmsExportPoint> exportPoints) { """ Creates a new export point driver based on the import/export configuration.<p> @param exportPoints the export points @return the export point driver instance """ if (m_tempExportpointPaths.isEmpty()) { ...
java
public I_CmsExportPointDriver createExportPointDriver(Set<CmsExportPoint> exportPoints) { if (m_tempExportpointPaths.isEmpty()) { return new CmsExportPointDriver(exportPoints); } else { return new CmsTempFolderExportPointDriver(exportPoints, getTempExportPointPaths()); }...
[ "public", "I_CmsExportPointDriver", "createExportPointDriver", "(", "Set", "<", "CmsExportPoint", ">", "exportPoints", ")", "{", "if", "(", "m_tempExportpointPaths", ".", "isEmpty", "(", ")", ")", "{", "return", "new", "CmsExportPointDriver", "(", "exportPoints", ")...
Creates a new export point driver based on the import/export configuration.<p> @param exportPoints the export points @return the export point driver instance
[ "Creates", "a", "new", "export", "point", "driver", "based", "on", "the", "import", "/", "export", "configuration", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportExportManager.java#L636-L644
alkacon/opencms-core
src/org/opencms/db/CmsDriverManager.java
CmsDriverManager.readProject
public CmsProject readProject(CmsDbContext dbc, String name) throws CmsException { """ Reads a project.<p> Important: Since a project name can be used multiple times, this is NOT the most efficient way to read the project. This is only a convenience for front end developing. Reading a project by name will ret...
java
public CmsProject readProject(CmsDbContext dbc, String name) throws CmsException { CmsProject project = null; project = m_monitor.getCachedProject(name); if (project == null) { project = getProjectDriver(dbc).readProject(dbc, name); m_monitor.cacheProject(project); ...
[ "public", "CmsProject", "readProject", "(", "CmsDbContext", "dbc", ",", "String", "name", ")", "throws", "CmsException", "{", "CmsProject", "project", "=", "null", ";", "project", "=", "m_monitor", ".", "getCachedProject", "(", "name", ")", ";", "if", "(", "...
Reads a project.<p> Important: Since a project name can be used multiple times, this is NOT the most efficient way to read the project. This is only a convenience for front end developing. Reading a project by name will return the first project with that name. All core classes must use the id version {@link #readProje...
[ "Reads", "a", "project", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L7281-L7290
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java
ExcelBase.getCell
public Cell getCell(int x, int y, boolean isCreateIfNotExist) { """ 获取指定坐标单元格,如果isCreateIfNotExist为false,则在单元格不存在时返回<code>null</code> @param x X坐标,从0计数,既列号 @param y Y坐标,从0计数,既行号 @param isCreateIfNotExist 单元格不存在时是否创建 @return {@link Cell} @since 4.0.6 """ final Row row = isCreateIfNotExist ? RowUtil.ge...
java
public Cell getCell(int x, int y, boolean isCreateIfNotExist) { final Row row = isCreateIfNotExist ? RowUtil.getOrCreateRow(this.sheet, y) : this.sheet.getRow(y); if (null != row) { return isCreateIfNotExist ? CellUtil.getOrCreateCell(row, x) : row.getCell(x); } return null; }
[ "public", "Cell", "getCell", "(", "int", "x", ",", "int", "y", ",", "boolean", "isCreateIfNotExist", ")", "{", "final", "Row", "row", "=", "isCreateIfNotExist", "?", "RowUtil", ".", "getOrCreateRow", "(", "this", ".", "sheet", ",", "y", ")", ":", "this",...
获取指定坐标单元格,如果isCreateIfNotExist为false,则在单元格不存在时返回<code>null</code> @param x X坐标,从0计数,既列号 @param y Y坐标,从0计数,既行号 @param isCreateIfNotExist 单元格不存在时是否创建 @return {@link Cell} @since 4.0.6
[ "获取指定坐标单元格,如果isCreateIfNotExist为false,则在单元格不存在时返回<code", ">", "null<", "/", "code", ">" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java#L172-L178
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java
GVRShaderData.setFloatArray
public void setFloatArray(String key, float val[]) { """ Set the value for a floating point vector uniform. <p> @param key name of uniform to set. @param val floating point array with new data. The size of the array must be at least as large as the uniform being updated. @throws IllegalArgumentException if ke...
java
public void setFloatArray(String key, float val[]) { checkKeyIsUniform(key); NativeShaderData.setFloatVec(getNative(), key, val, val.length); }
[ "public", "void", "setFloatArray", "(", "String", "key", ",", "float", "val", "[", "]", ")", "{", "checkKeyIsUniform", "(", "key", ")", ";", "NativeShaderData", ".", "setFloatVec", "(", "getNative", "(", ")", ",", "key", ",", "val", ",", "val", ".", "l...
Set the value for a floating point vector uniform. <p> @param key name of uniform to set. @param val floating point array with new data. The size of the array must be at least as large as the uniform being updated. @throws IllegalArgumentException if key is not in uniform descriptor or array is wrong length. @see #getF...
[ "Set", "the", "value", "for", "a", "floating", "point", "vector", "uniform", ".", "<p", ">" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java#L418-L422
logic-ng/LogicNG
src/main/java/org/logicng/backbones/BackboneGeneration.java
BackboneGeneration.computePositive
public static Backbone computePositive(final Formula formula, final Collection<Variable> variables) { """ Computes the positive backbone allVariablesInFormulas for a given formula w.r.t. a collection of variables. @param formula the given formula @param variables the given collection of relevant variables for ...
java
public static Backbone computePositive(final Formula formula, final Collection<Variable> variables) { return compute(formula, variables, BackboneType.ONLY_POSITIVE); }
[ "public", "static", "Backbone", "computePositive", "(", "final", "Formula", "formula", ",", "final", "Collection", "<", "Variable", ">", "variables", ")", "{", "return", "compute", "(", "formula", ",", "variables", ",", "BackboneType", ".", "ONLY_POSITIVE", ")",...
Computes the positive backbone allVariablesInFormulas for a given formula w.r.t. a collection of variables. @param formula the given formula @param variables the given collection of relevant variables for the backbone computation @return the positive backbone or {@code null} if the formula is UNSAT
[ "Computes", "the", "positive", "backbone", "allVariablesInFormulas", "for", "a", "given", "formula", "w", ".", "r", ".", "t", ".", "a", "collection", "of", "variables", "." ]
train
https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/backbones/BackboneGeneration.java#L183-L185
apache/incubator-druid
benchmarks/src/main/java/org/apache/druid/benchmark/query/SelectBenchmark.java
SelectBenchmark.incrementQueryPagination
private SelectQuery incrementQueryPagination(SelectQuery query, SelectResultValue prevResult) { """ Don't run this benchmark with a query that doesn't use {@link Granularities#ALL}, this pagination function probably doesn't work correctly in that case. """ Map<String, Integer> pagingIdentifiers = prevResu...
java
private SelectQuery incrementQueryPagination(SelectQuery query, SelectResultValue prevResult) { Map<String, Integer> pagingIdentifiers = prevResult.getPagingIdentifiers(); Map<String, Integer> newPagingIdentifers = new HashMap<>(); for (String segmentId : pagingIdentifiers.keySet()) { int newOffset...
[ "private", "SelectQuery", "incrementQueryPagination", "(", "SelectQuery", "query", ",", "SelectResultValue", "prevResult", ")", "{", "Map", "<", "String", ",", "Integer", ">", "pagingIdentifiers", "=", "prevResult", ".", "getPagingIdentifiers", "(", ")", ";", "Map",...
Don't run this benchmark with a query that doesn't use {@link Granularities#ALL}, this pagination function probably doesn't work correctly in that case.
[ "Don", "t", "run", "this", "benchmark", "with", "a", "query", "that", "doesn", "t", "use", "{" ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/benchmarks/src/main/java/org/apache/druid/benchmark/query/SelectBenchmark.java#L276-L287
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java
Configuration.getFloat
public float getFloat(String name, float defaultValue) { """ Get the value of the <code>name</code> property as a <code>float</code>. If no such property is specified, or if the specified value is not a valid <code>float</code>, then <code>defaultValue</code> is returned. @param name property name. @param de...
java
public float getFloat(String name, float defaultValue) { String valueString = get(name); if (valueString == null) return defaultValue; try { return Float.parseFloat(valueString); } catch (NumberFormatException e) { return defaultValue; } }
[ "public", "float", "getFloat", "(", "String", "name", ",", "float", "defaultValue", ")", "{", "String", "valueString", "=", "get", "(", "name", ")", ";", "if", "(", "valueString", "==", "null", ")", "return", "defaultValue", ";", "try", "{", "return", "F...
Get the value of the <code>name</code> property as a <code>float</code>. If no such property is specified, or if the specified value is not a valid <code>float</code>, then <code>defaultValue</code> is returned. @param name property name. @param defaultValue default value. @return property value as a <code>float</code...
[ "Get", "the", "value", "of", "the", "<code", ">", "name<", "/", "code", ">", "property", "as", "a", "<code", ">", "float<", "/", "code", ">", ".", "If", "no", "such", "property", "is", "specified", "or", "if", "the", "specified", "value", "is", "not"...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java#L563-L572
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java
SharedStateRegistry.registerReference
public Result registerReference(SharedStateRegistryKey registrationKey, StreamStateHandle state) { """ Register a reference to the given shared state in the registry. This does the following: We check if the state handle is actually new by the registrationKey. If it is new, we register it with a reference count ...
java
public Result registerReference(SharedStateRegistryKey registrationKey, StreamStateHandle state) { Preconditions.checkNotNull(state); StreamStateHandle scheduledStateDeletion = null; SharedStateRegistry.SharedStateEntry entry; synchronized (registeredStates) { Preconditions.checkState(open, "Attempt to r...
[ "public", "Result", "registerReference", "(", "SharedStateRegistryKey", "registrationKey", ",", "StreamStateHandle", "state", ")", "{", "Preconditions", ".", "checkNotNull", "(", "state", ")", ";", "StreamStateHandle", "scheduledStateDeletion", "=", "null", ";", "Shared...
Register a reference to the given shared state in the registry. This does the following: We check if the state handle is actually new by the registrationKey. If it is new, we register it with a reference count of 1. If there is already a state handle registered under the given key, we dispose the given "new" state hand...
[ "Register", "a", "reference", "to", "the", "given", "shared", "state", "in", "the", "registry", ".", "This", "does", "the", "following", ":", "We", "check", "if", "the", "state", "handle", "is", "actually", "new", "by", "the", "registrationKey", ".", "If",...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java#L85-L123
lucee/Lucee
core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java
ResourceUtil.toResourceExisting
public static Resource toResourceExisting(PageContext pc, String path) throws ExpressionException { """ cast a String (argument destination) to a File Object, if destination is not a absolute, file object will be relative to current position (get from PageContext) file must exist otherwise throw exception @pa...
java
public static Resource toResourceExisting(PageContext pc, String path) throws ExpressionException { return toResourceExisting(pc, path, pc.getConfig().allowRealPath()); }
[ "public", "static", "Resource", "toResourceExisting", "(", "PageContext", "pc", ",", "String", "path", ")", "throws", "ExpressionException", "{", "return", "toResourceExisting", "(", "pc", ",", "path", ",", "pc", ".", "getConfig", "(", ")", ".", "allowRealPath",...
cast a String (argument destination) to a File Object, if destination is not a absolute, file object will be relative to current position (get from PageContext) file must exist otherwise throw exception @param pc Page Context to the current position in filesystem @param path relative or absolute path for file object @...
[ "cast", "a", "String", "(", "argument", "destination", ")", "to", "a", "File", "Object", "if", "destination", "is", "not", "a", "absolute", "file", "object", "will", "be", "relative", "to", "current", "position", "(", "get", "from", "PageContext", ")", "fi...
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java#L188-L190