repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
spring-projects/spring-security
acl/src/main/java/org/springframework/security/acls/afterinvocation/AclEntryAfterInvocationProvider.java
AclEntryAfterInvocationProvider.decide
public Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> config, Object returnedObject) throws AccessDeniedException { if (returnedObject == null) { // AclManager interface contract prohibits nulls // As they have permission to null/nothing, grant access logger.de...
java
public Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> config, Object returnedObject) throws AccessDeniedException { if (returnedObject == null) { // AclManager interface contract prohibits nulls // As they have permission to null/nothing, grant access logger.de...
[ "public", "Object", "decide", "(", "Authentication", "authentication", ",", "Object", "object", ",", "Collection", "<", "ConfigAttribute", ">", "config", ",", "Object", "returnedObject", ")", "throws", "AccessDeniedException", "{", "if", "(", "returnedObject", "==",...
========================================================================================================
[ "========================================================================================================" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/acl/src/main/java/org/springframework/security/acls/afterinvocation/AclEntryAfterInvocationProvider.java#L90-L127
test
Decide whether the given object has permission to the given domain object.
Of course, here is the Java code you requested: ```java public Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> config, Object returnedObject) throws AccessDeniedException { if (returnedObject == null) { // AclManager interface contract prohibits nulls // As they h...
census-instrumentation/opencensus-java
exporters/stats/prometheus/src/main/java/io/opencensus/exporter/stats/prometheus/PrometheusExportUtils.java
PrometheusExportUtils.convertToLabelNames
@VisibleForTesting static List<String> convertToLabelNames(List<LabelKey> labelKeys) { final List<String> labelNames = new ArrayList<String>(labelKeys.size()); for (LabelKey labelKey : labelKeys) { labelNames.add(Collector.sanitizeMetricName(labelKey.getKey())); } return labelNames; }
java
@VisibleForTesting static List<String> convertToLabelNames(List<LabelKey> labelKeys) { final List<String> labelNames = new ArrayList<String>(labelKeys.size()); for (LabelKey labelKey : labelKeys) { labelNames.add(Collector.sanitizeMetricName(labelKey.getKey())); } return labelNames; }
[ "@", "VisibleForTesting", "static", "List", "<", "String", ">", "convertToLabelNames", "(", "List", "<", "LabelKey", ">", "labelKeys", ")", "{", "final", "List", "<", "String", ">", "labelNames", "=", "new", "ArrayList", "<", "String", ">", "(", "labelKeys",...
Converts the list of label keys to a list of string label names. Also sanitizes the label keys.
[ "Converts", "the", "list", "of", "label", "keys", "to", "a", "list", "of", "string", "label", "names", ".", "Also", "sanitizes", "the", "label", "keys", "." ]
deefac9bed77e40a2297bff1ca5ec5aa48a5f755
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/exporters/stats/prometheus/src/main/java/io/opencensus/exporter/stats/prometheus/PrometheusExportUtils.java#L263-L270
train
Convert a list of label keys to a list of metric names.
Of course, here is the Java code you requested: ```java @VisibleForTesting static List<String> convertToLabelNames(List<LabelKey> labelKeys) { final List<String> labelNames = new ArrayList<String>(labelKeys.size()); for (LabelKey labelKey : labelKeys) { labelNames.add(Collector.sanitizeMetricName(label...
WASdev/standards.jsr352.jbatch
com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java
JDBCPersistenceManagerImpl.getTagName
@Override public String getTagName(long jobExecutionId) { logger.entering(CLASSNAME, "getTagName", jobExecutionId); String apptag = null; Connection conn = null; PreparedStatement statement = null; ResultSet rs = null; String query = "SELECT A.apptag FROM jobinstancedata A INNER JOIN executioninstan...
java
@Override public String getTagName(long jobExecutionId) { logger.entering(CLASSNAME, "getTagName", jobExecutionId); String apptag = null; Connection conn = null; PreparedStatement statement = null; ResultSet rs = null; String query = "SELECT A.apptag FROM jobinstancedata A INNER JOIN executioninstan...
[ "@", "Override", "public", "String", "getTagName", "(", "long", "jobExecutionId", ")", "{", "logger", ".", "entering", "(", "CLASSNAME", ",", "\"getTagName\"", ",", "jobExecutionId", ")", ";", "String", "apptag", "=", "null", ";", "Connection", "conn", "=", ...
/* (non-Javadoc) @see com.ibm.jbatch.container.services.IPersistenceManagerService#getTagName(long)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f
https://github.com/WASdev/standards.jsr352.jbatch/blob/e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f/com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java#L2266-L2290
train
Returns the tag name of the specified job execution.
Of course, here is the Java code you requested: ```java @Override public String getTagName(long jobExecutionId) { logger.entering(CLASSNAME, "getTagName", jobExecutionId); String apptag = null; Connection conn = null; PreparedStatement statement = null; ResultSet rs = null; String query = "SELECT A...
alibaba/jstorm
jstorm-core/src/main/java/backtype/storm/generated/WorkerUploadMetrics.java
WorkerUploadMetrics.isSet
public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TOPOLOGY_ID: return is_set_topologyId(); case SUPERVISOR_ID: return is_set_supervisorId(); case PORT: return is_set_port(); case ALL_METRICS: ...
java
public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TOPOLOGY_ID: return is_set_topologyId(); case SUPERVISOR_ID: return is_set_supervisorId(); case PORT: return is_set_port(); case ALL_METRICS: ...
[ "public", "boolean", "isSet", "(", "_Fields", "field", ")", "{", "if", "(", "field", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "switch", "(", "field", ")", "{", "case", "TOPOLOGY_ID", ":", "return", "is_set_t...
Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise
[ "Returns", "true", "if", "field", "corresponding", "to", "fieldID", "is", "set", "(", "has", "been", "assigned", "a", "value", ")", "and", "false", "otherwise" ]
5d6cde22dbca7df3d6e6830bf94f98a6639ab559
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/generated/WorkerUploadMetrics.java#L353-L369
train
Checks if the value of the specified field is set to a value of the object.
Of course, here is the Java code you requested: ```java public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TOPOLOGY_ID: return is_set_topologyId(); case SUPERVISOR_ID: return is_set_supervisorId(); case POR...
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nuget/XPathNuspecParser.java
XPathNuspecParser.parse
@Override public NugetPackage parse(InputStream stream) throws NuspecParseException { try { final DocumentBuilder db = XmlUtils.buildSecureDocumentBuilder(); final Document d = db.parse(stream); final XPath xpath = XPathFactory.newInstance().newXPath(); final...
java
@Override public NugetPackage parse(InputStream stream) throws NuspecParseException { try { final DocumentBuilder db = XmlUtils.buildSecureDocumentBuilder(); final Document d = db.parse(stream); final XPath xpath = XPathFactory.newInstance().newXPath(); final...
[ "@", "Override", "public", "NugetPackage", "parse", "(", "InputStream", "stream", ")", "throws", "NuspecParseException", "{", "try", "{", "final", "DocumentBuilder", "db", "=", "XmlUtils", ".", "buildSecureDocumentBuilder", "(", ")", ";", "final", "Document", "d",...
Parse an input stream and return the resulting {@link NugetPackage}. @param stream the input stream to parse @return the populated bean @throws NuspecParseException when an exception occurs
[ "Parse", "an", "input", "stream", "and", "return", "the", "resulting", "{", "@link", "NugetPackage", "}", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nuget/XPathNuspecParser.java#L64-L90
train
Parses the Nuspec file.
Of course, here is the Java code you requested: ```java @Override public NugetPackage parse(InputStream stream) throws NuspecParseException { try { final DocumentBuilder db = XmlUtils.buildSecureDocumentBuilder(); final Document d = db.parse(stream); final XPath xpath =...
JodaOrg/joda-time
src/main/java/org/joda/time/IllegalFieldValueException.java
IllegalFieldValueException.prependMessage
public void prependMessage(String message) { if (iMessage == null) { iMessage = message; } else if (message != null) { iMessage = message + ": " + iMessage; } }
java
public void prependMessage(String message) { if (iMessage == null) { iMessage = message; } else if (message != null) { iMessage = message + ": " + iMessage; } }
[ "public", "void", "prependMessage", "(", "String", "message", ")", "{", "if", "(", "iMessage", "==", "null", ")", "{", "iMessage", "=", "message", ";", "}", "else", "if", "(", "message", "!=", "null", ")", "{", "iMessage", "=", "message", "+", "\": \""...
Provide additional detail by prepending a message to the existing message. A colon is separator is automatically inserted between the messages. @since 1.3
[ "Provide", "additional", "detail", "by", "prepending", "a", "message", "to", "the", "existing", "message", ".", "A", "colon", "is", "separator", "is", "automatically", "inserted", "between", "the", "messages", "." ]
bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/IllegalFieldValueException.java#L322-L328
train
Prepend the message to the exception message.
Of course, here is the Java code you requested: ```java public void prependMessage(String message) { if (iMessage == null) { iMessage = message; } else if (message != null) { iMessage = message + ": " + iMessage; } } ``` Hope this helps!
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java
KeyVaultClientImpl.deleteKey
public KeyBundle deleteKey(String vaultBaseUrl, String keyName) { return deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); }
java
public KeyBundle deleteKey(String vaultBaseUrl, String keyName) { return deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); }
[ "public", "KeyBundle", "deleteKey", "(", "String", "vaultBaseUrl", ",", "String", "keyName", ")", "{", "return", "deleteKeyWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "keyName", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", ".", "body", "...
Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorizatio...
[ "Deletes", "a", "key", "of", "any", "type", "from", "storage", "in", "Azure", "Key", "Vault", ".", "The", "delete", "key", "operation", "cannot", "be", "used", "to", "remove", "individual", "versions", "of", "a", "key", ".", "This", "operation", "removes",...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java#L836-L838
train
Deletes a key from a specified key vault.
Of course, here is the Java code you requested: ```java public KeyBundle deleteKey(String vaultBaseUrl, String keyName) { return deleteKeyWithServiceResponseAsync(vaultBaseUrl, keyName).toBlocking().single().body(); } ``` Hope this helps!
FedericoPecora/meta-csp-framework
src/main/java/org/metacsp/utility/Gaussian.java
Gaussian.phi
public static double phi(double x) { return Math.exp(-x*x / 2) / Math.sqrt(2 * Math.PI); }
java
public static double phi(double x) { return Math.exp(-x*x / 2) / Math.sqrt(2 * Math.PI); }
[ "public", "static", "double", "phi", "(", "double", "x", ")", "{", "return", "Math", ".", "exp", "(", "-", "x", "*", "x", "/", "2", ")", "/", "Math", ".", "sqrt", "(", "2", "*", "Math", ".", "PI", ")", ";", "}" ]
Returns phi(x) = standard Gaussian pdf @param x @return
[ "Returns", "phi", "(", "x", ")", "=", "standard", "Gaussian", "pdf" ]
42aaef2e2b76d0f738427f0dd9653c4f62b40517
https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/Gaussian.java#L32-L34
train
Returns the phi of a given number.
Of course, here is the Java code you requested: ```java public static double phi(double x) { return Math.exp(-x*x / 2) / Math.sqrt(2 * Math.PI); } ``` Hope this helps!
threerings/nenya
core/src/main/java/com/threerings/geom/GeomUtil.java
GeomUtil.dot
public static int dot (Point v1s, Point v1e, Point v2s, Point v2e) { return ((v1e.x - v1s.x) * (v2e.x - v2s.x) + (v1e.y - v1s.y) * (v2e.y - v2s.y)); }
java
public static int dot (Point v1s, Point v1e, Point v2s, Point v2e) { return ((v1e.x - v1s.x) * (v2e.x - v2s.x) + (v1e.y - v1s.y) * (v2e.y - v2s.y)); }
[ "public", "static", "int", "dot", "(", "Point", "v1s", ",", "Point", "v1e", ",", "Point", "v2s", ",", "Point", "v2e", ")", "{", "return", "(", "(", "v1e", ".", "x", "-", "v1s", ".", "x", ")", "*", "(", "v2e", ".", "x", "-", "v2s", ".", "x", ...
Computes and returns the dot product of the two vectors. @param v1s the starting point of the first vector. @param v1e the ending point of the first vector. @param v2s the starting point of the second vector. @param v2e the ending point of the second vector.
[ "Computes", "and", "returns", "the", "dot", "product", "of", "the", "two", "vectors", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L41-L44
train
Compute the dot product of two points.
Of course, here is the Java code you requested: ```java public static int dot (Point v1s, Point v1e, Point v2s, Point v2e) { return ((v1e.x - v1s.x) * (v2e.x - v2s.x) + (v1e.y - v1s.y) * (v2e.y - v2s.y)); } ``` Hope this helps!
threerings/nenya
core/src/main/java/com/threerings/media/image/ColorPository.java
ColorPository.getColorRecord
public ColorRecord getColorRecord (int classId, int colorId) { ClassRecord record = getClassRecord(classId); if (record == null) { // if they request color class zero, we assume they're just // decoding a blank colorprint, otherwise we complain if (classId != 0) {...
java
public ColorRecord getColorRecord (int classId, int colorId) { ClassRecord record = getClassRecord(classId); if (record == null) { // if they request color class zero, we assume they're just // decoding a blank colorprint, otherwise we complain if (classId != 0) {...
[ "public", "ColorRecord", "getColorRecord", "(", "int", "classId", ",", "int", "colorId", ")", "{", "ClassRecord", "record", "=", "getClassRecord", "(", "classId", ")", ";", "if", "(", "record", "==", "null", ")", "{", "// if they request color class zero, we assum...
Looks up the requested color record.
[ "Looks", "up", "the", "requested", "color", "record", "." ]
3165a012fd859009db3367f87bd2a5b820cc760a
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L435-L448
train
Get the ColorRecord for a given color id.
Of course, here is the Java code you requested: ```java public ColorRecord getColorRecord (int classId, int colorId) { ClassRecord record = getClassRecord(classId); if (record == null) { // if they request color class zero, we assume they're just // decoding a blank colorpri...
OpenLiberty/open-liberty
dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallUtils.java
InstallUtils.listFiles
public static File[] listFiles(final File f) { return AccessController.doPrivileged(new PrivilegedAction<File[]>() { @Override public File[] run() { return f.listFiles(); } }); }
java
public static File[] listFiles(final File f) { return AccessController.doPrivileged(new PrivilegedAction<File[]>() { @Override public File[] run() { return f.listFiles(); } }); }
[ "public", "static", "File", "[", "]", "listFiles", "(", "final", "File", "f", ")", "{", "return", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "File", "[", "]", ">", "(", ")", "{", "@", "Override", "public", "File", "[", ...
Java 2 security APIs for file.listFiles()
[ "Java", "2", "security", "APIs", "for", "file", ".", "listFiles", "()" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallUtils.java#L907-L914
train
List all files in the directory.
Of course, here is the Java code you requested: ```java public static File[] listFiles(final File f) { return AccessController.doPrivileged(new PrivilegedAction<File[]>() { @Override public File[] run() { return f.listFiles(); } }); } ``` Hope th...
mongodb/stitch-android-sdk
core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DataSynchronizer.java
DataSynchronizer.desyncDocumentsFromRemote
@CheckReturnValue LocalSyncWriteModelContainer desyncDocumentsFromRemote( final NamespaceSynchronizationConfig nsConfig, final BsonValue... documentIds) { this.waitUntilInitialized(); final MongoNamespace namespace = nsConfig.getNamespace(); final Lock lock = this.syncConfig.getNamespaceConfig...
java
@CheckReturnValue LocalSyncWriteModelContainer desyncDocumentsFromRemote( final NamespaceSynchronizationConfig nsConfig, final BsonValue... documentIds) { this.waitUntilInitialized(); final MongoNamespace namespace = nsConfig.getNamespace(); final Lock lock = this.syncConfig.getNamespaceConfig...
[ "@", "CheckReturnValue", "LocalSyncWriteModelContainer", "desyncDocumentsFromRemote", "(", "final", "NamespaceSynchronizationConfig", "nsConfig", ",", "final", "BsonValue", "...", "documentIds", ")", "{", "this", ".", "waitUntilInitialized", "(", ")", ";", "final", "Mongo...
Requests that a document be no longer be synchronized by the given _id. Any uncommitted writes will be lost. @param nsConfig the namespace synchronization config of the namespace where the document lives. @param documentIds the _ids of the documents.
[ "Requests", "that", "a", "document", "be", "no", "longer", "be", "synchronized", "by", "the", "given", "_id", ".", "Any", "uncommitted", "writes", "will", "be", "lost", "." ]
159b9334b1f1a827285544be5ee20cdf7b04e4cc
https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/DataSynchronizer.java#L2040-L2069
train
Desync documents from remote.
Of course, here is the Java code you requested: ```java @CheckReturnValue LocalSyncWriteModelContainer desyncDocumentsFromRemote( final NamespaceSynchronizationConfig nsConfig, final BsonValue... documentIds) { this.waitUntilInitialized(); final MongoNamespace namespace = nsConfig.getNamespace();...
wildfly/wildfly
weld/subsystem/src/main/java/org/jboss/as/weld/deployment/processors/ExternalBeanArchiveProcessor.java
ExternalBeanArchiveProcessor.findExportedResources
private Map<URL, URL> findExportedResources(Module dependencyModule) { Set<URL> beanXmls = findExportedResource(dependencyModule, META_INF_BEANS_XML); if (beanXmls.isEmpty()) { return Collections.emptyMap(); } Set<URL> indexes = findExportedResource(dependencyModule, META_INF...
java
private Map<URL, URL> findExportedResources(Module dependencyModule) { Set<URL> beanXmls = findExportedResource(dependencyModule, META_INF_BEANS_XML); if (beanXmls.isEmpty()) { return Collections.emptyMap(); } Set<URL> indexes = findExportedResource(dependencyModule, META_INF...
[ "private", "Map", "<", "URL", ",", "URL", ">", "findExportedResources", "(", "Module", "dependencyModule", ")", "{", "Set", "<", "URL", ">", "beanXmls", "=", "findExportedResource", "(", "dependencyModule", ",", "META_INF_BEANS_XML", ")", ";", "if", "(", "bean...
The entry key is bean.xml URL, value is (optional) jandex index URL. @param dependencyModule @return the map of exported resources
[ "The", "entry", "key", "is", "bean", ".", "xml", "URL", "value", "is", "(", "optional", ")", "jandex", "index", "URL", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/weld/subsystem/src/main/java/org/jboss/as/weld/deployment/processors/ExternalBeanArchiveProcessor.java#L308-L327
test
Find exported resources.
Of course, here is the Java code you requested: ```java private Map<URL, URL> findExportedResources(Module dependencyModule) { Set<URL> beanXmls = findExportedResource(dependencyModule, META_INF_BEANS_XML); if (beanXmls.isEmpty()) { return Collections.emptyMap(); } Set<URL> ...
ThreeTen/threetenbp
src/main/java/org/threeten/bp/Duration.java
Duration.compareTo
@Override public int compareTo(Duration otherDuration) { int cmp = Jdk8Methods.compareLongs(seconds, otherDuration.seconds); if (cmp != 0) { return cmp; } return nanos - otherDuration.nanos; }
java
@Override public int compareTo(Duration otherDuration) { int cmp = Jdk8Methods.compareLongs(seconds, otherDuration.seconds); if (cmp != 0) { return cmp; } return nanos - otherDuration.nanos; }
[ "@", "Override", "public", "int", "compareTo", "(", "Duration", "otherDuration", ")", "{", "int", "cmp", "=", "Jdk8Methods", ".", "compareLongs", "(", "seconds", ",", "otherDuration", ".", "seconds", ")", ";", "if", "(", "cmp", "!=", "0", ")", "{", "retu...
Compares this duration to the specified {@code Duration}. <p> The comparison is based on the total length of the durations. It is "consistent with equals", as defined by {@link Comparable}. @param otherDuration the other duration to compare to, not null @return the comparator value, negative if less, positive if grea...
[ "Compares", "this", "duration", "to", "the", "specified", "{", "@code", "Duration", "}", ".", "<p", ">", "The", "comparison", "is", "based", "on", "the", "total", "length", "of", "the", "durations", ".", "It", "is", "consistent", "with", "equals", "as", ...
5f05b649f89f205aabd96b2f83c36796ec616fe6
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/Duration.java#L1132-L1139
train
Compare two duration objects.
Of course, here is the Java code you requested: ```java @Override public int compareTo(Duration otherDuration) { int cmp = Jdk8Methods.compareLongs(seconds, otherDuration.seconds); if (cmp != 0) { return cmp; } return nanos - otherDuration.nanos; } ``` Hope this hel...
google/closure-templates
java/src/com/google/template/soy/SoyFileSet.java
SoyFileSet.compileTemplates
public SoySauce compileTemplates(Map<String, Supplier<Object>> pluginInstances) { resetErrorReporter(); disallowExternalCalls(); ServerCompilationPrimitives primitives = compileForServerRendering(); throwIfErrorsPresent(); SoySauce sauce = doCompileSoySauce(primitives, pluginInstances); reportW...
java
public SoySauce compileTemplates(Map<String, Supplier<Object>> pluginInstances) { resetErrorReporter(); disallowExternalCalls(); ServerCompilationPrimitives primitives = compileForServerRendering(); throwIfErrorsPresent(); SoySauce sauce = doCompileSoySauce(primitives, pluginInstances); reportW...
[ "public", "SoySauce", "compileTemplates", "(", "Map", "<", "String", ",", "Supplier", "<", "Object", ">", ">", "pluginInstances", ")", "{", "resetErrorReporter", "(", ")", ";", "disallowExternalCalls", "(", ")", ";", "ServerCompilationPrimitives", "primitives", "=...
Compiles this Soy file set into a set of java classes implementing the {@link SoySauce} interface. <p>This is useful for implementing 'edit refresh' workflows. Most production usecases should use the command line interface to 'ahead of time' compile templates to jar files and then use {@code PrecompiledSoyModule} or {...
[ "Compiles", "this", "Soy", "file", "set", "into", "a", "set", "of", "java", "classes", "implementing", "the", "{", "@link", "SoySauce", "}", "interface", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/SoyFileSet.java#L789-L798
train
Compiles the templates.
Of course, here is the Java code you requested: ```java public SoySauce compileTemplates(Map<String, Supplier<Object>> pluginInstances) { resetErrorReporter(); disallowExternalCalls(); ServerCompilationPrimitives primitives = compileForServerRendering(); throwIfErrorsPresent(); SoySauce sauce = doC...
lucee/Lucee
core/src/main/java/lucee/runtime/writer/CFMLWriterWSPref.java
CFMLWriterWSPref.print
@Override public void print(char c) throws IOException { boolean isWS = Character.isWhitespace(c); if (isWS) { if (isFirstChar) // ignore all WS before non-WS content return; if (c == CHAR_RETURN) // ignore Carriage-Return chars return; if (sb.length() > 0) { printBuffer(); // buffer should n...
java
@Override public void print(char c) throws IOException { boolean isWS = Character.isWhitespace(c); if (isWS) { if (isFirstChar) // ignore all WS before non-WS content return; if (c == CHAR_RETURN) // ignore Carriage-Return chars return; if (sb.length() > 0) { printBuffer(); // buffer should n...
[ "@", "Override", "public", "void", "print", "(", "char", "c", ")", "throws", "IOException", "{", "boolean", "isWS", "=", "Character", ".", "isWhitespace", "(", "c", ")", ";", "if", "(", "isWS", ")", "{", "if", "(", "isFirstChar", ")", "// ignore all WS b...
sends a character to output stream if it is not a consecutive white-space unless we're inside a PRE or TEXTAREA tag. @param c @throws IOException
[ "sends", "a", "character", "to", "output", "stream", "if", "it", "is", "not", "a", "consecutive", "white", "-", "space", "unless", "we", "re", "inside", "a", "PRE", "or", "TEXTAREA", "tag", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/writer/CFMLWriterWSPref.java#L168-L200
train
Print a single character.
Of course, here is the Java code you requested: ```java @Override public void print(char c) throws IOException { boolean isWS = Character.isWhitespace(c); if (isWS) { if (isFirstChar) // ignore all WS before non-WS content return; if (c == CHAR_RETURN) // ignore Carriage-Return chars return; i...
aws/aws-sdk-java
aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/transform/GetOperationsForResourceRequestMarshaller.java
GetOperationsForResourceRequestMarshaller.marshall
public void marshall(GetOperationsForResourceRequest getOperationsForResourceRequest, ProtocolMarshaller protocolMarshaller) { if (getOperationsForResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarsha...
java
public void marshall(GetOperationsForResourceRequest getOperationsForResourceRequest, ProtocolMarshaller protocolMarshaller) { if (getOperationsForResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarsha...
[ "public", "void", "marshall", "(", "GetOperationsForResourceRequest", "getOperationsForResourceRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "getOperationsForResourceRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/transform/GetOperationsForResourceRequestMarshaller.java#L44-L56
train
marshalls the given GetOperationsForResourceRequest to the given protocolMarshaller.
Of course, here is the Java code you requested: ```java public void marshall(GetOperationsForResourceRequest getOperationsForResourceRequest, ProtocolMarshaller protocolMarshaller) { if (getOperationsForResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(.....
nats-io/java-nats-streaming
src/main/java/io/nats/streaming/StreamingConnectionImpl.java
StreamingConnectionImpl.processAck
void processAck(Message msg) { PubAck pa; Exception ex = null; try { pa = PubAck.parseFrom(msg.getData()); } catch (InvalidProtocolBufferException e) { // If we are speaking to a server we don't understand, let the // user know. System.err....
java
void processAck(Message msg) { PubAck pa; Exception ex = null; try { pa = PubAck.parseFrom(msg.getData()); } catch (InvalidProtocolBufferException e) { // If we are speaking to a server we don't understand, let the // user know. System.err....
[ "void", "processAck", "(", "Message", "msg", ")", "{", "PubAck", "pa", ";", "Exception", "ex", "=", "null", ";", "try", "{", "pa", "=", "PubAck", ".", "parseFrom", "(", "msg", ".", "getData", "(", ")", ")", ";", "}", "catch", "(", "InvalidProtocolBuf...
Process an ack from the STAN cluster
[ "Process", "an", "ack", "from", "the", "STAN", "cluster" ]
72f964e9093622875d7f1c85ce60820e028863e7
https://github.com/nats-io/java-nats-streaming/blob/72f964e9093622875d7f1c85ce60820e028863e7/src/main/java/io/nats/streaming/StreamingConnectionImpl.java#L540-L572
train
Process an ack message.
Of course, here is the Java code you requested: ```java void processAck(Message msg) { PubAck pa; Exception ex = null; try { pa = PubAck.parseFrom(msg.getData()); } catch (InvalidProtocolBufferException e) { // If we are speaking to a server we don't understand, ...
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/cluster/manager/impl/DefaultClusterManager.java
DefaultClusterManager.doMultiMapKeys
private void doMultiMapKeys(final Message<JsonObject> message) { final String name = message.body().getString("name"); if (name == null) { message.reply(new JsonObject().putString("status", "error").putString("message", "No name specified.")); return; } context.execute(new Action<Set<Object...
java
private void doMultiMapKeys(final Message<JsonObject> message) { final String name = message.body().getString("name"); if (name == null) { message.reply(new JsonObject().putString("status", "error").putString("message", "No name specified.")); return; } context.execute(new Action<Set<Object...
[ "private", "void", "doMultiMapKeys", "(", "final", "Message", "<", "JsonObject", ">", "message", ")", "{", "final", "String", "name", "=", "message", ".", "body", "(", ")", ".", "getString", "(", "\"name\"", ")", ";", "if", "(", "name", "==", "null", "...
Handles a cluster multi-map keys command.
[ "Handles", "a", "cluster", "multi", "-", "map", "keys", "command", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/cluster/manager/impl/DefaultClusterManager.java#L1706-L1728
train
Handles a multi map keys request.
Of course, here is the Java code you requested: ```java private void doMultiMapKeys(final Message<JsonObject> message) { final String name = message.body().getString("name"); if (name == null) { message.reply(new JsonObject().putString("status", "error").putString("message", "No name specified.")); ...
micronaut-projects/micronaut-core
runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java
RxInstrumentedWrappers.wrap
static <T> Single<T> wrap( SingleSource<T> source, Collection<ReactiveInstrumenter> instrumentations) { if (source instanceof Callable) { return new RxInstrumentedCallableSingle<>(source, instrumentations); } return new RxInstrumentedSingle<>(source, instrumentations); ...
java
static <T> Single<T> wrap( SingleSource<T> source, Collection<ReactiveInstrumenter> instrumentations) { if (source instanceof Callable) { return new RxInstrumentedCallableSingle<>(source, instrumentations); } return new RxInstrumentedSingle<>(source, instrumentations); ...
[ "static", "<", "T", ">", "Single", "<", "T", ">", "wrap", "(", "SingleSource", "<", "T", ">", "source", ",", "Collection", "<", "ReactiveInstrumenter", ">", "instrumentations", ")", "{", "if", "(", "source", "instanceof", "Callable", ")", "{", "return", ...
Wrap a single. @param source The source @param instrumentations The instrumentations @param <T> The type @return The wrapped subscriber
[ "Wrap", "a", "single", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/reactive/rxjava2/RxInstrumentedWrappers.java#L93-L99
train
Wrap a single source.
Of course, here is the Java code you requested: ```java static <T> Single<T> wrap( SingleSource<T> source, Collection<ReactiveInstrumenter> instrumentations) { if (source instanceof Callable) { return new RxInstrumentedCallableSingle<>(source, instrumentations); } return...
robolectric/robolectric
shadows/framework/src/main/java/org/robolectric/shadows/ShadowResolveInfo.java
ShadowResolveInfo.newResolveInfo
public static ResolveInfo newResolveInfo(String displayName, String packageName) { return newResolveInfo(displayName, packageName, null); }
java
public static ResolveInfo newResolveInfo(String displayName, String packageName) { return newResolveInfo(displayName, packageName, null); }
[ "public", "static", "ResolveInfo", "newResolveInfo", "(", "String", "displayName", ",", "String", "packageName", ")", "{", "return", "newResolveInfo", "(", "displayName", ",", "packageName", ",", "null", ")", ";", "}" ]
Creates a {@link ResolveInfo}. @param displayName Display name. @param packageName Package name. @return Resolve info instance.
[ "Creates", "a", "{", "@link", "ResolveInfo", "}", "." ]
4fa79a2c72f8abbf742ab920419653c207b41d62
https://github.com/robolectric/robolectric/blob/4fa79a2c72f8abbf742ab920419653c207b41d62/shadows/framework/src/main/java/org/robolectric/shadows/ShadowResolveInfo.java#L19-L21
valid
Create a new resolve info object.
Of course, here is the Java code you requested: ```java public static ResolveInfo newResolveInfo(String displayName, String packageName) { return newResolveInfo(displayName, packageName, null); } ``` Hope this helps!
twitter/cloudhopper-commons
ch-commons-util/src/main/java/com/cloudhopper/commons/util/codec/URLCodec.java
URLCodec.decodeToBytes
public static byte[] decodeToBytes(CharSequence in) throws IOException{ if(in == null) return null; ByteArrayOutputStream baos = new ByteArrayOutputStream(in.length()); decode(in, baos); return baos.toByteArray(); }
java
public static byte[] decodeToBytes(CharSequence in) throws IOException{ if(in == null) return null; ByteArrayOutputStream baos = new ByteArrayOutputStream(in.length()); decode(in, baos); return baos.toByteArray(); }
[ "public", "static", "byte", "[", "]", "decodeToBytes", "(", "CharSequence", "in", ")", "throws", "IOException", "{", "if", "(", "in", "==", "null", ")", "return", "null", ";", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", "in", "...
Convenience method for {@link #decode(CharSequence, OutputStream)}.
[ "Convenience", "method", "for", "{" ]
b5bc397dbec4537e8149e7ec0733c1d7ed477499
https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/codec/URLCodec.java#L143-L148
train
Decode a char sequence to a byte array.
Of course, here is the Java code you requested: ```java public static byte[] decodeToBytes(CharSequence in) throws IOException{ if(in == null) return null; ByteArrayOutputStream baos = new ByteArrayOutputStream(in.length()); decode(in, baos); return baos.toByteArray(); } ``` Hope this helps!
wildfly/wildfly
jpa/subsystem/src/main/java/org/jboss/as/jpa/service/JPAService.java
JPAService.createManagementStatisticsResource
public static Resource createManagementStatisticsResource( final ManagementAdaptor managementAdaptor, final String scopedPersistenceUnitName, final DeploymentUnit deploymentUnit) { synchronized (existingResourceDescriptionResolver) { final EntityManagerFactoryLoo...
java
public static Resource createManagementStatisticsResource( final ManagementAdaptor managementAdaptor, final String scopedPersistenceUnitName, final DeploymentUnit deploymentUnit) { synchronized (existingResourceDescriptionResolver) { final EntityManagerFactoryLoo...
[ "public", "static", "Resource", "createManagementStatisticsResource", "(", "final", "ManagementAdaptor", "managementAdaptor", ",", "final", "String", "scopedPersistenceUnitName", ",", "final", "DeploymentUnit", "deploymentUnit", ")", "{", "synchronized", "(", "existingResourc...
Create single instance of management statistics resource per managementAdaptor version. ManagementAccess The persistence provider and jipijapa adapters will be in the same classloader, either a static module or included directly in the application. Those are the two supported use cases for management of deployment p...
[ "Create", "single", "instance", "of", "management", "statistics", "resource", "per", "managementAdaptor", "version", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/subsystem/src/main/java/org/jboss/as/jpa/service/JPAService.java#L132-L179
test
Creates a resource that is used to store the management statistics.
Of course, here is the Java code you requested: ```java public static Resource createManagementStatisticsResource( final ManagementAdaptor managementAdaptor, final String scopedPersistenceUnitName, final DeploymentUnit deploymentUnit) { synchronized (existingResourceDescrip...
micronaut-projects/micronaut-core
views/src/main/java/io/micronaut/views/ViewUtils.java
ViewUtils.normalizeFolder
@Nonnull public static String normalizeFolder(@Nullable String path) { if (path == null) { path = ""; } else { path = normalizeFile(path, null); } if (!path.endsWith("/")) { path = path + "/"; } return path; }
java
@Nonnull public static String normalizeFolder(@Nullable String path) { if (path == null) { path = ""; } else { path = normalizeFile(path, null); } if (!path.endsWith("/")) { path = path + "/"; } return path; }
[ "@", "Nonnull", "public", "static", "String", "normalizeFolder", "(", "@", "Nullable", "String", "path", ")", "{", "if", "(", "path", "==", "null", ")", "{", "path", "=", "\"\"", ";", "}", "else", "{", "path", "=", "normalizeFile", "(", "path", ",", ...
Returns a path with unix style folder separators that starts and ends with a "/". @param path The path to normalizeFile @return The normalized path
[ "Returns", "a", "path", "with", "unix", "style", "folder", "separators", "that", "starts", "and", "ends", "with", "a", "/", "." ]
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/views/src/main/java/io/micronaut/views/ViewUtils.java#L37-L48
train
Normalize a folder path.
Of course, here is the Java code you requested: ```java @Nonnull public static String normalizeFolder(@Nullable String path) { if (path == null) { path = ""; } else { path = normalizeFile(path, null); } if (!path.endsWith("/")) { path = path + "/"...
amaembo/streamex
src/main/java/one/util/streamex/AbstractStreamEx.java
AbstractStreamEx.minByDouble
public Optional<T> minByDouble(ToDoubleFunction<? super T> keyExtractor) { return Box.asOptional(reduce(null, (ObjDoubleBox<T> acc, T t) -> { double val = keyExtractor.applyAsDouble(t); if (acc == null) return new ObjDoubleBox<>(t, val); if (Double.compare(val...
java
public Optional<T> minByDouble(ToDoubleFunction<? super T> keyExtractor) { return Box.asOptional(reduce(null, (ObjDoubleBox<T> acc, T t) -> { double val = keyExtractor.applyAsDouble(t); if (acc == null) return new ObjDoubleBox<>(t, val); if (Double.compare(val...
[ "public", "Optional", "<", "T", ">", "minByDouble", "(", "ToDoubleFunction", "<", "?", "super", "T", ">", "keyExtractor", ")", "{", "return", "Box", ".", "asOptional", "(", "reduce", "(", "null", ",", "(", "ObjDoubleBox", "<", "T", ">", "acc", ",", "T"...
Returns the minimum element of this stream according to the double values extracted by provided function. This is a special case of a reduction. <p> This is a terminal operation. <p> This method is equivalent to {@code min(Comparator.comparingDouble(keyExtractor))}, but may work faster as keyExtractor function is app...
[ "Returns", "the", "minimum", "element", "of", "this", "stream", "according", "to", "the", "double", "values", "extracted", "by", "provided", "function", ".", "This", "is", "a", "special", "case", "of", "a", "reduction", "." ]
936bbd1b7dfbcf64a3b990682bfc848213441d14
https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/AbstractStreamEx.java#L947-L959
train
Get the smallest element of this stream according to the specified key extractor.
Of course, here is the Java code you requested: ```java public Optional<T> minByDouble(ToDoubleFunction<? super T> keyExtractor) { return Box.asOptional(reduce(null, (ObjDoubleBox<T> acc, T t) -> { double val = keyExtractor.applyAsDouble(t); if (acc == null) return new O...
actorapp/actor-platform
actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/encryption/KeyManagerActor.java
KeyManagerActor.onPublicKeysGroupRemoved
private void onPublicKeysGroupRemoved(int uid, int keyGroupId) { UserKeys userKeys = getCachedUserKeys(uid); if (userKeys == null) { return; } UserKeys updatedUserKeys = userKeys.removeUserKeyGroup(keyGroupId); cacheUserKeys(updatedUserKeys); context().getEnc...
java
private void onPublicKeysGroupRemoved(int uid, int keyGroupId) { UserKeys userKeys = getCachedUserKeys(uid); if (userKeys == null) { return; } UserKeys updatedUserKeys = userKeys.removeUserKeyGroup(keyGroupId); cacheUserKeys(updatedUserKeys); context().getEnc...
[ "private", "void", "onPublicKeysGroupRemoved", "(", "int", "uid", ",", "int", "keyGroupId", ")", "{", "UserKeys", "userKeys", "=", "getCachedUserKeys", "(", "uid", ")", ";", "if", "(", "userKeys", "==", "null", ")", "{", "return", ";", "}", "UserKeys", "up...
Handler for removing key group @param uid User's id @param keyGroupId Removed key group id
[ "Handler", "for", "removing", "key", "group" ]
5123c1584757c6eeea0ed2a0e7e043629871a0c6
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/encryption/KeyManagerActor.java#L460-L470
train
Called when a public key group is removed from the user s public key group list.
Of course, here is the Java code you requested: ```java private void onPublicKeysGroupRemoved(int uid, int keyGroupId) { UserKeys userKeys = getCachedUserKeys(uid); if (userKeys == null) { return; } UserKeys updatedUserKeys = userKeys.removeUserKeyGroup(keyGroupId); ...
couchbase/java-dcp-client
src/main/java/com/couchbase/client/dcp/Client.java
Client.startStreaming
public Completable startStreaming(Short... vbids) { int numPartitions = numPartitions(); final List<Short> partitions = partitionsForVbids(numPartitions, vbids); List<Short> initializedPartitions = selectInitializedPartitions(numPartitions, partitions); if (initializedPartitions.isEmpty()) { LOGG...
java
public Completable startStreaming(Short... vbids) { int numPartitions = numPartitions(); final List<Short> partitions = partitionsForVbids(numPartitions, vbids); List<Short> initializedPartitions = selectInitializedPartitions(numPartitions, partitions); if (initializedPartitions.isEmpty()) { LOGG...
[ "public", "Completable", "startStreaming", "(", "Short", "...", "vbids", ")", "{", "int", "numPartitions", "=", "numPartitions", "(", ")", ";", "final", "List", "<", "Short", ">", "partitions", "=", "partitionsForVbids", "(", "numPartitions", ",", "vbids", ")"...
Start DCP streams based on the initialized state for the given partition IDs (vbids). <p> If no ids are provided, all initialized partitions will be started. @param vbids the partition ids (0-indexed) to start streaming for. @return a {@link Completable} indicating that streaming has started or failed.
[ "Start", "DCP", "streams", "based", "on", "the", "initialized", "state", "for", "the", "given", "partition", "IDs", "(", "vbids", ")", ".", "<p", ">", "If", "no", "ids", "are", "provided", "all", "initialized", "partitions", "will", "be", "started", "." ]
75359d8c081d6c575f8087cf7c28d24ab24c6421
https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/Client.java#L367-L407
train
Start streaming for the specified VBIDs.
Of course, here is the Java code you requested: ```java public Completable startStreaming(Short... vbids) { int numPartitions = numPartitions(); final List<Short> partitions = partitionsForVbids(numPartitions, vbids); List<Short> initializedPartitions = selectInitializedPartitions(numPartitions, partition...
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/ltc/impl/LocalTranCoordImpl.java
LocalTranCoordImpl.getComponentMetadataForLTC
protected void getComponentMetadataForLTC() { if (_deferredConfig) { if (tc.isEntryEnabled()) Tr.entry(tc, "getComponentMetadataForLTC"); _deferredConfig = false; if (tc.isEntryEnabled()) Tr.exit(tc, "getComponentMetadataForLTC"); } }
java
protected void getComponentMetadataForLTC() { if (_deferredConfig) { if (tc.isEntryEnabled()) Tr.entry(tc, "getComponentMetadataForLTC"); _deferredConfig = false; if (tc.isEntryEnabled()) Tr.exit(tc, "getComponentMetadataForLTC"); } }
[ "protected", "void", "getComponentMetadataForLTC", "(", ")", "{", "if", "(", "_deferredConfig", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"getComponentMetadataForLTC\"", ")", ";", "_deferredConfig", ...
Complete the deferred LTC start by retrieving the remaining LTC config from component metadata
[ "Complete", "the", "deferred", "LTC", "start", "by", "retrieving", "the", "remaining", "LTC", "config", "from", "component", "metadata" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/ltc/impl/LocalTranCoordImpl.java#L1533-L1541
train
Method getComponentMetadataForLTC.
Of course, here is the Java code you requested: ```java protected void getComponentMetadataForLTC() { if (_deferredConfig) { if (tc.isEntryEnabled()) Tr.entry(tc, "getComponentMetadataForLTC"); _deferredConfig = false; if (tc.isEntryEnabled()) Tr.exit(tc, "getCom...
Unidata/thredds
dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java
HttpDSP.getCapabilities
public String getCapabilities(String url) throws IOException { // Save the original url String saveurl = this.xuri.getOriginal(); parseURL(url); String fdsurl = buildURL(this.xuri.assemble(XURI.URLALL), DSRSUFFIX, null, null); try { // Make the req...
java
public String getCapabilities(String url) throws IOException { // Save the original url String saveurl = this.xuri.getOriginal(); parseURL(url); String fdsurl = buildURL(this.xuri.assemble(XURI.URLALL), DSRSUFFIX, null, null); try { // Make the req...
[ "public", "String", "getCapabilities", "(", "String", "url", ")", "throws", "IOException", "{", "// Save the original url", "String", "saveurl", "=", "this", ".", "xuri", ".", "getOriginal", "(", ")", ";", "parseURL", "(", "url", ")", ";", "String", "fdsurl", ...
Provide a method for getting the capabilities document. @param url for accessing the document @throws DapException
[ "Provide", "a", "method", "for", "getting", "the", "capabilities", "document", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java#L295-L314
test
Get the content of a CIS SECTYPE from a URL.
Of course, here is the Java code you requested: ```java public String getCapabilities(String url) throws IOException { // Save the original url String saveurl = this.xuri.getOriginal(); parseURL(url); String fdsurl = buildURL(this.xuri.assemble(XURI.URLALL), DSRSUFFI...
neoremind/navi
navi-mgr-console/src/main/java/com/baidu/beidou/navimgr/util/CookieUtils.java
CookieUtils.resetCookieValue
public static void resetCookieValue(HttpServletResponse response, String cookieName) { Cookie cookie = new Cookie(cookieName, null); cookie.setMaxAge(0); response.addCookie(cookie); }
java
public static void resetCookieValue(HttpServletResponse response, String cookieName) { Cookie cookie = new Cookie(cookieName, null); cookie.setMaxAge(0); response.addCookie(cookie); }
[ "public", "static", "void", "resetCookieValue", "(", "HttpServletResponse", "response", ",", "String", "cookieName", ")", "{", "Cookie", "cookie", "=", "new", "Cookie", "(", "cookieName", ",", "null", ")", ";", "cookie", ".", "setMaxAge", "(", "0", ")", ";",...
清除cookie @param response 返回response @param cookieName cookie名
[ "清除cookie" ]
d37e4b46ef07d124be2740ad3d85d87e939acc84
https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi-mgr-console/src/main/java/com/baidu/beidou/navimgr/util/CookieUtils.java#L46-L50
train
Reset the value of a cookie in the response.
Of course, here is the Java code you requested: ```java public static void resetCookieValue(HttpServletResponse response, String cookieName) { Cookie cookie = new Cookie(cookieName, null); cookie.setMaxAge(0); response.addCookie(cookie); } ``` Hope this helps!
eiichiro/bootleg
src/main/java/org/eiichiro/bootleg/BootlegFilter.java
BootlegFilter.configuration
protected Configuration configuration(FilterConfig config) throws ServletException { ServletContext context = config.getServletContext(); String clazz = context.getInitParameter(CONFIGURATION); Configuration configuration = null; if (clazz != null) { try { configuration = (Configuration) Class.forName...
java
protected Configuration configuration(FilterConfig config) throws ServletException { ServletContext context = config.getServletContext(); String clazz = context.getInitParameter(CONFIGURATION); Configuration configuration = null; if (clazz != null) { try { configuration = (Configuration) Class.forName...
[ "protected", "Configuration", "configuration", "(", "FilterConfig", "config", ")", "throws", "ServletException", "{", "ServletContext", "context", "=", "config", ".", "getServletContext", "(", ")", ";", "String", "clazz", "=", "context", ".", "getInitParameter", "("...
Constructs the {@code Configuration}. This method attempts to get custom configuration class from {@code ServletContext} init parameter and instantiate and initialize it. If the custom configuration class has not been specified as the {@code ServletContext} init parameter, this method returns <code>null</code>. @param...
[ "Constructs", "the", "{", "@code", "Configuration", "}", ".", "This", "method", "attempts", "to", "get", "custom", "configuration", "class", "from", "{", "@code", "ServletContext", "}", "init", "parameter", "and", "instantiate", "and", "initialize", "it", ".", ...
b98a108500597cb6185056be2eef7de5ba1963d2
https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/BootlegFilter.java#L136-L153
test
Loads the configuration from the servlet context.
Of course, here is the Java code you requested: ```java protected Configuration configuration(FilterConfig config) throws ServletException { ServletContext context = config.getServletContext(); String clazz = context.getInitParameter(CONFIGURATION); Configuration configuration = null; if (clazz != null) { ...
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Dictionary.java
Dictionary.getDouble
@Override public double getDouble(@NonNull String key) { if (key == null) { throw new IllegalArgumentException("key cannot be null."); } synchronized (lock) { return CBLConverter.asDouble(getMValue(internalDict, key), internalDict); } }
java
@Override public double getDouble(@NonNull String key) { if (key == null) { throw new IllegalArgumentException("key cannot be null."); } synchronized (lock) { return CBLConverter.asDouble(getMValue(internalDict, key), internalDict); } }
[ "@", "Override", "public", "double", "getDouble", "(", "@", "NonNull", "String", "key", ")", "{", "if", "(", "key", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"key cannot be null.\"", ")", ";", "}", "synchronized", "(", "lock"...
Gets a property's value as an double. Integers will be converted to double. The value `true` is returned as 1.0, `false` as 0.0. Returns 0.0 if the property doesn't exist or does not have a numeric value. @param key the key @return the double value.
[ "Gets", "a", "property", "s", "value", "as", "an", "double", ".", "Integers", "will", "be", "converted", "to", "double", ".", "The", "value", "true", "is", "returned", "as", "1", ".", "0", "false", "as", "0", ".", "0", ".", "Returns", "0", ".", "0"...
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Dictionary.java#L214-L221
train
Gets a double value from the CBL object.
Of course, here is the Java code you requested: ```java @Override public double getDouble(@NonNull String key) { if (key == null) { throw new IllegalArgumentException("key cannot be null."); } synchronized (lock) { return CBLConverter.asDouble(getMValue(internalDict, key), internalDict...
phax/ph-genericode
src/main/java/com/helger/genericode/excel/ExcelReadOptions.java
ExcelReadOptions.addColumn
@Nonnull public ExcelReadOptions <USE_TYPE> addColumn (@Nonnegative final int nIndex, @Nonnull @Nonempty final String sColumnID, @Nonnull final USE_TYPE eUseType, @Nonnull @N...
java
@Nonnull public ExcelReadOptions <USE_TYPE> addColumn (@Nonnegative final int nIndex, @Nonnull @Nonempty final String sColumnID, @Nonnull final USE_TYPE eUseType, @Nonnull @N...
[ "@", "Nonnull", "public", "ExcelReadOptions", "<", "USE_TYPE", ">", "addColumn", "(", "@", "Nonnegative", "final", "int", "nIndex", ",", "@", "Nonnull", "@", "Nonempty", "final", "String", "sColumnID", ",", "@", "Nonnull", "final", "USE_TYPE", "eUseType", ",",...
Add a single column definition. @param nIndex The 0-based index of the column in Excel. @param sColumnID The ID of the column in Genericode. @param eUseType Optional or required? @param sDataType The XSD data type to be used in Genericode. Use "string" if you're unsure. @param bKeyColumn <code>true</code> if this is a...
[ "Add", "a", "single", "column", "definition", "." ]
76ef5bb0744af42bd3decd41c2bf0829c87ae71d
https://github.com/phax/ph-genericode/blob/76ef5bb0744af42bd3decd41c2bf0829c87ae71d/src/main/java/com/helger/genericode/excel/ExcelReadOptions.java#L133-L147
test
Add a new column to the read options.
Of course, here is the Java code you requested: ```java @Nonnull public ExcelReadOptions <USE_TYPE> addColumn (@Nonnegative final int nIndex, @Nonnull @Nonempty final String sColumnID, @Nonnull final USE_TYPE eUseType, ...
diirt/util
src/main/java/org/epics/util/time/Timestamp.java
Timestamp.createWithCarry
private static Timestamp createWithCarry(long seconds, long nanos) { if (nanos > 999999999) { seconds = seconds + nanos / 1000000000; nanos = nanos % 1000000000; } if (nanos < 0) { long pastSec = nanos / 1000000000; pastSec--; ...
java
private static Timestamp createWithCarry(long seconds, long nanos) { if (nanos > 999999999) { seconds = seconds + nanos / 1000000000; nanos = nanos % 1000000000; } if (nanos < 0) { long pastSec = nanos / 1000000000; pastSec--; ...
[ "private", "static", "Timestamp", "createWithCarry", "(", "long", "seconds", ",", "long", "nanos", ")", "{", "if", "(", "nanos", ">", "999999999", ")", "{", "seconds", "=", "seconds", "+", "nanos", "/", "1000000000", ";", "nanos", "=", "nanos", "%", "100...
Creates a new time stamp by carrying nanosecs into seconds if necessary. @param seconds new seconds @param ofNanos new nanoseconds (can be the whole long range) @return the new timestamp
[ "Creates", "a", "new", "time", "stamp", "by", "carrying", "nanosecs", "into", "seconds", "if", "necessary", "." ]
24aca0a173a635aaf0b78d213a3fee8d4f91c077
https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/time/Timestamp.java#L173-L187
train
Creates a Timestamp object with the specified seconds and nanos.
Of course, here is the Java code you requested: ```java private static Timestamp createWithCarry(long seconds, long nanos) { if (nanos > 999999999) { seconds = seconds + nanos / 1000000000; nanos = nanos % 1000000000; } if (nanos < 0) { long pastSec =...
cdk/cdk
base/core/src/main/java/org/openscience/cdk/ringsearch/RegularCyclicVertexSearch.java
RegularCyclicVertexSearch.cyclic
@Override public boolean cyclic(int u, int v) { final int[] colors = vertexColor(); // if either vertex has no color then the edge can not // be cyclic if (colors[u] < 0 || colors[v] < 0) return false; // if the vertex color is 0 it is shared between // two compone...
java
@Override public boolean cyclic(int u, int v) { final int[] colors = vertexColor(); // if either vertex has no color then the edge can not // be cyclic if (colors[u] < 0 || colors[v] < 0) return false; // if the vertex color is 0 it is shared between // two compone...
[ "@", "Override", "public", "boolean", "cyclic", "(", "int", "u", ",", "int", "v", ")", "{", "final", "int", "[", "]", "colors", "=", "vertexColor", "(", ")", ";", "// if either vertex has no color then the edge can not", "// be cyclic", "if", "(", "colors", "[...
{@inheritDoc}
[ "{" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/ringsearch/RegularCyclicVertexSearch.java#L289-L314
train
Check if the edge is cyclic between two vertex colors.
Of course, here is the Java code you requested: ```java @Override public boolean cyclic(int u, int v) { final int[] colors = vertexColor(); // if either vertex has no color then the edge can not // be cyclic if (colors[u] < 0 || colors[v] < 0) return false; // if the vert...
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/auth/NoAuthService.java
NoAuthService.getUser
@Override public PrincipalUser getUser(String username, String password) { requireNotDisposed(); PrincipalUser result = _userService.findUserByUsername(username); String isPrivileged= _config.getValue(Property.IS_PRIVILEGED.getName(), Property.IS_PRIVILEGED.getDefaultValue()); if(result == null){ result =...
java
@Override public PrincipalUser getUser(String username, String password) { requireNotDisposed(); PrincipalUser result = _userService.findUserByUsername(username); String isPrivileged= _config.getValue(Property.IS_PRIVILEGED.getName(), Property.IS_PRIVILEGED.getDefaultValue()); if(result == null){ result =...
[ "@", "Override", "public", "PrincipalUser", "getUser", "(", "String", "username", ",", "String", "password", ")", "{", "requireNotDisposed", "(", ")", ";", "PrincipalUser", "result", "=", "_userService", ".", "findUserByUsername", "(", "username", ")", ";", "Str...
~ Methods **************************************************************************************************************************************
[ "~", "Methods", "**************************************************************************************************************************************" ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/auth/NoAuthService.java#L47-L74
train
Returns a user object.
Of course, here is the Java code you requested: ```java @Override public PrincipalUser getUser(String username, String password) { requireNotDisposed(); PrincipalUser result = _userService.findUserByUsername(username); String isPrivileged= _config.getValue(Property.IS_PRIVILEGED.getName(), Property.IS_PRIVILEG...
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.skipLast
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipLast(int count) { if (count < 0) { throw new IndexOutOfBoundsException("count >= 0 required but it was " + count); } if (count == 0) { ...
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipLast(int count) { if (count < 0) { throw new IndexOutOfBoundsException("count >= 0 required but it was " + count); } if (count == 0) { ...
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "T", ">", "skipLast", "(", "int", "count", ")", "{", "if", ...
Returns a Flowable that drops a specified number of items from the end of the sequence emitted by the source Publisher. <p> <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipLast.png" alt=""> <p> This Subscriber accumulates a queue long enough to store the first {@c...
[ "Returns", "a", "Flowable", "that", "drops", "a", "specified", "number", "of", "items", "from", "the", "end", "of", "the", "sequence", "emitted", "by", "the", "source", "Publisher", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "305", "src"...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L14178-L14189
test
Skip the last count items from the stream.
Of course, here is the Java code you requested: ```java @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> skipLast(int count) { if (count < 0) { throw new IndexOutOfBoundsException("count >= 0 required but it ...
javers/javers
javers-core/src/main/java/org/javers/common/collections/Sets.java
Sets.difference
public static <E> Collection<E> difference(Set<E> first, Set<E> second, Function<E, Integer> hasher) { if (first == null || first.size() == 0) { return Collections.emptyList(); } if (second == null || second.size() == 0) { return first; } Map<Integer, E>...
java
public static <E> Collection<E> difference(Set<E> first, Set<E> second, Function<E, Integer> hasher) { if (first == null || first.size() == 0) { return Collections.emptyList(); } if (second == null || second.size() == 0) { return first; } Map<Integer, E>...
[ "public", "static", "<", "E", ">", "Collection", "<", "E", ">", "difference", "(", "Set", "<", "E", ">", "first", ",", "Set", "<", "E", ">", "second", ",", "Function", "<", "E", ",", "Integer", ">", "hasher", ")", "{", "if", "(", "first", "==", ...
null args are allowed
[ "null", "args", "are", "allowed" ]
a51511be7d8bcee3e1812db8b7e69a45330b4e14
https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/common/collections/Sets.java#L75-L90
train
Returns the difference of two sets of elements.
Of course, here is the Java code you requested: ```java public static <E> Collection<E> difference(Set<E> first, Set<E> second, Function<E, Integer> hasher) { if (first == null || first.size() == 0) { return Collections.emptyList(); } if (second == null || second.size() == 0) { ...
aws/aws-sdk-java
aws-java-sdk-storagegateway/src/main/java/com/amazonaws/services/storagegateway/model/transform/StartGatewayRequestMarshaller.java
StartGatewayRequestMarshaller.marshall
public void marshall(StartGatewayRequest startGatewayRequest, ProtocolMarshaller protocolMarshaller) { if (startGatewayRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(startGatewayRequest.ge...
java
public void marshall(StartGatewayRequest startGatewayRequest, ProtocolMarshaller protocolMarshaller) { if (startGatewayRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(startGatewayRequest.ge...
[ "public", "void", "marshall", "(", "StartGatewayRequest", "startGatewayRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "startGatewayRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to m...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-storagegateway/src/main/java/com/amazonaws/services/storagegateway/model/transform/StartGatewayRequestMarshaller.java#L42-L53
train
marshalls the given startGatewayRequest to the JSON - compatible parameter object.
Of course, here is the Java code you requested: ```java public void marshall(StartGatewayRequest startGatewayRequest, ProtocolMarshaller protocolMarshaller) { if (startGatewayRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiff.java
CoverageDataTiff.drawTileData
@Override public byte[] drawTileData(GriddedTile griddedTile, Double[] values, int tileWidth, int tileHeight) { CoverageDataTiffImage image = drawTile(griddedTile, values, tileWidth, tileHeight); byte[] bytes = image.getImageBytes(); return byte...
java
@Override public byte[] drawTileData(GriddedTile griddedTile, Double[] values, int tileWidth, int tileHeight) { CoverageDataTiffImage image = drawTile(griddedTile, values, tileWidth, tileHeight); byte[] bytes = image.getImageBytes(); return byte...
[ "@", "Override", "public", "byte", "[", "]", "drawTileData", "(", "GriddedTile", "griddedTile", ",", "Double", "[", "]", "values", ",", "int", "tileWidth", ",", "int", "tileHeight", ")", "{", "CoverageDataTiffImage", "image", "=", "drawTile", "(", "griddedTile...
{@inheritDoc}
[ "{" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiff.java#L309-L316
test
Draw a coverage data tile.
Of course, here is the Java code you requested: ```java @Override public byte[] drawTileData(GriddedTile griddedTile, Double[] values, int tileWidth, int tileHeight) { CoverageDataTiffImage image = drawTile(griddedTile, values, tileWidth, tileHeight); ...
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java
ResultIterator.getEntity
private E getEntity(Object entity) { return (E) (entity.getClass().isAssignableFrom(EnhanceEntity.class) ? ((EnhanceEntity) entity).getEntity() : entity); }
java
private E getEntity(Object entity) { return (E) (entity.getClass().isAssignableFrom(EnhanceEntity.class) ? ((EnhanceEntity) entity).getEntity() : entity); }
[ "private", "E", "getEntity", "(", "Object", "entity", ")", "{", "return", "(", "E", ")", "(", "entity", ".", "getClass", "(", ")", ".", "isAssignableFrom", "(", "EnhanceEntity", ".", "class", ")", "?", "(", "(", "EnhanceEntity", ")", "entity", ")", "."...
Extract wrapped entity object from enhanced entity. @param entity enhanced entity. @return returns extracted instance of E.
[ "Extract", "wrapped", "entity", "object", "from", "enhanced", "entity", "." ]
268958ab1ec09d14ec4d9184f0c8ded7a9158908
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L663-L667
train
Get the entity from the entity object.
Of course, here is the Java code you requested: ```java private E getEntity(Object entity) { return (E) (entity.getClass().isAssignableFrom(EnhanceEntity.class) ? ((EnhanceEntity) entity).getEntity() : entity); } ``` Hope this helps!
james-hu/jabb-core
src/main/java/net/sf/jabb/util/text/RegExpSubstitution.java
RegExpSubstitution.replace
protected String replace(CharSequence text, boolean firstOnly){ StringBuilder sb = new StringBuilder(); AutomatonMatcher am = runAutomation.newMatcher(text); int lastEnd = 0; while (am.find() && (firstOnly == false || lastEnd == 0)){ sb.append(text, lastEnd, am.start()); lastEnd = am.end(); sb.a...
java
protected String replace(CharSequence text, boolean firstOnly){ StringBuilder sb = new StringBuilder(); AutomatonMatcher am = runAutomation.newMatcher(text); int lastEnd = 0; while (am.find() && (firstOnly == false || lastEnd == 0)){ sb.append(text, lastEnd, am.start()); lastEnd = am.end(); sb.a...
[ "protected", "String", "replace", "(", "CharSequence", "text", ",", "boolean", "firstOnly", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "AutomatonMatcher", "am", "=", "runAutomation", ".", "newMatcher", "(", "text", ")", ";", ...
Do replacement.<br> 进行替换。 @param text The original String.<br>替换前的原始字符串。 @param firstOnly If true, then only do replacement upon the first occurrence; otherwise, replace in all the occurrences.<br> 如果为true则只替换第一个出现的地方,否则全部替换。 @return The String after substitution; If no match found, the same String as the input one ...
[ "Do", "replacement", ".", "<br", ">", "进行替换。" ]
bceed441595c5e5195a7418795f03b69fa7b61e4
https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/text/RegExpSubstitution.java#L118-L129
train
Replaces all occurrences of the entity in the text with the replacement.
Of course, here is the Java code you requested: ```java protected String replace(CharSequence text, boolean firstOnly){ StringBuilder sb = new StringBuilder(); AutomatonMatcher am = runAutomation.newMatcher(text); int lastEnd = 0; while (am.find() && (firstOnly == false || lastEnd == 0)){ sb.append(tex...
magro/memcached-session-manager
core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java
MemcachedSessionService.changeSessionIdOnMemcachedFailover
public String changeSessionIdOnMemcachedFailover( final String requestedSessionId ) { if ( !_memcachedNodesManager.isEncodeNodeIdInSessionId() ) { return null; } try { if ( _sticky ) { /* We can just lookup the session in the local session map, as we wouldn't get ...
java
public String changeSessionIdOnMemcachedFailover( final String requestedSessionId ) { if ( !_memcachedNodesManager.isEncodeNodeIdInSessionId() ) { return null; } try { if ( _sticky ) { /* We can just lookup the session in the local session map, as we wouldn't get ...
[ "public", "String", "changeSessionIdOnMemcachedFailover", "(", "final", "String", "requestedSessionId", ")", "{", "if", "(", "!", "_memcachedNodesManager", ".", "isEncodeNodeIdInSessionId", "(", ")", ")", "{", "return", "null", ";", "}", "try", "{", "if", "(", "...
Check if the valid session associated with the provided requested session Id will be relocated with the next {@link #backupSession(Session, boolean)} and change the session id to the new one (containing the new memcached node). The new session id must be returned if the session will be relocated and the id was changed....
[ "Check", "if", "the", "valid", "session", "associated", "with", "the", "provided", "requested", "session", "Id", "will", "be", "relocated", "with", "the", "next", "{", "@link", "#backupSession", "(", "Session", "boolean", ")", "}", "and", "change", "the", "s...
716e147c9840ab10298c4d2b9edd0662058331e6
https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java#L886-L932
train
Change the session id on memcached failover.
Of course, here is the Java code you requested: ```java public String changeSessionIdOnMemcachedFailover( final String requestedSessionId ) { if ( !_memcachedNodesManager.isEncodeNodeIdInSessionId() ) { return null; } try { if ( _sticky ) { /* We can just lookup th...
FXMisc/RichTextFX
richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/richtext/RichTextDemo.java
RichTextDemo.insertImage
private void insertImage() { String initialDir = System.getProperty("user.dir"); FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Insert image"); fileChooser.setInitialDirectory(new File(initialDir)); File selectedFile = fileChooser.showOpenDialog(mainStage); ...
java
private void insertImage() { String initialDir = System.getProperty("user.dir"); FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Insert image"); fileChooser.setInitialDirectory(new File(initialDir)); File selectedFile = fileChooser.showOpenDialog(mainStage); ...
[ "private", "void", "insertImage", "(", ")", "{", "String", "initialDir", "=", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ";", "FileChooser", "fileChooser", "=", "new", "FileChooser", "(", ")", ";", "fileChooser", ".", "setTitle", "(", "\"Insert im...
Action listener which inserts a new image at the current caret position.
[ "Action", "listener", "which", "inserts", "a", "new", "image", "at", "the", "current", "caret", "position", "." ]
bc7cab6a637855e0f37d9b9c12a9172c31545f0b
https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/richtext/RichTextDemo.java#L452-L466
train
Insert image in the area.
Of course, here is the Java code you requested: ```java private void insertImage() { String initialDir = System.getProperty("user.dir"); FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Insert image"); fileChooser.setInitialDirectory(new File(initialDir)); File...
sannies/mp4parser
isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/TimeToSampleBox.java
TimeToSampleBox.blowupTimeToSamples
public static synchronized long[] blowupTimeToSamples(List<TimeToSampleBox.Entry> entries) { SoftReference<long[]> cacheEntry; if ((cacheEntry = cache.get(entries)) != null) { long[] cacheVal; if ((cacheVal = cacheEntry.get()) != null) { return cacheVal; ...
java
public static synchronized long[] blowupTimeToSamples(List<TimeToSampleBox.Entry> entries) { SoftReference<long[]> cacheEntry; if ((cacheEntry = cache.get(entries)) != null) { long[] cacheVal; if ((cacheVal = cacheEntry.get()) != null) { return cacheVal; ...
[ "public", "static", "synchronized", "long", "[", "]", "blowupTimeToSamples", "(", "List", "<", "TimeToSampleBox", ".", "Entry", ">", "entries", ")", "{", "SoftReference", "<", "long", "[", "]", ">", "cacheEntry", ";", "if", "(", "(", "cacheEntry", "=", "ca...
Decompresses the list of entries and returns the list of decoding times. @param entries compressed entries @return decoding time per sample
[ "Decompresses", "the", "list", "of", "entries", "and", "returns", "the", "list", "of", "decoding", "times", "." ]
3382ff5d489363900f352a8da0f794a20ad3b063
https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/isoparser/src/main/java/org/mp4parser/boxes/iso14496/part12/TimeToSampleBox.java#L58-L83
train
Blow up the list of time to samples.
Of course, here is the Java code you requested: ```java public static synchronized long[] blowupTimeToSamples(List<TimeToSampleBox.Entry> entries) { SoftReference<long[]> cacheEntry; if ((cacheEntry = cache.get(entries)) != null) { long[] cacheVal; if ((cacheVal = cacheEntry.get...
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.getResultAndReset
public ItemsSketch<T> getResultAndReset() { if (gadget_ == null) { return null; } //Intentionally return null here for speed. final ItemsSketch<T> hqs = gadget_; gadget_ = null; return hqs; }
java
public ItemsSketch<T> getResultAndReset() { if (gadget_ == null) { return null; } //Intentionally return null here for speed. final ItemsSketch<T> hqs = gadget_; gadget_ = null; return hqs; }
[ "public", "ItemsSketch", "<", "T", ">", "getResultAndReset", "(", ")", "{", "if", "(", "gadget_", "==", "null", ")", "{", "return", "null", ";", "}", "//Intentionally return null here for speed.", "final", "ItemsSketch", "<", "T", ">", "hqs", "=", "gadget_", ...
Gets the result of this Union operation (without a copy) and resets this Union to the virgin state. @return the result of this Union operation and reset.
[ "Gets", "the", "result", "of", "this", "Union", "operation", "(", "without", "a", "copy", ")", "and", "resets", "this", "Union", "to", "the", "virgin", "state", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L151-L156
train
Returns the result of this sketch and resets the internal state.
Of course, here is the Java code you requested: ```java public ItemsSketch<T> getResultAndReset() { if (gadget_ == null) { return null; } //Intentionally return null here for speed. final ItemsSketch<T> hqs = gadget_; gadget_ = null; return hqs; } ``` Hope this helps!
eclipse/xtext-extras
org.eclipse.xtext.purexbase/src-gen/org/eclipse/xtext/purexbase/parser/antlr/internal/InternalPureXbaseParser.java
InternalPureXbaseParser.entryRuleOpAnd
public final String entryRuleOpAnd() throws RecognitionException { String current = null; AntlrDatatypeRuleToken iv_ruleOpAnd = null; try { // InternalPureXbase.g:1206:45: (iv_ruleOpAnd= ruleOpAnd EOF ) // InternalPureXbase.g:1207:2: iv_ruleOpAnd= ruleOpAnd EOF ...
java
public final String entryRuleOpAnd() throws RecognitionException { String current = null; AntlrDatatypeRuleToken iv_ruleOpAnd = null; try { // InternalPureXbase.g:1206:45: (iv_ruleOpAnd= ruleOpAnd EOF ) // InternalPureXbase.g:1207:2: iv_ruleOpAnd= ruleOpAnd EOF ...
[ "public", "final", "String", "entryRuleOpAnd", "(", ")", "throws", "RecognitionException", "{", "String", "current", "=", "null", ";", "AntlrDatatypeRuleToken", "iv_ruleOpAnd", "=", "null", ";", "try", "{", "// InternalPureXbase.g:1206:45: (iv_ruleOpAnd= ruleOpAnd EOF )", ...
InternalPureXbase.g:1206:1: entryRuleOpAnd returns [String current=null] : iv_ruleOpAnd= ruleOpAnd EOF ;
[ "InternalPureXbase", ".", "g", ":", "1206", ":", "1", ":", "entryRuleOpAnd", "returns", "[", "String", "current", "=", "null", "]", ":", "iv_ruleOpAnd", "=", "ruleOpAnd", "EOF", ";" ]
451359541295323a29f5855e633f770cec02069a
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.purexbase/src-gen/org/eclipse/xtext/purexbase/parser/antlr/internal/InternalPureXbaseParser.java#L3457-L3491
train
Use this method to match a ruleOpAnd input.
Of course, here is the Java code you requested: ```java public final String entryRuleOpAnd() throws RecognitionException { String current = null; AntlrDatatypeRuleToken iv_ruleOpAnd = null; try { // InternalPureXbase.g:1206:45: (iv_ruleOpAnd= ruleOpAnd EOF ) // Intern...
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java
TimePickerDialog.processKeyUp
private boolean processKeyUp(int keyCode) { if (keyCode == KeyEvent.KEYCODE_TAB) { if(mInKbMode) { if (isTypedTimeFullyLegal()) { finishKbMode(true); } return true; } } else if (keyCode == KeyEvent.KEYCODE_ENTER)...
java
private boolean processKeyUp(int keyCode) { if (keyCode == KeyEvent.KEYCODE_TAB) { if(mInKbMode) { if (isTypedTimeFullyLegal()) { finishKbMode(true); } return true; } } else if (keyCode == KeyEvent.KEYCODE_ENTER)...
[ "private", "boolean", "processKeyUp", "(", "int", "keyCode", ")", "{", "if", "(", "keyCode", "==", "KeyEvent", ".", "KEYCODE_TAB", ")", "{", "if", "(", "mInKbMode", ")", "{", "if", "(", "isTypedTimeFullyLegal", "(", ")", ")", "{", "finishKbMode", "(", "t...
For keyboard mode, processes key events. @param keyCode the pressed key. @return true if the key was successfully processed, false otherwise.
[ "For", "keyboard", "mode", "processes", "key", "events", "." ]
0a8fe28f19db4f5a5a6cfc525a852416232873a8
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/TimePickerDialog.java#L1287-L1349
train
Process key up.
Of course, here is the Java code you requested: ```java private boolean processKeyUp(int keyCode) { if (keyCode == KeyEvent.KEYCODE_TAB) { if(mInKbMode) { if (isTypedTimeFullyLegal()) { finishKbMode(true); } return true; ...
PureSolTechnologies/graphs
graph/src/main/java/com/puresoltechnologies/graphs/graph/CycleAnalyzer.java
CycleAnalyzer.hasCycles
public static <V extends Vertex<V, E>, E extends Edge<V, E>> boolean hasCycles( Graph<V, E> graph, V startVertex, boolean directed) throws IllegalArgumentException { requireNonNull(graph, "The given start vertex is null"); requireNonNull(startVertex, "The given start vertex is null"); if (!graph.getVertices...
java
public static <V extends Vertex<V, E>, E extends Edge<V, E>> boolean hasCycles( Graph<V, E> graph, V startVertex, boolean directed) throws IllegalArgumentException { requireNonNull(graph, "The given start vertex is null"); requireNonNull(startVertex, "The given start vertex is null"); if (!graph.getVertices...
[ "public", "static", "<", "V", "extends", "Vertex", "<", "V", ",", "E", ">", ",", "E", "extends", "Edge", "<", "V", ",", "E", ">", ">", "boolean", "hasCycles", "(", "Graph", "<", "V", ",", "E", ">", "graph", ",", "V", "startVertex", ",", "boolean"...
This method searches a given {@link Graph} for cycles. This method is different to {@link #hasCycles(Graph, boolean)}, because here it is started at a dedicated vertex and only vertices are checked for cycles which are connected to this start vertex. If disconnected subgraphs exist, these are not checked. @param <V> i...
[ "This", "method", "searches", "a", "given", "{", "@link", "Graph", "}", "for", "cycles", ".", "This", "method", "is", "different", "to", "{", "@link", "#hasCycles", "(", "Graph", "boolean", ")", "}", "because", "here", "it", "is", "started", "at", "a", ...
35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1
https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/graph/src/main/java/com/puresoltechnologies/graphs/graph/CycleAnalyzer.java#L104-L116
train
Checks if the given graph contains cycles between the given start vertex.
Of course, here is the Java code you requested: ```java public static <V extends Vertex<V, E>, E extends Edge<V, E>> boolean hasCycles( Graph<V, E> graph, V startVertex, boolean directed) throws IllegalArgumentException { requireNonNull(graph, "The given start vertex is null"); requireNonNull(startVertex, "T...
lastaflute/lastaflute
src/main/java/org/lastaflute/web/aspect/RomanticActionCustomizer.java
RomanticActionCustomizer.createActionMapping
protected ActionMapping createActionMapping(ComponentDef actionDef) { final String actionName = buildActionName(actionDef); verifyPackageConvention(actionDef, actionName); final ActionMapping mapping = newActionMapping(actionDef, actionName, comeOnAdjustmentProvider()); setupMethod(mappi...
java
protected ActionMapping createActionMapping(ComponentDef actionDef) { final String actionName = buildActionName(actionDef); verifyPackageConvention(actionDef, actionName); final ActionMapping mapping = newActionMapping(actionDef, actionName, comeOnAdjustmentProvider()); setupMethod(mappi...
[ "protected", "ActionMapping", "createActionMapping", "(", "ComponentDef", "actionDef", ")", "{", "final", "String", "actionName", "=", "buildActionName", "(", "actionDef", ")", ";", "verifyPackageConvention", "(", "actionDef", ",", "actionName", ")", ";", "final", "...
==============
[ "==============" ]
17b56dda8322e4c6d79043532c1dda917d6b60a8
https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/aspect/RomanticActionCustomizer.java#L58-L64
train
Create an action mapping.
Of course, here is the Java code you requested: ```java protected ActionMapping createActionMapping(ComponentDef actionDef) { final String actionName = buildActionName(actionDef); verifyPackageConvention(actionDef, actionName); final ActionMapping mapping = newActionMapping(actionDef, actionNam...
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/TagUtils.java
TagUtils.parseNameTokens
static public String[] parseNameTokens(String stringValue) { if (stringValue == null) { return null; } ArrayList<String> list = new ArrayList<String>(5); int length = stringValue.length(); boolean inSpace = true; int start = 0; for (int i = 0; i < length; i++) { ...
java
static public String[] parseNameTokens(String stringValue) { if (stringValue == null) { return null; } ArrayList<String> list = new ArrayList<String>(5); int length = stringValue.length(); boolean inSpace = true; int start = 0; for (int i = 0; i < length; i++) { ...
[ "static", "public", "String", "[", "]", "parseNameTokens", "(", "String", "stringValue", ")", "{", "if", "(", "stringValue", "==", "null", ")", "{", "return", "null", ";", "}", "ArrayList", "<", "String", ">", "list", "=", "new", "ArrayList", "<", "Strin...
Parses a whitespace separated series of name tokens. @param stringValue the full string @return an array of each constituent value, or null if there are no tokens (that is, the string is empty or all whitespace)
[ "Parses", "a", "whitespace", "separated", "series", "of", "name", "tokens", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/TagUtils.java#L318-L371
train
Parse a string of name tokens.
Of course, here is the Java code you requested: ```java static public String[] parseNameTokens(String stringValue) { if (stringValue == null) { return null; } ArrayList<String> list = new ArrayList<String>(5); int length = stringValue.length(); boolean inSpace = true; int ...
jaxio/celerio
celerio-engine/src/main/java/com/jaxio/celerio/util/support/AbstractListHolder.java
AbstractListHolder.except
public SimpleListHolder<T> except(String... namesToExclude) { String key = "current" + getCacheKey(namesToExclude); SimpleListHolder<T> result = cache.get(key); if (result == null) { result = new SimpleListHolder<T>(getIterable(), asNameNotEqualsToPredicates(namesToExclude), getSortP...
java
public SimpleListHolder<T> except(String... namesToExclude) { String key = "current" + getCacheKey(namesToExclude); SimpleListHolder<T> result = cache.get(key); if (result == null) { result = new SimpleListHolder<T>(getIterable(), asNameNotEqualsToPredicates(namesToExclude), getSortP...
[ "public", "SimpleListHolder", "<", "T", ">", "except", "(", "String", "...", "namesToExclude", ")", "{", "String", "key", "=", "\"current\"", "+", "getCacheKey", "(", "namesToExclude", ")", ";", "SimpleListHolder", "<", "T", ">", "result", "=", "cache", ".",...
Fork this list with extra predicates. @param namesToExclude the name of the elements to exclude from the list.
[ "Fork", "this", "list", "with", "extra", "predicates", "." ]
fbfacb639e286f9f3f3a18986f74ea275bebd887
https://github.com/jaxio/celerio/blob/fbfacb639e286f9f3f3a18986f74ea275bebd887/celerio-engine/src/main/java/com/jaxio/celerio/util/support/AbstractListHolder.java#L175-L183
train
Gets a SimpleListHolder of all the elements except the ones in namesToExclude.
Of course, here is the Java code you requested: ```java public SimpleListHolder<T> except(String... namesToExclude) { String key = "current" + getCacheKey(namesToExclude); SimpleListHolder<T> result = cache.get(key); if (result == null) { result = new SimpleListHolder<T>(getIterable...
sd4324530/fastweixin
src/main/java/com/github/sd4324530/fastweixin/servlet/WeixinControllerSupport.java
WeixinControllerSupport.process
@RequestMapping(method = RequestMethod.POST) protected final void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (isLegal(request)) { String result = processRequest(request); //设置正确的 content-type 以防止中文乱码 respons...
java
@RequestMapping(method = RequestMethod.POST) protected final void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (isLegal(request)) { String result = processRequest(request); //设置正确的 content-type 以防止中文乱码 respons...
[ "@", "RequestMapping", "(", "method", "=", "RequestMethod", ".", "POST", ")", "protected", "final", "void", "process", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "if", "...
微信消息交互处理 @param request http 请求对象 @param response http 响应对象 @throws ServletException 异常 @throws IOException IO异常
[ "微信消息交互处理" ]
6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447
https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/servlet/WeixinControllerSupport.java#L49-L59
train
Process a request.
Of course, here is the Java code you requested: ```java @RequestMapping(method = RequestMethod.POST) protected final void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (isLegal(request)) { String result = processRequest(request); ...
Breinify/brein-time-utilities
src/com/brein/time/timeseries/BucketTimeSeries.java
BucketTimeSeries.getEndPoints
public BucketEndPoints getEndPoints(final int bucketsFromNow) throws IllegalTimePoint { if (currentNowIdx == -1 || now == null) { throw new IllegalTimePoint("The now is not set yet, thus no end-points can be returned"); } return now.move(bucketsFromNow); }
java
public BucketEndPoints getEndPoints(final int bucketsFromNow) throws IllegalTimePoint { if (currentNowIdx == -1 || now == null) { throw new IllegalTimePoint("The now is not set yet, thus no end-points can be returned"); } return now.move(bucketsFromNow); }
[ "public", "BucketEndPoints", "getEndPoints", "(", "final", "int", "bucketsFromNow", ")", "throws", "IllegalTimePoint", "{", "if", "(", "currentNowIdx", "==", "-", "1", "||", "now", "==", "null", ")", "{", "throw", "new", "IllegalTimePoint", "(", "\"The now is no...
Gets the end-points by an offset to now, i.e., 0 means to get the now bucket, -1 gets the previous bucket, and +1 will get the next bucket. @param bucketsFromNow the amount of buckets to retrieve using now as anchor @return the end-point (bucket) with an offset of {@code bucketsFromNow} from now @throws IllegalTimeP...
[ "Gets", "the", "end", "-", "points", "by", "an", "offset", "to", "now", "i", ".", "e", ".", "0", "means", "to", "get", "the", "now", "bucket", "-", "1", "gets", "the", "previous", "bucket", "and", "+", "1", "will", "get", "the", "next", "bucket", ...
ec0165a50ec1951ec7730b72c85c801c2018f314
https://github.com/Breinify/brein-time-utilities/blob/ec0165a50ec1951ec7730b72c85c801c2018f314/src/com/brein/time/timeseries/BucketTimeSeries.java#L217-L224
train
Get the end - points of the current time - point.
Of course, here is the Java code you requested: ```java public BucketEndPoints getEndPoints(final int bucketsFromNow) throws IllegalTimePoint { if (currentNowIdx == -1 || now == null) { throw new IllegalTimePoint("The now is not set yet, thus no end-points can be returned"); } ret...
aws/aws-sdk-java
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java
AmazonRDSClient.promoteReadReplica
@Override public DBInstance promoteReadReplica(PromoteReadReplicaRequest request) { request = beforeClientExecution(request); return executePromoteReadReplica(request); }
java
@Override public DBInstance promoteReadReplica(PromoteReadReplicaRequest request) { request = beforeClientExecution(request); return executePromoteReadReplica(request); }
[ "@", "Override", "public", "DBInstance", "promoteReadReplica", "(", "PromoteReadReplicaRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executePromoteReadReplica", "(", "request", ")", ";", "}" ]
<p> Promotes a Read Replica DB instance to a standalone DB instance. </p> <note> <ul> <li> <p> Backup duration is a function of the amount of changes to the database since the previous backup. If you plan to promote a Read Replica to a standalone instance, we recommend that you enable backups and complete at least one ...
[ "<p", ">", "Promotes", "a", "Read", "Replica", "DB", "instance", "to", "a", "standalone", "DB", "instance", ".", "<", "/", "p", ">", "<note", ">", "<ul", ">", "<li", ">", "<p", ">", "Backup", "duration", "is", "a", "function", "of", "the", "amount", ...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java#L6311-L6315
train
Promotes a read - replica to a read - replica.
Of course, here is the Java code you requested: ```java @Override public DBInstance promoteReadReplica(PromoteReadReplicaRequest request) { request = beforeClientExecution(request); return executePromoteReadReplica(request); } ``` Hope this helps!
ehcache/ehcache3
impl/src/main/java/org/ehcache/config/builders/ResourcePoolsBuilder.java
ResourcePoolsBuilder.withReplacing
public ResourcePoolsBuilder withReplacing(ResourcePool resourcePool) { Map<ResourceType<?>, ResourcePool> newPools = new HashMap<>(resourcePools); newPools.put(resourcePool.getType(), resourcePool); return new ResourcePoolsBuilder(newPools); }
java
public ResourcePoolsBuilder withReplacing(ResourcePool resourcePool) { Map<ResourceType<?>, ResourcePool> newPools = new HashMap<>(resourcePools); newPools.put(resourcePool.getType(), resourcePool); return new ResourcePoolsBuilder(newPools); }
[ "public", "ResourcePoolsBuilder", "withReplacing", "(", "ResourcePool", "resourcePool", ")", "{", "Map", "<", "ResourceType", "<", "?", ">", ",", "ResourcePool", ">", "newPools", "=", "new", "HashMap", "<>", "(", "resourcePools", ")", ";", "newPools", ".", "pu...
Add or replace the {@link ResourcePool} of {@link ResourceType} in the returned builder. @param resourcePool the non-{@code null} resource pool to add/replace @return a new builder with the added pool
[ "Add", "or", "replace", "the", "{", "@link", "ResourcePool", "}", "of", "{", "@link", "ResourceType", "}", "in", "the", "returned", "builder", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/ResourcePoolsBuilder.java#L117-L121
train
Replaces the resource pool with another one.
Of course, here is the Java code you requested: ```java public ResourcePoolsBuilder withReplacing(ResourcePool resourcePool) { Map<ResourceType<?>, ResourcePool> newPools = new HashMap<>(resourcePools); newPools.put(resourcePool.getType(), resourcePool); return new ResourcePoolsBuilder(newPools); } ``` ...
Wolfgang-Schuetzelhofer/jcypher
src/main/java/iot/jcypher/query/api/returns/RDistinct.java
RDistinct.ALL
public RTerminal ALL() { ReturnExpression rx = getReturnExpression(); ReturnElement elem = new ReturnElement(); elem.setAll(); rx.setReturnValue(elem); RTerminal ret = new RTerminal(rx); return ret; }
java
public RTerminal ALL() { ReturnExpression rx = getReturnExpression(); ReturnElement elem = new ReturnElement(); elem.setAll(); rx.setReturnValue(elem); RTerminal ret = new RTerminal(rx); return ret; }
[ "public", "RTerminal", "ALL", "(", ")", "{", "ReturnExpression", "rx", "=", "getReturnExpression", "(", ")", ";", "ReturnElement", "elem", "=", "new", "ReturnElement", "(", ")", ";", "elem", ".", "setAll", "(", ")", ";", "rx", ".", "setReturnValue", "(", ...
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div> <div color='red' style="font-size:18px;color:red"><i>return all nodes, relationships and paths found in a query,</i></div> <div color='red' style="font-size:18px;color:red"><i>e.g. <b>ALL()</b></i></div> <br/>
[ "<div", "color", "=", "red", "style", "=", "font", "-", "size", ":", "24px", ";", "color", ":", "red", ">", "<b", ">", "<i", ">", "<u", ">", "JCYPHER<", "/", "u", ">", "<", "/", "i", ">", "<", "/", "b", ">", "<", "/", "div", ">", "<div", ...
0f36914b4d6993a004cc235bb18dd3e02a59d253
https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/api/returns/RDistinct.java#L51-L58
train
Creates all the RTerminal objects in this ReturnExpression and ReturnElement.
Of course, here is the Java code you requested: ```java public RTerminal ALL() { ReturnExpression rx = getReturnExpression(); ReturnElement elem = new ReturnElement(); elem.setAll(); rx.setReturnValue(elem); RTerminal ret = new RTerminal(rx); return ret; } ``` Hope this helps!
wisdom-framework/wisdom
extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java
CSRFServiceImpl.extractTokenFromRequest
@Override public String extractTokenFromRequest(Context context) { // First check the tags, this is where tokens are added if it's added to the current request // In that case, the request scope contains the token String token = (String) context.request().data().get(TOKEN_KEY); if (t...
java
@Override public String extractTokenFromRequest(Context context) { // First check the tags, this is where tokens are added if it's added to the current request // In that case, the request scope contains the token String token = (String) context.request().data().get(TOKEN_KEY); if (t...
[ "@", "Override", "public", "String", "extractTokenFromRequest", "(", "Context", "context", ")", "{", "// First check the tags, this is where tokens are added if it's added to the current request", "// In that case, the request scope contains the token", "String", "token", "=", "(", "...
Extracts the token from the request. This implementation checks in the request data, then in the CORS cookie if any, and finally in the session cookie. If the token is signed, it resigns it to avoid the BREACH vulnerability. @param context the context @return the extract token, {@code null} if no token.
[ "Extracts", "the", "token", "from", "the", "request", ".", "This", "implementation", "checks", "in", "the", "request", "data", "then", "in", "the", "CORS", "cookie", "if", "any", "and", "finally", "in", "the", "session", "cookie", ".", "If", "the", "token"...
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L87-L111
train
Extract the token from the request.
Of course, here is the Java code you requested: ```java @Override public String extractTokenFromRequest(Context context) { // First check the tags, this is where tokens are added if it's added to the current request // In that case, the request scope contains the token String token = (Strin...
googleapis/google-cloud-java
google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java
LoggingSnippets.write
public void write(String logName) { // [START logging_write_log_entry] List<LogEntry> entries = new ArrayList<>(); entries.add(LogEntry.of(StringPayload.of("Entry payload"))); Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("key", "value"); entries.add(LogEntry.of(JsonPayload.of(jsonM...
java
public void write(String logName) { // [START logging_write_log_entry] List<LogEntry> entries = new ArrayList<>(); entries.add(LogEntry.of(StringPayload.of("Entry payload"))); Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("key", "value"); entries.add(LogEntry.of(JsonPayload.of(jsonM...
[ "public", "void", "write", "(", "String", "logName", ")", "{", "// [START logging_write_log_entry]", "List", "<", "LogEntry", ">", "entries", "=", "new", "ArrayList", "<>", "(", ")", ";", "entries", ".", "add", "(", "LogEntry", ".", "of", "(", "StringPayload...
[VARIABLE "my_log_name"]
[ "[", "VARIABLE", "my_log_name", "]" ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java#L425-L437
train
Write a log entry to the log file.
Of course, here is the Java code you requested: ```java public void write(String logName) { // [START logging_write_log_entry] List<LogEntry> entries = new ArrayList<>(); entries.add(LogEntry.of(StringPayload.of("Entry payload"))); Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("key", "...
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/Sort.java
Sort.mergeSort
@SuppressWarnings("unchecked") public static <T extends Comparable<? super T>> void mergeSort( T[] arr ) { /*if ( arr.length < 15 ) { insertionSort( arr ); return; }*/ T[] tmpArr = (T[]) new Comparable[arr.length]; mergeSort(arr, tmpArr, ...
java
@SuppressWarnings("unchecked") public static <T extends Comparable<? super T>> void mergeSort( T[] arr ) { /*if ( arr.length < 15 ) { insertionSort( arr ); return; }*/ T[] tmpArr = (T[]) new Comparable[arr.length]; mergeSort(arr, tmpArr, ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "void", "mergeSort", "(", "T", "[", "]", "arr", ")", "{", "/*if ( arr.length < 15 ) {\n insertionSort( arr );\n ...
merge sort algorithm @param arr an array of Comparable item
[ "merge", "sort", "algorithm" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/Sort.java#L90-L101
train
Merge sort of a array of CIS elements.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T extends Comparable<? super T>> void mergeSort( T[] arr ) { /*if ( arr.length < 15 ) { insertionSort( arr ); return; }*/ T[] tmpArr = (T[]) new Compara...
gekoh/yaGen
lib/yagen-api/src/main/java/com/github/gekoh/yagen/util/FieldInfo.java
FieldInfo.getAttributeOverrides
private Map<String, String> getAttributeOverrides(Class type) { Map<String, String> overrides = new LinkedHashMap<String, String>(); addAttributeOverrides(overrides, "", type); return overrides; }
java
private Map<String, String> getAttributeOverrides(Class type) { Map<String, String> overrides = new LinkedHashMap<String, String>(); addAttributeOverrides(overrides, "", type); return overrides; }
[ "private", "Map", "<", "String", ",", "String", ">", "getAttributeOverrides", "(", "Class", "type", ")", "{", "Map", "<", "String", ",", "String", ">", "overrides", "=", "new", "LinkedHashMap", "<", "String", ",", "String", ">", "(", ")", ";", "addAttrib...
generates a collection of javax.persistence.AttributeOverride annotations needed to override nullable=false columns since this is not allowed in *Hst-Entities @param type embeddable class with non-nullable fields @return collection of javax.persistence.AttributeOverride annotations needed to set columns to nullable=tr...
[ "generates", "a", "collection", "of", "javax", ".", "persistence", ".", "AttributeOverride", "annotations", "needed", "to", "override", "nullable", "=", "false", "columns", "since", "this", "is", "not", "allowed", "in", "*", "Hst", "-", "Entities" ]
144cabeb294ce9d3d9e6f78403085d146579cc8e
https://github.com/gekoh/yaGen/blob/144cabeb294ce9d3d9e6f78403085d146579cc8e/lib/yagen-api/src/main/java/com/github/gekoh/yagen/util/FieldInfo.java#L289-L293
train
Get the attribute overrides for a class.
Of course, here is the Java code you requested: ```java private Map<String, String> getAttributeOverrides(Class type) { Map<String, String> overrides = new LinkedHashMap<String, String>(); addAttributeOverrides(overrides, "", type); return overrides; } ``` Hope this helps!
drewwills/cernunnos
cernunnos-core/src/main/java/org/danann/cernunnos/runtime/web/ServletStatusCodeTask.java
ServletStatusCodeTask.getFormula
public Formula getFormula() { Reagent[] reagents = new Reagent[] {STATUS_CODE, SOURCE}; final Formula rslt = new SimpleFormula(ServletStatusCodeTask.class, reagents); return rslt; }
java
public Formula getFormula() { Reagent[] reagents = new Reagent[] {STATUS_CODE, SOURCE}; final Formula rslt = new SimpleFormula(ServletStatusCodeTask.class, reagents); return rslt; }
[ "public", "Formula", "getFormula", "(", ")", "{", "Reagent", "[", "]", "reagents", "=", "new", "Reagent", "[", "]", "{", "STATUS_CODE", ",", "SOURCE", "}", ";", "final", "Formula", "rslt", "=", "new", "SimpleFormula", "(", "ServletStatusCodeTask", ".", "cl...
{@inheritDoc }
[ "{" ]
dc6848e0253775e22b6c869fd06506d4ddb6d728
https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/runtime/web/ServletStatusCodeTask.java#L61-L65
train
Gets the formula for this task.
Of course, here is the Java code you requested: ```java public Formula getFormula() { Reagent[] reagents = new Reagent[] {STATUS_CODE, SOURCE}; final Formula rslt = new SimpleFormula(ServletStatusCodeTask.class, reagents); return rslt; } ``` Hope this helps!
rhuss/jolokia
agent/core/src/main/java/org/jolokia/converter/json/TabularDataExtractor.java
TabularDataExtractor.setObjectValue
public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue) throws IllegalAccessException, InvocationTargetException { throw new IllegalArgumentException("TabularData cannot be written to"); }
java
public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue) throws IllegalAccessException, InvocationTargetException { throw new IllegalArgumentException("TabularData cannot be written to"); }
[ "public", "Object", "setObjectValue", "(", "StringToObjectConverter", "pConverter", ",", "Object", "pInner", ",", "String", "pAttribute", ",", "Object", "pValue", ")", "throws", "IllegalAccessException", ",", "InvocationTargetException", "{", "throw", "new", "IllegalArg...
Throws always {@link IllegalArgumentException} since tabular data is immutable
[ "Throws", "always", "{" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/TabularDataExtractor.java#L334-L337
train
This method is called to set the value of an object attribute.
Of course, here is the Java code you requested: ```java public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pAttribute, Object pValue) throws IllegalAccessException, InvocationTargetException { throw new IllegalArgumentException("TabularData cannot be written to")...
wuman/orientdb-android
core/src/main/java/com/orientechnologies/orient/core/db/graph/OGraphDatabase.java
OGraphDatabase.getEdgesBetweenVertexes
public Set<ODocument> getEdgesBetweenVertexes(final ODocument iVertex1, final ODocument iVertex2, final String[] iLabels, final String[] iClassNames) { final Set<ODocument> result = new HashSet<ODocument>(); if (iVertex1 != null && iVertex2 != null) { // CHECK OUT EDGES for (OIdentifi...
java
public Set<ODocument> getEdgesBetweenVertexes(final ODocument iVertex1, final ODocument iVertex2, final String[] iLabels, final String[] iClassNames) { final Set<ODocument> result = new HashSet<ODocument>(); if (iVertex1 != null && iVertex2 != null) { // CHECK OUT EDGES for (OIdentifi...
[ "public", "Set", "<", "ODocument", ">", "getEdgesBetweenVertexes", "(", "final", "ODocument", "iVertex1", ",", "final", "ODocument", "iVertex2", ",", "final", "String", "[", "]", "iLabels", ",", "final", "String", "[", "]", "iClassNames", ")", "{", "final", ...
Returns all the edges between the vertexes iVertex1 and iVertex2 with label between the array of labels passed as iLabels and with class between the array of class names passed as iClassNames. @param iVertex1 First Vertex @param iVertex2 Second Vertex @param iLabels Array of strings with the labels to get as filter @p...
[ "Returns", "all", "the", "edges", "between", "the", "vertexes", "iVertex1", "and", "iVertex2", "with", "label", "between", "the", "array", "of", "labels", "passed", "as", "iLabels", "and", "with", "class", "between", "the", "array", "of", "class", "names", "...
ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0
https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/db/graph/OGraphDatabase.java#L371-L399
train
Gets the edges between the two vertices.
Of course, here is the Java code you requested: ```java public Set<ODocument> getEdgesBetweenVertexes(final ODocument iVertex1, final ODocument iVertex2, final String[] iLabels, final String[] iClassNames) { final Set<ODocument> result = new HashSet<ODocument>(); if (iVertex1 != null && iVertex2 !...
aws/aws-sdk-java
aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/ResourceChange.java
ResourceChange.withScope
public ResourceChange withScope(ResourceAttribute... scope) { java.util.ArrayList<String> scopeCopy = new java.util.ArrayList<String>(scope.length); for (ResourceAttribute value : scope) { scopeCopy.add(value.toString()); } if (getScope() == null) { setScope(scope...
java
public ResourceChange withScope(ResourceAttribute... scope) { java.util.ArrayList<String> scopeCopy = new java.util.ArrayList<String>(scope.length); for (ResourceAttribute value : scope) { scopeCopy.add(value.toString()); } if (getScope() == null) { setScope(scope...
[ "public", "ResourceChange", "withScope", "(", "ResourceAttribute", "...", "scope", ")", "{", "java", ".", "util", ".", "ArrayList", "<", "String", ">", "scopeCopy", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "String", ">", "(", "scope", ".", ...
<p> The change scope. </p> @param scope The change scope. @return Returns a reference to this object so that method calls can be chained together. @see ResourceAttribute
[ "<p", ">", "The", "change", "scope", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/ResourceChange.java#L406-L417
train
Sets the scope of the resource change.
Of course, here is the Java code you requested: ```java public ResourceChange withScope(ResourceAttribute... scope) { java.util.ArrayList<String> scopeCopy = new java.util.ArrayList<String>(scope.length); for (ResourceAttribute value : scope) { scopeCopy.add(value.toString()); } ...
mygreen/super-csv-annotation
src/main/java/com/github/mygreen/supercsv/builder/standard/AbstractDateProcessorBuilder.java
AbstractDateProcessorBuilder.getDefaultFormatter
@SuppressWarnings("unchecked") protected DateFormatWrapper<T> getDefaultFormatter(final FieldAccessor field, final Configuration config) { final Optional<CsvDateTimeFormat> formatAnno = field.getAnnotation(CsvDateTimeFormat.class); if(!formatAnno.isPresent()) { return new D...
java
@SuppressWarnings("unchecked") protected DateFormatWrapper<T> getDefaultFormatter(final FieldAccessor field, final Configuration config) { final Optional<CsvDateTimeFormat> formatAnno = field.getAnnotation(CsvDateTimeFormat.class); if(!formatAnno.isPresent()) { return new D...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "DateFormatWrapper", "<", "T", ">", "getDefaultFormatter", "(", "final", "FieldAccessor", "field", ",", "final", "Configuration", "config", ")", "{", "final", "Optional", "<", "CsvDateTimeFormat", ">",...
日時のフォーマッタを作成する。 <p>アノテーション{@link CsvDateTimeFormat}が付与されていない場合は、各種タイプごとの標準の書式で作成する。</p> @param field プロパティ情報 @param config システム設定 @return {@link DateFormatWrapper}のインスタンス。
[ "日時のフォーマッタを作成する。", "<p", ">", "アノテーション", "{" ]
9910320cb6dc143be972c7d10d9ab5ffb09c3b84
https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/builder/standard/AbstractDateProcessorBuilder.java#L59-L88
train
Gets the default formatter.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") protected DateFormatWrapper<T> getDefaultFormatter(final FieldAccessor field, final Configuration config) { final Optional<CsvDateTimeFormat> formatAnno = field.getAnnotation(CsvDateTimeFormat.class); ...
aws/aws-sdk-java
aws-java-sdk-chime/src/main/java/com/amazonaws/services/chime/model/transform/CreateAccountRequestMarshaller.java
CreateAccountRequestMarshaller.marshall
public void marshall(CreateAccountRequest createAccountRequest, ProtocolMarshaller protocolMarshaller) { if (createAccountRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createAccountReques...
java
public void marshall(CreateAccountRequest createAccountRequest, ProtocolMarshaller protocolMarshaller) { if (createAccountRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createAccountReques...
[ "public", "void", "marshall", "(", "CreateAccountRequest", "createAccountRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "createAccountRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed t...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-chime/src/main/java/com/amazonaws/services/chime/model/transform/CreateAccountRequestMarshaller.java#L42-L53
train
Creates the given parameter object.
Of course, here is the Java code you requested: ```java public void marshall(CreateAccountRequest createAccountRequest, ProtocolMarshaller protocolMarshaller) { if (createAccountRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.catalog_formatted_privateCloudDC_GET
public net.minidev.ovh.api.order.catalog.privatecloud.OvhCatalog catalog_formatted_privateCloudDC_GET(OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException { String qPath = "/order/catalog/formatted/privateCloudDC"; StringBuilder sb = path(qPath); query(sb, "ovhSubsidiary", ovhSubsidiary); String resp = execN(...
java
public net.minidev.ovh.api.order.catalog.privatecloud.OvhCatalog catalog_formatted_privateCloudDC_GET(OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException { String qPath = "/order/catalog/formatted/privateCloudDC"; StringBuilder sb = path(qPath); query(sb, "ovhSubsidiary", ovhSubsidiary); String resp = execN(...
[ "public", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "order", ".", "catalog", ".", "privatecloud", ".", "OvhCatalog", "catalog_formatted_privateCloudDC_GET", "(", "OvhOvhSubsidiaryEnum", "ovhSubsidiary", ")", "throws", "IOException", "{", "String", "qPath",...
Retrieve information of Private Cloud Dedicated Cloud catalog REST: GET /order/catalog/formatted/privateCloudDC @param ovhSubsidiary [required] Subsidiary of the country you want to consult catalog API beta
[ "Retrieve", "information", "of", "Private", "Cloud", "Dedicated", "Cloud", "catalog" ]
6d531a40e56e09701943e334c25f90f640c55701
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L7331-L7337
train
Get details of Private Cloud DC catalog
Of course, here is the Java code you requested: ```java public net.minidev.ovh.api.order.catalog.privatecloud.OvhCatalog catalog_formatted_privateCloudDC_GET(OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException { String qPath = "/order/catalog/formatted/privateCloudDC"; StringBuilder sb = path(qPath); query(sb...
Wikidata/Wikidata-Toolkit
wdtk-storage/src/main/java/org/wikidata/wdtk/storage/datastructures/FindPositionArray.java
FindPositionArray.findPosition
public long findPosition(long nOccurrence) { updateCount(); if (nOccurrence <= 0) { return RankedBitVector.NOT_FOUND; } int findPos = (int) (nOccurrence / this.blockSize); if (findPos < this.positionArray.length) { long pos0 = this.positionArray[findPos]; long leftOccurrences = nOccurrence - (findPos...
java
public long findPosition(long nOccurrence) { updateCount(); if (nOccurrence <= 0) { return RankedBitVector.NOT_FOUND; } int findPos = (int) (nOccurrence / this.blockSize); if (findPos < this.positionArray.length) { long pos0 = this.positionArray[findPos]; long leftOccurrences = nOccurrence - (findPos...
[ "public", "long", "findPosition", "(", "long", "nOccurrence", ")", "{", "updateCount", "(", ")", ";", "if", "(", "nOccurrence", "<=", "0", ")", "{", "return", "RankedBitVector", ".", "NOT_FOUND", ";", "}", "int", "findPos", "=", "(", "int", ")", "(", "...
Returns the position for a given number of occurrences or NOT_FOUND if this value is not found. @param nOccurrence number of occurrences @return the position for a given number of occurrences or NOT_FOUND if this value is not found
[ "Returns", "the", "position", "for", "a", "given", "number", "of", "occurrences", "or", "NOT_FOUND", "if", "this", "value", "is", "not", "found", "." ]
7732851dda47e1febff406fba27bfec023f4786e
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-storage/src/main/java/org/wikidata/wdtk/storage/datastructures/FindPositionArray.java#L148-L170
train
Find the position of the given occurrence.
Of course, here is the Java code you requested: ```java public long findPosition(long nOccurrence) { updateCount(); if (nOccurrence <= 0) { return RankedBitVector.NOT_FOUND; } int findPos = (int) (nOccurrence / this.blockSize); if (findPos < this.positionArray.length) { long pos0 = this.positionArray[f...
aws/aws-sdk-java
aws-java-sdk-config/src/main/java/com/amazonaws/services/config/AmazonConfigClient.java
AmazonConfigClient.startRemediationExecution
@Override public StartRemediationExecutionResult startRemediationExecution(StartRemediationExecutionRequest request) { request = beforeClientExecution(request); return executeStartRemediationExecution(request); }
java
@Override public StartRemediationExecutionResult startRemediationExecution(StartRemediationExecutionRequest request) { request = beforeClientExecution(request); return executeStartRemediationExecution(request); }
[ "@", "Override", "public", "StartRemediationExecutionResult", "startRemediationExecution", "(", "StartRemediationExecutionRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeStartRemediationExecution", "(", "requ...
<p> Runs an on-demand remediation for the specified AWS Config rules against the last known remediation configuration. It runs an execution against the current state of your resources. Remediation execution is asynchronous. </p> <p> You can specify up to 100 resource keys per request. An existing StartRemediationExecut...
[ "<p", ">", "Runs", "an", "on", "-", "demand", "remediation", "for", "the", "specified", "AWS", "Config", "rules", "against", "the", "last", "known", "remediation", "configuration", ".", "It", "runs", "an", "execution", "against", "the", "current", "state", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/AmazonConfigClient.java#L4131-L4135
train
Start an app s remediation.
Of course, here is the Java code you requested: ```java @Override public StartRemediationExecutionResult startRemediationExecution(StartRemediationExecutionRequest request) { request = beforeClientExecution(request); return executeStartRemediationExecution(request); } ``` Hope this helps!
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java
PropertyUtil.getValues
public static List<String> getValues(String propertyName, String instanceName) { return getPropertyService().getValues(propertyName, instanceName); }
java
public static List<String> getValues(String propertyName, String instanceName) { return getPropertyService().getValues(propertyName, instanceName); }
[ "public", "static", "List", "<", "String", ">", "getValues", "(", "String", "propertyName", ",", "String", "instanceName", ")", "{", "return", "getPropertyService", "(", ")", ".", "getValues", "(", "propertyName", ",", "instanceName", ")", ";", "}" ]
Returns a property value as a string list. @param propertyName Name of the property whose value is sought. @param instanceName An optional instance name. Specify null to indicate the default instance. @return The property value as a string list, or null if not found. @see IPropertyService#getValues
[ "Returns", "a", "property", "value", "as", "a", "string", "list", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java#L106-L108
train
Gets the values of a property.
Of course, here is the Java code you requested: ```java public static List<String> getValues(String propertyName, String instanceName) { return getPropertyService().getValues(propertyName, instanceName); } ``` Hope this helps!
csc19601128/Phynixx
phynixx/phynixx-connection/src/main/java/org/csc/phynixx/connection/PooledPhynixxManagedConnectionFactory.java
PooledPhynixxManagedConnectionFactory.connectionFreed
public void connectionFreed(IManagedConnectionEvent<C> event) { IPhynixxManagedConnection<C> proxy = event.getManagedConnection(); if (!proxy.hasCoreConnection()) { return; } else { this.freeConnection(proxy); } if (LOG.isDebugEnabled()) { LOG....
java
public void connectionFreed(IManagedConnectionEvent<C> event) { IPhynixxManagedConnection<C> proxy = event.getManagedConnection(); if (!proxy.hasCoreConnection()) { return; } else { this.freeConnection(proxy); } if (LOG.isDebugEnabled()) { LOG....
[ "public", "void", "connectionFreed", "(", "IManagedConnectionEvent", "<", "C", ">", "event", ")", "{", "IPhynixxManagedConnection", "<", "C", ">", "proxy", "=", "event", ".", "getManagedConnection", "(", ")", ";", "if", "(", "!", "proxy", ".", "hasCoreConnecti...
the connection is set free an released from the pool
[ "the", "connection", "is", "set", "free", "an", "released", "from", "the", "pool" ]
a26c03bc229a8882c647799834115bec6bdc0ac8
https://github.com/csc19601128/Phynixx/blob/a26c03bc229a8882c647799834115bec6bdc0ac8/phynixx/phynixx-connection/src/main/java/org/csc/phynixx/connection/PooledPhynixxManagedConnectionFactory.java#L212-L223
train
Frees a connection from the system.
Of course, here is the Java code you requested: ```java public void connectionFreed(IManagedConnectionEvent<C> event) { IPhynixxManagedConnection<C> proxy = event.getManagedConnection(); if (!proxy.hasCoreConnection()) { return; } else { this.freeConnection(proxy); ...
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java
LinearEquationSystem.reducedRowEchelonForm
private void reducedRowEchelonForm(int method) { final int rows = coeff.length; final int cols = coeff[0].length; int k = -1; // denotes current position on diagonal int pivotRow; // row index of pivot element int pivotCol; // column index of pivot element double pivot; // value of pivot elemen...
java
private void reducedRowEchelonForm(int method) { final int rows = coeff.length; final int cols = coeff[0].length; int k = -1; // denotes current position on diagonal int pivotRow; // row index of pivot element int pivotCol; // column index of pivot element double pivot; // value of pivot elemen...
[ "private", "void", "reducedRowEchelonForm", "(", "int", "method", ")", "{", "final", "int", "rows", "=", "coeff", ".", "length", ";", "final", "int", "cols", "=", "coeff", "[", "0", "]", ".", "length", ";", "int", "k", "=", "-", "1", ";", "// denotes...
Brings this linear equation system into reduced row echelon form with choice of pivot method. @param method the pivot search method to use
[ "Brings", "this", "linear", "equation", "system", "into", "reduced", "row", "echelon", "form", "with", "choice", "of", "pivot", "method", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L392-L463
train
reduced row echelon form.
Of course, here is the Java code you requested: ```java private void reducedRowEchelonForm(int method) { final int rows = coeff.length; final int cols = coeff[0].length; int k = -1; // denotes current position on diagonal int pivotRow; // row index of pivot element int pivotCol; // column index of...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATSyncAsynchReader.java
CATSyncAsynchReader.sendChunkedMessage
private void sendChunkedMessage(JsMessage jsMessage) throws UnsupportedEncodingException, MessageEncodeFailedException, IncorrectMessageTypeException, MessageCopyFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(thi...
java
private void sendChunkedMessage(JsMessage jsMessage) throws UnsupportedEncodingException, MessageEncodeFailedException, IncorrectMessageTypeException, MessageCopyFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(thi...
[ "private", "void", "sendChunkedMessage", "(", "JsMessage", "jsMessage", ")", "throws", "UnsupportedEncodingException", ",", "MessageEncodeFailedException", ",", "IncorrectMessageTypeException", ",", "MessageCopyFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTr...
This method sends the message to the peer in chunks. As the request to receive a message is a synchronous request, the client is currently blocked waiting for a reply. As such, the message will be encoded into chunks, sent asynchronously to the client in chunks with the final chunk sent as the reply to the exchange req...
[ "This", "method", "sends", "the", "message", "to", "the", "peer", "in", "chunks", ".", "As", "the", "request", "to", "receive", "a", "message", "is", "a", "synchronous", "request", "the", "client", "is", "currently", "blocked", "waiting", "for", "a", "repl...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATSyncAsynchReader.java#L452-L560
train
This method is called by the CommsServerByteBuffer class when a message is chunked. It will send the message in one of the two cases.
Of course, here is the Java code you requested: ```java private void sendChunkedMessage(JsMessage jsMessage) throws UnsupportedEncodingException, MessageEncodeFailedException, IncorrectMessageTypeException, MessageCopyFailedException { if (TraceComponent.isAnyTracingEnab...
opentelecoms-org/jsmpp
jsmpp/src/main/java/org/jsmpp/util/DefaultDecomposer.java
DefaultDecomposer.outbind
public Outbind outbind(byte[] b) throws PDUStringException { Outbind req = new Outbind(); SequentialBytesReader reader = new SequentialBytesReader(b); assignHeader(req, reader); req.setSystemId(reader.readCString()); StringValidator.validateString(req.getSystemId(), ...
java
public Outbind outbind(byte[] b) throws PDUStringException { Outbind req = new Outbind(); SequentialBytesReader reader = new SequentialBytesReader(b); assignHeader(req, reader); req.setSystemId(reader.readCString()); StringValidator.validateString(req.getSystemId(), ...
[ "public", "Outbind", "outbind", "(", "byte", "[", "]", "b", ")", "throws", "PDUStringException", "{", "Outbind", "req", "=", "new", "Outbind", "(", ")", ";", "SequentialBytesReader", "reader", "=", "new", "SequentialBytesReader", "(", "b", ")", ";", "assignH...
/* (non-Javadoc) @see org.jsmpp.util.PDUDecomposer#outbind(byte[])
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
acc15e73e7431deabc803731971b15323315baaf
https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/util/DefaultDecomposer.java#L165-L176
train
Create an Outbind message from a byte array.
Of course, here is the Java code you requested: ```java public Outbind outbind(byte[] b) throws PDUStringException { Outbind req = new Outbind(); SequentialBytesReader reader = new SequentialBytesReader(b); assignHeader(req, reader); req.setSystemId(reader.readCString()); String...
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java
PravegaTablesStoreHelper.getEntriesPaginated
public <T> CompletableFuture<Map.Entry<ByteBuf, List<Map.Entry<String, VersionedMetadata<T>>>>> getEntriesPaginated( String tableName, ByteBuf continuationToken, int limit, Function<byte[], T> fromBytes) { log.trace("get entries paginated called for : {}", tableName); return wit...
java
public <T> CompletableFuture<Map.Entry<ByteBuf, List<Map.Entry<String, VersionedMetadata<T>>>>> getEntriesPaginated( String tableName, ByteBuf continuationToken, int limit, Function<byte[], T> fromBytes) { log.trace("get entries paginated called for : {}", tableName); return wit...
[ "public", "<", "T", ">", "CompletableFuture", "<", "Map", ".", "Entry", "<", "ByteBuf", ",", "List", "<", "Map", ".", "Entry", "<", "String", ",", "VersionedMetadata", "<", "T", ">", ">", ">", ">", ">", "getEntriesPaginated", "(", "String", "tableName", ...
Method to get paginated list of entries with a continuation token. @param tableName tableName @param continuationToken previous continuationToken @param limit limit on number of entries to retrieve @param fromBytes function to deserialize byte array into object of type T @param <T> type of deserialized entry values @re...
[ "Method", "to", "get", "paginated", "list", "of", "entries", "with", "a", "continuation", "token", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L366-L383
train
Gets paginated entries for a table.
Of course, here is the Java code you requested: ```java public <T> CompletableFuture<Map.Entry<ByteBuf, List<Map.Entry<String, VersionedMetadata<T>>>>> getEntriesPaginated( String tableName, ByteBuf continuationToken, int limit, Function<byte[], T> fromBytes) { log.trace("get entries p...
Azure/azure-sdk-for-java
eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java
EventSubscriptionsInner.listRegionalBySubscriptionAsync
public Observable<List<EventSubscriptionInner>> listRegionalBySubscriptionAsync(String location) { return listRegionalBySubscriptionWithServiceResponseAsync(location).map(new Func1<ServiceResponse<List<EventSubscriptionInner>>, List<EventSubscriptionInner>>() { @Override public List<Even...
java
public Observable<List<EventSubscriptionInner>> listRegionalBySubscriptionAsync(String location) { return listRegionalBySubscriptionWithServiceResponseAsync(location).map(new Func1<ServiceResponse<List<EventSubscriptionInner>>, List<EventSubscriptionInner>>() { @Override public List<Even...
[ "public", "Observable", "<", "List", "<", "EventSubscriptionInner", ">", ">", "listRegionalBySubscriptionAsync", "(", "String", "location", ")", "{", "return", "listRegionalBySubscriptionWithServiceResponseAsync", "(", "location", ")", ".", "map", "(", "new", "Func1", ...
List all regional event subscriptions under an Azure subscription. List all event subscriptions from the given location under a specific Azure subscription. @param location Name of the location @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the List&lt;EventSubscrip...
[ "List", "all", "regional", "event", "subscriptions", "under", "an", "Azure", "subscription", ".", "List", "all", "event", "subscriptions", "from", "the", "given", "location", "under", "a", "specific", "Azure", "subscription", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L1208-L1215
train
List all regional event subscriptions in a region.
Of course, here is the Java code you requested: ```java public Observable<List<EventSubscriptionInner>> listRegionalBySubscriptionAsync(String location) { return listRegionalBySubscriptionWithServiceResponseAsync(location).map(new Func1<ServiceResponse<List<EventSubscriptionInner>>, List<EventSubscriptionInner...
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableBufferedMutator.java
BigtableBufferedMutator.mutate
@Override public void mutate(Mutation mutation) throws IOException { handleExceptions(); addCallback(helper.mutate(mutation), mutation); }
java
@Override public void mutate(Mutation mutation) throws IOException { handleExceptions(); addCallback(helper.mutate(mutation), mutation); }
[ "@", "Override", "public", "void", "mutate", "(", "Mutation", "mutation", ")", "throws", "IOException", "{", "handleExceptions", "(", ")", ";", "addCallback", "(", "helper", ".", "mutate", "(", "mutation", ")", ",", "mutation", ")", ";", "}" ]
{@inheritDoc} Being a Mutation. This method will block if either of the following are true: 1) There are more than {@code maxInflightRpcs} RPCs in flight 2) There are more than {@link #getWriteBufferSize()} bytes pending
[ "{", "@inheritDoc", "}" ]
53543f36e4d6f9ed1963640d91a35be2a2047656
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableBufferedMutator.java#L131-L135
train
Override the mutation method to perform the actual mutation.
Of course, here is the Java code you requested: ```java @Override public void mutate(Mutation mutation) throws IOException { handleExceptions(); addCallback(helper.mutate(mutation), mutation); } ``` Hope this helps!
operasoftware/operaprestodriver
src/com/opera/core/systems/OperaDesktopDriver.java
OperaDesktopDriver.waitForMenuItemPressed
public String waitForMenuItemPressed(String menuItemText) { if (getScopeServices().getConnection() == null) { throw new CommunicationException( "waiting for a menu item to be pressed failed because Opera is not connected."); } return getScopeServices().waitForMenuItemPressed(menuItemText, ...
java
public String waitForMenuItemPressed(String menuItemText) { if (getScopeServices().getConnection() == null) { throw new CommunicationException( "waiting for a menu item to be pressed failed because Opera is not connected."); } return getScopeServices().waitForMenuItemPressed(menuItemText, ...
[ "public", "String", "waitForMenuItemPressed", "(", "String", "menuItemText", ")", "{", "if", "(", "getScopeServices", "(", ")", ".", "getConnection", "(", ")", "==", "null", ")", "{", "throw", "new", "CommunicationException", "(", "\"waiting for a menu item to be pr...
Waits until the menu item is pressed and then returns the text of the menu item pressed @param menuItemText - window to wait for shown event on @return text of the menu item
[ "Waits", "until", "the", "menu", "item", "is", "pressed", "and", "then", "returns", "the", "text", "of", "the", "menu", "item", "pressed" ]
1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01
https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L825-L833
train
Waits until a menu item is pressed.
Of course, here is the Java code you requested: ```java public String waitForMenuItemPressed(String menuItemText) { if (getScopeServices().getConnection() == null) { throw new CommunicationException( "waiting for a menu item to be pressed failed because Opera is not connected."); } return ...
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java
MemoryFileManager.inferBinaryName
@Override public String inferBinaryName(JavaFileManager.Location location, JavaFileObject file) { if (file instanceof OutputMemoryJavaFileObject) { OutputMemoryJavaFileObject ofo = (OutputMemoryJavaFileObject) file; proc.debug(DBG_FMGR, "inferBinaryName %s => %s\n", file, ofo.getName...
java
@Override public String inferBinaryName(JavaFileManager.Location location, JavaFileObject file) { if (file instanceof OutputMemoryJavaFileObject) { OutputMemoryJavaFileObject ofo = (OutputMemoryJavaFileObject) file; proc.debug(DBG_FMGR, "inferBinaryName %s => %s\n", file, ofo.getName...
[ "@", "Override", "public", "String", "inferBinaryName", "(", "JavaFileManager", ".", "Location", "location", ",", "JavaFileObject", "file", ")", "{", "if", "(", "file", "instanceof", "OutputMemoryJavaFileObject", ")", "{", "OutputMemoryJavaFileObject", "ofo", "=", "...
Infers a binary name of a file object based on a location. The binary name returned might not be a valid binary name according to <cite>The Java&trade { throw new UnsupportedOperationException("Not supported yet."); } Language Specification</cite>. @param location a location @param file a file object @return ...
[ "Infers", "a", "binary", "name", "of", "a", "file", "object", "based", "on", "a", "location", ".", "The", "binary", "name", "returned", "might", "not", "be", "a", "valid", "binary", "name", "according", "to", "<cite", ">", "The", "Java&trade", "{", "thro...
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java#L282-L291
train
Infer binary name.
Of course, here is the Java code you requested: ```java @Override public String inferBinaryName(JavaFileManager.Location location, JavaFileObject file) { if (file instanceof OutputMemoryJavaFileObject) { OutputMemoryJavaFileObject ofo = (OutputMemoryJavaFileObject) file; proc.debug(...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/template/engine/enjoy/EnjoyTemplate.java
EnjoyTemplate.wrap
public static EnjoyTemplate wrap(com.jfinal.template.Template EnjoyTemplate) { return (null == EnjoyTemplate) ? null : new EnjoyTemplate(EnjoyTemplate); }
java
public static EnjoyTemplate wrap(com.jfinal.template.Template EnjoyTemplate) { return (null == EnjoyTemplate) ? null : new EnjoyTemplate(EnjoyTemplate); }
[ "public", "static", "EnjoyTemplate", "wrap", "(", "com", ".", "jfinal", ".", "template", ".", "Template", "EnjoyTemplate", ")", "{", "return", "(", "null", "==", "EnjoyTemplate", ")", "?", "null", ":", "new", "EnjoyTemplate", "(", "EnjoyTemplate", ")", ";", ...
包装Enjoy模板 @param EnjoyTemplate Enjoy的模板对象 {@link com.jfinal.template.Template} @return {@link EnjoyTemplate}
[ "包装Enjoy模板" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/enjoy/EnjoyTemplate.java#L27-L29
train
Wraps an existing jpa. template. Template object.
Of course, here is the Java code you requested: ```java public static EnjoyTemplate wrap(com.jfinal.template.Template EnjoyTemplate) { return (null == EnjoyTemplate) ? null : new EnjoyTemplate(EnjoyTemplate); } ``` Hope this helps!
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPRuleUserSegmentRelLocalServiceBaseImpl.java
CPRuleUserSegmentRelLocalServiceBaseImpl.getCPRuleUserSegmentRels
@Override public List<CPRuleUserSegmentRel> getCPRuleUserSegmentRels(int start, int end) { return cpRuleUserSegmentRelPersistence.findAll(start, end); }
java
@Override public List<CPRuleUserSegmentRel> getCPRuleUserSegmentRels(int start, int end) { return cpRuleUserSegmentRelPersistence.findAll(start, end); }
[ "@", "Override", "public", "List", "<", "CPRuleUserSegmentRel", ">", "getCPRuleUserSegmentRels", "(", "int", "start", ",", "int", "end", ")", "{", "return", "cpRuleUserSegmentRelPersistence", ".", "findAll", "(", "start", ",", "end", ")", ";", "}" ]
Returns a range of all the cp rule user segment rels. <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. Setting both <...
[ "Returns", "a", "range", "of", "all", "the", "cp", "rule", "user", "segment", "rels", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPRuleUserSegmentRelLocalServiceBaseImpl.java#L321-L325
train
Returns a range of cp rule user segment rels.
Of course, here is the Java code you requested: ```java @Override public List<CPRuleUserSegmentRel> getCPRuleUserSegmentRels(int start, int end) { return cpRuleUserSegmentRelPersistence.findAll(start, end); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/PoolManager.java
PoolManager.needToReclaimConnections
private boolean needToReclaimConnections() { boolean removemcw = false; for (int j = 0; j < maxFreePoolHashSize; ++j) { synchronized (freePool[j].freeConnectionLockObject) { int localtotalConnectionCount = totalConnectionCount.get(); int mcwlSize = freePool[j]...
java
private boolean needToReclaimConnections() { boolean removemcw = false; for (int j = 0; j < maxFreePoolHashSize; ++j) { synchronized (freePool[j].freeConnectionLockObject) { int localtotalConnectionCount = totalConnectionCount.get(); int mcwlSize = freePool[j]...
[ "private", "boolean", "needToReclaimConnections", "(", ")", "{", "boolean", "removemcw", "=", "false", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "maxFreePoolHashSize", ";", "++", "j", ")", "{", "synchronized", "(", "freePool", "[", "j", "]", ...
Do we need to reclaim connections.
[ "Do", "we", "need", "to", "reclaim", "connections", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/PoolManager.java#L3367-L3395
train
need to reclaim connections
Of course, here is the Java code you requested: ```java private boolean needToReclaimConnections() { boolean removemcw = false; for (int j = 0; j < maxFreePoolHashSize; ++j) { synchronized (freePool[j].freeConnectionLockObject) { int localtotalConnectionCount = totalConnecti...
GerdHolz/TOVAL
src/de/invation/code/toval/misc/ArrayUtils.java
ArrayUtils.divideArray
public static <T> List<T[]> divideArray(T[] arr, Integer... cuts) { Arrays.sort(cuts); int c = cuts.length; if (cuts[0] < 0 || cuts[c - 1] > arr.length - 1) throw new IllegalArgumentException("cut position out of bounds."); int startIndex = cuts[0] == 0 ? 1 : 0; if (cuts[c - 1] != arr.length - 1) { ...
java
public static <T> List<T[]> divideArray(T[] arr, Integer... cuts) { Arrays.sort(cuts); int c = cuts.length; if (cuts[0] < 0 || cuts[c - 1] > arr.length - 1) throw new IllegalArgumentException("cut position out of bounds."); int startIndex = cuts[0] == 0 ? 1 : 0; if (cuts[c - 1] != arr.length - 1) { ...
[ "public", "static", "<", "T", ">", "List", "<", "T", "[", "]", ">", "divideArray", "(", "T", "[", "]", "arr", ",", "Integer", "...", "cuts", ")", "{", "Arrays", ".", "sort", "(", "cuts", ")", ";", "int", "c", "=", "cuts", ".", "length", ";", ...
Divides the given array using the boundaries in <code>cuts</code>.<br> Cuts are interpreted in an inclusive way, which means that a single cut at position i divides the given array in 0...i-1 + i...n<br> This method deals with both cut positions including and excluding start and end-indexes<br> @param <T> Type of arra...
[ "Divides", "the", "given", "array", "using", "the", "boundaries", "in", "<code", ">", "cuts<", "/", "code", ">", ".", "<br", ">", "Cuts", "are", "interpreted", "in", "an", "inclusive", "way", "which", "means", "that", "a", "single", "cut", "at", "positio...
036922cdfd710fa53b18e5dbe1e07f226f731fde
https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ArrayUtils.java#L281-L300
train
Divides the array by the number of elements in the cuts.
Of course, here is the Java code you requested: ```java public static <T> List<T[]> divideArray(T[] arr, Integer... cuts) { Arrays.sort(cuts); int c = cuts.length; if (cuts[0] < 0 || cuts[c - 1] > arr.length - 1) throw new IllegalArgumentException("cut position out of bounds."); int startIndex = cuts[0...
mlhartme/sushi
src/main/java/net/oneandone/sushi/util/IntBitSet.java
IntBitSet.remove
public void remove(int ele) { int idx; idx = ele >> SHIFT; if (idx < data.length) { data[idx] &= ~(1 << ele); } }
java
public void remove(int ele) { int idx; idx = ele >> SHIFT; if (idx < data.length) { data[idx] &= ~(1 << ele); } }
[ "public", "void", "remove", "(", "int", "ele", ")", "{", "int", "idx", ";", "idx", "=", "ele", ">>", "SHIFT", ";", "if", "(", "idx", "<", "data", ".", "length", ")", "{", "data", "[", "idx", "]", "&=", "~", "(", "1", "<<", "ele", ")", ";", ...
Remove an element from the set. @param ele element to remove
[ "Remove", "an", "element", "from", "the", "set", "." ]
4af33414b04bd58584d4febe5cc63ef6c7346a75
https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/util/IntBitSet.java#L233-L240
train
Removes the specified element from the set.
Of course, here is the Java code you requested: ```java public void remove(int ele) { int idx; idx = ele >> SHIFT; if (idx < data.length) { data[idx] &= ~(1 << ele); } } ``` Hope this helps!
baratine/baratine
core/src/main/java/com/caucho/v5/bytecode/ByteCode.java
ByteCode.readFromClassPath
public JavaClass readFromClassPath(String classFile) throws IOException { Thread thread = Thread.currentThread(); ClassLoader loader = thread.getContextClassLoader(); InputStream is = loader.getResourceAsStream(classFile); try { return parse(is); } finally { is.close(); } ...
java
public JavaClass readFromClassPath(String classFile) throws IOException { Thread thread = Thread.currentThread(); ClassLoader loader = thread.getContextClassLoader(); InputStream is = loader.getResourceAsStream(classFile); try { return parse(is); } finally { is.close(); } ...
[ "public", "JavaClass", "readFromClassPath", "(", "String", "classFile", ")", "throws", "IOException", "{", "Thread", "thread", "=", "Thread", ".", "currentThread", "(", ")", ";", "ClassLoader", "loader", "=", "thread", ".", "getContextClassLoader", "(", ")", ";"...
Reads the class from the classpath.
[ "Reads", "the", "class", "from", "the", "classpath", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/ByteCode.java#L41-L53
train
Reads a CRA from the classpath.
Of course, here is the Java code you requested: ```java public JavaClass readFromClassPath(String classFile) throws IOException { Thread thread = Thread.currentThread(); ClassLoader loader = thread.getContextClassLoader(); InputStream is = loader.getResourceAsStream(classFile); try { r...
aspectran/aspectran
shell/src/main/java/com/aspectran/shell/command/option/HelpFormatter.java
HelpFormatter.printOptions
public int printOptions(Options options) { Collection<Option> optList = options.getAllOptions(); StringBuilder sb = new StringBuilder(); int leftWidth = 0; if (!options.isEmpty()) { leftWidth = renderOptions(sb, optList); if (sb.length() > 0) { if ...
java
public int printOptions(Options options) { Collection<Option> optList = options.getAllOptions(); StringBuilder sb = new StringBuilder(); int leftWidth = 0; if (!options.isEmpty()) { leftWidth = renderOptions(sb, optList); if (sb.length() > 0) { if ...
[ "public", "int", "printOptions", "(", "Options", "options", ")", "{", "Collection", "<", "Option", ">", "optList", "=", "options", ".", "getAllOptions", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "int", "leftWidth", "...
Print the help for the specified Options to the specified writer, using the specified width, left padding and description padding. @param options the Options instance @return the longest opt string's length
[ "Print", "the", "help", "for", "the", "specified", "Options", "to", "the", "specified", "writer", "using", "the", "specified", "width", "left", "padding", "and", "description", "padding", "." ]
2d758a2a28b71ee85b42823c12dc44674d7f2c70
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/HelpFormatter.java#L336-L350
train
Print options.
Of course, here is the Java code you requested: ```java public int printOptions(Options options) { Collection<Option> optList = options.getAllOptions(); StringBuilder sb = new StringBuilder(); int leftWidth = 0; if (!options.isEmpty()) { leftWidth = renderOptions(sb, optList...
liyiorg/weixin-popular
src/main/java/weixin/popular/api/CustomserviceAPI.java
CustomserviceAPI.kfsessionGetsession
public static KFCustomSession kfsessionGetsession(String access_token, String openid) { HttpUriRequest httpUriRequest = RequestBuilder.get() .setHeader(jsonHeader) .setUri(BASE_URI + "/customservice/kfsession/getsession") .addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token)) .addPa...
java
public static KFCustomSession kfsessionGetsession(String access_token, String openid) { HttpUriRequest httpUriRequest = RequestBuilder.get() .setHeader(jsonHeader) .setUri(BASE_URI + "/customservice/kfsession/getsession") .addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token)) .addPa...
[ "public", "static", "KFCustomSession", "kfsessionGetsession", "(", "String", "access_token", ",", "String", "openid", ")", "{", "HttpUriRequest", "httpUriRequest", "=", "RequestBuilder", ".", "get", "(", ")", ".", "setHeader", "(", "jsonHeader", ")", ".", "setUri"...
获取客户的会话状态 @param access_token access_token @param openid 客户openid @return KFCustomSession
[ "获取客户的会话状态" ]
c64255292d41463bdb671938feaabf42a335d82c
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/CustomserviceAPI.java#L186-L194
train
Gets a KFCustomSession object.
Of course, here is the Java code you requested: ```java public static KFCustomSession kfsessionGetsession(String access_token, String openid) { HttpUriRequest httpUriRequest = RequestBuilder.get() .setHeader(jsonHeader) .setUri(BASE_URI + "/customservice/kfsession/getsession") .addParameter(PARAM_...
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/request_allocation/RequestAllocatorUtils.java
RequestAllocatorUtils.inferFromConfig
public static <T extends Request<T>> RequestAllocator<T> inferFromConfig(RequestAllocatorConfig<T> configuration) { try { String alias = configuration.getLimitedScopeConfig().hasPath(ALLOCATOR_ALIAS_KEY) ? configuration.getLimitedScopeConfig().getString(ALLOCATOR_ALIAS_KEY) : BruteForceAll...
java
public static <T extends Request<T>> RequestAllocator<T> inferFromConfig(RequestAllocatorConfig<T> configuration) { try { String alias = configuration.getLimitedScopeConfig().hasPath(ALLOCATOR_ALIAS_KEY) ? configuration.getLimitedScopeConfig().getString(ALLOCATOR_ALIAS_KEY) : BruteForceAll...
[ "public", "static", "<", "T", "extends", "Request", "<", "T", ">", ">", "RequestAllocator", "<", "T", ">", "inferFromConfig", "(", "RequestAllocatorConfig", "<", "T", ">", "configuration", ")", "{", "try", "{", "String", "alias", "=", "configuration", ".", ...
Infer and construct a {@link RequestAllocator} from an input {@link Config}.
[ "Infer", "and", "construct", "a", "{" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/request_allocation/RequestAllocatorUtils.java#L35-L49
train
Infer from the given configuration
Of course, here is the Java code you requested: ```java public static <T extends Request<T>> RequestAllocator<T> inferFromConfig(RequestAllocatorConfig<T> configuration) { try { String alias = configuration.getLimitedScopeConfig().hasPath(ALLOCATOR_ALIAS_KEY) ? configuration.getLimitedScopeConfig()...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/firewall/RequestWrapper.java
RequestWrapper.strip
private String strip(String path) { if (path == null) { return null; } int scIndex = path.indexOf(';'); if (scIndex < 0) { int doubleSlashIndex = path.indexOf("//"); if (doubleSlashIndex < 0) { // Most likely case, no parameters in any segment and no '//', so no // stripping required retu...
java
private String strip(String path) { if (path == null) { return null; } int scIndex = path.indexOf(';'); if (scIndex < 0) { int doubleSlashIndex = path.indexOf("//"); if (doubleSlashIndex < 0) { // Most likely case, no parameters in any segment and no '//', so no // stripping required retu...
[ "private", "String", "strip", "(", "String", "path", ")", "{", "if", "(", "path", "==", "null", ")", "{", "return", "null", ";", "}", "int", "scIndex", "=", "path", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "scIndex", "<", "0", ")", "...
Removes path parameters from each path segment in the supplied path and truncates sequences of multiple '/' characters to a single '/'. @param path either the {@code servletPath} and {@code pathInfo} from the original request @return the supplied value, with path parameters removed and sequences of multiple '/' chara...
[ "Removes", "path", "parameters", "from", "each", "path", "segment", "in", "the", "supplied", "path", "and", "truncates", "sequences", "of", "multiple", "/", "characters", "to", "a", "single", "/", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/firewall/RequestWrapper.java#L71-L110
test
Strip off the path parameters and trailing slashes.
Of course, here is the Java code you requested: ```java private String strip(String path) { if (path == null) { return null; } int scIndex = path.indexOf(';'); if (scIndex < 0) { int doubleSlashIndex = path.indexOf("//"); if (doubleSlashIndex < 0) { // Most likely case, no parameters in any segm...
jeppetto/jeppetto
jeppetto-dao-mongo/src/main/java/org/iternine/jeppetto/dao/mongodb/projections/CountCommand.java
CountCommand.addFieldExistsCriterion
private static DBObject addFieldExistsCriterion(DBObject query, String field) { return new BasicDBObject(query.toMap()).append(field, new BasicDBObject("$exists", true)); }
java
private static DBObject addFieldExistsCriterion(DBObject query, String field) { return new BasicDBObject(query.toMap()).append(field, new BasicDBObject("$exists", true)); }
[ "private", "static", "DBObject", "addFieldExistsCriterion", "(", "DBObject", "query", ",", "String", "field", ")", "{", "return", "new", "BasicDBObject", "(", "query", ".", "toMap", "(", ")", ")", ".", "append", "(", "field", ",", "new", "BasicDBObject", "("...
-------------------------------------------------------------
[ "-------------------------------------------------------------" ]
bd2796dcf53376052f590e727931990a2902a933
https://github.com/jeppetto/jeppetto/blob/bd2796dcf53376052f590e727931990a2902a933/jeppetto-dao-mongo/src/main/java/org/iternine/jeppetto/dao/mongodb/projections/CountCommand.java#L34-L36
train
Add a field exists criterion to the query.
Of course, here is the Java code you requested: ```java private static DBObject addFieldExistsCriterion(DBObject query, String field) { return new BasicDBObject(query.toMap()).append(field, new BasicDBObject("$exists", true)); } ``` Hope this helps!
jakenjarvis/Android-OrmLiteContentProvider
ormlite-content-provider-library/src/com/tojc/ormlite/android/annotation/OrmLiteAnnotationAccessor.java
OrmLiteAnnotationAccessor.getAnnotationTableName
public static String getAnnotationTableName(AnnotatedElement element) { String result = ""; result = DatabaseTableConfig.extractTableName((Class<?>) element); return result; }
java
public static String getAnnotationTableName(AnnotatedElement element) { String result = ""; result = DatabaseTableConfig.extractTableName((Class<?>) element); return result; }
[ "public", "static", "String", "getAnnotationTableName", "(", "AnnotatedElement", "element", ")", "{", "String", "result", "=", "\"\"", ";", "result", "=", "DatabaseTableConfig", ".", "extractTableName", "(", "(", "Class", "<", "?", ">", ")", "element", ")", ";...
Gets the table name from DatabaseTable annotation. If the DatabaseTable#tableName is not specified, returns the class name. @param element Element to be evaluated. @return Returns the table name.
[ "Gets", "the", "table", "name", "from", "DatabaseTable", "annotation", ".", "If", "the", "DatabaseTable#tableName", "is", "not", "specified", "returns", "the", "class", "name", "." ]
8f102f0743b308c9f58d43639e98f832fd951985
https://github.com/jakenjarvis/Android-OrmLiteContentProvider/blob/8f102f0743b308c9f58d43639e98f832fd951985/ormlite-content-provider-library/src/com/tojc/ormlite/android/annotation/OrmLiteAnnotationAccessor.java#L49-L53
train
Get the table name from an annotated element.
Of course, here is the Java code you requested: ```java public static String getAnnotationTableName(AnnotatedElement element) { String result = ""; result = DatabaseTableConfig.extractTableName((Class<?>) element); return result; } ``` Hope this helps!
js-lib-com/commons
src/main/java/js/util/Strings.java
Strings.escapeFilesPattern
public static String escapeFilesPattern(String filesPattern) { if(filesPattern == null) { return null; } return filesPattern.replace(".", DOT_REX).replace("*", ANY_REX); }
java
public static String escapeFilesPattern(String filesPattern) { if(filesPattern == null) { return null; } return filesPattern.replace(".", DOT_REX).replace("*", ANY_REX); }
[ "public", "static", "String", "escapeFilesPattern", "(", "String", "filesPattern", ")", "{", "if", "(", "filesPattern", "==", "null", ")", "{", "return", "null", ";", "}", "return", "filesPattern", ".", "replace", "(", "\".\"", ",", "DOT_REX", ")", ".", "r...
Escape files pattern for usage with Java regular expressions. Replace dot with escaped dot and asterisk with match at least one character so that <code>*.html</code> becomes <code>.+\.html</code>. Return null if files pattern argument is null and empty if empty. @param filesPattern files pattern to prepare. @return fi...
[ "Escape", "files", "pattern", "for", "usage", "with", "Java", "regular", "expressions", ".", "Replace", "dot", "with", "escaped", "dot", "and", "asterisk", "with", "match", "at", "least", "one", "character", "so", "that", "<code", ">", "*", ".", "html<", "...
f8c64482142b163487745da74feb106f0765c16b
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Strings.java#L964-L970
train
Escape filesPattern.
Of course, here is the Java code you requested: ```java public static String escapeFilesPattern(String filesPattern) { if(filesPattern == null) { return null; } return filesPattern.replace(".", DOT_REX).replace("*", ANY_REX); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java
AmazonEC2Client.modifySnapshotAttribute
@Override public ModifySnapshotAttributeResult modifySnapshotAttribute(ModifySnapshotAttributeRequest request) { request = beforeClientExecution(request); return executeModifySnapshotAttribute(request); }
java
@Override public ModifySnapshotAttributeResult modifySnapshotAttribute(ModifySnapshotAttributeRequest request) { request = beforeClientExecution(request); return executeModifySnapshotAttribute(request); }
[ "@", "Override", "public", "ModifySnapshotAttributeResult", "modifySnapshotAttribute", "(", "ModifySnapshotAttributeRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeModifySnapshotAttribute", "(", "request", ...
<p> Adds or removes permission settings for the specified snapshot. You may add or remove specified AWS account IDs from a snapshot's list of create volume permissions, but you cannot do both in a single API call. If you need to both add and remove account IDs for a snapshot, you must use multiple API calls. </p> <p> E...
[ "<p", ">", "Adds", "or", "removes", "permission", "settings", "for", "the", "specified", "snapshot", ".", "You", "may", "add", "or", "remove", "specified", "AWS", "account", "IDs", "from", "a", "snapshot", "s", "list", "of", "create", "volume", "permissions"...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java#L16739-L16743
train
Modify the attributes of an existing AZ snapshot.
Of course, here is the Java code you requested: ```java @Override public ModifySnapshotAttributeResult modifySnapshotAttribute(ModifySnapshotAttributeRequest request) { request = beforeClientExecution(request); return executeModifySnapshotAttribute(request); } ``` Hope this helps!
btaz/data-util
src/main/java/com/btaz/util/files/FileMerger.java
FileMerger.merge
public static void merge(File mergeDir, List<File> sortedFiles, File mergedFile, Comparator<String> comparator) { merge(mergeDir, sortedFiles, mergedFile, comparator, MERGE_FACTOR); }
java
public static void merge(File mergeDir, List<File> sortedFiles, File mergedFile, Comparator<String> comparator) { merge(mergeDir, sortedFiles, mergedFile, comparator, MERGE_FACTOR); }
[ "public", "static", "void", "merge", "(", "File", "mergeDir", ",", "List", "<", "File", ">", "sortedFiles", ",", "File", "mergedFile", ",", "Comparator", "<", "String", ">", "comparator", ")", "{", "merge", "(", "mergeDir", ",", "sortedFiles", ",", "merged...
Merge multiple files into a single file. Multi-pass approach where the merge factor controls how many passes that are required. This method uses the default merge factor for merging. @param mergeDir merge directory. If null, then it defaults to system temp. @param sortedFiles sorted files that are to be merged @param m...
[ "Merge", "multiple", "files", "into", "a", "single", "file", ".", "Multi", "-", "pass", "approach", "where", "the", "merge", "factor", "controls", "how", "many", "passes", "that", "are", "required", ".", "This", "method", "uses", "the", "default", "merge", ...
f01de64854c456a88a31ffbe8bac6d605151b496
https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/FileMerger.java#L27-L29
train
Merge the files in the mergeDir with the mergedFile.
Of course, here is the Java code you requested: ```java public static void merge(File mergeDir, List<File> sortedFiles, File mergedFile, Comparator<String> comparator) { merge(mergeDir, sortedFiles, mergedFile, comparator, MERGE_FACTOR); } ``` Hope this helps!
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getPvPRankInfo
public void getPvPRankInfo(int[] ids, Callback<List<PvPRank>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getPvPRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); }
java
public void getPvPRankInfo(int[] ids, Callback<List<PvPRank>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getPvPRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); }
[ "public", "void", "getPvPRankInfo", "(", "int", "[", "]", "ids", ",", "Callback", "<", "List", "<", "PvPRank", ">", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker", "(", "ids",...
For more info on pvp ranks API go <a href="https://wiki.guildwars2.com/wiki/API:2/pvp/ranks">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param ids list of PvP rank id @param callback callback tha...
[ "For", "more", "info", "on", "pvp", "ranks", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "pvp", "/", "ranks", ">", "here<", "/", "a", ">", "<br", "/", ">", ...
c8a43b51f363b032074fb152ee6efe657e33e525
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2112-L2115
train
Get list of pv - rank info for a list of user ids
Of course, here is the Java code you requested: ```java public void getPvPRankInfo(int[] ids, Callback<List<PvPRank>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getPvPRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); } ``` Hope ...
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
JavaCompiler.compile
public void compile(Collection<JavaFileObject> sourceFileObjects, Collection<String> classnames, Iterable<? extends Processor> processors, Collection<String> addModules) { if (!taskListener.isEmpty()) { taskListener.started(...
java
public void compile(Collection<JavaFileObject> sourceFileObjects, Collection<String> classnames, Iterable<? extends Processor> processors, Collection<String> addModules) { if (!taskListener.isEmpty()) { taskListener.started(...
[ "public", "void", "compile", "(", "Collection", "<", "JavaFileObject", ">", "sourceFileObjects", ",", "Collection", "<", "String", ">", "classnames", ",", "Iterable", "<", "?", "extends", "Processor", ">", "processors", ",", "Collection", "<", "String", ">", "...
Main method: compile a list of files, return all compiled classes @param sourceFileObjects file objects to be compiled @param classnames class names to process for annotations @param processors user provided annotation processors to bypass discovery, {@code null} means that no processors were provided @param addModule...
[ "Main", "method", ":", "compile", "a", "list", "of", "files", "return", "all", "compiled", "classes" ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L883-L987
train
Compiles a set of classes.
Of course, here is the Java code you requested: ```java public void compile(Collection<JavaFileObject> sourceFileObjects, Collection<String> classnames, Iterable<? extends Processor> processors, Collection<String> addModules) { if (!ta...
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/LinkedConverter.java
LinkedConverter.addComponent
public void addComponent(Object screenField) { if (this.getNextConverter() != null) this.getNextConverter().addComponent(screenField); else super.addComponent(screenField); }
java
public void addComponent(Object screenField) { if (this.getNextConverter() != null) this.getNextConverter().addComponent(screenField); else super.addComponent(screenField); }
[ "public", "void", "addComponent", "(", "Object", "screenField", ")", "{", "if", "(", "this", ".", "getNextConverter", "(", ")", "!=", "null", ")", "this", ".", "getNextConverter", "(", ")", ".", "addComponent", "(", "screenField", ")", ";", "else", "super"...
Add this component to the components displaying this field. @param Object sField The screen component.. either a awt.Component or a ScreenField.
[ "Add", "this", "component", "to", "the", "components", "displaying", "this", "field", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/LinkedConverter.java#L67-L73
train
Add this component to the next converter.
Of course, here is the Java code you requested: ```java public void addComponent(Object screenField) { if (this.getNextConverter() != null) this.getNextConverter().addComponent(screenField); else super.addComponent(screenField); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/widgets/CmsHtmlWidget.java
CmsHtmlWidget.filterEmbeddedGalleryOptions
private void filterEmbeddedGalleryOptions(JSONObject json) { Set<String> validKeys = Sets.newHashSet( Arrays.asList( I_CmsGalleryProviderConstants.CONFIG_GALLERY_TYPES, I_CmsGalleryProviderConstants.CONFIG_GALLERY_PATH, I_CmsGalleryProviderConstants.C...
java
private void filterEmbeddedGalleryOptions(JSONObject json) { Set<String> validKeys = Sets.newHashSet( Arrays.asList( I_CmsGalleryProviderConstants.CONFIG_GALLERY_TYPES, I_CmsGalleryProviderConstants.CONFIG_GALLERY_PATH, I_CmsGalleryProviderConstants.C...
[ "private", "void", "filterEmbeddedGalleryOptions", "(", "JSONObject", "json", ")", "{", "Set", "<", "String", ">", "validKeys", "=", "Sets", ".", "newHashSet", "(", "Arrays", ".", "asList", "(", "I_CmsGalleryProviderConstants", ".", "CONFIG_GALLERY_TYPES", ",", "I...
Removes all keys from the given JSON object which do not directly result from the embedded gallery configuration strings.<p> @param json the JSON object to modify
[ "Removes", "all", "keys", "from", "the", "given", "JSON", "object", "which", "do", "not", "directly", "result", "from", "the", "embedded", "gallery", "configuration", "strings", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsHtmlWidget.java#L450-L465
train
Filter embedded gallery options.
Of course, here is the Java code you requested: ```java private void filterEmbeddedGalleryOptions(JSONObject json) { Set<String> validKeys = Sets.newHashSet( Arrays.asList( I_CmsGalleryProviderConstants.CONFIG_GALLERY_TYPES, I_CmsGalleryProviderConstants.CONFIG_GALL...
citygml4j/citygml4j
src-gen/main/java/net/opengis/gml/ObjectFactory.java
ObjectFactory.createSemiMajorAxis
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "semiMajorAxis") public JAXBElement<MeasureType> createSemiMajorAxis(MeasureType value) { return new JAXBElement<MeasureType>(_SemiMajorAxis_QNAME, MeasureType.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "semiMajorAxis") public JAXBElement<MeasureType> createSemiMajorAxis(MeasureType value) { return new JAXBElement<MeasureType>(_SemiMajorAxis_QNAME, MeasureType.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.opengis.net/gml\"", ",", "name", "=", "\"semiMajorAxis\"", ")", "public", "JAXBElement", "<", "MeasureType", ">", "createSemiMajorAxis", "(", "MeasureType", "value", ")", "{", "return", "new", "JAXBElement", ...
Create an instance of {@link JAXBElement }{@code <}{@link MeasureType }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link MeasureType }{@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "MeasureType", "}", "{", "@code", ">", "}" ]
9155997d5ecf7e8f19411a02ba047f13375b97b9
https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/gml/ObjectFactory.java#L7539-L7542
train
Create an instance of the SEQUENCE sector axis.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "semiMajorAxis") public JAXBElement<MeasureType> createSemiMajorAxis(MeasureType value) { return new JAXBElement<MeasureType>(_SemiMajorAxis_QNAME, MeasureType.class, null, value); }...