repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ServerConfiguration.java
ServerConfiguration.getNestedInstances
public List<ConfigElement> getNestedInstances(RegistryEntry re) throws ConfigMergeException { """ Given a Pid and corresponding metatype registry entry, this finds all the ConfigElements with the parentPID specified in the registry entry and then all the children with given (factory) pid of those parent instances...
java
public List<ConfigElement> getNestedInstances(RegistryEntry re) throws ConfigMergeException { return getNestedInstances(re, new HashSet<RegistryEntry>()); }
[ "public", "List", "<", "ConfigElement", ">", "getNestedInstances", "(", "RegistryEntry", "re", ")", "throws", "ConfigMergeException", "{", "return", "getNestedInstances", "(", "re", ",", "new", "HashSet", "<", "RegistryEntry", ">", "(", ")", ")", ";", "}" ]
Given a Pid and corresponding metatype registry entry, this finds all the ConfigElements with the parentPID specified in the registry entry and then all the children with given (factory) pid of those parent instances. @param pid (factory) pid of a registry entry. @return list of all the instances of the supplied (fac...
[ "Given", "a", "Pid", "and", "corresponding", "metatype", "registry", "entry", "this", "finds", "all", "the", "ConfigElements", "with", "the", "parentPID", "specified", "in", "the", "registry", "entry", "and", "then", "all", "the", "children", "with", "given", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ServerConfiguration.java#L191-L193
gallandarakhneorg/afc
advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/OrientedRectangle2dfx.java
OrientedRectangle2dfx.secondAxisProperty
@Pure public ReadOnlyUnitVectorProperty secondAxisProperty() { """ Replies the property for the second rectangle axis. @return the secondAxis property. """ if (this.saxis == null) { this.saxis = new ReadOnlyUnitVectorWrapper(this, MathFXAttributeNames.SECOND_AXIS, getGeomFactory()); this.saxis.bind...
java
@Pure public ReadOnlyUnitVectorProperty secondAxisProperty() { if (this.saxis == null) { this.saxis = new ReadOnlyUnitVectorWrapper(this, MathFXAttributeNames.SECOND_AXIS, getGeomFactory()); this.saxis.bind(Bindings.createObjectBinding(() -> { final Vector2dfx firstAxis = firstAxisProperty().get(); ret...
[ "@", "Pure", "public", "ReadOnlyUnitVectorProperty", "secondAxisProperty", "(", ")", "{", "if", "(", "this", ".", "saxis", "==", "null", ")", "{", "this", ".", "saxis", "=", "new", "ReadOnlyUnitVectorWrapper", "(", "this", ",", "MathFXAttributeNames", ".", "SE...
Replies the property for the second rectangle axis. @return the secondAxis property.
[ "Replies", "the", "property", "for", "the", "second", "rectangle", "axis", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/OrientedRectangle2dfx.java#L283-L294
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FilterFileSystem.java
FilterFileSystem.startLocalOutput
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException { """ Returns a local File that the user can write output to. The caller provides both the eventual FS target name and the local working file. If the FS is local, we write directly into the target. If the FS is remote, ...
java
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException { return fs.startLocalOutput(fsOutputFile, tmpLocalFile); }
[ "public", "Path", "startLocalOutput", "(", "Path", "fsOutputFile", ",", "Path", "tmpLocalFile", ")", "throws", "IOException", "{", "return", "fs", ".", "startLocalOutput", "(", "fsOutputFile", ",", "tmpLocalFile", ")", ";", "}" ]
Returns a local File that the user can write output to. The caller provides both the eventual FS target name and the local working file. If the FS is local, we write directly into the target. If the FS is remote, we write into the tmp local area.
[ "Returns", "a", "local", "File", "that", "the", "user", "can", "write", "output", "to", ".", "The", "caller", "provides", "both", "the", "eventual", "FS", "target", "name", "and", "the", "local", "working", "file", ".", "If", "the", "FS", "is", "local", ...
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L354-L357
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.endSession
@EventThread public void endSession () { """ Forcibly terminates a client's session. This must be called from the dobjmgr thread. """ _clmgr.clientSessionWillEnd(this); // queue up a request for our connection to be closed (if we have a connection, that is) Connection conn = getCon...
java
@EventThread public void endSession () { _clmgr.clientSessionWillEnd(this); // queue up a request for our connection to be closed (if we have a connection, that is) Connection conn = getConnection(); if (conn != null) { // go ahead and clear out our connection now to...
[ "@", "EventThread", "public", "void", "endSession", "(", ")", "{", "_clmgr", ".", "clientSessionWillEnd", "(", "this", ")", ";", "// queue up a request for our connection to be closed (if we have a connection, that is)", "Connection", "conn", "=", "getConnection", "(", ")",...
Forcibly terminates a client's session. This must be called from the dobjmgr thread.
[ "Forcibly", "terminates", "a", "client", "s", "session", ".", "This", "must", "be", "called", "from", "the", "dobjmgr", "thread", "." ]
train
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L341-L378
deeplearning4j/deeplearning4j
gym-java-client/src/main/java/org/deeplearning4j/gym/Client.java
Client.monitorStart
public void monitorStart(String directory, boolean force, boolean resume) { """ Start monitoring. @param directory path to directory in which store the monitoring file @param force clear out existing training data from this directory (by deleting every file prefixed with "openaigym.") @param resume ret...
java
public void monitorStart(String directory, boolean force, boolean resume) { JSONObject json = new JSONObject().put("directory", directory).put("force", force).put("resume", resume); monitorStartPost(json); }
[ "public", "void", "monitorStart", "(", "String", "directory", ",", "boolean", "force", ",", "boolean", "resume", ")", "{", "JSONObject", "json", "=", "new", "JSONObject", "(", ")", ".", "put", "(", "\"directory\"", ",", "directory", ")", ".", "put", "(", ...
Start monitoring. @param directory path to directory in which store the monitoring file @param force clear out existing training data from this directory (by deleting every file prefixed with "openaigym.") @param resume retain the training data already in this directory, which will be merged with our new data
[ "Start", "monitoring", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/gym-java-client/src/main/java/org/deeplearning4j/gym/Client.java#L139-L143
undera/jmeter-plugins
plugins/jmxmon/src/main/java/kg/apc/jmeter/jmxmon/JMXMonConnectionPool.java
JMXMonConnectionPool.getConnection
public MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes, boolean wait) { """ Try to get a connection to the specified jmx url @param jmxUrl the jmx url @param attributes jmx connection attributes @param wait if true wait the current thread until the end of the connection attempt @return ...
java
public MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes, boolean wait) { JMXMonConnection connection = (JMXMonConnection)pool.get(jmxUrl); if (connection == null) { connection = new JMXMonConnection(jmxUrl); pool.put(jmxUrl, connection); } return connection.connect(attribute...
[ "public", "MBeanServerConnection", "getConnection", "(", "String", "jmxUrl", ",", "Hashtable", "attributes", ",", "boolean", "wait", ")", "{", "JMXMonConnection", "connection", "=", "(", "JMXMonConnection", ")", "pool", ".", "get", "(", "jmxUrl", ")", ";", "if",...
Try to get a connection to the specified jmx url @param jmxUrl the jmx url @param attributes jmx connection attributes @param wait if true wait the current thread until the end of the connection attempt @return a jmx connection
[ "Try", "to", "get", "a", "connection", "to", "the", "specified", "jmx", "url" ]
train
https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/jmxmon/src/main/java/kg/apc/jmeter/jmxmon/JMXMonConnectionPool.java#L61-L70
JavaMoney/jsr354-ri
moneta-core/src/main/java/org/javamoney/moneta/Money.java
Money.ofMinor
public static Money ofMinor(CurrencyUnit currency, long amountMinor) { """ Obtains an instance of {@code Money} from an amount in minor units. For example, {@code ofMinor(USD, 1234)} creates the instance {@code USD 12.34}. @param currency the currency @param amountMinor the amount of money in the minor divisi...
java
public static Money ofMinor(CurrencyUnit currency, long amountMinor) { return ofMinor(currency, amountMinor, currency.getDefaultFractionDigits()); }
[ "public", "static", "Money", "ofMinor", "(", "CurrencyUnit", "currency", ",", "long", "amountMinor", ")", "{", "return", "ofMinor", "(", "currency", ",", "amountMinor", ",", "currency", ".", "getDefaultFractionDigits", "(", ")", ")", ";", "}" ]
Obtains an instance of {@code Money} from an amount in minor units. For example, {@code ofMinor(USD, 1234)} creates the instance {@code USD 12.34}. @param currency the currency @param amountMinor the amount of money in the minor division of the currency @return the Money from minor units @throws NullPointerException ...
[ "Obtains", "an", "instance", "of", "{" ]
train
https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/Money.java#L814-L816
sahan/IckleBot
icklebot/src/main/java/com/lonepulse/icklebot/injector/resolver/ImplicitInjectionResolver.java
ImplicitInjectionResolver.isCategoryResourceInteger
private boolean isCategoryResourceInteger(Context context, Field field) { """ <p>Determines if this {@link Field} injection falls into {@link InjectionCategory#RESOURCE_INTEGER}.</p> @param context the context from which the injection resolution is requested @param field the {@link Field} whose {@link Inj...
java
private boolean isCategoryResourceInteger(Context context, Field field) { return ((Integer.class.isAssignableFrom(field.getType()) || int.class.isAssignableFrom(field.getType())) && ((ReflectiveR.integer(context, field.getName())) != 0))? true : false; }
[ "private", "boolean", "isCategoryResourceInteger", "(", "Context", "context", ",", "Field", "field", ")", "{", "return", "(", "(", "Integer", ".", "class", ".", "isAssignableFrom", "(", "field", ".", "getType", "(", ")", ")", "||", "int", ".", "class", "."...
<p>Determines if this {@link Field} injection falls into {@link InjectionCategory#RESOURCE_INTEGER}.</p> @param context the context from which the injection resolution is requested @param field the {@link Field} whose {@link InjectionCategory} is to be resolved <br><br> @return {@code true} if it's {@link InjectionCa...
[ "<p", ">", "Determines", "if", "this", "{", "@link", "Field", "}", "injection", "falls", "into", "{", "@link", "InjectionCategory#RESOURCE_INTEGER", "}", ".", "<", "/", "p", ">" ]
train
https://github.com/sahan/IckleBot/blob/a19003ceb3ad7c7ee508dc23a8cb31b5676aa499/icklebot/src/main/java/com/lonepulse/icklebot/injector/resolver/ImplicitInjectionResolver.java#L130-L135
Coolerfall/Android-HttpDownloadManager
library/src/main/java/com/coolerfall/download/Utils.java
Utils.getFilenameFromHeader
public static String getFilenameFromHeader(String url, String contentDisposition) { """ Get filename from content disposition in header. @param url url of current file to download @param contentDisposition content disposition in header @return filename in header if existed, otherwise get from url """ ...
java
public static String getFilenameFromHeader(String url, String contentDisposition) { String filename; if (!TextUtils.isEmpty(contentDisposition)) { int index = contentDisposition.indexOf("filename"); if (index > 0) { filename = contentDisposition.substring(index + 9, contentDisposition.length...
[ "public", "static", "String", "getFilenameFromHeader", "(", "String", "url", ",", "String", "contentDisposition", ")", "{", "String", "filename", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "contentDisposition", ")", ")", "{", "int", "index", "=", ...
Get filename from content disposition in header. @param url url of current file to download @param contentDisposition content disposition in header @return filename in header if existed, otherwise get from url
[ "Get", "filename", "from", "content", "disposition", "in", "header", "." ]
train
https://github.com/Coolerfall/Android-HttpDownloadManager/blob/2b32451c1799c77708c12bf8155e43c7dc25bc57/library/src/main/java/com/coolerfall/download/Utils.java#L119-L140
ops4j/org.ops4j.base
ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java
PostConditionException.validateNotNull
public static void validateNotNull( Object object, String identifier ) throws PostConditionException { """ Validates that the object is not null. @param object The object to be validated. @param identifier The name of the object. @throws PostConditionException if the object is null. """ ...
java
public static void validateNotNull( Object object, String identifier ) throws PostConditionException { if( object == null ) { throw new PostConditionException( identifier + " was NULL." ); } }
[ "public", "static", "void", "validateNotNull", "(", "Object", "object", ",", "String", "identifier", ")", "throws", "PostConditionException", "{", "if", "(", "object", "==", "null", ")", "{", "throw", "new", "PostConditionException", "(", "identifier", "+", "\" ...
Validates that the object is not null. @param object The object to be validated. @param identifier The name of the object. @throws PostConditionException if the object is null.
[ "Validates", "that", "the", "object", "is", "not", "null", "." ]
train
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java#L48-L55
JodaOrg/joda-time
src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java
BaseSingleFieldPeriod.standardPeriodIn
protected static int standardPeriodIn(ReadablePeriod period, long millisPerUnit) { """ Creates a new instance representing the number of complete standard length units in the specified period. <p> This factory method converts all fields from the period to hours using standardised durations for each field. Only...
java
protected static int standardPeriodIn(ReadablePeriod period, long millisPerUnit) { if (period == null) { return 0; } Chronology iso = ISOChronology.getInstanceUTC(); long duration = 0L; for (int i = 0; i < period.size(); i++) { int value = period.getValue(...
[ "protected", "static", "int", "standardPeriodIn", "(", "ReadablePeriod", "period", ",", "long", "millisPerUnit", ")", "{", "if", "(", "period", "==", "null", ")", "{", "return", "0", ";", "}", "Chronology", "iso", "=", "ISOChronology", ".", "getInstanceUTC", ...
Creates a new instance representing the number of complete standard length units in the specified period. <p> This factory method converts all fields from the period to hours using standardised durations for each field. Only those fields which have a precise duration in the ISO UTC chronology can be converted. <ul> <li...
[ "Creates", "a", "new", "instance", "representing", "the", "number", "of", "complete", "standard", "length", "units", "in", "the", "specified", "period", ".", "<p", ">", "This", "factory", "method", "converts", "all", "fields", "from", "the", "period", "to", ...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java#L129-L148
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/COPACNeighborPredicate.java
COPACNeighborPredicate.computeLocalModel
protected COPACModel computeLocalModel(DBIDRef id, DoubleDBIDList knnneighbors, Relation<V> relation) { """ COPAC model computation @param id Query object @param knnneighbors k nearest neighbors @param relation Data relation @return COPAC object model """ PCAResult epairs = settings.pca.processIds(kn...
java
protected COPACModel computeLocalModel(DBIDRef id, DoubleDBIDList knnneighbors, Relation<V> relation) { PCAResult epairs = settings.pca.processIds(knnneighbors, relation); int pdim = settings.filter.filter(epairs.getEigenvalues()); PCAFilteredResult pcares = new PCAFilteredResult(epairs.getEigenPairs(), pdi...
[ "protected", "COPACModel", "computeLocalModel", "(", "DBIDRef", "id", ",", "DoubleDBIDList", "knnneighbors", ",", "Relation", "<", "V", ">", "relation", ")", "{", "PCAResult", "epairs", "=", "settings", ".", "pca", ".", "processIds", "(", "knnneighbors", ",", ...
COPAC model computation @param id Query object @param knnneighbors k nearest neighbors @param relation Data relation @return COPAC object model
[ "COPAC", "model", "computation" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/COPACNeighborPredicate.java#L141-L163
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java
ULocale.getDisplayScriptInContext
@Deprecated public static String getDisplayScriptInContext(String localeID, ULocale displayLocale) { """ <strong>[icu]</strong> Returns a locale's script localized for display in the provided locale. @param localeID the id of the locale whose script will be displayed. @param displayLocale the locale in which...
java
@Deprecated public static String getDisplayScriptInContext(String localeID, ULocale displayLocale) { return getDisplayScriptInContextInternal(new ULocale(localeID), displayLocale); }
[ "@", "Deprecated", "public", "static", "String", "getDisplayScriptInContext", "(", "String", "localeID", ",", "ULocale", "displayLocale", ")", "{", "return", "getDisplayScriptInContextInternal", "(", "new", "ULocale", "(", "localeID", ")", ",", "displayLocale", ")", ...
<strong>[icu]</strong> Returns a locale's script localized for display in the provided locale. @param localeID the id of the locale whose script will be displayed. @param displayLocale the locale in which to display the name. @return the localized script name. @deprecated This API is ICU internal only. @hide original d...
[ "<strong", ">", "[", "icu", "]", "<", "/", "strong", ">", "Returns", "a", "locale", "s", "script", "localized", "for", "display", "in", "the", "provided", "locale", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1546-L1549
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.createRelation
private void createRelation(CmsResource resource, CmsResource target, String relationType, boolean importCase) throws CmsException { """ Adds a new relation to the given resource.<p> @param resource the source resource @param target the target resource @param relationType the type of the relation @param ...
java
private void createRelation(CmsResource resource, CmsResource target, String relationType, boolean importCase) throws CmsException { CmsRelationType type = CmsRelationType.valueOf(relationType); m_securityManager.addRelationToResource(m_context, resource, target, type, importCase); }
[ "private", "void", "createRelation", "(", "CmsResource", "resource", ",", "CmsResource", "target", ",", "String", "relationType", ",", "boolean", "importCase", ")", "throws", "CmsException", "{", "CmsRelationType", "type", "=", "CmsRelationType", ".", "valueOf", "("...
Adds a new relation to the given resource.<p> @param resource the source resource @param target the target resource @param relationType the type of the relation @param importCase if importing relations @throws CmsException if something goes wrong
[ "Adds", "a", "new", "relation", "to", "the", "given", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L4222-L4227
the-fascinator/plugin-indexer-solr
src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java
SolrIndexer.addToBuffer
private void addToBuffer(String index, String document) { """ Add a new document into the buffer, and check if submission is required @param document : The Solr document to add to the buffer. """ JsonObject message = new JsonObject(); message.put("event", "index"); message.put("index", index); mess...
java
private void addToBuffer(String index, String document) { JsonObject message = new JsonObject(); message.put("event", "index"); message.put("index", index); message.put("document", document); sendToIndex(message.toString()); }
[ "private", "void", "addToBuffer", "(", "String", "index", ",", "String", "document", ")", "{", "JsonObject", "message", "=", "new", "JsonObject", "(", ")", ";", "message", ".", "put", "(", "\"event\"", ",", "\"index\"", ")", ";", "message", ".", "put", "...
Add a new document into the buffer, and check if submission is required @param document : The Solr document to add to the buffer.
[ "Add", "a", "new", "document", "into", "the", "buffer", "and", "check", "if", "submission", "is", "required" ]
train
https://github.com/the-fascinator/plugin-indexer-solr/blob/001159b18b78a87daa5d8b2a17ced28694bae156/src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java#L815-L821
spring-projects/spring-hateoas
src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorHandlerMethodReturnValueHandler.java
RepresentationModelProcessorHandlerMethodReturnValueHandler.rewrapResult
Object rewrapResult(RepresentationModel<?> newBody, @Nullable Object originalValue) { """ Re-wraps the result of the post-processing work into an {@link HttpEntity} or {@link ResponseEntity} if the original value was one of those two types. Copies headers and status code from the original value but uses the new ...
java
Object rewrapResult(RepresentationModel<?> newBody, @Nullable Object originalValue) { if (!(originalValue instanceof HttpEntity)) { return rootLinksAsHeaders ? HeaderLinksResponseEntity.wrap(newBody) : newBody; } HttpEntity<RepresentationModel<?>> entity = null; if (originalValue instanceof ResponseEntity...
[ "Object", "rewrapResult", "(", "RepresentationModel", "<", "?", ">", "newBody", ",", "@", "Nullable", "Object", "originalValue", ")", "{", "if", "(", "!", "(", "originalValue", "instanceof", "HttpEntity", ")", ")", "{", "return", "rootLinksAsHeaders", "?", "He...
Re-wraps the result of the post-processing work into an {@link HttpEntity} or {@link ResponseEntity} if the original value was one of those two types. Copies headers and status code from the original value but uses the new body. @param newBody the post-processed value. @param originalValue the original input value. @r...
[ "Re", "-", "wraps", "the", "result", "of", "the", "post", "-", "processing", "work", "into", "an", "{", "@link", "HttpEntity", "}", "or", "{", "@link", "ResponseEntity", "}", "if", "the", "original", "value", "was", "one", "of", "those", "two", "types", ...
train
https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorHandlerMethodReturnValueHandler.java#L138-L155
fracpete/multisearch-weka-package
src/main/java/weka/classifiers/meta/multisearch/AbstractSearch.java
AbstractSearch.logPerformances
protected void logPerformances(Space space, Vector<Performance> performances) { """ aligns all performances in the space and prints those tables to the log file. @param space the current space to align the performances to @param performances the performances to align """ m_Owner.logPerformances(space...
java
protected void logPerformances(Space space, Vector<Performance> performances) { m_Owner.logPerformances(space, performances); }
[ "protected", "void", "logPerformances", "(", "Space", "space", ",", "Vector", "<", "Performance", ">", "performances", ")", "{", "m_Owner", ".", "logPerformances", "(", "space", ",", "performances", ")", ";", "}" ]
aligns all performances in the space and prints those tables to the log file. @param space the current space to align the performances to @param performances the performances to align
[ "aligns", "all", "performances", "in", "the", "space", "and", "prints", "those", "tables", "to", "the", "log", "file", "." ]
train
https://github.com/fracpete/multisearch-weka-package/blob/756fcf343e7cc9fd3844c99a0e1e828368f393d0/src/main/java/weka/classifiers/meta/multisearch/AbstractSearch.java#L273-L275
docusign/docusign-java-client
src/main/java/com/docusign/esign/api/EnvelopesApi.java
EnvelopesApi.getDocumentTabs
public Tabs getDocumentTabs(String accountId, String envelopeId, String documentId) throws ApiException { """ Returns tabs on the document. @param accountId The external account number (int) or account ID Guid. (required) @param envelopeId The envelopeId Guid of the envelope being accessed. (required) @param ...
java
public Tabs getDocumentTabs(String accountId, String envelopeId, String documentId) throws ApiException { return getDocumentTabs(accountId, envelopeId, documentId, null); }
[ "public", "Tabs", "getDocumentTabs", "(", "String", "accountId", ",", "String", "envelopeId", ",", "String", "documentId", ")", "throws", "ApiException", "{", "return", "getDocumentTabs", "(", "accountId", ",", "envelopeId", ",", "documentId", ",", "null", ")", ...
Returns tabs on the document. @param accountId The external account number (int) or account ID Guid. (required) @param envelopeId The envelopeId Guid of the envelope being accessed. (required) @param documentId The ID of the document being accessed. (required) @return Tabs
[ "Returns", "tabs", "on", "the", "document", "." ]
train
https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L2445-L2447
vkostyukov/la4j
src/main/java/org/la4j/Matrix.java
Matrix.from1DArray
public static Matrix from1DArray(int rows, int columns, double[] array) { """ Creates a {@link Matrix} of the given 1D {@code array} w/o copying the underlying array. """ return Basic1DMatrix.from1DArray(rows, columns, array); }
java
public static Matrix from1DArray(int rows, int columns, double[] array) { return Basic1DMatrix.from1DArray(rows, columns, array); }
[ "public", "static", "Matrix", "from1DArray", "(", "int", "rows", ",", "int", "columns", ",", "double", "[", "]", "array", ")", "{", "return", "Basic1DMatrix", ".", "from1DArray", "(", "rows", ",", "columns", ",", "array", ")", ";", "}" ]
Creates a {@link Matrix} of the given 1D {@code array} w/o copying the underlying array.
[ "Creates", "a", "{" ]
train
https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L167-L169
groupby/api-java
src/main/java/com/groupbyinc/util/UrlBeautifier.java
UrlBeautifier.toUrl
@Deprecated public String toUrl(String searchString, String existingRefinements) throws UrlBeautifier.UrlBeautificationException { """ <code> Convert a search term and a list of refinements into a beautified URL. Each refinement that has a mapping will be turned into a path segment. If a mapping has been crea...
java
@Deprecated public String toUrl(String searchString, String existingRefinements) throws UrlBeautifier.UrlBeautificationException { StringBuilder pathSegmentLookup = new StringBuilder("/"); Query query = createQuery(); if (StringUtils.isNotBlank(searchString)) { query.setQuery(searchString); } ...
[ "@", "Deprecated", "public", "String", "toUrl", "(", "String", "searchString", ",", "String", "existingRefinements", ")", "throws", "UrlBeautifier", ".", "UrlBeautificationException", "{", "StringBuilder", "pathSegmentLookup", "=", "new", "StringBuilder", "(", "\"/\"", ...
<code> Convert a search term and a list of refinements into a beautified URL. Each refinement that has a mapping will be turned into a path segment. If a mapping has been created for search, the search term will also be placed into a URL path segment. </code> @deprecated Use {@link #toUrl(String, Map)} ()} @param sear...
[ "<code", ">", "Convert", "a", "search", "term", "and", "a", "list", "of", "refinements", "into", "a", "beautified", "URL", ".", "Each", "refinement", "that", "has", "a", "mapping", "will", "be", "turned", "into", "a", "path", "segment", ".", "If", "a", ...
train
https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/util/UrlBeautifier.java#L102-L119
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AgentRegistrationInformationsInner.java
AgentRegistrationInformationsInner.regenerateKeyAsync
public Observable<AgentRegistrationInner> regenerateKeyAsync(String resourceGroupName, String automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) { """ Regenerate a primary or secondary agent registration key. @param resourceGroupName Name of an Azure Resource group. @param automationAcc...
java
public Observable<AgentRegistrationInner> regenerateKeyAsync(String resourceGroupName, String automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) { return regenerateKeyWithServiceResponseAsync(resourceGroupName, automationAccountName, parameters).map(new Func1<ServiceResponse<AgentRegistr...
[ "public", "Observable", "<", "AgentRegistrationInner", ">", "regenerateKeyAsync", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "AgentRegistrationRegenerateKeyParameter", "parameters", ")", "{", "return", "regenerateKeyWithServiceResponseAsync",...
Regenerate a primary or secondary agent registration key. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param parameters The name of the agent registration key to be regenerated @throws IllegalArgumentException thrown if parameters fail the ...
[ "Regenerate", "a", "primary", "or", "secondary", "agent", "registration", "key", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AgentRegistrationInformationsInner.java#L190-L197
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/ItemStream.java
ItemStream.addReferenceStream
public void addReferenceStream(final ReferenceStream referenceStream, final Transaction transaction) throws ProtocolException, OutOfCacheSpace, StreamIsFull, TransactionException, PersistenceException, SevereMessageStoreException { """ Add an {@link ReferenceStream} to an item stream under a tr...
java
public void addReferenceStream(final ReferenceStream referenceStream, final Transaction transaction) throws ProtocolException, OutOfCacheSpace, StreamIsFull, TransactionException, PersistenceException, SevereMessageStoreException { addReferenceStream(referenceStream, NO_LOCK_ID, transact...
[ "public", "void", "addReferenceStream", "(", "final", "ReferenceStream", "referenceStream", ",", "final", "Transaction", "transaction", ")", "throws", "ProtocolException", ",", "OutOfCacheSpace", ",", "StreamIsFull", ",", "TransactionException", ",", "PersistenceException",...
Add an {@link ReferenceStream} to an item stream under a transaction. A ReferenceStream can only be added onto one stream at a time. . <p>This method can be overridden by subclass implementors in order to customize the behaviour of the stream. Any override should call the superclass implementation to maintain correct b...
[ "Add", "an", "{", "@link", "ReferenceStream", "}", "to", "an", "item", "stream", "under", "a", "transaction", ".", "A", "ReferenceStream", "can", "only", "be", "added", "onto", "one", "stream", "at", "a", "time", ".", ".", "<p", ">", "This", "method", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/ItemStream.java#L300-L304
linkedin/dexmaker
dexmaker/src/main/java/com/android/dx/Code.java
Code.getThis
public <T> Local<T> getThis(TypeId<T> type) { """ Returns the local for {@code this} of type {@code type}. It is an error to call {@code getThis()} if this is a static method. """ if (thisLocal == null) { throw new IllegalStateException("static methods cannot access 'this'"); } ...
java
public <T> Local<T> getThis(TypeId<T> type) { if (thisLocal == null) { throw new IllegalStateException("static methods cannot access 'this'"); } return coerce(thisLocal, type); }
[ "public", "<", "T", ">", "Local", "<", "T", ">", "getThis", "(", "TypeId", "<", "T", ">", "type", ")", "{", "if", "(", "thisLocal", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"static methods cannot access 'this'\"", ")", ";", ...
Returns the local for {@code this} of type {@code type}. It is an error to call {@code getThis()} if this is a static method.
[ "Returns", "the", "local", "for", "{" ]
train
https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L254-L259
jboss/jboss-jsf-api_spec
src/main/java/javax/faces/component/UIViewParameter.java
UIViewParameter.getConvertedValue
@Override protected Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException { """ <p class="changed_added_2_0">Because this class has no {@link Renderer}, leverage the one from the standard HTML_BASIC {@link RenderKit} with <code>component-family: javax.faces...
java
@Override protected Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException { return getInputTextRenderer(context).getConvertedValue(context, this, submittedValue); }
[ "@", "Override", "protected", "Object", "getConvertedValue", "(", "FacesContext", "context", ",", "Object", "submittedValue", ")", "throws", "ConverterException", "{", "return", "getInputTextRenderer", "(", "context", ")", ".", "getConvertedValue", "(", "context", ","...
<p class="changed_added_2_0">Because this class has no {@link Renderer}, leverage the one from the standard HTML_BASIC {@link RenderKit} with <code>component-family: javax.faces.Input</code> and <code>renderer-type: javax.faces.Text</code> and call its {@link Renderer#getConvertedValue} method.</p> @since 2.0
[ "<p", "class", "=", "changed_added_2_0", ">", "Because", "this", "class", "has", "no", "{", "@link", "Renderer", "}", "leverage", "the", "one", "from", "the", "standard", "HTML_BASIC", "{", "@link", "RenderKit", "}", "with", "<code", ">", "component", "-", ...
train
https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIViewParameter.java#L433-L440
apache/spark
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleClient.java
ExternalShuffleClient.registerWithShuffleServer
public void registerWithShuffleServer( String host, int port, String execId, ExecutorShuffleInfo executorInfo) throws IOException, InterruptedException { """ Registers this executor with an external shuffle server. This registration is required to inform the shuffle server about where and ...
java
public void registerWithShuffleServer( String host, int port, String execId, ExecutorShuffleInfo executorInfo) throws IOException, InterruptedException { checkInit(); try (TransportClient client = clientFactory.createUnmanagedClient(host, port)) { ByteBuffer registerMessage = new R...
[ "public", "void", "registerWithShuffleServer", "(", "String", "host", ",", "int", "port", ",", "String", "execId", ",", "ExecutorShuffleInfo", "executorInfo", ")", "throws", "IOException", ",", "InterruptedException", "{", "checkInit", "(", ")", ";", "try", "(", ...
Registers this executor with an external shuffle server. This registration is required to inform the shuffle server about where and how we store our shuffle files. @param host Host of shuffle server. @param port Port of shuffle server. @param execId This Executor's id. @param executorInfo Contains all info necessary f...
[ "Registers", "this", "executor", "with", "an", "external", "shuffle", "server", ".", "This", "registration", "is", "required", "to", "inform", "the", "shuffle", "server", "about", "where", "and", "how", "we", "store", "our", "shuffle", "files", "." ]
train
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleClient.java#L136-L146
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java
AbstractDisplayer.filterApply
public void filterApply(String columnId, List<Interval> intervalList) { """ Filter the values of the given column. @param columnId The name of the column to filter. @param intervalList A list of interval selections to filter for. """ if (displayerSettings.isFilterEnabled()) { // For st...
java
public void filterApply(String columnId, List<Interval> intervalList) { if (displayerSettings.isFilterEnabled()) { // For string column filters, init the group interval selection operation. DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId); groupOp.setSelecte...
[ "public", "void", "filterApply", "(", "String", "columnId", ",", "List", "<", "Interval", ">", "intervalList", ")", "{", "if", "(", "displayerSettings", ".", "isFilterEnabled", "(", ")", ")", "{", "// For string column filters, init the group interval selection operatio...
Filter the values of the given column. @param columnId The name of the column to filter. @param intervalList A list of interval selections to filter for.
[ "Filter", "the", "values", "of", "the", "given", "column", "." ]
train
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L651-L670
NessComputing/service-discovery
client/src/main/java/com/nesscomputing/service/discovery/client/internal/ServiceDiscoveryRunnable.java
ServiceDiscoveryRunnable.determineCurrentGeneration
@Override public long determineCurrentGeneration(final AtomicLong generation, final long tick) { """ Trigger the loop every time enough ticks have been accumulated, or whenever any of the visitors requests it. """ // If the scan interval was reached, trigger the // run. if (tick - ...
java
@Override public long determineCurrentGeneration(final AtomicLong generation, final long tick) { // If the scan interval was reached, trigger the // run. if (tick - lastScan >= scanTicks) { lastScan = tick; return generation.incrementAndGet(); } /...
[ "@", "Override", "public", "long", "determineCurrentGeneration", "(", "final", "AtomicLong", "generation", ",", "final", "long", "tick", ")", "{", "// If the scan interval was reached, trigger the", "// run.", "if", "(", "tick", "-", "lastScan", ">=", "scanTicks", ")"...
Trigger the loop every time enough ticks have been accumulated, or whenever any of the visitors requests it.
[ "Trigger", "the", "loop", "every", "time", "enough", "ticks", "have", "been", "accumulated", "or", "whenever", "any", "of", "the", "visitors", "requests", "it", "." ]
train
https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/client/src/main/java/com/nesscomputing/service/discovery/client/internal/ServiceDiscoveryRunnable.java#L68-L85
RestExpress/PluginExpress
metrics/src/main/java/com/strategicgains/restexpress/plugin/metrics/LogOutputFactory.java
LogOutputFactory.createStringBuilder
public StringBuilder createStringBuilder(Request request, Response response, Long duration) { """ Creates a pre-populated StringBuilder instance. The output contains the following: "Time=<now> RequestTime=<duration> URL=<request URL> Method=<http method> Format=<requested format e.g. 'json'> Resource=<route patt...
java
public StringBuilder createStringBuilder(Request request, Response response, Long duration) { StringBuilder builder = new StringBuilder(); builder.append("Time=" + ((DateFormat) DATE_FORMAT.clone()).format(new Date())); builder.append(" RequestTime=" + duration); builder.append(" URL=" + request.getUrl()); ...
[ "public", "StringBuilder", "createStringBuilder", "(", "Request", "request", ",", "Response", "response", ",", "Long", "duration", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "builder", ".", "append", "(", "\"Time=\"", "+", ...
Creates a pre-populated StringBuilder instance. The output contains the following: "Time=<now> RequestTime=<duration> URL=<request URL> Method=<http method> Format=<requested format e.g. 'json'> Resource=<route pattern> Machine=<machineName> CorrelationId=<request correlation id> Status=<http status> User-Agent=<user ...
[ "Creates", "a", "pre", "-", "populated", "StringBuilder", "instance", ".", "The", "output", "contains", "the", "following", ":", "Time", "=", "<now", ">", "RequestTime", "=", "<duration", ">", "URL", "=", "<request", "URL", ">", "Method", "=", "<http", "me...
train
https://github.com/RestExpress/PluginExpress/blob/aeb13907c23bf31ef2b2b17ae4c0ca4a6f5bee69/metrics/src/main/java/com/strategicgains/restexpress/plugin/metrics/LogOutputFactory.java#L73-L106
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/FileFixer.java
FileFixer.getFs
static FileSystem getFs(Configuration conf, Path p) { """ /* returns the FileSystem of the path. If the FileSystem is down, then log an error and return null """ try { return p.getFileSystem(conf); } catch (Exception e) { // if a single namenode is down, log it and ignore. Continue to ...
java
static FileSystem getFs(Configuration conf, Path p) { try { return p.getFileSystem(conf); } catch (Exception e) { // if a single namenode is down, log it and ignore. Continue to // fix other namenodes. LOG.warn("getFs: Unable to contact filesystem: " + p + " ignoring.... " + ...
[ "static", "FileSystem", "getFs", "(", "Configuration", "conf", ",", "Path", "p", ")", "{", "try", "{", "return", "p", ".", "getFileSystem", "(", "conf", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "// if a single namenode is down, log it and ignor...
/* returns the FileSystem of the path. If the FileSystem is down, then log an error and return null
[ "/", "*", "returns", "the", "FileSystem", "of", "the", "path", ".", "If", "the", "FileSystem", "is", "down", "then", "log", "an", "error", "and", "return", "null" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/hightidenode/FileFixer.java#L208-L219
vvakame/JsonPullParser
jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java
AptUtil.getNameForNew
public static String getNameForNew(Element element) { """ Returns unqualified class name (e.g. String, if java.lang.String) NB: This method requires the given element has the kind of {@link ElementKind#CLASS}. @param element @return unqualified class name @author vvakame """ if (element.getKind() != Elem...
java
public static String getNameForNew(Element element) { if (element.getKind() != ElementKind.CLASS) { throw new IllegalStateException(); } return getNameForNew("", element); }
[ "public", "static", "String", "getNameForNew", "(", "Element", "element", ")", "{", "if", "(", "element", ".", "getKind", "(", ")", "!=", "ElementKind", ".", "CLASS", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "return", "getName...
Returns unqualified class name (e.g. String, if java.lang.String) NB: This method requires the given element has the kind of {@link ElementKind#CLASS}. @param element @return unqualified class name @author vvakame
[ "Returns", "unqualified", "class", "name", "(", "e", ".", "g", ".", "String", "if", "java", ".", "lang", ".", "String", ")", "NB", ":", "This", "method", "requires", "the", "given", "element", "has", "the", "kind", "of", "{" ]
train
https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java#L254-L259
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSetSpanner.java
UnicodeSetSpanner.countIn
public int countIn(CharSequence sequence, CountMethod countMethod) { """ Returns the number of matching characters found in a character sequence, using SpanCondition.SIMPLE. The code alternates spans; see the class doc for {@link UnicodeSetSpanner} for a note about boundary conditions. @param sequence the seque...
java
public int countIn(CharSequence sequence, CountMethod countMethod) { return countIn(sequence, countMethod, SpanCondition.SIMPLE); }
[ "public", "int", "countIn", "(", "CharSequence", "sequence", ",", "CountMethod", "countMethod", ")", "{", "return", "countIn", "(", "sequence", ",", "countMethod", ",", "SpanCondition", ".", "SIMPLE", ")", ";", "}" ]
Returns the number of matching characters found in a character sequence, using SpanCondition.SIMPLE. The code alternates spans; see the class doc for {@link UnicodeSetSpanner} for a note about boundary conditions. @param sequence the sequence to count characters in @param countMethod whether to treat an entire span as ...
[ "Returns", "the", "number", "of", "matching", "characters", "found", "in", "a", "character", "sequence", "using", "SpanCondition", ".", "SIMPLE", ".", "The", "code", "alternates", "spans", ";", "see", "the", "class", "doc", "for", "{" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSetSpanner.java#L131-L133
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java
SynchronousRequest.getCurrentGameBuild
public GameBuild getCurrentGameBuild() throws GuildWars2Exception { """ For more info on build API go <a href="https://wiki.guildwars2.com/wiki/API:2/build">here</a><br/> get current game bild @return current game build @throws GuildWars2Exception see {@link ErrorCode} for detail @see GameBuild game build in...
java
public GameBuild getCurrentGameBuild() throws GuildWars2Exception { try { Response<GameBuild> response = gw2API.getCurrentGameBuild().execute(); if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); return response.body(); } catch (IOException e) { throw new GuildWars2Exceptio...
[ "public", "GameBuild", "getCurrentGameBuild", "(", ")", "throws", "GuildWars2Exception", "{", "try", "{", "Response", "<", "GameBuild", ">", "response", "=", "gw2API", ".", "getCurrentGameBuild", "(", ")", ".", "execute", "(", ")", ";", "if", "(", "!", "resp...
For more info on build API go <a href="https://wiki.guildwars2.com/wiki/API:2/build">here</a><br/> get current game bild @return current game build @throws GuildWars2Exception see {@link ErrorCode} for detail @see GameBuild game build info
[ "For", "more", "info", "on", "build", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "build", ">", "here<", "/", "a", ">", "<br", "/", ">", "get", "current", "g...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L838-L846
square/okhttp
okhttp/src/main/java/okhttp3/internal/cache/CacheStrategy.java
CacheStrategy.isCacheable
public static boolean isCacheable(Response response, Request request) { """ Returns true if {@code response} can be stored to later serve another request. """ // Always go to network for uncacheable response codes (RFC 7231 section 6.1), // This implementation doesn't support caching partial content. ...
java
public static boolean isCacheable(Response response, Request request) { // Always go to network for uncacheable response codes (RFC 7231 section 6.1), // This implementation doesn't support caching partial content. switch (response.code()) { case HTTP_OK: case HTTP_NOT_AUTHORITATIVE: case ...
[ "public", "static", "boolean", "isCacheable", "(", "Response", "response", ",", "Request", "request", ")", "{", "// Always go to network for uncacheable response codes (RFC 7231 section 6.1),", "// This implementation doesn't support caching partial content.", "switch", "(", "respons...
Returns true if {@code response} can be stored to later serve another request.
[ "Returns", "true", "if", "{" ]
train
https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/cache/CacheStrategy.java#L63-L101
alkacon/opencms-core
src/org/opencms/loader/CmsJspLoader.java
CmsJspLoader.getJspRfsPath
private String getJspRfsPath(CmsResource resource, boolean online) throws CmsLoaderException { """ Returns the RFS path for a JSP resource.<p> This does not check whether there actually exists a file at the returned path. @param resource the JSP resource @param online true if the path for the online project...
java
private String getJspRfsPath(CmsResource resource, boolean online) throws CmsLoaderException { String jspVfsName = resource.getRootPath(); String extension; int loaderId = OpenCms.getResourceManager().getResourceType(resource.getTypeId()).getLoaderId(); if ((loaderId == CmsJspLoader.RES...
[ "private", "String", "getJspRfsPath", "(", "CmsResource", "resource", ",", "boolean", "online", ")", "throws", "CmsLoaderException", "{", "String", "jspVfsName", "=", "resource", ".", "getRootPath", "(", ")", ";", "String", "extension", ";", "int", "loaderId", "...
Returns the RFS path for a JSP resource.<p> This does not check whether there actually exists a file at the returned path. @param resource the JSP resource @param online true if the path for the online project should be returned @return the RFS path for the JSP @throws CmsLoaderException if accessing the resource l...
[ "Returns", "the", "RFS", "path", "for", "a", "JSP", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsJspLoader.java#L1777-L1791
infinispan/infinispan
cdi/common/src/main/java/org/infinispan/cdi/common/util/Annotateds.java
Annotateds.createParameterId
public static <X> String createParameterId(Type type, Set<Annotation> annotations) { """ Creates a string representation of a given type and set of annotations. """ StringBuilder builder = new StringBuilder(); if (type instanceof Class<?>) { Class<?> c = (Class<?>) type; ...
java
public static <X> String createParameterId(Type type, Set<Annotation> annotations) { StringBuilder builder = new StringBuilder(); if (type instanceof Class<?>) { Class<?> c = (Class<?>) type; builder.append(c.getName()); } else { builder.append(type.toString()...
[ "public", "static", "<", "X", ">", "String", "createParameterId", "(", "Type", "type", ",", "Set", "<", "Annotation", ">", "annotations", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "type", "instanceof", "Cl...
Creates a string representation of a given type and set of annotations.
[ "Creates", "a", "string", "representation", "of", "a", "given", "type", "and", "set", "of", "annotations", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/cdi/common/src/main/java/org/infinispan/cdi/common/util/Annotateds.java#L288-L298
tvesalainen/util
util/src/main/java/org/vesalainen/util/CharSequences.java
CharSequences.endsWith
public static boolean endsWith(CharSequence seq, CharSequence pattern, IntUnaryOperator op) { """ Return true if seq end match pattern after both characters have been converted @param seq @param pattern @param op @return """ if (pattern.length() > seq.length()) { return false...
java
public static boolean endsWith(CharSequence seq, CharSequence pattern, IntUnaryOperator op) { if (pattern.length() > seq.length()) { return false; } int ls = seq.length(); int lp = pattern.length(); for (int ii=1;ii<=lp;ii++) { ...
[ "public", "static", "boolean", "endsWith", "(", "CharSequence", "seq", ",", "CharSequence", "pattern", ",", "IntUnaryOperator", "op", ")", "{", "if", "(", "pattern", ".", "length", "(", ")", ">", "seq", ".", "length", "(", ")", ")", "{", "return", "false...
Return true if seq end match pattern after both characters have been converted @param seq @param pattern @param op @return
[ "Return", "true", "if", "seq", "end", "match", "pattern", "after", "both", "characters", "have", "been", "converted" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/CharSequences.java#L114-L130
dimaki/refuel
src/main/java/de/dimaki/refuel/updater/boundary/Updater.java
Updater.getApplicationStatus
public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl) { """ Get the update status of the application specified. @param localVersion The local version string, e.g. "2.0.1344" @param updateUrl The update URL (Appcast URL) @return The application status or 'null' if the status c...
java
public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl) { return getApplicationStatus(localVersion, updateUrl, null, AppcastManager.DEFAULT_CONNECT_TIMEOUT, AppcastManager.DEFAULT_READ_TIMEOUT); }
[ "public", "ApplicationStatus", "getApplicationStatus", "(", "String", "localVersion", ",", "final", "URL", "updateUrl", ")", "{", "return", "getApplicationStatus", "(", "localVersion", ",", "updateUrl", ",", "null", ",", "AppcastManager", ".", "DEFAULT_CONNECT_TIMEOUT",...
Get the update status of the application specified. @param localVersion The local version string, e.g. "2.0.1344" @param updateUrl The update URL (Appcast URL) @return The application status or 'null' if the status could not be evaluated
[ "Get", "the", "update", "status", "of", "the", "application", "specified", "." ]
train
https://github.com/dimaki/refuel/blob/8024ac34f52b33de291d859c3b12fc237783f873/src/main/java/de/dimaki/refuel/updater/boundary/Updater.java#L68-L70
undertow-io/undertow
core/src/main/java/io/undertow/util/FlexBase64.java
FlexBase64.encodeString
public static String encodeString(byte[] source, int pos, int limit, boolean wrap) { """ Encodes a fixed and complete byte array into a Base64 String. <p>This method is only useful for applications which require a String and have all data to be encoded up-front. Note that byte arrays or buffers are almost alwa...
java
public static String encodeString(byte[] source, int pos, int limit, boolean wrap) { return Encoder.encodeString(source, pos, limit, wrap, false); }
[ "public", "static", "String", "encodeString", "(", "byte", "[", "]", "source", ",", "int", "pos", ",", "int", "limit", ",", "boolean", "wrap", ")", "{", "return", "Encoder", ".", "encodeString", "(", "source", ",", "pos", ",", "limit", ",", "wrap", ","...
Encodes a fixed and complete byte array into a Base64 String. <p>This method is only useful for applications which require a String and have all data to be encoded up-front. Note that byte arrays or buffers are almost always a better storage choice. They consume half the memory and can be reused (modified). In other w...
[ "Encodes", "a", "fixed", "and", "complete", "byte", "array", "into", "a", "Base64", "String", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/FlexBase64.java#L189-L191
apache/reef
lang/java/reef-bridge-proto-java/src/main/java/org/apache/reef/bridge/driver/common/grpc/GRPCUtils.java
GRPCUtils.createExceptionInfo
public static ExceptionInfo createExceptionInfo(final ExceptionCodec exceptionCodec, final Throwable ex) { """ Create exception info from exception object. @param exceptionCodec to encode exception into bytes @param ex exception object @return ExceptionInfo """ return ExceptionInfo.newBuilder() ...
java
public static ExceptionInfo createExceptionInfo(final ExceptionCodec exceptionCodec, final Throwable ex) { return ExceptionInfo.newBuilder() .setName(ex.getCause() != null ? ex.getCause().toString() : ex.toString()) .setMessage(StringUtils.isNotEmpty(ex.getMessage()) ? ex.getMessage() : ex.toString...
[ "public", "static", "ExceptionInfo", "createExceptionInfo", "(", "final", "ExceptionCodec", "exceptionCodec", ",", "final", "Throwable", "ex", ")", "{", "return", "ExceptionInfo", ".", "newBuilder", "(", ")", ".", "setName", "(", "ex", ".", "getCause", "(", ")",...
Create exception info from exception object. @param exceptionCodec to encode exception into bytes @param ex exception object @return ExceptionInfo
[ "Create", "exception", "info", "from", "exception", "object", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-proto-java/src/main/java/org/apache/reef/bridge/driver/common/grpc/GRPCUtils.java#L66-L72
threerings/nenya
core/src/main/java/com/threerings/chat/ComicChatOverlay.java
ComicChatOverlay.getRectWithOlds
protected Rectangle getRectWithOlds (Rectangle r, List<BubbleGlyph> oldbubs) { """ Get a rectangle based on the old bubbles, but with room for the new one. """ int n = oldbubs.size(); // if no old bubs, just return the new one. if (n == 0) { return r; } // o...
java
protected Rectangle getRectWithOlds (Rectangle r, List<BubbleGlyph> oldbubs) { int n = oldbubs.size(); // if no old bubs, just return the new one. if (n == 0) { return r; } // otherwise, encompass all the oldies Rectangle bigR = null; for (int ii=...
[ "protected", "Rectangle", "getRectWithOlds", "(", "Rectangle", "r", ",", "List", "<", "BubbleGlyph", ">", "oldbubs", ")", "{", "int", "n", "=", "oldbubs", ".", "size", "(", ")", ";", "// if no old bubs, just return the new one.", "if", "(", "n", "==", "0", "...
Get a rectangle based on the old bubbles, but with room for the new one.
[ "Get", "a", "rectangle", "based", "on", "the", "old", "bubbles", "but", "with", "room", "for", "the", "new", "one", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L439-L463
openengsb/openengsb
components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java
CheckPreCommitHook.checkInserts
private List<JPAObject> checkInserts(List<JPAObject> inserts) { """ Checks if all oid's of the given JPAObjects are not existing yet. Returns a list of objects where the JPAObject already exists. """ List<JPAObject> failedObjects = new ArrayList<JPAObject>(); for (JPAObject insert : inserts) {...
java
private List<JPAObject> checkInserts(List<JPAObject> inserts) { List<JPAObject> failedObjects = new ArrayList<JPAObject>(); for (JPAObject insert : inserts) { String oid = insert.getOID(); if (checkIfActiveOidExisting(oid)) { failedObjects.add(insert); ...
[ "private", "List", "<", "JPAObject", ">", "checkInserts", "(", "List", "<", "JPAObject", ">", "inserts", ")", "{", "List", "<", "JPAObject", ">", "failedObjects", "=", "new", "ArrayList", "<", "JPAObject", ">", "(", ")", ";", "for", "(", "JPAObject", "in...
Checks if all oid's of the given JPAObjects are not existing yet. Returns a list of objects where the JPAObject already exists.
[ "Checks", "if", "all", "oid", "s", "of", "the", "given", "JPAObjects", "are", "not", "existing", "yet", ".", "Returns", "a", "list", "of", "objects", "where", "the", "JPAObject", "already", "exists", "." ]
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java#L98-L109
apache/incubator-shardingsphere
sharding-core/sharding-core-optimize/src/main/java/org/apache/shardingsphere/core/optimize/result/insert/InsertOptimizeResult.java
InsertOptimizeResult.addUnit
public void addUnit(final SQLExpression[] columnValues, final Object[] columnParameters) { """ Add insert optimize result uint. @param columnValues column values @param columnParameters column parameters """ if (type == InsertType.VALUES) { this.units.add(new ColumnValueOptimizeResult(c...
java
public void addUnit(final SQLExpression[] columnValues, final Object[] columnParameters) { if (type == InsertType.VALUES) { this.units.add(new ColumnValueOptimizeResult(columnNames, columnValues, columnParameters)); } else { this.units.add(new SetAssignmentOptimizeResult(columnNa...
[ "public", "void", "addUnit", "(", "final", "SQLExpression", "[", "]", "columnValues", ",", "final", "Object", "[", "]", "columnParameters", ")", "{", "if", "(", "type", "==", "InsertType", ".", "VALUES", ")", "{", "this", ".", "units", ".", "add", "(", ...
Add insert optimize result uint. @param columnValues column values @param columnParameters column parameters
[ "Add", "insert", "optimize", "result", "uint", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-optimize/src/main/java/org/apache/shardingsphere/core/optimize/result/insert/InsertOptimizeResult.java#L53-L59
sagiegurari/fax4j
src/main/java/org/fax4j/util/IOHelper.java
IOHelper.writeFile
public static void writeFile(byte[] content,File file) throws IOException { """ Writes the content to the file. @param content The content to write to the provided file @param file The target file @throws IOException Any IO exception """ OutputStream outputStream=null; try ...
java
public static void writeFile(byte[] content,File file) throws IOException { OutputStream outputStream=null; try { //create output stream to file outputStream=new FileOutputStream(file); //write to file outputStream.write(content); ...
[ "public", "static", "void", "writeFile", "(", "byte", "[", "]", "content", ",", "File", "file", ")", "throws", "IOException", "{", "OutputStream", "outputStream", "=", "null", ";", "try", "{", "//create output stream to file", "outputStream", "=", "new", "FileOu...
Writes the content to the file. @param content The content to write to the provided file @param file The target file @throws IOException Any IO exception
[ "Writes", "the", "content", "to", "the", "file", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/IOHelper.java#L463-L479
apache/incubator-gobblin
gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/extractor/InstrumentedExtractorBase.java
InstrumentedExtractorBase.afterRead
public void afterRead(D record, long startTime) { """ Called after each record is read. @param record record read. @param startTime reading start time. """ Instrumented.updateTimer(this.extractorTimer, System.nanoTime() - startTime, TimeUnit.NANOSECONDS); if (record != null) { Instrumented.mark...
java
public void afterRead(D record, long startTime) { Instrumented.updateTimer(this.extractorTimer, System.nanoTime() - startTime, TimeUnit.NANOSECONDS); if (record != null) { Instrumented.markMeter(this.readRecordsMeter); } }
[ "public", "void", "afterRead", "(", "D", "record", ",", "long", "startTime", ")", "{", "Instrumented", ".", "updateTimer", "(", "this", ".", "extractorTimer", ",", "System", ".", "nanoTime", "(", ")", "-", "startTime", ",", "TimeUnit", ".", "NANOSECONDS", ...
Called after each record is read. @param record record read. @param startTime reading start time.
[ "Called", "after", "each", "record", "is", "read", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/extractor/InstrumentedExtractorBase.java#L208-L213
google/j2objc
jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/ICU.java
ICU.getCurrencySymbol
public static String getCurrencySymbol(Locale locale, String currencyCode) { """ public static native int getCurrencyNumericCode(String currencyCode); J2ObjC unused. """ return getCurrencySymbol(locale.toLanguageTag(), currencyCode); }
java
public static String getCurrencySymbol(Locale locale, String currencyCode) { return getCurrencySymbol(locale.toLanguageTag(), currencyCode); }
[ "public", "static", "String", "getCurrencySymbol", "(", "Locale", "locale", ",", "String", "currencyCode", ")", "{", "return", "getCurrencySymbol", "(", "locale", ".", "toLanguageTag", "(", ")", ",", "currencyCode", ")", ";", "}" ]
public static native int getCurrencyNumericCode(String currencyCode); J2ObjC unused.
[ "public", "static", "native", "int", "getCurrencyNumericCode", "(", "String", "currencyCode", ")", ";", "J2ObjC", "unused", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/objc/java/libcore/icu/ICU.java#L411-L413
goldmansachs/gs-collections
collections/src/main/java/com/gs/collections/impl/utility/Iterate.java
Iterate.forEachWithIndex
public static <T> void forEachWithIndex(Iterable<T> iterable, ObjectIntProcedure<? super T> objectIntProcedure) { """ Iterates over a collection passing each element and the current relative int index to the specified instance of ObjectIntProcedure. <p> Example using a Java 8 lambda expression: <pre> Iterate....
java
public static <T> void forEachWithIndex(Iterable<T> iterable, ObjectIntProcedure<? super T> objectIntProcedure) { if (iterable instanceof InternalIterable) { ((InternalIterable<T>) iterable).forEachWithIndex(objectIntProcedure); } else if (iterable instanceof ArrayList) ...
[ "public", "static", "<", "T", ">", "void", "forEachWithIndex", "(", "Iterable", "<", "T", ">", "iterable", ",", "ObjectIntProcedure", "<", "?", "super", "T", ">", "objectIntProcedure", ")", "{", "if", "(", "iterable", "instanceof", "InternalIterable", ")", "...
Iterates over a collection passing each element and the current relative int index to the specified instance of ObjectIntProcedure. <p> Example using a Java 8 lambda expression: <pre> Iterate.<b>forEachWithIndex</b>(people, (Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName())); ...
[ "Iterates", "over", "a", "collection", "passing", "each", "element", "and", "the", "current", "relative", "int", "index", "to", "the", "specified", "instance", "of", "ObjectIntProcedure", ".", "<p", ">", "Example", "using", "a", "Java", "8", "lambda", "express...
train
https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/Iterate.java#L224-L246
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java
CPDefinitionLinkPersistenceImpl.findByCP_T
@Override public List<CPDefinitionLink> findByCP_T(long CProductId, String type, int start, int end) { """ Returns a range of all the cp definition links where CProductId = &#63; and type = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code>...
java
@Override public List<CPDefinitionLink> findByCP_T(long CProductId, String type, int start, int end) { return findByCP_T(CProductId, type, start, end, null); }
[ "@", "Override", "public", "List", "<", "CPDefinitionLink", ">", "findByCP_T", "(", "long", "CProductId", ",", "String", "type", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCP_T", "(", "CProductId", ",", "type", ",", "start", ",", ...
Returns a range of all the cp definition links where CProductId = &#63; and type = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the fir...
[ "Returns", "a", "range", "of", "all", "the", "cp", "definition", "links", "where", "CProductId", "=", "&#63", ";", "and", "type", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L3153-L3157
SeaCloudsEU/SeaCloudsPlatform
dashboard/src/main/java/eu/seaclouds/platform/dashboard/util/ObjectMapperHelpers.java
ObjectMapperHelpers.JsonToObject
public static <T> T JsonToObject(String json, Class<T> type) throws IOException { """ Transforms a JSON string to an Object using org.codehaus.jackson.map.ObjectMapper If you want to parse a collection please @see {#link JsonToObjectCollection} @param json @param type Class object representing the target clas...
java
public static <T> T JsonToObject(String json, Class<T> type) throws IOException { return JACKSON2_MAPPER.readValue(json, type); }
[ "public", "static", "<", "T", ">", "T", "JsonToObject", "(", "String", "json", ",", "Class", "<", "T", ">", "type", ")", "throws", "IOException", "{", "return", "JACKSON2_MAPPER", ".", "readValue", "(", "json", ",", "type", ")", ";", "}" ]
Transforms a JSON string to an Object using org.codehaus.jackson.map.ObjectMapper If you want to parse a collection please @see {#link JsonToObjectCollection} @param json @param type Class object representing the target class T @param <T> target class @return an instance of T @throws IOException if is not possible to...
[ "Transforms", "a", "JSON", "string", "to", "an", "Object", "using", "org", ".", "codehaus", ".", "jackson", ".", "map", ".", "ObjectMapper", "If", "you", "want", "to", "parse", "a", "collection", "please", "@see", "{", "#link", "JsonToObjectCollection", "}" ...
train
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/dashboard/src/main/java/eu/seaclouds/platform/dashboard/util/ObjectMapperHelpers.java#L52-L55
Azure/azure-sdk-for-java
servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java
ClientFactory.createMessageSenderFromEntityPathAsync
public static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) { """ Creates a message sender asynchronously to the entity using the client settings. @param namespaceEndpointURI endpoint uri of entity namespace @p...
java
public static CompletableFuture<IMessageSender> createMessageSenderFromEntityPathAsync(URI namespaceEndpointURI, String entityPath, ClientSettings clientSettings) { return createMessageSenderFromEntityPathAsync(namespaceEndpointURI, entityPath, null, clientSettings); }
[ "public", "static", "CompletableFuture", "<", "IMessageSender", ">", "createMessageSenderFromEntityPathAsync", "(", "URI", "namespaceEndpointURI", ",", "String", "entityPath", ",", "ClientSettings", "clientSettings", ")", "{", "return", "createMessageSenderFromEntityPathAsync",...
Creates a message sender asynchronously to the entity using the client settings. @param namespaceEndpointURI endpoint uri of entity namespace @param entityPath path of entity @param clientSettings client settings @return a CompletableFuture representing the pending creating of IMessageSender instance
[ "Creates", "a", "message", "sender", "asynchronously", "to", "the", "entity", "using", "the", "client", "settings", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L169-L172
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/util/encoding/HttpEncodingTools.java
HttpEncodingTools.encodePath
@Deprecated public static String encodePath(String path) { """ Encodes characters in the string except for those allowed in an absolute path. @deprecated Prefer to use {@link HttpEncodingTools#encode(String)} instead for encoding specific pieces of the URI. This method does not escape certain reserved char...
java
@Deprecated public static String encodePath(String path) { try { return URIUtil.encodePath(path, "UTF-8"); } catch (URIException ex) { throw new EsHadoopIllegalArgumentException("Cannot encode path segment [" + path + "]", ex); } }
[ "@", "Deprecated", "public", "static", "String", "encodePath", "(", "String", "path", ")", "{", "try", "{", "return", "URIUtil", ".", "encodePath", "(", "path", ",", "\"UTF-8\"", ")", ";", "}", "catch", "(", "URIException", "ex", ")", "{", "throw", "new"...
Encodes characters in the string except for those allowed in an absolute path. @deprecated Prefer to use {@link HttpEncodingTools#encode(String)} instead for encoding specific pieces of the URI. This method does not escape certain reserved characters, like '/' and ':'. As such, this is not safe to use on paths that ma...
[ "Encodes", "characters", "in", "the", "string", "except", "for", "those", "allowed", "in", "an", "absolute", "path", "." ]
train
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/util/encoding/HttpEncodingTools.java#L68-L75
SonarSource/sonarqube
server/sonar-server/src/main/java/org/sonar/server/organization/OrganizationUpdaterImpl.java
OrganizationUpdaterImpl.insertOwnersGroup
private GroupDto insertOwnersGroup(DbSession dbSession, OrganizationDto organization) { """ Owners group has an hard coded name, a description based on the organization's name and has all global permissions. """ GroupDto group = dbClient.groupDao().insert(dbSession, new GroupDto() .setOrganizationUui...
java
private GroupDto insertOwnersGroup(DbSession dbSession, OrganizationDto organization) { GroupDto group = dbClient.groupDao().insert(dbSession, new GroupDto() .setOrganizationUuid(organization.getUuid()) .setName(OWNERS_GROUP_NAME) .setDescription(format(OWNERS_GROUP_DESCRIPTION_PATTERN, organizati...
[ "private", "GroupDto", "insertOwnersGroup", "(", "DbSession", "dbSession", ",", "OrganizationDto", "organization", ")", "{", "GroupDto", "group", "=", "dbClient", ".", "groupDao", "(", ")", ".", "insert", "(", "dbSession", ",", "new", "GroupDto", "(", ")", "."...
Owners group has an hard coded name, a description based on the organization's name and has all global permissions.
[ "Owners", "group", "has", "an", "hard", "coded", "name", "a", "description", "based", "on", "the", "organization", "s", "name", "and", "has", "all", "global", "permissions", "." ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/organization/OrganizationUpdaterImpl.java#L322-L329
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/StatementManager.java
StatementManager.bindStatement
private int bindStatement(PreparedStatement stmt, int index, SelectionCriteria crit, ClassDescriptor cld) throws SQLException { """ bind SelectionCriteria @param stmt the PreparedStatement @param index the position of the parameter to bind @param crit the Criteria containing the parameter @param cld the ClassD...
java
private int bindStatement(PreparedStatement stmt, int index, SelectionCriteria crit, ClassDescriptor cld) throws SQLException { return bindStatementValue(stmt, index, crit.getAttribute(), crit.getValue(), cld); }
[ "private", "int", "bindStatement", "(", "PreparedStatement", "stmt", ",", "int", "index", ",", "SelectionCriteria", "crit", ",", "ClassDescriptor", "cld", ")", "throws", "SQLException", "{", "return", "bindStatementValue", "(", "stmt", ",", "index", ",", "crit", ...
bind SelectionCriteria @param stmt the PreparedStatement @param index the position of the parameter to bind @param crit the Criteria containing the parameter @param cld the ClassDescriptor @return next index for PreparedStatement
[ "bind", "SelectionCriteria" ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java#L246-L249
primefaces/primefaces
src/main/java/org/primefaces/component/importconstants/ImportConstantsTagHandler.java
ImportConstantsTagHandler.getClassFromAttribute
protected Class<?> getClassFromAttribute(TagAttribute attribute, FaceletContext ctx) { """ Gets the {@link Class} from the {@link TagAttribute}. @param attribute The {@link TagAttribute}. @param ctx The {@link FaceletContext}. @return The {@link Class}. """ String type = attribute.getValue(c...
java
protected Class<?> getClassFromAttribute(TagAttribute attribute, FaceletContext ctx) { String type = attribute.getValue(ctx); try { return LangUtils.loadClassForName(type); } catch (ClassNotFoundException e) { throw new FacesException("Class " + type + " not foun...
[ "protected", "Class", "<", "?", ">", "getClassFromAttribute", "(", "TagAttribute", "attribute", ",", "FaceletContext", "ctx", ")", "{", "String", "type", "=", "attribute", ".", "getValue", "(", "ctx", ")", ";", "try", "{", "return", "LangUtils", ".", "loadCl...
Gets the {@link Class} from the {@link TagAttribute}. @param attribute The {@link TagAttribute}. @param ctx The {@link FaceletContext}. @return The {@link Class}.
[ "Gets", "the", "{", "@link", "Class", "}", "from", "the", "{", "@link", "TagAttribute", "}", "." ]
train
https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/component/importconstants/ImportConstantsTagHandler.java#L86-L95
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ComponentUtil.java
ComponentUtil.registerTypeMapping
private static Class registerTypeMapping(Class clazz) throws PageException { """ search in methods of a class for complex types @param clazz @return @throws PageException """ PageContext pc = ThreadLocalPageContext.get(); WSServer server = ((ConfigImpl) ThreadLocalPageContext.getConfig(pc)).getWSHandler...
java
private static Class registerTypeMapping(Class clazz) throws PageException { PageContext pc = ThreadLocalPageContext.get(); WSServer server = ((ConfigImpl) ThreadLocalPageContext.getConfig(pc)).getWSHandler().getWSServer(pc); return registerTypeMapping(server, clazz); }
[ "private", "static", "Class", "registerTypeMapping", "(", "Class", "clazz", ")", "throws", "PageException", "{", "PageContext", "pc", "=", "ThreadLocalPageContext", ".", "get", "(", ")", ";", "WSServer", "server", "=", "(", "(", "ConfigImpl", ")", "ThreadLocalPa...
search in methods of a class for complex types @param clazz @return @throws PageException
[ "search", "in", "methods", "of", "a", "class", "for", "complex", "types" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java#L278-L282
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.makeActionLabel
public static Label makeActionLabel (Label label, ClickHandler onClick) { """ Makes the supplied label into an action label. The label will be styled such that it configures the mouse pointer and adds underline to the text. """ return makeActionable(label, onClick, null); }
java
public static Label makeActionLabel (Label label, ClickHandler onClick) { return makeActionable(label, onClick, null); }
[ "public", "static", "Label", "makeActionLabel", "(", "Label", "label", ",", "ClickHandler", "onClick", ")", "{", "return", "makeActionable", "(", "label", ",", "onClick", ",", "null", ")", ";", "}" ]
Makes the supplied label into an action label. The label will be styled such that it configures the mouse pointer and adds underline to the text.
[ "Makes", "the", "supplied", "label", "into", "an", "action", "label", ".", "The", "label", "will", "be", "styled", "such", "that", "it", "configures", "the", "mouse", "pointer", "and", "adds", "underline", "to", "the", "text", "." ]
train
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L213-L216
rhuss/jolokia
agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgent.java
JvmAgent.premain
public static void premain(String agentArgs, Instrumentation inst) { """ Entry point for the agent, using command line attach (that is via -javaagent command line argument) @param agentArgs arguments as given on the command line """ startAgent(new JvmAgentConfig(agentArgs), true /* register and det...
java
public static void premain(String agentArgs, Instrumentation inst) { startAgent(new JvmAgentConfig(agentArgs), true /* register and detect lazy */, inst); }
[ "public", "static", "void", "premain", "(", "String", "agentArgs", ",", "Instrumentation", "inst", ")", "{", "startAgent", "(", "new", "JvmAgentConfig", "(", "agentArgs", ")", ",", "true", "/* register and detect lazy */", ",", "inst", ")", ";", "}" ]
Entry point for the agent, using command line attach (that is via -javaagent command line argument) @param agentArgs arguments as given on the command line
[ "Entry", "point", "for", "the", "agent", "using", "command", "line", "attach", "(", "that", "is", "via", "-", "javaagent", "command", "line", "argument", ")" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgent.java#L71-L73
OpenLiberty/open-liberty
dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java
AppBndAuthorizationTableService.establishInitialTable
private boolean establishInitialTable(String appName, Collection<SecurityRole> secRoles) { """ Establishes the basic information that comprises an authorization table, but all real work is deferred until later. This has some benefits:<p> <ol> <li>Faster application deployment</li> <li>If the authorization tabl...
java
private boolean establishInitialTable(String appName, Collection<SecurityRole> secRoles) { // Create and add a new table if we don't have a cached copy if (resourceToAuthzInfoMap.putIfAbsent(appName, new AuthzInfo(appName, secRoles)) == null) { if (TraceComponent.isAnyTracingEnabled() && tc....
[ "private", "boolean", "establishInitialTable", "(", "String", "appName", ",", "Collection", "<", "SecurityRole", ">", "secRoles", ")", "{", "// Create and add a new table if we don't have a cached copy", "if", "(", "resourceToAuthzInfoMap", ".", "putIfAbsent", "(", "appName...
Establishes the basic information that comprises an authorization table, but all real work is deferred until later. This has some benefits:<p> <ol> <li>Faster application deployment</li> <li>If the authorization table is not used, such as for SAF authorization, we do not incur much cost to establish the table.</li> </o...
[ "Establishes", "the", "basic", "information", "that", "comprises", "an", "authorization", "table", "but", "all", "real", "work", "is", "deferred", "until", "later", ".", "This", "has", "some", "benefits", ":", "<p", ">", "<ol", ">", "<li", ">", "Faster", "...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java#L210-L219
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java
Utils.computeFileRelativeLocation
public static String computeFileRelativeLocation( File rootDirectory, File subFile ) { """ Computes the relative location of a file with respect to a root directory. @param rootDirectory a directory @param subFile a file contained (directly or indirectly) in the directory @return a non-null string """ St...
java
public static String computeFileRelativeLocation( File rootDirectory, File subFile ) { String rootPath = rootDirectory.getAbsolutePath(); String subPath = subFile.getAbsolutePath(); if( ! subPath.startsWith( rootPath )) throw new IllegalArgumentException( "The sub-file must be contained in the directory." );...
[ "public", "static", "String", "computeFileRelativeLocation", "(", "File", "rootDirectory", ",", "File", "subFile", ")", "{", "String", "rootPath", "=", "rootDirectory", ".", "getAbsolutePath", "(", ")", ";", "String", "subPath", "=", "subFile", ".", "getAbsolutePa...
Computes the relative location of a file with respect to a root directory. @param rootDirectory a directory @param subFile a file contained (directly or indirectly) in the directory @return a non-null string
[ "Computes", "the", "relative", "location", "of", "a", "file", "with", "respect", "to", "a", "root", "directory", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L899-L910
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/record/RecordFile.java
RecordFile.setVal
public void setVal(String fldName, Constant val) { """ Sets a value of the specified field in the current record. The type of the value must be equal to that of the specified field. @param fldName the name of the field @param val the new value for the field """ if (tx.isReadOnly() && !isTempTable()) ...
java
public void setVal(String fldName, Constant val) { if (tx.isReadOnly() && !isTempTable()) throw new UnsupportedOperationException(); Type fldType = ti.schema().type(fldName); Constant v = val.castTo(fldType); if (Page.size(v) > Page.maxSize(fldType)) throw new SchemaIncompatibleException(); rp....
[ "public", "void", "setVal", "(", "String", "fldName", ",", "Constant", "val", ")", "{", "if", "(", "tx", ".", "isReadOnly", "(", ")", "&&", "!", "isTempTable", "(", ")", ")", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "Type", "fldTyp...
Sets a value of the specified field in the current record. The type of the value must be equal to that of the specified field. @param fldName the name of the field @param val the new value for the field
[ "Sets", "a", "value", "of", "the", "specified", "field", "in", "the", "current", "record", ".", "The", "type", "of", "the", "value", "must", "be", "equal", "to", "that", "of", "the", "specified", "field", "." ]
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/record/RecordFile.java#L159-L168
lightblueseas/file-worker
src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java
WriteFileExtensions.writeByteArrayToFile
public static void writeByteArrayToFile(final File file, final byte[] byteArray) throws IOException { """ Writes the given byte array to the given file. @param file The file. @param byteArray The byte array. @throws IOException Signals that an I/O exception has occurred. """ try (FileOutputStream f...
java
public static void writeByteArrayToFile(final File file, final byte[] byteArray) throws IOException { try (FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(fos)) { bos.write(byteArray); } catch (final FileNotFoundException ex) { throw ex; } ...
[ "public", "static", "void", "writeByteArrayToFile", "(", "final", "File", "file", ",", "final", "byte", "[", "]", "byteArray", ")", "throws", "IOException", "{", "try", "(", "FileOutputStream", "fos", "=", "new", "FileOutputStream", "(", "file", ")", ";", "B...
Writes the given byte array to the given file. @param file The file. @param byteArray The byte array. @throws IOException Signals that an I/O exception has occurred.
[ "Writes", "the", "given", "byte", "array", "to", "the", "given", "file", "." ]
train
https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java#L437-L453
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java
ReviewsImpl.addVideoTranscript
public void addVideoTranscript(String teamName, String reviewId, byte[] vTTfile) { """ This API adds a transcript file (text version of all the words spoken in a video) to a video review. The file should be a valid WebVTT format. @param teamName Your team name. @param reviewId Id of the review. @param vTTfile...
java
public void addVideoTranscript(String teamName, String reviewId, byte[] vTTfile) { addVideoTranscriptWithServiceResponseAsync(teamName, reviewId, vTTfile).toBlocking().single().body(); }
[ "public", "void", "addVideoTranscript", "(", "String", "teamName", ",", "String", "reviewId", ",", "byte", "[", "]", "vTTfile", ")", "{", "addVideoTranscriptWithServiceResponseAsync", "(", "teamName", ",", "reviewId", ",", "vTTfile", ")", ".", "toBlocking", "(", ...
This API adds a transcript file (text version of all the words spoken in a video) to a video review. The file should be a valid WebVTT format. @param teamName Your team name. @param reviewId Id of the review. @param vTTfile Transcript file of the video. @throws IllegalArgumentException thrown if parameters fail the va...
[ "This", "API", "adds", "a", "transcript", "file", "(", "text", "version", "of", "all", "the", "words", "spoken", "in", "a", "video", ")", "to", "a", "video", "review", ".", "The", "file", "should", "be", "a", "valid", "WebVTT", "format", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L1792-L1794
deeplearning4j/deeplearning4j
rl4j/rl4j-malmo/src/main/java/org/deeplearning4j/malmo/MalmoEnv.java
MalmoEnv.loadMissionXML
public static MissionSpec loadMissionXML(String filename) { """ Convenience method to load a Malmo mission specification from an XML-file @param filename name of XML file @return Mission specification loaded from XML-file """ MissionSpec mission = null; try { String xml = new Stri...
java
public static MissionSpec loadMissionXML(String filename) { MissionSpec mission = null; try { String xml = new String(Files.readAllBytes(Paths.get(filename))); mission = new MissionSpec(xml, true); } catch (Exception e) { //e.printStackTrace(); thr...
[ "public", "static", "MissionSpec", "loadMissionXML", "(", "String", "filename", ")", "{", "MissionSpec", "mission", "=", "null", ";", "try", "{", "String", "xml", "=", "new", "String", "(", "Files", ".", "readAllBytes", "(", "Paths", ".", "get", "(", "file...
Convenience method to load a Malmo mission specification from an XML-file @param filename name of XML file @return Mission specification loaded from XML-file
[ "Convenience", "method", "to", "load", "a", "Malmo", "mission", "specification", "from", "an", "XML", "-", "file" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/rl4j/rl4j-malmo/src/main/java/org/deeplearning4j/malmo/MalmoEnv.java#L140-L151
finmath/finmath-lib
src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java
BermudanSwaptionFromSwapSchedules.getConditionalExpectationEstimator
public ConditionalExpectationEstimator getConditionalExpectationEstimator(double exerciseTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException { """ The conditional expectation is calculated using a Monte-Carlo regression technique. @param exerciseTime The exercise time @param model The ...
java
public ConditionalExpectationEstimator getConditionalExpectationEstimator(double exerciseTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException { RandomVariable[] regressionBasisFunctions = regressionBasisFunctionProvider.getBasisFunctions(exerciseTime, model); return conditionalExpectationR...
[ "public", "ConditionalExpectationEstimator", "getConditionalExpectationEstimator", "(", "double", "exerciseTime", ",", "LIBORModelMonteCarloSimulationModel", "model", ")", "throws", "CalculationException", "{", "RandomVariable", "[", "]", "regressionBasisFunctions", "=", "regress...
The conditional expectation is calculated using a Monte-Carlo regression technique. @param exerciseTime The exercise time @param model The valuation model @return The condition expectation estimator @throws CalculationException Thrown if underlying model failed to calculate stochastic process.
[ "The", "conditional", "expectation", "is", "calculated", "using", "a", "Monte", "-", "Carlo", "regression", "technique", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java#L324-L327
js-lib-com/commons
src/main/java/js/util/Strings.java
Strings.save
public static void save(CharSequence chars, OutputStream outputStream) throws IOException { """ Copy source characters to requested output bytes stream. If given <code>chars</code> parameter is null or empty this method does nothing. @param chars source characters stream, @param outputStream target bytes stre...
java
public static void save(CharSequence chars, OutputStream outputStream) throws IOException { if(chars != null) { ByteArrayInputStream inputStream = new ByteArrayInputStream(chars.toString().getBytes()); Files.copy(inputStream, outputStream); } }
[ "public", "static", "void", "save", "(", "CharSequence", "chars", ",", "OutputStream", "outputStream", ")", "throws", "IOException", "{", "if", "(", "chars", "!=", "null", ")", "{", "ByteArrayInputStream", "inputStream", "=", "new", "ByteArrayInputStream", "(", ...
Copy source characters to requested output bytes stream. If given <code>chars</code> parameter is null or empty this method does nothing. @param chars source characters stream, @param outputStream target bytes stream. @throws IOException if copy operation fails.
[ "Copy", "source", "characters", "to", "requested", "output", "bytes", "stream", ".", "If", "given", "<code", ">", "chars<", "/", "code", ">", "parameter", "is", "null", "or", "empty", "this", "method", "does", "nothing", "." ]
train
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Strings.java#L1525-L1531
phax/ph-commons
ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathFunctionResolver.java
MapBasedXPathFunctionResolver.addAllFrom
@Nonnull public EChange addAllFrom (@Nonnull final MapBasedXPathFunctionResolver aOther, final boolean bOverwrite) { """ Add all functions from the other function resolver into this resolver. @param aOther The function resolver to import the functions from. May not be <code>null</code>. @param bOverwrite ...
java
@Nonnull public EChange addAllFrom (@Nonnull final MapBasedXPathFunctionResolver aOther, final boolean bOverwrite) { ValueEnforcer.notNull (aOther, "Other"); EChange eChange = EChange.UNCHANGED; for (final Map.Entry <XPathFunctionKey, XPathFunction> aEntry : aOther.m_aMap.entrySet ()) if (bOverwri...
[ "@", "Nonnull", "public", "EChange", "addAllFrom", "(", "@", "Nonnull", "final", "MapBasedXPathFunctionResolver", "aOther", ",", "final", "boolean", "bOverwrite", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aOther", ",", "\"Other\"", ")", ";", "EChange", "e...
Add all functions from the other function resolver into this resolver. @param aOther The function resolver to import the functions from. May not be <code>null</code>. @param bOverwrite if <code>true</code> existing functions will be overwritten with the new functions, otherwise the old functions are kept. @return {@li...
[ "Add", "all", "functions", "from", "the", "other", "function", "resolver", "into", "this", "resolver", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathFunctionResolver.java#L129-L141
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java
PlanNode.findAncestor
public PlanNode findAncestor( Type firstTypeToFind, Type... additionalTypesToFind ) { """ Starting at the parent of this node, find the lowest (also closest) ancestor that has one of the specified types. @param firstTypeToFind the first type to find; may not be null @param add...
java
public PlanNode findAncestor( Type firstTypeToFind, Type... additionalTypesToFind ) { return findAncestor(EnumSet.of(firstTypeToFind, additionalTypesToFind)); }
[ "public", "PlanNode", "findAncestor", "(", "Type", "firstTypeToFind", ",", "Type", "...", "additionalTypesToFind", ")", "{", "return", "findAncestor", "(", "EnumSet", ".", "of", "(", "firstTypeToFind", ",", "additionalTypesToFind", ")", ")", ";", "}" ]
Starting at the parent of this node, find the lowest (also closest) ancestor that has one of the specified types. @param firstTypeToFind the first type to find; may not be null @param additionalTypesToFind additional types to find; may not be null @return the node with the specified type, or null if there is no such a...
[ "Starting", "at", "the", "parent", "of", "this", "node", "find", "the", "lowest", "(", "also", "closest", ")", "ancestor", "that", "has", "one", "of", "the", "specified", "types", "." ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1121-L1124
tvesalainen/util
util/src/main/java/org/vesalainen/util/InterfaceTracer.java
InterfaceTracer.getTracer
public static <T> T getTracer(Class<T> intf, T ob) { """ Creates a tracer for intf @param <T> @param intf Implemented interface @param ob Class instance for given interface or null @return """ return getTracer(intf, new InterfaceTracer(ob), ob); }
java
public static <T> T getTracer(Class<T> intf, T ob) { return getTracer(intf, new InterfaceTracer(ob), ob); }
[ "public", "static", "<", "T", ">", "T", "getTracer", "(", "Class", "<", "T", ">", "intf", ",", "T", "ob", ")", "{", "return", "getTracer", "(", "intf", ",", "new", "InterfaceTracer", "(", "ob", ")", ",", "ob", ")", ";", "}" ]
Creates a tracer for intf @param <T> @param intf Implemented interface @param ob Class instance for given interface or null @return
[ "Creates", "a", "tracer", "for", "intf" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/InterfaceTracer.java#L62-L65
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java
Aggregations.bigIntegerSum
public static <Key, Value> Aggregation<Key, BigInteger, BigInteger> bigIntegerSum() { """ Returns an aggregation to calculate the {@link java.math.BigInteger} sum of all supplied values.<br/> This aggregation is similar to: <pre>SELECT SUM(value) FROM x</pre> @param <Key> the input key type @param <Value> ...
java
public static <Key, Value> Aggregation<Key, BigInteger, BigInteger> bigIntegerSum() { return new AggregationAdapter(new BigIntegerSumAggregation<Key, Value>()); }
[ "public", "static", "<", "Key", ",", "Value", ">", "Aggregation", "<", "Key", ",", "BigInteger", ",", "BigInteger", ">", "bigIntegerSum", "(", ")", "{", "return", "new", "AggregationAdapter", "(", "new", "BigIntegerSumAggregation", "<", "Key", ",", "Value", ...
Returns an aggregation to calculate the {@link java.math.BigInteger} sum of all supplied values.<br/> This aggregation is similar to: <pre>SELECT SUM(value) FROM x</pre> @param <Key> the input key type @param <Value> the supplied value type @return the sum over all supplied values
[ "Returns", "an", "aggregation", "to", "calculate", "the", "{", "@link", "java", ".", "math", ".", "BigInteger", "}", "sum", "of", "all", "supplied", "values", ".", "<br", "/", ">", "This", "aggregation", "is", "similar", "to", ":", "<pre", ">", "SELECT",...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L312-L314
aoindustries/semanticcms-core-model
src/main/java/com/semanticcms/core/model/ResourceRef.java
ResourceRef.setPath
public ResourceRef setPath(Path newPath) { """ Sets the path. @return this object if path unchanged or a new object representing the new path """ if(newPath.equals(path)) { return this; } else { return new ResourceRef(bookRef, newPath); } }
java
public ResourceRef setPath(Path newPath) { if(newPath.equals(path)) { return this; } else { return new ResourceRef(bookRef, newPath); } }
[ "public", "ResourceRef", "setPath", "(", "Path", "newPath", ")", "{", "if", "(", "newPath", ".", "equals", "(", "path", ")", ")", "{", "return", "this", ";", "}", "else", "{", "return", "new", "ResourceRef", "(", "bookRef", ",", "newPath", ")", ";", ...
Sets the path. @return this object if path unchanged or a new object representing the new path
[ "Sets", "the", "path", "." ]
train
https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/ResourceRef.java#L62-L68
heinrichreimer/material-drawer
library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java
DrawerItem.setRoundedImage
public DrawerItem setRoundedImage(Context context, Bitmap image, int imageMode) { """ Sets a rounded image with a given image mode to the drawer item @param image Image to set @param imageMode Image mode to set """ return setImage(new RoundedAvatarDrawable(new BitmapDrawable(context.getResource...
java
public DrawerItem setRoundedImage(Context context, Bitmap image, int imageMode) { return setImage(new RoundedAvatarDrawable(new BitmapDrawable(context.getResources(), image).getBitmap()), imageMode); }
[ "public", "DrawerItem", "setRoundedImage", "(", "Context", "context", ",", "Bitmap", "image", ",", "int", "imageMode", ")", "{", "return", "setImage", "(", "new", "RoundedAvatarDrawable", "(", "new", "BitmapDrawable", "(", "context", ".", "getResources", "(", ")...
Sets a rounded image with a given image mode to the drawer item @param image Image to set @param imageMode Image mode to set
[ "Sets", "a", "rounded", "image", "with", "a", "given", "image", "mode", "to", "the", "drawer", "item" ]
train
https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java#L232-L234
voldemort/voldemort
contrib/collections/src/java/voldemort/collections/VLinkedPagedList.java
VLinkedPagedList.listIterator
public MappedListIterator<VLinkedPagedKey, LK> listIterator(LK linearKey, boolean next) { """ Return a listIterator<K>. Uses the page index to figure out what page to start iterating from. Runtime: 2 - 3 gets. @param linearKey key to position the cursor. @param next true if the cursor is to be placed direc...
java
public MappedListIterator<VLinkedPagedKey, LK> listIterator(LK linearKey, boolean next) { int indexPage = 0; if(linearKey == null) { if(next) { indexPage = 0; } else { List<Map<String, Object>> indexList = _pageIndex.getValue(_identifier); ...
[ "public", "MappedListIterator", "<", "VLinkedPagedKey", ",", "LK", ">", "listIterator", "(", "LK", "linearKey", ",", "boolean", "next", ")", "{", "int", "indexPage", "=", "0", ";", "if", "(", "linearKey", "==", "null", ")", "{", "if", "(", "next", ")", ...
Return a listIterator<K>. Uses the page index to figure out what page to start iterating from. Runtime: 2 - 3 gets. @param linearKey key to position the cursor. @param next true if the cursor is to be placed directly before the first key that is less than linearKey false if the cursor is to be placed directly after t...
[ "Return", "a", "listIterator<K", ">", ".", "Uses", "the", "page", "index", "to", "figure", "out", "what", "page", "to", "start", "iterating", "from", "." ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/collections/src/java/voldemort/collections/VLinkedPagedList.java#L145-L172
kuali/ojb-1.0.4
src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java
FieldDescriptorConstraints.checkReadonlyAccessForNativePKs
private void checkReadonlyAccessForNativePKs(FieldDescriptorDef fieldDef, String checkLevel) { """ Checks that native primarykey fields have readonly access, and warns if not. @param fieldDef The field descriptor @param checkLevel The current check level (this constraint is checked in basic and strict) """...
java
private void checkReadonlyAccessForNativePKs(FieldDescriptorDef fieldDef, String checkLevel) { if (CHECKLEVEL_NONE.equals(checkLevel)) { return; } String access = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_ACCESS); String autoInc = fieldDef.getProp...
[ "private", "void", "checkReadonlyAccessForNativePKs", "(", "FieldDescriptorDef", "fieldDef", ",", "String", "checkLevel", ")", "{", "if", "(", "CHECKLEVEL_NONE", ".", "equals", "(", "checkLevel", ")", ")", "{", "return", ";", "}", "String", "access", "=", "field...
Checks that native primarykey fields have readonly access, and warns if not. @param fieldDef The field descriptor @param checkLevel The current check level (this constraint is checked in basic and strict)
[ "Checks", "that", "native", "primarykey", "fields", "have", "readonly", "access", "and", "warns", "if", "not", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java#L393-L411
relayrides/pushy
pushy/src/main/java/com/turo/pushy/apns/util/ApnsPayloadBuilder.java
ApnsPayloadBuilder.addCustomProperty
public ApnsPayloadBuilder addCustomProperty(final String key, final Object value) { """ <p>Adds a custom property to the payload. According to Apple's documentation:</p> <blockquote>Providers can specify custom payload values outside the Apple-reserved {@code aps} namespace. Custom values must use the JSON str...
java
public ApnsPayloadBuilder addCustomProperty(final String key, final Object value) { this.customProperties.put(key, value); return this; }
[ "public", "ApnsPayloadBuilder", "addCustomProperty", "(", "final", "String", "key", ",", "final", "Object", "value", ")", "{", "this", ".", "customProperties", ".", "put", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
<p>Adds a custom property to the payload. According to Apple's documentation:</p> <blockquote>Providers can specify custom payload values outside the Apple-reserved {@code aps} namespace. Custom values must use the JSON structured and primitive types: dictionary (object), array, string, number, and Boolean. You should...
[ "<p", ">", "Adds", "a", "custom", "property", "to", "the", "payload", ".", "According", "to", "Apple", "s", "documentation", ":", "<", "/", "p", ">" ]
train
https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/util/ApnsPayloadBuilder.java#L680-L683
lukas-krecan/JsonUnit
json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java
JsonAssert.withMatcher
public static Configuration withMatcher(String matcherName, Matcher<?> matcher) { """ Adds a matcher to be used in ${json-unit.matches:matcherName} macro. """ return Configuration.empty().withMatcher(matcherName, matcher); }
java
public static Configuration withMatcher(String matcherName, Matcher<?> matcher) { return Configuration.empty().withMatcher(matcherName, matcher); }
[ "public", "static", "Configuration", "withMatcher", "(", "String", "matcherName", ",", "Matcher", "<", "?", ">", "matcher", ")", "{", "return", "Configuration", ".", "empty", "(", ")", ".", "withMatcher", "(", "matcherName", ",", "matcher", ")", ";", "}" ]
Adds a matcher to be used in ${json-unit.matches:matcherName} macro.
[ "Adds", "a", "matcher", "to", "be", "used", "in", "$", "{", "json", "-", "unit", ".", "matches", ":", "matcherName", "}", "macro", "." ]
train
https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java#L281-L283
briandilley/jsonrpc4j
src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java
JsonRpcHttpAsyncClient.doInvoke
@SuppressWarnings("unchecked") private <T> Future<T> doInvoke(String methodName, Object argument, Class<T> returnType, Map<String, String> extraHeaders, JsonRpcCallback<T> callback) { """ Invokes the given method with the given arguments and invokes the {@code JsonRpcCallback} with the result cast to the given ...
java
@SuppressWarnings("unchecked") private <T> Future<T> doInvoke(String methodName, Object argument, Class<T> returnType, Map<String, String> extraHeaders, JsonRpcCallback<T> callback) { String path = serviceUrl.getPath() + (serviceUrl.getQuery() != null ? "?" + serviceUrl.getQuery() : ""); int port = serviceUrl.g...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "T", ">", "Future", "<", "T", ">", "doInvoke", "(", "String", "methodName", ",", "Object", "argument", ",", "Class", "<", "T", ">", "returnType", ",", "Map", "<", "String", ",", "String"...
Invokes the given method with the given arguments and invokes the {@code JsonRpcCallback} with the result cast to the given {@code returnType}, or null if void. The {@code extraHeaders} are added to the request. @param methodName the name of the method to invoke @param argument the arguments to the method @param...
[ "Invokes", "the", "given", "method", "with", "the", "given", "arguments", "and", "invokes", "the", "{", "@code", "JsonRpcCallback", "}", "with", "the", "result", "cast", "to", "the", "given", "{", "@code", "returnType", "}", "or", "null", "if", "void", "."...
train
https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java#L227-L253
HubSpot/Singularity
SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java
SingularityClient.getSlaves
public Collection<SingularitySlave> getSlaves(Optional<MachineState> slaveState) { """ Retrieve the list of all known slaves, optionally filtering by a particular slave state @param slaveState Optionally specify a particular state to filter slaves by @return A collection of {@link SingularitySlave} """ ...
java
public Collection<SingularitySlave> getSlaves(Optional<MachineState> slaveState) { final Function<String, String> requestUri = (host) -> String.format(SLAVES_FORMAT, getApiBase(host)); Optional<Map<String, Object>> maybeQueryParams = Optional.absent(); String type = "slaves"; if (slaveState.isPresent...
[ "public", "Collection", "<", "SingularitySlave", ">", "getSlaves", "(", "Optional", "<", "MachineState", ">", "slaveState", ")", "{", "final", "Function", "<", "String", ",", "String", ">", "requestUri", "=", "(", "host", ")", "-", ">", "String", ".", "for...
Retrieve the list of all known slaves, optionally filtering by a particular slave state @param slaveState Optionally specify a particular state to filter slaves by @return A collection of {@link SingularitySlave}
[ "Retrieve", "the", "list", "of", "all", "known", "slaves", "optionally", "filtering", "by", "a", "particular", "slave", "state" ]
train
https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java#L948-L962
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java
AbstractSelectCodeGenerator.generateSQLBuild
private static void generateSQLBuild(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, SplittedSql splittedSql, boolean countQuery) { """ Generate SQL build. @param method the method @param methodBuilder the method builder @param splittedSql the splitted sql @param countQuery is true, the query...
java
private static void generateSQLBuild(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, SplittedSql splittedSql, boolean countQuery) { methodBuilder.addStatement("$T _sqlBuilder=sqlBuilder()", StringBuilder.class); methodBuilder.addStatement("_sqlBuilder.append($S)", splittedSql.sqlBasic.trim()); SqlMod...
[ "private", "static", "void", "generateSQLBuild", "(", "SQLiteModelMethod", "method", ",", "MethodSpec", ".", "Builder", "methodBuilder", ",", "SplittedSql", "splittedSql", ",", "boolean", "countQuery", ")", "{", "methodBuilder", ".", "addStatement", "(", "\"$T _sqlBui...
Generate SQL build. @param method the method @param methodBuilder the method builder @param splittedSql the splitted sql @param countQuery is true, the query manage the count query for paged result
[ "Generate", "SQL", "build", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L825-L837
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringParser.java
StringParser.parseBigInteger
@Nullable public static BigInteger parseBigInteger (@Nullable final String sStr) { """ Parse the given {@link String} as {@link BigInteger} with radix {@value #DEFAULT_RADIX}. @param sStr The String to parse. May be <code>null</code>. @return <code>null</code> if the string does not represent a valid value...
java
@Nullable public static BigInteger parseBigInteger (@Nullable final String sStr) { return parseBigInteger (sStr, DEFAULT_RADIX, null); }
[ "@", "Nullable", "public", "static", "BigInteger", "parseBigInteger", "(", "@", "Nullable", "final", "String", "sStr", ")", "{", "return", "parseBigInteger", "(", "sStr", ",", "DEFAULT_RADIX", ",", "null", ")", ";", "}" ]
Parse the given {@link String} as {@link BigInteger} with radix {@value #DEFAULT_RADIX}. @param sStr The String to parse. May be <code>null</code>. @return <code>null</code> if the string does not represent a valid value.
[ "Parse", "the", "given", "{", "@link", "String", "}", "as", "{", "@link", "BigInteger", "}", "with", "radix", "{", "@value", "#DEFAULT_RADIX", "}", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1382-L1386
zalando-nakadi/fahrschein
fahrschein/src/main/java/org/zalando/fahrschein/StreamParameters.java
StreamParameters.withCommitTimeout
public StreamParameters withCommitTimeout(int commitTimeout) { """ Maximum amount of seconds that nakadi will be waiting for commit after sending a batch to a client. If the commit does not come within this timeout, nakadi will initialize stream termination, no new data will be sent. Partitions from this stream ...
java
public StreamParameters withCommitTimeout(int commitTimeout) { return new StreamParameters(batchLimit, streamLimit, batchFlushTimeout, streamTimeout, streamKeepAliveLimit, maxUncommittedEvents, commitTimeout); }
[ "public", "StreamParameters", "withCommitTimeout", "(", "int", "commitTimeout", ")", "{", "return", "new", "StreamParameters", "(", "batchLimit", ",", "streamLimit", ",", "batchFlushTimeout", ",", "streamTimeout", ",", "streamKeepAliveLimit", ",", "maxUncommittedEvents", ...
Maximum amount of seconds that nakadi will be waiting for commit after sending a batch to a client. If the commit does not come within this timeout, nakadi will initialize stream termination, no new data will be sent. Partitions from this stream will be assigned to other streams. @param commitTimeout
[ "Maximum", "amount", "of", "seconds", "that", "nakadi", "will", "be", "waiting", "for", "commit", "after", "sending", "a", "batch", "to", "a", "client", ".", "If", "the", "commit", "does", "not", "come", "within", "this", "timeout", "nakadi", "will", "init...
train
https://github.com/zalando-nakadi/fahrschein/blob/b55ae0ff79aacb300548a88f3969fd11a0904804/fahrschein/src/main/java/org/zalando/fahrschein/StreamParameters.java#L156-L158
GoogleCloudPlatform/appengine-plugins-core
src/main/java/com/google/cloud/tools/managedcloudsdk/components/SdkComponentInstaller.java
SdkComponentInstaller.newComponentInstaller
public static SdkComponentInstaller newComponentInstaller(OsInfo.Name osName, Path gcloudPath) { """ Configure and create a new Component Installer instance. @param gcloudPath full path to gcloud in the Cloud SDK @return a new configured Cloud SDK component installer """ switch (osName) { case WI...
java
public static SdkComponentInstaller newComponentInstaller(OsInfo.Name osName, Path gcloudPath) { switch (osName) { case WINDOWS: return new SdkComponentInstaller( gcloudPath, CommandRunner.newRunner(), new WindowsBundledPythonCopier(gcloudPath, CommandCaller.newCall...
[ "public", "static", "SdkComponentInstaller", "newComponentInstaller", "(", "OsInfo", ".", "Name", "osName", ",", "Path", "gcloudPath", ")", "{", "switch", "(", "osName", ")", "{", "case", "WINDOWS", ":", "return", "new", "SdkComponentInstaller", "(", "gcloudPath",...
Configure and create a new Component Installer instance. @param gcloudPath full path to gcloud in the Cloud SDK @return a new configured Cloud SDK component installer
[ "Configure", "and", "create", "a", "new", "Component", "Installer", "instance", "." ]
train
https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/d22e9fa1103522409ab6fdfbf68c4a5a0bc5b97d/src/main/java/com/google/cloud/tools/managedcloudsdk/components/SdkComponentInstaller.java#L83-L93
huahin/huahin-core
src/main/java/org/huahinframework/core/SimpleJob.java
SimpleJob.setJoin
public SimpleJob setJoin(String[] masterLabels, String masterColumn, String dataColumn, String masterPath) throws IOException, URISyntaxException { """ This method is to determine automatically join the Simple and Big. @param masterLabels label of master data @param masterColumn mast...
java
public SimpleJob setJoin(String[] masterLabels, String masterColumn, String dataColumn, String masterPath) throws IOException, URISyntaxException { String separator = conf.get(SEPARATOR); return setJoin(masterLabels, masterColumn, dataColumn, masterPath, separator, false, DE...
[ "public", "SimpleJob", "setJoin", "(", "String", "[", "]", "masterLabels", ",", "String", "masterColumn", ",", "String", "dataColumn", ",", "String", "masterPath", ")", "throws", "IOException", ",", "URISyntaxException", "{", "String", "separator", "=", "conf", ...
This method is to determine automatically join the Simple and Big. @param masterLabels label of master data @param masterColumn master column @param dataColumn data column @param masterPath master data HDFS path @return this @throws URISyntaxException @throws IOException
[ "This", "method", "is", "to", "determine", "automatically", "join", "the", "Simple", "and", "Big", "." ]
train
https://github.com/huahin/huahin-core/blob/a87921b5a12be92a822f753c075ab2431036e6f5/src/main/java/org/huahinframework/core/SimpleJob.java#L448-L452
finmath/finmath-lib
src/main/java6/net/finmath/montecarlo/interestrate/products/Swaption.java
Swaption.getValue
public double getValue(ForwardCurveInterface forwardCurve, double swaprateVolatility) { """ This method returns the value of the product using a Black-Scholes model for the swap rate The model is determined by a discount factor curve and a swap rate volatility. @param forwardCurve The forward curve on which to...
java
public double getValue(ForwardCurveInterface forwardCurve, double swaprateVolatility) { double swaprate = swaprates[0]; for (double swaprate1 : swaprates) { if (swaprate1 != swaprate) { throw new RuntimeException("Uneven swaprates not allows for analytical pricing."); } } double[] swapTenor = new dou...
[ "public", "double", "getValue", "(", "ForwardCurveInterface", "forwardCurve", ",", "double", "swaprateVolatility", ")", "{", "double", "swaprate", "=", "swaprates", "[", "0", "]", ";", "for", "(", "double", "swaprate1", ":", "swaprates", ")", "{", "if", "(", ...
This method returns the value of the product using a Black-Scholes model for the swap rate The model is determined by a discount factor curve and a swap rate volatility. @param forwardCurve The forward curve on which to value the swap. @param swaprateVolatility The Black volatility. @return Value of this product
[ "This", "method", "returns", "the", "value", "of", "the", "product", "using", "a", "Black", "-", "Scholes", "model", "for", "the", "swap", "rate", "The", "model", "is", "determined", "by", "a", "discount", "factor", "curve", "and", "a", "swap", "rate", "...
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/products/Swaption.java#L189-L205
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/util/DummySSLSocketFactory.java
DummySSLSocketFactory.trySetFakeRemoteHost
private static void trySetFakeRemoteHost(Socket socket) { """ We set the host name of the remote machine because otherwise the SSL implementation is going to try to try to do a reverse lookup to find out the host name for the host which is really slow. Of course we don't know the host name of the remote machine ...
java
private static void trySetFakeRemoteHost(Socket socket) { try { final Method setHostMethod = socket.getClass().getMethod("setHost", String.class); String fakeHostName = "greenmailHost" + new BigInteger(130, new Random()).toString(32); setHostMethod.invoke(socket, fakeHost...
[ "private", "static", "void", "trySetFakeRemoteHost", "(", "Socket", "socket", ")", "{", "try", "{", "final", "Method", "setHostMethod", "=", "socket", ".", "getClass", "(", ")", ".", "getMethod", "(", "\"setHost\"", ",", "String", ".", "class", ")", ";", "...
We set the host name of the remote machine because otherwise the SSL implementation is going to try to try to do a reverse lookup to find out the host name for the host which is really slow. Of course we don't know the host name of the remote machine so we just set a fake host name that is unique. <p/> This forces the ...
[ "We", "set", "the", "host", "name", "of", "the", "remote", "machine", "because", "otherwise", "the", "SSL", "implementation", "is", "going", "to", "try", "to", "try", "to", "do", "a", "reverse", "lookup", "to", "find", "out", "the", "host", "name", "for"...
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/DummySSLSocketFactory.java#L123-L135
alkacon/opencms-core
src/org/opencms/db/generic/CmsVfsDriver.java
CmsVfsDriver.readUrlNameMappingEntries
public List<CmsUrlNameMappingEntry> readUrlNameMappingEntries( CmsDbContext dbc, boolean online, CmsUrlNameMappingFilter filter) throws CmsDataAccessException { """ Reads the URL name mapping entries which match a given filter.<p> @param dbc the database context @param online if tru...
java
public List<CmsUrlNameMappingEntry> readUrlNameMappingEntries( CmsDbContext dbc, boolean online, CmsUrlNameMappingFilter filter) throws CmsDataAccessException { Connection conn = null; ResultSet resultSet = null; PreparedStatement stmt = null; List<CmsUrlName...
[ "public", "List", "<", "CmsUrlNameMappingEntry", ">", "readUrlNameMappingEntries", "(", "CmsDbContext", "dbc", ",", "boolean", "online", ",", "CmsUrlNameMappingFilter", "filter", ")", "throws", "CmsDataAccessException", "{", "Connection", "conn", "=", "null", ";", "Re...
Reads the URL name mapping entries which match a given filter.<p> @param dbc the database context @param online if true, reads from the online mapping, else from the offline mapping @param filter the filter which the entries to be read should match @return the mapping entries which match the given filter @throws Cms...
[ "Reads", "the", "URL", "name", "mapping", "entries", "which", "match", "a", "given", "filter", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L2751-L2777
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/Interval.java
Interval.toInterval
public static <E extends Comparable<E>> Interval<E> toInterval(E a, E b) { """ Create an interval with the specified endpoints in the specified order, Returns null if a does not come before b (invalid interval) @param a start endpoints @param b end endpoint @param <E> type of the interval endpoints @return In...
java
public static <E extends Comparable<E>> Interval<E> toInterval(E a, E b) { return toInterval(a,b,0); }
[ "public", "static", "<", "E", "extends", "Comparable", "<", "E", ">", ">", "Interval", "<", "E", ">", "toInterval", "(", "E", "a", ",", "E", "b", ")", "{", "return", "toInterval", "(", "a", ",", "b", ",", "0", ")", ";", "}" ]
Create an interval with the specified endpoints in the specified order, Returns null if a does not come before b (invalid interval) @param a start endpoints @param b end endpoint @param <E> type of the interval endpoints @return Interval with endpoints in specified order, null if a does not come before b
[ "Create", "an", "interval", "with", "the", "specified", "endpoints", "in", "the", "specified", "order", "Returns", "null", "if", "a", "does", "not", "come", "before", "b", "(", "invalid", "interval", ")" ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Interval.java#L339-L341
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.expandBoundingVolume
public final BoundingVolume expandBoundingVolume(final float pointX, final float pointY, final float pointZ) { """ Expand the current volume by the given point @param pointX x coordinate of point @param pointY y coordinate of point @param pointZ z coordinate of point @return the updated BoundingVolume...
java
public final BoundingVolume expandBoundingVolume(final float pointX, final float pointY, final float pointZ) { return new BoundingVolume( NativeSceneObject.expandBoundingVolumeByPoint( getNative(), pointX, pointY, pointZ)); }
[ "public", "final", "BoundingVolume", "expandBoundingVolume", "(", "final", "float", "pointX", ",", "final", "float", "pointY", ",", "final", "float", "pointZ", ")", "{", "return", "new", "BoundingVolume", "(", "NativeSceneObject", ".", "expandBoundingVolumeByPoint", ...
Expand the current volume by the given point @param pointX x coordinate of point @param pointY y coordinate of point @param pointZ z coordinate of point @return the updated BoundingVolume.
[ "Expand", "the", "current", "volume", "by", "the", "given", "point" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L1261-L1265
samskivert/samskivert
src/main/java/com/samskivert/util/MethodFinder.java
MethodFinder.findMemberIn
protected Member findMemberIn (List<Member> memberList, Class<?>[] parameterTypes) throws NoSuchMethodException { """ Basis of {@link #findConstructor} and {@link #findMethod}. The member list fed to this method will be either all {@link Constructor} objects or all {@link Method} objects. """ ...
java
protected Member findMemberIn (List<Member> memberList, Class<?>[] parameterTypes) throws NoSuchMethodException { List<Member> matchingMembers = new ArrayList<Member>(); for (Iterator<Member> it = memberList.iterator(); it.hasNext();) { Member member = it.next(); Cla...
[ "protected", "Member", "findMemberIn", "(", "List", "<", "Member", ">", "memberList", ",", "Class", "<", "?", ">", "[", "]", "parameterTypes", ")", "throws", "NoSuchMethodException", "{", "List", "<", "Member", ">", "matchingMembers", "=", "new", "ArrayList", ...
Basis of {@link #findConstructor} and {@link #findMethod}. The member list fed to this method will be either all {@link Constructor} objects or all {@link Method} objects.
[ "Basis", "of", "{" ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/MethodFinder.java#L144-L172
mnlipp/jgrapes
examples/src/org/jgrapes/http/demo/httpserver/FormProcessor.java
FormProcessor.onPost
@RequestHandler(patterns = "/form,/form/**") public void onPost(Request.In.Post event, IOSubchannel channel) { """ Handle a `POST` request. @param event the event @param channel the channel """ FormContext ctx = channel .associated(this, FormContext::new); ctx.request = even...
java
@RequestHandler(patterns = "/form,/form/**") public void onPost(Request.In.Post event, IOSubchannel channel) { FormContext ctx = channel .associated(this, FormContext::new); ctx.request = event.httpRequest(); ctx.session = event.associated(Session.class).get(); event.setR...
[ "@", "RequestHandler", "(", "patterns", "=", "\"/form,/form/**\"", ")", "public", "void", "onPost", "(", "Request", ".", "In", ".", "Post", "event", ",", "IOSubchannel", "channel", ")", "{", "FormContext", "ctx", "=", "channel", ".", "associated", "(", "this...
Handle a `POST` request. @param event the event @param channel the channel
[ "Handle", "a", "POST", "request", "." ]
train
https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/examples/src/org/jgrapes/http/demo/httpserver/FormProcessor.java#L90-L98
UrielCh/ovh-java-sdk
ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java
ApiOvhVrack.serviceName_dedicatedCloudDatacenter_datacenter_move_POST
public OvhTask serviceName_dedicatedCloudDatacenter_datacenter_move_POST(String serviceName, String datacenter, String targetServiceName) throws IOException { """ Move your dedicatedCloud datacenter from a Vrack to another REST: POST /vrack/{serviceName}/dedicatedCloudDatacenter/{datacenter}/move @param target...
java
public OvhTask serviceName_dedicatedCloudDatacenter_datacenter_move_POST(String serviceName, String datacenter, String targetServiceName) throws IOException { String qPath = "/vrack/{serviceName}/dedicatedCloudDatacenter/{datacenter}/move"; StringBuilder sb = path(qPath, serviceName, datacenter); HashMap<String, ...
[ "public", "OvhTask", "serviceName_dedicatedCloudDatacenter_datacenter_move_POST", "(", "String", "serviceName", ",", "String", "datacenter", ",", "String", "targetServiceName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/vrack/{serviceName}/dedicatedCloudData...
Move your dedicatedCloud datacenter from a Vrack to another REST: POST /vrack/{serviceName}/dedicatedCloudDatacenter/{datacenter}/move @param targetServiceName [required] The internal name of your target vrack @param serviceName [required] The internal name of your vrack @param datacenter [required] Your dedicatedClou...
[ "Move", "your", "dedicatedCloud", "datacenter", "from", "a", "Vrack", "to", "another" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java#L138-L145
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleData.java
LocaleData.getExemplarSet
public UnicodeSet getExemplarSet(int options, int extype) { """ Returns the set of exemplar characters for a locale. @param options Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify UnicodeSet.CASE to retrieve a cas...
java
public UnicodeSet getExemplarSet(int options, int extype) { String [] exemplarSetTypes = { "ExemplarCharacters", "AuxExemplarCharacters", "ExemplarCharactersIndex", "ExemplarCharactersCurrency", "ExemplarCharactersPunctuation" ...
[ "public", "UnicodeSet", "getExemplarSet", "(", "int", "options", ",", "int", "extype", ")", "{", "String", "[", "]", "exemplarSetTypes", "=", "{", "\"ExemplarCharacters\"", ",", "\"AuxExemplarCharacters\"", ",", "\"ExemplarCharactersIndex\"", ",", "\"ExemplarCharactersC...
Returns the set of exemplar characters for a locale. @param options Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify UnicodeSet.CASE to retrieve a case-folded exemplar set. See {@link UnicodeSet#applyPattern(String, int)} f...
[ "Returns", "the", "set", "of", "exemplar", "characters", "for", "a", "locale", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleData.java#L178-L206
robocup-atan/atan
src/main/java/com/github/robocup_atan/atan/parser/Filter.java
Filter.run
public void run(String cmd, CommandFilter f) { """ Works out what type of command has been put into the method. @param cmd The string of text from SServer. @param f An instance of CommandFilter. """ CommandWords commandWord = null; if ( cmd.contains(" ") ) { try { ...
java
public void run(String cmd, CommandFilter f) { CommandWords commandWord = null; if ( cmd.contains(" ") ) { try { commandWord = CommandWords.valueOf(cmd.substring(1, cmd.indexOf(" "))); } catch (IllegalArgumentException e) { commandWord = CommandW...
[ "public", "void", "run", "(", "String", "cmd", ",", "CommandFilter", "f", ")", "{", "CommandWords", "commandWord", "=", "null", ";", "if", "(", "cmd", ".", "contains", "(", "\" \"", ")", ")", "{", "try", "{", "commandWord", "=", "CommandWords", ".", "v...
Works out what type of command has been put into the method. @param cmd The string of text from SServer. @param f An instance of CommandFilter.
[ "Works", "out", "what", "type", "of", "command", "has", "been", "put", "into", "the", "method", "." ]
train
https://github.com/robocup-atan/atan/blob/52237b468b09ba5b7c52d290984dbe0326c96df7/src/main/java/com/github/robocup_atan/atan/parser/Filter.java#L61-L116
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java
ClassUtils.isAProperty
public static boolean isAProperty(Class theClass, String propertyName) { """ Is the given name a property in the class? In other words, does it have a setter and/or a getter method? @param theClass the class to look for the property in @param propertyName the name of the property @return true if there is e...
java
public static boolean isAProperty(Class theClass, String propertyName) { if (theClass == null) throw new IllegalArgumentException("theClass == null"); if (propertyName == null) throw new IllegalArgumentException("propertyName == null"); if (getReadMethod(theClass, propertyName) != null) return true; i...
[ "public", "static", "boolean", "isAProperty", "(", "Class", "theClass", ",", "String", "propertyName", ")", "{", "if", "(", "theClass", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"theClass == null\"", ")", ";", "if", "(", "propertyName...
Is the given name a property in the class? In other words, does it have a setter and/or a getter method? @param theClass the class to look for the property in @param propertyName the name of the property @return true if there is either a setter or a getter for the property @throws IllegalArgumentException if either ...
[ "Is", "the", "given", "name", "a", "property", "in", "the", "class?", "In", "other", "words", "does", "it", "have", "a", "setter", "and", "/", "or", "a", "getter", "method?" ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java#L343-L354
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfDocument.java
PdfDocument.remoteGoto
void remoteGoto(String filename, int page, float llx, float lly, float urx, float ury) { """ Implements a link to another document. @param filename the filename for the remote document @param page the page to jump to @param llx the lower left x corner of the activation area @param lly the lower left y corner o...
java
void remoteGoto(String filename, int page, float llx, float lly, float urx, float ury) { addAnnotation(new PdfAnnotation(writer, llx, lly, urx, ury, new PdfAction(filename, page))); }
[ "void", "remoteGoto", "(", "String", "filename", ",", "int", "page", ",", "float", "llx", ",", "float", "lly", ",", "float", "urx", ",", "float", "ury", ")", "{", "addAnnotation", "(", "new", "PdfAnnotation", "(", "writer", ",", "llx", ",", "lly", ",",...
Implements a link to another document. @param filename the filename for the remote document @param page the page to jump to @param llx the lower left x corner of the activation area @param lly the lower left y corner of the activation area @param urx the upper right x corner of the activation area @param ury the upper ...
[ "Implements", "a", "link", "to", "another", "document", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfDocument.java#L2040-L2042
bingoohuang/excel2javabeans
src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java
PoiUtil.writeCellValue
public static String writeCellValue(Cell cell, Object fv) { """ 向单元格写入值,处理值为整型时的写入情况。 @param cell 单元格。 @param fv 单元格值。 @return 单元格字符串取值。 """ if (fv == null) { cell.setCellType(CellType.BLANK); return ""; } if (fv instanceof Number) { val value...
java
public static String writeCellValue(Cell cell, Object fv) { if (fv == null) { cell.setCellType(CellType.BLANK); return ""; } if (fv instanceof Number) { val value = ((Number) fv).doubleValue(); cell.setCellValue(value); return "" + val...
[ "public", "static", "String", "writeCellValue", "(", "Cell", "cell", ",", "Object", "fv", ")", "{", "if", "(", "fv", "==", "null", ")", "{", "cell", ".", "setCellType", "(", "CellType", ".", "BLANK", ")", ";", "return", "\"\"", ";", "}", "if", "(", ...
向单元格写入值,处理值为整型时的写入情况。 @param cell 单元格。 @param fv 单元格值。 @return 单元格字符串取值。
[ "向单元格写入值,处理值为整型时的写入情况。" ]
train
https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java#L147-L167
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/r/interpolation2d/core/TPSInterpolator.java
TPSInterpolator.calculateFunctionU
private double calculateFunctionU( Coordinate p_i, Coordinate p_j ) { """ Calculates U function where distance = ||p<sub>i</sub>, p<sub>j</sub>|| (from source points) @param p_i p_i @param p_j p_j @return log(distance)*distance<sub>2</sub> or 0 if distance = 0 """ double distance = p_i.distance(p_...
java
private double calculateFunctionU( Coordinate p_i, Coordinate p_j ) { double distance = p_i.distance(p_j); return functionU(distance); }
[ "private", "double", "calculateFunctionU", "(", "Coordinate", "p_i", ",", "Coordinate", "p_j", ")", "{", "double", "distance", "=", "p_i", ".", "distance", "(", "p_j", ")", ";", "return", "functionU", "(", "distance", ")", ";", "}" ]
Calculates U function where distance = ||p<sub>i</sub>, p<sub>j</sub>|| (from source points) @param p_i p_i @param p_j p_j @return log(distance)*distance<sub>2</sub> or 0 if distance = 0
[ "Calculates", "U", "function", "where", "distance", "=", "||p<sub", ">", "i<", "/", "sub", ">", "p<sub", ">", "j<", "/", "sub", ">", "||", "(", "from", "source", "points", ")" ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/interpolation2d/core/TPSInterpolator.java#L108-L111
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java
CommandLine.addSwitchWithOptionalExtraPart
public void addSwitchWithOptionalExtraPart(String option, String optionExtraPartSynopsis, String description) { """ Add a command line switch that allows optional extra information to be specified as part of it. @param option the option, must start with "-" @param optionExtraPartSynopsis synopsis of the opt...
java
public void addSwitchWithOptionalExtraPart(String option, String optionExtraPartSynopsis, String description) { optionList.add(option); optionExtraPartSynopsisMap.put(option, optionExtraPartSynopsis); optionDescriptionMap.put(option, description); // Option will display as -foo[:extraPa...
[ "public", "void", "addSwitchWithOptionalExtraPart", "(", "String", "option", ",", "String", "optionExtraPartSynopsis", ",", "String", "description", ")", "{", "optionList", ".", "add", "(", "option", ")", ";", "optionExtraPartSynopsisMap", ".", "put", "(", "option",...
Add a command line switch that allows optional extra information to be specified as part of it. @param option the option, must start with "-" @param optionExtraPartSynopsis synopsis of the optional extra information @param description single-line description of the option
[ "Add", "a", "command", "line", "switch", "that", "allows", "optional", "extra", "information", "to", "be", "specified", "as", "part", "of", "it", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/config/CommandLine.java#L114-L124
google/error-prone-javac
make/src/classes/build/tools/symbolgenerator/CreateSymbols.java
CreateSymbols.createSymbols
@SuppressWarnings("unchecked") public void createSymbols(String ctDescriptionFile, String ctSymLocation, CtSymKind ctSymKind) throws IOException { """ Create sig files for ct.sym reading the classes description from the directory that contains {@code ctDescriptionFile}, using the file as a recipe to create th...
java
@SuppressWarnings("unchecked") public void createSymbols(String ctDescriptionFile, String ctSymLocation, CtSymKind ctSymKind) throws IOException { ClassList classes = load(Paths.get(ctDescriptionFile)); splitHeaders(classes); for (ClassDescription classDescription : classes) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "createSymbols", "(", "String", "ctDescriptionFile", ",", "String", "ctSymLocation", ",", "CtSymKind", "ctSymKind", ")", "throws", "IOException", "{", "ClassList", "classes", "=", "load", "(", "...
Create sig files for ct.sym reading the classes description from the directory that contains {@code ctDescriptionFile}, using the file as a recipe to create the sigfiles.
[ "Create", "sig", "files", "for", "ct", ".", "sym", "reading", "the", "classes", "description", "from", "the", "directory", "that", "contains", "{" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/make/src/classes/build/tools/symbolgenerator/CreateSymbols.java#L165-L191
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/locking/ReadUncommittedStrategy.java
ReadUncommittedStrategy.writeLock
public boolean writeLock(TransactionImpl tx, Object obj) { """ acquire a write lock on Object obj for Transaction tx. @param tx the transaction requesting the lock @param obj the Object to be locked @return true if successful, else false """ LockEntry writer = getWriter(obj); if (writer ==...
java
public boolean writeLock(TransactionImpl tx, Object obj) { LockEntry writer = getWriter(obj); if (writer == null) { if (setWriter(tx, obj)) return true; else return writeLock(tx, obj); } if (writer.isOwnedBy(tx...
[ "public", "boolean", "writeLock", "(", "TransactionImpl", "tx", ",", "Object", "obj", ")", "{", "LockEntry", "writer", "=", "getWriter", "(", "obj", ")", ";", "if", "(", "writer", "==", "null", ")", "{", "if", "(", "setWriter", "(", "tx", ",", "obj", ...
acquire a write lock on Object obj for Transaction tx. @param tx the transaction requesting the lock @param obj the Object to be locked @return true if successful, else false
[ "acquire", "a", "write", "lock", "on", "Object", "obj", "for", "Transaction", "tx", ".", "@param", "tx", "the", "transaction", "requesting", "the", "lock", "@param", "obj", "the", "Object", "to", "be", "locked", "@return", "true", "if", "successful", "else",...
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/locking/ReadUncommittedStrategy.java#L58-L73
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/processors/HolidayProcessor.java
HolidayProcessor.getEasterSundayOrthodox
public String getEasterSundayOrthodox(int year, int days) { """ Get the date of a day relative to Easter Sunday in a given year. Algorithm used is from the http://en.wikipedia.org/wiki/Computus#cite_note-otheralgs-47. @author Elena Klyachko @param year @param days @return date """ int A = year%4;...
java
public String getEasterSundayOrthodox(int year, int days) { int A = year%4; int B = year%7; int C = year%19; int D = (19*C+15)%30; int E = ((2*A + 4*B -D + 34))%7; int Month = (int)(Math.floor ((D + E + 114) / 31)); int Day = ((D + E + 114)% 31) +1; /* ...
[ "public", "String", "getEasterSundayOrthodox", "(", "int", "year", ",", "int", "days", ")", "{", "int", "A", "=", "year", "%", "4", ";", "int", "B", "=", "year", "%", "7", ";", "int", "C", "=", "year", "%", "19", ";", "int", "D", "=", "(", "19"...
Get the date of a day relative to Easter Sunday in a given year. Algorithm used is from the http://en.wikipedia.org/wiki/Computus#cite_note-otheralgs-47. @author Elena Klyachko @param year @param days @return date
[ "Get", "the", "date", "of", "a", "day", "relative", "to", "Easter", "Sunday", "in", "a", "given", "year", ".", "Algorithm", "used", "is", "from", "the", "http", ":", "//", "en", ".", "wikipedia", ".", "org", "/", "wiki", "/", "Computus#cite_note", "-",...
train
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/processors/HolidayProcessor.java#L247-L285
codelibs/fess
src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java
FessMessages.addErrorsCouldNotFindLogFile
public FessMessages addErrorsCouldNotFindLogFile(String property, String arg0) { """ Add the created action message for the key 'errors.could_not_find_log_file' with parameters. <pre> message: Could not find {0}. </pre> @param property The property name for the message. (NotNull) @param arg0 The parameter arg...
java
public FessMessages addErrorsCouldNotFindLogFile(String property, String arg0) { assertPropertyNotNull(property); add(property, new UserMessage(ERRORS_could_not_find_log_file, arg0)); return this; }
[ "public", "FessMessages", "addErrorsCouldNotFindLogFile", "(", "String", "property", ",", "String", "arg0", ")", "{", "assertPropertyNotNull", "(", "property", ")", ";", "add", "(", "property", ",", "new", "UserMessage", "(", "ERRORS_could_not_find_log_file", ",", "...
Add the created action message for the key 'errors.could_not_find_log_file' with parameters. <pre> message: Could not find {0}. </pre> @param property The property name for the message. (NotNull) @param arg0 The parameter arg0 for message. (NotNull) @return this. (NotNull)
[ "Add", "the", "created", "action", "message", "for", "the", "key", "errors", ".", "could_not_find_log_file", "with", "parameters", ".", "<pre", ">", "message", ":", "Could", "not", "find", "{", "0", "}", ".", "<", "/", "pre", ">" ]
train
https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L1248-L1252