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
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/AnalyticHelper.java
AnalyticHelper.getAccumulator
public <A> A getAccumulator(ExecutionEnvironment env, String accumulatorName) { """ Gets the accumulator with the given name. Returns {@code null}, if no accumulator with that name was produced. @param accumulatorName The name of the accumulator @param <A> The generic type of the accumulator value @return Th...
java
public <A> A getAccumulator(ExecutionEnvironment env, String accumulatorName) { JobExecutionResult result = env.getLastJobExecutionResult(); Preconditions.checkNotNull(result, "No result found for job, was execute() called before getting the result?"); return result.getAccumulatorResult(id + SEPARATOR + accumul...
[ "public", "<", "A", ">", "A", "getAccumulator", "(", "ExecutionEnvironment", "env", ",", "String", "accumulatorName", ")", "{", "JobExecutionResult", "result", "=", "env", ".", "getLastJobExecutionResult", "(", ")", ";", "Preconditions", ".", "checkNotNull", "(", ...
Gets the accumulator with the given name. Returns {@code null}, if no accumulator with that name was produced. @param accumulatorName The name of the accumulator @param <A> The generic type of the accumulator value @return The value of the accumulator with the given name
[ "Gets", "the", "accumulator", "with", "the", "given", "name", ".", "Returns", "{", "@code", "null", "}", "if", "no", "accumulator", "with", "that", "name", "was", "produced", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/AnalyticHelper.java#L78-L84
spotify/docker-client
src/main/java/com/spotify/docker/client/DockerConfigReader.java
DockerConfigReader.fromConfig
@Deprecated public RegistryAuth fromConfig(final Path configPath, final String serverAddress) throws IOException { """ Returns the RegistryAuth for the config file for the given registry server name. @throws IllegalArgumentException if the config file does not contain registry auth info for the registr...
java
@Deprecated public RegistryAuth fromConfig(final Path configPath, final String serverAddress) throws IOException { return authForRegistry(configPath, serverAddress); }
[ "@", "Deprecated", "public", "RegistryAuth", "fromConfig", "(", "final", "Path", "configPath", ",", "final", "String", "serverAddress", ")", "throws", "IOException", "{", "return", "authForRegistry", "(", "configPath", ",", "serverAddress", ")", ";", "}" ]
Returns the RegistryAuth for the config file for the given registry server name. @throws IllegalArgumentException if the config file does not contain registry auth info for the registry @deprecated In favor of {@link #authForRegistry(Path, String)}
[ "Returns", "the", "RegistryAuth", "for", "the", "config", "file", "for", "the", "given", "registry", "server", "name", "." ]
train
https://github.com/spotify/docker-client/blob/f297361891f3bb6a2980b08057eede628d681791/src/main/java/com/spotify/docker/client/DockerConfigReader.java#L71-L75
ldapchai/ldapchai
src/main/java/com/novell/ldapchai/util/SearchHelper.java
SearchHelper.setFilter
public void setFilter( final String attributeName, final String value ) { """ Set up a standard filter attribute name and value pair. <table border="1"><caption>Example Values</caption> <tr><td><b>Attribute</b></td><td><b>Value</b></td></tr> <tr><td>givenName</td><td>John</td></tr> </table> <p><i>Result</i>...
java
public void setFilter( final String attributeName, final String value ) { filter = new FilterSequence( attributeName, value ).toString(); }
[ "public", "void", "setFilter", "(", "final", "String", "attributeName", ",", "final", "String", "value", ")", "{", "filter", "=", "new", "FilterSequence", "(", "attributeName", ",", "value", ")", ".", "toString", "(", ")", ";", "}" ]
Set up a standard filter attribute name and value pair. <table border="1"><caption>Example Values</caption> <tr><td><b>Attribute</b></td><td><b>Value</b></td></tr> <tr><td>givenName</td><td>John</td></tr> </table> <p><i>Result</i></p> <code>(givenName=John)</code> @param attributeName A valid attribute name @param va...
[ "Set", "up", "a", "standard", "filter", "attribute", "name", "and", "value", "pair", "." ]
train
https://github.com/ldapchai/ldapchai/blob/a6d4b5dbfa4e270db0ce70892512cbe39e64b874/src/main/java/com/novell/ldapchai/util/SearchHelper.java#L594-L597
SonarOpenCommunity/sonar-cxx
cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxReportSensor.java
CxxReportSensor.resolveFilename
@Nullable public static String resolveFilename(final String baseDir, @Nullable final String filename) { """ resolveFilename normalizes the report full path @param baseDir of the project @param filename of the report @return String """ if (filename != null) { // Normalization can return nu...
java
@Nullable public static String resolveFilename(final String baseDir, @Nullable final String filename) { if (filename != null) { // Normalization can return null if path is null, is invalid, // or is a path with back-ticks outside known directory structure String normalizedPath = FilenameU...
[ "@", "Nullable", "public", "static", "String", "resolveFilename", "(", "final", "String", "baseDir", ",", "@", "Nullable", "final", "String", "filename", ")", "{", "if", "(", "filename", "!=", "null", ")", "{", "// Normalization can return null if path is null, is i...
resolveFilename normalizes the report full path @param baseDir of the project @param filename of the report @return String
[ "resolveFilename", "normalizes", "the", "report", "full", "path" ]
train
https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxReportSensor.java#L86-L104
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/types/TypeUtils.java
TypeUtils.appendModifierKeyword
private static void appendModifierKeyword(final StringBuilder buf, final String modifierKeyword) { """ Append a space if necessary (if not at the beginning of the buffer, and the last character is not already a space), then append a modifier keyword. @param buf the buf @param modifierKeyword the modifier ke...
java
private static void appendModifierKeyword(final StringBuilder buf, final String modifierKeyword) { if (buf.length() > 0 && buf.charAt(buf.length() - 1) != ' ') { buf.append(' '); } buf.append(modifierKeyword); }
[ "private", "static", "void", "appendModifierKeyword", "(", "final", "StringBuilder", "buf", ",", "final", "String", "modifierKeyword", ")", "{", "if", "(", "buf", ".", "length", "(", ")", ">", "0", "&&", "buf", ".", "charAt", "(", "buf", ".", "length", "...
Append a space if necessary (if not at the beginning of the buffer, and the last character is not already a space), then append a modifier keyword. @param buf the buf @param modifierKeyword the modifier keyword
[ "Append", "a", "space", "if", "necessary", "(", "if", "not", "at", "the", "beginning", "of", "the", "buffer", "and", "the", "last", "character", "is", "not", "already", "a", "space", ")", "then", "append", "a", "modifier", "keyword", "." ]
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/types/TypeUtils.java#L112-L117
thymeleaf/thymeleaf
src/main/java/org/thymeleaf/expression/Uris.java
Uris.unescapePathSegment
public String unescapePathSegment(final String text, final String encoding) { """ <p> Perform am URI path segment <strong>unescape</strong> operation on a {@code String} input. </p> <p> This method simply calls the equivalent method in the {@code UriEscape} class from the <a href="http://www.unbescape.org">U...
java
public String unescapePathSegment(final String text, final String encoding) { return UriEscape.unescapeUriPathSegment(text, encoding); }
[ "public", "String", "unescapePathSegment", "(", "final", "String", "text", ",", "final", "String", "encoding", ")", "{", "return", "UriEscape", ".", "unescapeUriPathSegment", "(", "text", ",", "encoding", ")", ";", "}" ]
<p> Perform am URI path segment <strong>unescape</strong> operation on a {@code String} input. </p> <p> This method simply calls the equivalent method in the {@code UriEscape} class from the <a href="http://www.unbescape.org">Unbescape</a> library. </p> <p> This method will unescape every percent-encoded ({@code %HH}) ...
[ "<p", ">", "Perform", "am", "URI", "path", "segment", "<strong", ">", "unescape<", "/", "strong", ">", "operation", "on", "a", "{", "@code", "String", "}", "input", ".", "<", "/", "p", ">", "<p", ">", "This", "method", "simply", "calls", "the", "equi...
train
https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/expression/Uris.java#L331-L333
ArcBees/gwtquery
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java
Effects.queueAnimation
public void queueAnimation(final GQAnimation anim, final int duration) { """ Queue an animation for an element. The goal of this method is to reuse animations. @param e @param anim @param duration """ if (isOff()) { anim.onStart(); anim.onComplete(); } else { queue(anim.e, DEFAU...
java
public void queueAnimation(final GQAnimation anim, final int duration) { if (isOff()) { anim.onStart(); anim.onComplete(); } else { queue(anim.e, DEFAULT_NAME, new Function() { public void cancel(Element e) { Animation anim = (Animation) data(e, GQAnimation.ACTUAL_ANIMATION, ...
[ "public", "void", "queueAnimation", "(", "final", "GQAnimation", "anim", ",", "final", "int", "duration", ")", "{", "if", "(", "isOff", "(", ")", ")", "{", "anim", ".", "onStart", "(", ")", ";", "anim", ".", "onComplete", "(", ")", ";", "}", "else", ...
Queue an animation for an element. The goal of this method is to reuse animations. @param e @param anim @param duration
[ "Queue", "an", "animation", "for", "an", "element", "." ]
train
https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java#L122-L140
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java
PhotosGeoApi.setLocation
public Response setLocation(String photoId, Float lat, Float lon, Integer accuracy, JinxConstants.GeoContext context) throws JinxException { """ Sets the geo data (latitude and longitude and, optionally, the accuracy level) for a photo. Before users may assign location data to a photo they must define who, by def...
java
public Response setLocation(String photoId, Float lat, Float lon, Integer accuracy, JinxConstants.GeoContext context) throws JinxException { JinxUtils.validateParams(photoId, lat, lon); Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.photos.geo.setLocation"); params.put("photo...
[ "public", "Response", "setLocation", "(", "String", "photoId", ",", "Float", "lat", ",", "Float", "lon", ",", "Integer", "accuracy", ",", "JinxConstants", ".", "GeoContext", "context", ")", "throws", "JinxException", "{", "JinxUtils", ".", "validateParams", "(",...
Sets the geo data (latitude and longitude and, optionally, the accuracy level) for a photo. Before users may assign location data to a photo they must define who, by default, may view that information. Users can edit this preference at http://www.flickr.com/account/geo/privacy/. If a user has not set this preference, t...
[ "Sets", "the", "geo", "data", "(", "latitude", "and", "longitude", "and", "optionally", "the", "accuracy", "level", ")", "for", "a", "photo", ".", "Before", "users", "may", "assign", "location", "data", "to", "a", "photo", "they", "must", "define", "who", ...
train
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java#L251-L265
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/recurrent/RnnLossLayer.java
RnnLossLayer.computeScoreForExamples
@Override public INDArray computeScoreForExamples(double fullNetRegTerm, LayerWorkspaceMgr workspaceMgr) { """ Compute the score for each example individually, after labels and input have been set. @param fullNetRegTerm Regularization score term for the entire network (or, 0.0 to not include regularization)...
java
@Override public INDArray computeScoreForExamples(double fullNetRegTerm, LayerWorkspaceMgr workspaceMgr) { //For RNN: need to sum up the score over each time step before returning. if (input == null || labels == null) throw new IllegalStateException("Cannot calculate score without input...
[ "@", "Override", "public", "INDArray", "computeScoreForExamples", "(", "double", "fullNetRegTerm", ",", "LayerWorkspaceMgr", "workspaceMgr", ")", "{", "//For RNN: need to sum up the score over each time step before returning.", "if", "(", "input", "==", "null", "||", "labels"...
Compute the score for each example individually, after labels and input have been set. @param fullNetRegTerm Regularization score term for the entire network (or, 0.0 to not include regularization) @return A column INDArray of shape [numExamples,1], where entry i is the score of the ith example
[ "Compute", "the", "score", "for", "each", "example", "individually", "after", "labels", "and", "input", "have", "been", "set", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/recurrent/RnnLossLayer.java#L222-L258
alkacon/opencms-core
src/org/opencms/db/CmsDriverManager.java
CmsDriverManager.readPublishJob
public CmsPublishJobInfoBean readPublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException { """ Reads a single publish job identified by its publish history id.<p> @param dbc the current database context @param publishHistoryId unique id to identify the publish job in the publish history @re...
java
public CmsPublishJobInfoBean readPublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsException { return getProjectDriver(dbc).readPublishJob(dbc, publishHistoryId); }
[ "public", "CmsPublishJobInfoBean", "readPublishJob", "(", "CmsDbContext", "dbc", ",", "CmsUUID", "publishHistoryId", ")", "throws", "CmsException", "{", "return", "getProjectDriver", "(", "dbc", ")", ".", "readPublishJob", "(", "dbc", ",", "publishHistoryId", ")", "...
Reads a single publish job identified by its publish history id.<p> @param dbc the current database context @param publishHistoryId unique id to identify the publish job in the publish history @return an object of type <code>{@link CmsPublishJobInfoBean}</code> @throws CmsException if something goes wrong
[ "Reads", "a", "single", "publish", "job", "identified", "by", "its", "publish", "history", "id", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L7553-L7556
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/PatternPathMotion.java
PatternPathMotion.setPatternPath
public void setPatternPath(@Nullable Path patternPath) { """ Sets the Path defining a pattern of motion between two coordinates. The pattern will be translated, rotated, and scaled to fit between the start and end points. The pattern must not be empty and must have the end point differ from the start point. @...
java
public void setPatternPath(@Nullable Path patternPath) { PathMeasure pathMeasure = new PathMeasure(patternPath, false); float length = pathMeasure.getLength(); float[] pos = new float[2]; pathMeasure.getPosTan(length, pos, null); float endX = pos[0]; float endY = pos[1]; ...
[ "public", "void", "setPatternPath", "(", "@", "Nullable", "Path", "patternPath", ")", "{", "PathMeasure", "pathMeasure", "=", "new", "PathMeasure", "(", "patternPath", ",", "false", ")", ";", "float", "length", "=", "pathMeasure", ".", "getLength", "(", ")", ...
Sets the Path defining a pattern of motion between two coordinates. The pattern will be translated, rotated, and scaled to fit between the start and end points. The pattern must not be empty and must have the end point differ from the start point. @param patternPath A Path to be used as a pattern for two-dimensional m...
[ "Sets", "the", "Path", "defining", "a", "pattern", "of", "motion", "between", "two", "coordinates", ".", "The", "pattern", "will", "be", "translated", "rotated", "and", "scaled", "to", "fit", "between", "the", "start", "and", "end", "points", ".", "The", "...
train
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/PatternPathMotion.java#L106-L133
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java
ByteUtils.bigIntegerToBytes
public static final void bigIntegerToBytes( BigInteger n, byte[] data, int[] offset ) { """ Write the bytes representing <code>n</code> into the byte array <code>data</code>, starting at index <code>offset [0]</code>, and increment <code>offset [0]</code> by the number of bytes written; if <code>data == null</c...
java
public static final void bigIntegerToBytes( BigInteger n, byte[] data, int[] offset ) { byte[] bytes = n.toByteArray(); intToBytes(bytes.length, data, offset); offset[0] += memcpy(data, offset[0], bytes, 0, bytes.length); }
[ "public", "static", "final", "void", "bigIntegerToBytes", "(", "BigInteger", "n", ",", "byte", "[", "]", "data", ",", "int", "[", "]", "offset", ")", "{", "byte", "[", "]", "bytes", "=", "n", ".", "toByteArray", "(", ")", ";", "intToBytes", "(", "byt...
Write the bytes representing <code>n</code> into the byte array <code>data</code>, starting at index <code>offset [0]</code>, and increment <code>offset [0]</code> by the number of bytes written; if <code>data == null</code>, increment <code>offset [0]</code> by the number of bytes that would have been written otherwis...
[ "Write", "the", "bytes", "representing", "<code", ">", "n<", "/", "code", ">", "into", "the", "byte", "array", "<code", ">", "data<", "/", "code", ">", "starting", "at", "index", "<code", ">", "offset", "[", "0", "]", "<", "/", "code", ">", "and", ...
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L380-L384
apache/incubator-shardingsphere
sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XAPropertiesFactory.java
XAPropertiesFactory.createXAProperties
public static XAProperties createXAProperties(final DatabaseType databaseType) { """ Create XA properties. @param databaseType database type @return XA properties """ switch (databaseType) { case H2: return new H2XAProperties(); case MySQL: re...
java
public static XAProperties createXAProperties(final DatabaseType databaseType) { switch (databaseType) { case H2: return new H2XAProperties(); case MySQL: return new MySQLXAProperties(); case PostgreSQL: return new PostgreSQLXAP...
[ "public", "static", "XAProperties", "createXAProperties", "(", "final", "DatabaseType", "databaseType", ")", "{", "switch", "(", "databaseType", ")", "{", "case", "H2", ":", "return", "new", "H2XAProperties", "(", ")", ";", "case", "MySQL", ":", "return", "new...
Create XA properties. @param databaseType database type @return XA properties
[ "Create", "XA", "properties", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XAPropertiesFactory.java#L43-L58
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfStamper.java
PdfStamper.createSignature
public static PdfStamper createSignature(PdfReader reader, OutputStream os, char pdfVersion) throws DocumentException, IOException { """ Applies a digital signature to a document. The returned PdfStamper can be used normally as the signature is only applied when closing. <p> Note that the pdf is created in memo...
java
public static PdfStamper createSignature(PdfReader reader, OutputStream os, char pdfVersion) throws DocumentException, IOException { return createSignature(reader, os, pdfVersion, null, false); }
[ "public", "static", "PdfStamper", "createSignature", "(", "PdfReader", "reader", ",", "OutputStream", "os", ",", "char", "pdfVersion", ")", "throws", "DocumentException", ",", "IOException", "{", "return", "createSignature", "(", "reader", ",", "os", ",", "pdfVers...
Applies a digital signature to a document. The returned PdfStamper can be used normally as the signature is only applied when closing. <p> Note that the pdf is created in memory. <p> A possible use is: <p> <pre> KeyStore ks = KeyStore.getInstance("pkcs12"); ks.load(new FileInputStream("my_private_key.pfx"), "my_passwor...
[ "Applies", "a", "digital", "signature", "to", "a", "document", ".", "The", "returned", "PdfStamper", "can", "be", "used", "normally", "as", "the", "signature", "is", "only", "applied", "when", "closing", ".", "<p", ">", "Note", "that", "the", "pdf", "is", ...
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStamper.java#L718-L720
Squarespace/cldr
runtime/src/main/java/com/squarespace/cldr/dates/CalendarFormatterBase.java
CalendarFormatterBase.getTimeZoneName
public Name getTimeZoneName(String zoneId, ZonedDateTime date, boolean long_) { """ Lookup the time zone name variants (long or short) for the given zoneId and datetime. """ TimeZoneNames names = timezoneNames.get(zoneId); if (names != null) { return long_ ? names.longName() : names.shortName(); ...
java
public Name getTimeZoneName(String zoneId, ZonedDateTime date, boolean long_) { TimeZoneNames names = timezoneNames.get(zoneId); if (names != null) { return long_ ? names.longName() : names.shortName(); } zoneId = _CalendarUtils.getMetazone(zoneId, date); if (zoneId == null) { retur...
[ "public", "Name", "getTimeZoneName", "(", "String", "zoneId", ",", "ZonedDateTime", "date", ",", "boolean", "long_", ")", "{", "TimeZoneNames", "names", "=", "timezoneNames", ".", "get", "(", "zoneId", ")", ";", "if", "(", "names", "!=", "null", ")", "{", ...
Lookup the time zone name variants (long or short) for the given zoneId and datetime.
[ "Lookup", "the", "time", "zone", "name", "variants", "(", "long", "or", "short", ")", "for", "the", "given", "zoneId", "and", "datetime", "." ]
train
https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/dates/CalendarFormatterBase.java#L234-L249
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/util/Geometry.java
Geometry.getCappedOffset
private static final double getCappedOffset(final Point2D p0, final Point2D p2, final Point2D p4, final double offset) { """ this will check if the radius needs capping, and return a smaller value if it does """ final double radius = Math.min(p2.sub(p0).getLength(), p2.sub(p4).getLength()) / 2;// it m...
java
private static final double getCappedOffset(final Point2D p0, final Point2D p2, final Point2D p4, final double offset) { final double radius = Math.min(p2.sub(p0).getLength(), p2.sub(p4).getLength()) / 2;// it must be half, as there may be another radius on the other side, and they should not cross over. ...
[ "private", "static", "final", "double", "getCappedOffset", "(", "final", "Point2D", "p0", ",", "final", "Point2D", "p2", ",", "final", "Point2D", "p4", ",", "final", "double", "offset", ")", "{", "final", "double", "radius", "=", "Math", ".", "min", "(", ...
this will check if the radius needs capping, and return a smaller value if it does
[ "this", "will", "check", "if", "the", "radius", "needs", "capping", "and", "return", "a", "smaller", "value", "if", "it", "does" ]
train
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L883-L888
apache/groovy
src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java
ResourceGroovyMethods.eachFileMatch
public static void eachFileMatch(final File self, final Object nameFilter, @ClosureParams(value = SimpleType.class, options = "java.io.File") final Closure closure) throws FileNotFoundException, IllegalArgumentException { """ Invokes the closure for each file whose name (file.name) matches the given na...
java
public static void eachFileMatch(final File self, final Object nameFilter, @ClosureParams(value = SimpleType.class, options = "java.io.File") final Closure closure) throws FileNotFoundException, IllegalArgumentException { eachFileMatch(self, FileType.ANY, nameFilter, closure); }
[ "public", "static", "void", "eachFileMatch", "(", "final", "File", "self", ",", "final", "Object", "nameFilter", ",", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"java.io.File\"", ")", "final", "Closure", "closur...
Invokes the closure for each file whose name (file.name) matches the given nameFilter in the given directory - calling the {@link DefaultGroovyMethods#isCase(java.lang.Object, java.lang.Object)} method to determine if a match occurs. This method can be used with different kinds of filters like regular expressions, cla...
[ "Invokes", "the", "closure", "for", "each", "file", "whose", "name", "(", "file", ".", "name", ")", "matches", "the", "given", "nameFilter", "in", "the", "given", "directory", "-", "calling", "the", "{", "@link", "DefaultGroovyMethods#isCase", "(", "java", "...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1563-L1566
eserating/siren4j
src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java
ReflectingConverter.handleBaseUriLink
private void handleBaseUriLink(EntityBuilder builder, String baseUri) { """ Add the baseUri link to the entity if the baseUri is set on the entity. @param builder assumed not <code>null</code>. @param baseUri the token resolved uri. Assumed not blank. """ if (StringUtils.isBlank(baseUri)) { ...
java
private void handleBaseUriLink(EntityBuilder builder, String baseUri) { if (StringUtils.isBlank(baseUri)) { return; } Link link = LinkBuilder.newInstance().setRelationship(Link.RELATIONSHIP_BASEURI).setHref(baseUri).build(); builder.addLink(link); }
[ "private", "void", "handleBaseUriLink", "(", "EntityBuilder", "builder", ",", "String", "baseUri", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "baseUri", ")", ")", "{", "return", ";", "}", "Link", "link", "=", "LinkBuilder", ".", "newInstance", ...
Add the baseUri link to the entity if the baseUri is set on the entity. @param builder assumed not <code>null</code>. @param baseUri the token resolved uri. Assumed not blank.
[ "Add", "the", "baseUri", "link", "to", "the", "entity", "if", "the", "baseUri", "is", "set", "on", "the", "entity", "." ]
train
https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java#L593-L599
jcuda/jnvgraph
JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java
JNvgraph.nvgraphSpectralClustering
public static int nvgraphSpectralClustering( nvgraphHandle handle, nvgraphGraphDescr graph_descr, long weight_index, SpectralClusteringParameter params, Pointer clustering, Pointer eig_vals, Pointer eig_vects) { """ <pre> nvGRAPH spectral clustering g...
java
public static int nvgraphSpectralClustering( nvgraphHandle handle, nvgraphGraphDescr graph_descr, long weight_index, SpectralClusteringParameter params, Pointer clustering, Pointer eig_vals, Pointer eig_vects) { return checkResult(nvgraphSpectral...
[ "public", "static", "int", "nvgraphSpectralClustering", "(", "nvgraphHandle", "handle", ",", "nvgraphGraphDescr", "graph_descr", ",", "long", "weight_index", ",", "SpectralClusteringParameter", "params", ",", "Pointer", "clustering", ",", "Pointer", "eig_vals", ",", "Po...
<pre> nvGRAPH spectral clustering given a graph and solver parameters of struct SpectralClusteringParameter, assign vertices to groups such as intra-group connections are strong and/or inter-groups connections are weak using spectral technique. </pre>
[ "<pre", ">", "nvGRAPH", "spectral", "clustering", "given", "a", "graph", "and", "solver", "parameters", "of", "struct", "SpectralClusteringParameter", "assign", "vertices", "to", "groups", "such", "as", "intra", "-", "group", "connections", "are", "strong", "and",...
train
https://github.com/jcuda/jnvgraph/blob/2c6bd7c58edac181753bacf30af2cceeb1989a78/JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java#L714-L724
sebastiangraf/jSCSI
bundles/commons/src/main/java/org/jscsi/utils/Utils.java
Utils.printField
public static final void printField (final StringBuilder sb, final String fieldName, final byte fieldValue, final int indent) { """ This methods creates an easy to use interface to print out a logging message of a specific variable. @param sb StringBuilder to directly write the logging messages in. @param fiel...
java
public static final void printField (final StringBuilder sb, final String fieldName, final byte fieldValue, final int indent) { printField(sb, fieldName, (int) fieldValue, indent); }
[ "public", "static", "final", "void", "printField", "(", "final", "StringBuilder", "sb", ",", "final", "String", "fieldName", ",", "final", "byte", "fieldValue", ",", "final", "int", "indent", ")", "{", "printField", "(", "sb", ",", "fieldName", ",", "(", "...
This methods creates an easy to use interface to print out a logging message of a specific variable. @param sb StringBuilder to directly write the logging messages in. @param fieldName The name of the variable. @param fieldValue The value of the given variable. @param indent The level of indention.
[ "This", "methods", "creates", "an", "easy", "to", "use", "interface", "to", "print", "out", "a", "logging", "message", "of", "a", "specific", "variable", "." ]
train
https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/utils/Utils.java#L162-L165
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLNamedIndividualImpl_CustomFieldSerializer.java
OWLNamedIndividualImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLNamedIndividualImpl instance) throws SerializationException { """ Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.us...
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLNamedIndividualImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLNamedIndividualImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.client.rp...
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{" ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLNamedIndividualImpl_CustomFieldSerializer.java#L63-L66
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/component/thumbnail/ThumbnailRenderer.java
ThumbnailRenderer.encodeEnd
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { """ This methods generates the HTML code of the current b:thumbnail. <code>encodeBegin</code> generates the start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the H...
java
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { if (!component.isRendered()) { return; } Thumbnail thumbnail = (Thumbnail) component; ResponseWriter rw = context.getResponseWriter(); UIComponent capt; ...
[ "@", "Override", "public", "void", "encodeEnd", "(", "FacesContext", "context", ",", "UIComponent", "component", ")", "throws", "IOException", "{", "if", "(", "!", "component", ".", "isRendered", "(", ")", ")", "{", "return", ";", "}", "Thumbnail", "thumbnai...
This methods generates the HTML code of the current b:thumbnail. <code>encodeBegin</code> generates the start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the HTML code between the beginning and the end of the component. For instance, in the case of a panel component th...
[ "This", "methods", "generates", "the", "HTML", "code", "of", "the", "current", "b", ":", "thumbnail", ".", "<code", ">", "encodeBegin<", "/", "code", ">", "generates", "the", "start", "of", "the", "component", ".", "After", "the", "the", "JSF", "framework"...
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/thumbnail/ThumbnailRenderer.java#L84-L104
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/JoinableResourceBundleImpl.java
JoinableResourceBundleImpl.getAvailableVariant
private String getAvailableVariant(Map<String, String> curVariants) { """ Resolves a registered path from a variant key. @param variantKey the requested variant key @return the variant key to use """ String variantKey = null; if (variants != null) { Map<String, String> availableVariants = generato...
java
private String getAvailableVariant(Map<String, String> curVariants) { String variantKey = null; if (variants != null) { Map<String, String> availableVariants = generatorRegistry.getAvailableVariantMap(variants, curVariants); variantKey = VariantUtils.getVariantKey(availableVariants); } return variantKey...
[ "private", "String", "getAvailableVariant", "(", "Map", "<", "String", ",", "String", ">", "curVariants", ")", "{", "String", "variantKey", "=", "null", ";", "if", "(", "variants", "!=", "null", ")", "{", "Map", "<", "String", ",", "String", ">", "availa...
Resolves a registered path from a variant key. @param variantKey the requested variant key @return the variant key to use
[ "Resolves", "a", "registered", "path", "from", "a", "variant", "key", "." ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/JoinableResourceBundleImpl.java#L683-L692
sdl/Testy
src/main/java/com/sdl/selenium/web/XPathBuilder.java
XPathBuilder.setText
@SuppressWarnings("unchecked") public <T extends XPathBuilder> T setText(final String text, final SearchType... searchTypes) { """ <p><b>Used for finding element process (to generate xpath address)</b></p> @param text with which to identify the item @param searchTypes type search text element: see m...
java
@SuppressWarnings("unchecked") public <T extends XPathBuilder> T setText(final String text, final SearchType... searchTypes) { this.text = text; // notSupportedForCss(text, "text"); // if(text == null) { // xpath.remove("text"); // } else { // xpath.add("text"); //...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", "extends", "XPathBuilder", ">", "T", "setText", "(", "final", "String", "text", ",", "final", "SearchType", "...", "searchTypes", ")", "{", "this", ".", "text", "=", "text", ";", "// ...
<p><b>Used for finding element process (to generate xpath address)</b></p> @param text with which to identify the item @param searchTypes type search text element: see more details see {@link SearchType} @param <T> the element which calls this method @return this element
[ "<p", ">", "<b", ">", "Used", "for", "finding", "element", "process", "(", "to", "generate", "xpath", "address", ")", "<", "/", "b", ">", "<", "/", "p", ">" ]
train
https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/XPathBuilder.java#L257-L268
joniles/mpxj
src/main/java/net/sf/mpxj/ikvm/MapFileGenerator.java
MapFileGenerator.addProperty
private void addProperty(XMLStreamWriter writer, String name, Class<?> propertyType, String readMethod, String writeMethod) throws XMLStreamException { """ Add a simple property to the map file. @param writer xml stream writer @param name property name @param propertyType property type @param readMethod read...
java
private void addProperty(XMLStreamWriter writer, String name, Class<?> propertyType, String readMethod, String writeMethod) throws XMLStreamException { if (name.length() != 0) { writer.writeStartElement("property"); // convert property name to .NET style (i.e. first letter uppercase) ...
[ "private", "void", "addProperty", "(", "XMLStreamWriter", "writer", ",", "String", "name", ",", "Class", "<", "?", ">", "propertyType", ",", "String", "readMethod", ",", "String", "writeMethod", ")", "throws", "XMLStreamException", "{", "if", "(", "name", ".",...
Add a simple property to the map file. @param writer xml stream writer @param name property name @param propertyType property type @param readMethod read method name @param writeMethod write method name @throws XMLStreamException
[ "Add", "a", "simple", "property", "to", "the", "map", "file", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ikvm/MapFileGenerator.java#L250-L280
netty/netty
common/src/main/java/io/netty/util/AsciiString.java
AsciiString.toUpperCase
public AsciiString toUpperCase() { """ Converts the characters in this string to uppercase, using the default Locale. @return a new string containing the uppercase characters equivalent to the characters in this string. """ boolean uppercased = true; int i, j; final int len = length(...
java
public AsciiString toUpperCase() { boolean uppercased = true; int i, j; final int len = length() + arrayOffset(); for (i = arrayOffset(); i < len; ++i) { byte b = value[i]; if (b >= 'a' && b <= 'z') { uppercased = false; break; ...
[ "public", "AsciiString", "toUpperCase", "(", ")", "{", "boolean", "uppercased", "=", "true", ";", "int", "i", ",", "j", ";", "final", "int", "len", "=", "length", "(", ")", "+", "arrayOffset", "(", ")", ";", "for", "(", "i", "=", "arrayOffset", "(", ...
Converts the characters in this string to uppercase, using the default Locale. @return a new string containing the uppercase characters equivalent to the characters in this string.
[ "Converts", "the", "characters", "in", "this", "string", "to", "uppercase", "using", "the", "default", "Locale", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L958-L981
dejv78/javafx-commons
jfx-controls/src/main/java/dejv/jfx/controls/radialmenu1/ContextRadialMenu.java
ContextRadialMenu.showAt
public void showAt(Node target, double x, double y) { """ Shows the <code>ContextRadialMenu</code> at specified coordinates. @param target Target node. This will be sent as parameter to all triggered actions. @param x X-coord @param y Y-coord """ requireNonNull(target, "Parameter 'target...
java
public void showAt(Node target, double x, double y) { requireNonNull(target, "Parameter 'target' is null"); internalShow(pointer, target, x, y); pointer.setVisible(true); }
[ "public", "void", "showAt", "(", "Node", "target", ",", "double", "x", ",", "double", "y", ")", "{", "requireNonNull", "(", "target", ",", "\"Parameter 'target' is null\"", ")", ";", "internalShow", "(", "pointer", ",", "target", ",", "x", ",", "y", ")", ...
Shows the <code>ContextRadialMenu</code> at specified coordinates. @param target Target node. This will be sent as parameter to all triggered actions. @param x X-coord @param y Y-coord
[ "Shows", "the", "<code", ">", "ContextRadialMenu<", "/", "code", ">", "at", "specified", "coordinates", "." ]
train
https://github.com/dejv78/javafx-commons/blob/ea846eeeb4ed43a7628a40931a3e6f27d513592f/jfx-controls/src/main/java/dejv/jfx/controls/radialmenu1/ContextRadialMenu.java#L134-L139
apache/incubator-gobblin
gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java
GPGFileDecryptor.findSecretKey
private PGPPrivateKey findSecretKey(PGPSecretKeyRingCollection pgpSec, long keyID, String passPhrase) throws PGPException { """ Private util function that finds the private key from keyring collection based on keyId and passPhrase @param pgpSec keyring collection @param keyID keyID for this encryption file...
java
private PGPPrivateKey findSecretKey(PGPSecretKeyRingCollection pgpSec, long keyID, String passPhrase) throws PGPException { PGPSecretKey pgpSecKey = pgpSec.getSecretKey(keyID); if (pgpSecKey == null) { return null; } return pgpSecKey.extractPrivateKey( new JcePBESecretKeyDecryptorBu...
[ "private", "PGPPrivateKey", "findSecretKey", "(", "PGPSecretKeyRingCollection", "pgpSec", ",", "long", "keyID", ",", "String", "passPhrase", ")", "throws", "PGPException", "{", "PGPSecretKey", "pgpSecKey", "=", "pgpSec", ".", "getSecretKey", "(", "keyID", ")", ";", ...
Private util function that finds the private key from keyring collection based on keyId and passPhrase @param pgpSec keyring collection @param keyID keyID for this encryption file @param passPhrase passPhrase for this encryption file @throws PGPException
[ "Private", "util", "function", "that", "finds", "the", "private", "key", "from", "keyring", "collection", "based", "on", "keyId", "and", "passPhrase" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java#L124-L134
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java
WaveformFinder.requestWaveformPreviewFrom
public WaveformPreview requestWaveformPreviewFrom(final DataReference dataReference) { """ Ask the specified player for the specified waveform preview from the specified media slot, first checking if we have a cached copy. @param dataReference uniquely identifies the desired waveform preview @return the pre...
java
public WaveformPreview requestWaveformPreviewFrom(final DataReference dataReference) { ensureRunning(); for (WaveformPreview cached : previewHotCache.values()) { if (cached.dataReference.equals(dataReference)) { // Found a hot cue hit, use it. return cached; } ...
[ "public", "WaveformPreview", "requestWaveformPreviewFrom", "(", "final", "DataReference", "dataReference", ")", "{", "ensureRunning", "(", ")", ";", "for", "(", "WaveformPreview", "cached", ":", "previewHotCache", ".", "values", "(", ")", ")", "{", "if", "(", "c...
Ask the specified player for the specified waveform preview from the specified media slot, first checking if we have a cached copy. @param dataReference uniquely identifies the desired waveform preview @return the preview, if it was found, or {@code null} @throws IllegalStateException if the WaveformFinder is not ru...
[ "Ask", "the", "specified", "player", "for", "the", "specified", "waveform", "preview", "from", "the", "specified", "media", "slot", "first", "checking", "if", "we", "have", "a", "cached", "copy", "." ]
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L459-L467
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.registerBean
public void registerBean(String beanId, boolean isRequired) { """ Registers a helper bean with this container. @param beanId The bean's id. @param isRequired If true and the bean is not found, an exception is raised. """ if (beanId == null || beanId.isEmpty()) { return; } ...
java
public void registerBean(String beanId, boolean isRequired) { if (beanId == null || beanId.isEmpty()) { return; } Object bean = SpringUtil.getBean(beanId); if (bean == null && isRequired) { throw new PluginException("Required bean resouce not found: " + beanId);...
[ "public", "void", "registerBean", "(", "String", "beanId", ",", "boolean", "isRequired", ")", "{", "if", "(", "beanId", "==", "null", "||", "beanId", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "Object", "bean", "=", "SpringUtil", ".", "get...
Registers a helper bean with this container. @param beanId The bean's id. @param isRequired If true and the bean is not found, an exception is raised.
[ "Registers", "a", "helper", "bean", "with", "this", "container", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L802-L832
wg/lettuce
src/main/java/com/lambdaworks/redis/protocol/Command.java
Command.await
public boolean await(long timeout, TimeUnit unit) { """ Wait up to the specified time for the command output to become available. @param timeout Maximum time to wait for a result. @param unit Unit of time for the timeout. @return true if the output became available. """ try { ...
java
public boolean await(long timeout, TimeUnit unit) { try { return latch.await(timeout, unit); } catch (InterruptedException e) { throw new RedisCommandInterruptedException(e); } }
[ "public", "boolean", "await", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "{", "try", "{", "return", "latch", ".", "await", "(", "timeout", ",", "unit", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "throw", "new", "Redi...
Wait up to the specified time for the command output to become available. @param timeout Maximum time to wait for a result. @param unit Unit of time for the timeout. @return true if the output became available.
[ "Wait", "up", "to", "the", "specified", "time", "for", "the", "command", "output", "to", "become", "available", "." ]
train
https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/protocol/Command.java#L128-L134
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java
Strs.betn
public static Betner betn(String target, String left, String right) { """ Returns a {@code String} between matcher that matches any character in a given range @param target @param left @param right @return """ return betn(target).between(left, right); }
java
public static Betner betn(String target, String left, String right) { return betn(target).between(left, right); }
[ "public", "static", "Betner", "betn", "(", "String", "target", ",", "String", "left", ",", "String", "right", ")", "{", "return", "betn", "(", "target", ")", ".", "between", "(", "left", ",", "right", ")", ";", "}" ]
Returns a {@code String} between matcher that matches any character in a given range @param target @param left @param right @return
[ "Returns", "a", "{", "@code", "String", "}", "between", "matcher", "that", "matches", "any", "character", "in", "a", "given", "range" ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L431-L433
Stratio/bdt
src/main/java/com/stratio/qa/specs/CommonG.java
CommonG.isThisDateValid
private boolean isThisDateValid(String dateToValidate, String dateFromat) { """ Check is a String is a valid timestamp format @param dateToValidate @param dateFromat @return true/false """ if (dateToValidate == null) { return false; } SimpleDateFormat sdf = new SimpleDate...
java
private boolean isThisDateValid(String dateToValidate, String dateFromat) { if (dateToValidate == null) { return false; } SimpleDateFormat sdf = new SimpleDateFormat(dateFromat); sdf.setLenient(false); try { //if not valid, it will throw ParseException ...
[ "private", "boolean", "isThisDateValid", "(", "String", "dateToValidate", ",", "String", "dateFromat", ")", "{", "if", "(", "dateToValidate", "==", "null", ")", "{", "return", "false", ";", "}", "SimpleDateFormat", "sdf", "=", "new", "SimpleDateFormat", "(", "...
Check is a String is a valid timestamp format @param dateToValidate @param dateFromat @return true/false
[ "Check", "is", "a", "String", "is", "a", "valid", "timestamp", "format" ]
train
https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1526-L1540
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/internal/rendering/painter/tile/StringContentTilePainter.java
StringContentTilePainter.createFeatureDocument
private GraphicsDocument createFeatureDocument(StringWriter writer) throws RenderException { """ Create a document that parses the tile's featureFragment, using GraphicsWriter classes. @param writer writer @return document @throws RenderException oops """ if (TileMetadata.PARAM_SVG_RENDERER.equalsIgno...
java
private GraphicsDocument createFeatureDocument(StringWriter writer) throws RenderException { if (TileMetadata.PARAM_SVG_RENDERER.equalsIgnoreCase(renderer)) { DefaultSvgDocument document = new DefaultSvgDocument(writer, false); document.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS); document.registerWrit...
[ "private", "GraphicsDocument", "createFeatureDocument", "(", "StringWriter", "writer", ")", "throws", "RenderException", "{", "if", "(", "TileMetadata", ".", "PARAM_SVG_RENDERER", ".", "equalsIgnoreCase", "(", "renderer", ")", ")", "{", "DefaultSvgDocument", "document",...
Create a document that parses the tile's featureFragment, using GraphicsWriter classes. @param writer writer @return document @throws RenderException oops
[ "Create", "a", "document", "that", "parses", "the", "tile", "s", "featureFragment", "using", "GraphicsWriter", "classes", "." ]
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/rendering/painter/tile/StringContentTilePainter.java#L250-L269
riccardove/easyjasub
easyjasub-lib/src/main/java/com/github/riccardove/easyjasub/dictionary/EasyJaSubDictionary.java
EasyJaSubDictionary.addJMDict
public void addJMDict(File file) throws IOException, SAXException { """ Adds entries from a JMDict file @param file an XML JMDict file @throws IOException when reading file @throws SAXException when reading file """ new JMDictParser().parse(file, new DictionaryJMDictReader(trie, errors), thre...
java
public void addJMDict(File file) throws IOException, SAXException { new JMDictParser().parse(file, new DictionaryJMDictReader(trie, errors), threeLetterlanguageCode); }
[ "public", "void", "addJMDict", "(", "File", "file", ")", "throws", "IOException", ",", "SAXException", "{", "new", "JMDictParser", "(", ")", ".", "parse", "(", "file", ",", "new", "DictionaryJMDictReader", "(", "trie", ",", "errors", ")", ",", "threeLetterla...
Adds entries from a JMDict file @param file an XML JMDict file @throws IOException when reading file @throws SAXException when reading file
[ "Adds", "entries", "from", "a", "JMDict", "file" ]
train
https://github.com/riccardove/easyjasub/blob/58d6af66b1b1c738326c74d9ad5e4ad514120e27/easyjasub-lib/src/main/java/com/github/riccardove/easyjasub/dictionary/EasyJaSubDictionary.java#L95-L99
FasterXML/woodstox
src/main/java/com/ctc/wstx/dtd/FullDTDReader.java
FullDTDReader.findSharedName
private PrefixedName findSharedName(String prefix, String localName) { """ Method used to 'intern()' qualified names; main benefit is reduced memory usage as the name objects are shared. May also slightly speed up Map access, as more often identity comparisons catch matches. <p> Note: it is assumed at this po...
java
private PrefixedName findSharedName(String prefix, String localName) { HashMap<PrefixedName,PrefixedName> m = mSharedNames; if (mSharedNames == null) { mSharedNames = m = new HashMap<PrefixedName,PrefixedName>(); } else { // Maybe we already have a shared instance......
[ "private", "PrefixedName", "findSharedName", "(", "String", "prefix", ",", "String", "localName", ")", "{", "HashMap", "<", "PrefixedName", ",", "PrefixedName", ">", "m", "=", "mSharedNames", ";", "if", "(", "mSharedNames", "==", "null", ")", "{", "mSharedName...
Method used to 'intern()' qualified names; main benefit is reduced memory usage as the name objects are shared. May also slightly speed up Map access, as more often identity comparisons catch matches. <p> Note: it is assumed at this point that access is only from a single thread, and non-recursive -- generally valid as...
[ "Method", "used", "to", "intern", "()", "qualified", "names", ";", "main", "benefit", "is", "reduced", "memory", "usage", "as", "the", "name", "objects", "are", "shared", ".", "May", "also", "slightly", "speed", "up", "Map", "access", "as", "more", "often"...
train
https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L3310-L3330
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/database/CmsHtmlImport.java
CmsHtmlImport.getAbsoluteUri
public String getAbsoluteUri(String relativeUri, String baseUri) { """ Calculates an absolute uri from a relative "uri" and the given absolute "baseUri".<p> If "uri" is already absolute, it is returned unchanged. This method also returns "uri" unchanged if it is not well-formed.<p> @param relativeUri the re...
java
public String getAbsoluteUri(String relativeUri, String baseUri) { if ((relativeUri == null) || (relativeUri.charAt(0) == '/') || (relativeUri.startsWith("#"))) { return relativeUri; } // if we are on a windows system, we must add a ":" in the uri later String windowsAddit...
[ "public", "String", "getAbsoluteUri", "(", "String", "relativeUri", ",", "String", "baseUri", ")", "{", "if", "(", "(", "relativeUri", "==", "null", ")", "||", "(", "relativeUri", ".", "charAt", "(", "0", ")", "==", "'", "'", ")", "||", "(", "relativeU...
Calculates an absolute uri from a relative "uri" and the given absolute "baseUri".<p> If "uri" is already absolute, it is returned unchanged. This method also returns "uri" unchanged if it is not well-formed.<p> @param relativeUri the relative uri to calculate an absolute uri for @param baseUri the base uri, this mus...
[ "Calculates", "an", "absolute", "uri", "from", "a", "relative", "uri", "and", "the", "given", "absolute", "baseUri", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/database/CmsHtmlImport.java#L224-L252
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ScriptablePageInput.java
ScriptablePageInput.entrySet
public Set entrySet() { """ Create a {@link java.util.Set} of page input entries. This implementation assumes that the page input set does not change, which is acceptable for JSP clients as the page inputs have been specified when the JSP starts to render. @return Set """ if(_entrySet == null) {...
java
public Set entrySet() { if(_entrySet == null) { Map piMap = InternalUtils.getPageInputMap(_request); ArrayList list = new ArrayList(); if(piMap != null) { Iterator iterator = piMap.keySet().iterator(); while(iterator.hasNext()) { ...
[ "public", "Set", "entrySet", "(", ")", "{", "if", "(", "_entrySet", "==", "null", ")", "{", "Map", "piMap", "=", "InternalUtils", ".", "getPageInputMap", "(", "_request", ")", ";", "ArrayList", "list", "=", "new", "ArrayList", "(", ")", ";", "if", "(",...
Create a {@link java.util.Set} of page input entries. This implementation assumes that the page input set does not change, which is acceptable for JSP clients as the page inputs have been specified when the JSP starts to render. @return Set
[ "Create", "a", "{", "@link", "java", ".", "util", ".", "Set", "}", "of", "page", "input", "entries", ".", "This", "implementation", "assumes", "that", "the", "page", "input", "set", "does", "not", "change", "which", "is", "acceptable", "for", "JSP", "cli...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ScriptablePageInput.java#L74-L91
skjolber/3d-bin-container-packing
src/main/java/com/github/skjolberg/packing/Packager.java
Packager.pack
public Container pack(List<BoxItem> boxes, List<Container> containers, long deadline) { """ Return a container which holds all the boxes in the argument @param boxes list of boxes to fit in a container @param containers list of containers @param deadline the system time in milliseconds at which the sea...
java
public Container pack(List<BoxItem> boxes, List<Container> containers, long deadline) { return pack(boxes, containers, deadLinePredicate(deadline)); }
[ "public", "Container", "pack", "(", "List", "<", "BoxItem", ">", "boxes", ",", "List", "<", "Container", ">", "containers", ",", "long", "deadline", ")", "{", "return", "pack", "(", "boxes", ",", "containers", ",", "deadLinePredicate", "(", "deadline", ")"...
Return a container which holds all the boxes in the argument @param boxes list of boxes to fit in a container @param containers list of containers @param deadline the system time in milliseconds at which the search should be aborted @return index of container if match, -1 if not
[ "Return", "a", "container", "which", "holds", "all", "the", "boxes", "in", "the", "argument" ]
train
https://github.com/skjolber/3d-bin-container-packing/blob/9609bc7515322b2de2cad0dfb3d2f72607e71aae/src/main/java/com/github/skjolberg/packing/Packager.java#L113-L115
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java
AtomTetrahedralLigandPlacer3D.getUnsetAtomsInAtomContainer
public IAtomContainer getUnsetAtomsInAtomContainer(IAtom atom, IAtomContainer ac) { """ Gets the unsetAtomsInAtomContainer attribute of the AtomTetrahedralLigandPlacer3D object. @param atom Description of the Parameter @param ac Description of the Parameter @return The unsetAtomsInAtomContainer v...
java
public IAtomContainer getUnsetAtomsInAtomContainer(IAtom atom, IAtomContainer ac) { List atoms = ac.getConnectedAtomsList(atom); IAtomContainer connectedAtoms = atom.getBuilder().newInstance(IAtomContainer.class); for (int i = 0; i < atoms.size(); i++) { IAtom curAtom = (IAtom) atoms...
[ "public", "IAtomContainer", "getUnsetAtomsInAtomContainer", "(", "IAtom", "atom", ",", "IAtomContainer", "ac", ")", "{", "List", "atoms", "=", "ac", ".", "getConnectedAtomsList", "(", "atom", ")", ";", "IAtomContainer", "connectedAtoms", "=", "atom", ".", "getBuil...
Gets the unsetAtomsInAtomContainer attribute of the AtomTetrahedralLigandPlacer3D object. @param atom Description of the Parameter @param ac Description of the Parameter @return The unsetAtomsInAtomContainer value
[ "Gets", "the", "unsetAtomsInAtomContainer", "attribute", "of", "the", "AtomTetrahedralLigandPlacer3D", "object", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java#L838-L848
datastax/java-driver
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java
SchemaBuilder.createFunction
@NonNull public static CreateFunctionStart createFunction( @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier functionName) { """ Starts a CREATE FUNCTION query with the given function name for the given keyspace name. """ return new DefaultCreateFunction(keyspace, functionName); }
java
@NonNull public static CreateFunctionStart createFunction( @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier functionName) { return new DefaultCreateFunction(keyspace, functionName); }
[ "@", "NonNull", "public", "static", "CreateFunctionStart", "createFunction", "(", "@", "Nullable", "CqlIdentifier", "keyspace", ",", "@", "NonNull", "CqlIdentifier", "functionName", ")", "{", "return", "new", "DefaultCreateFunction", "(", "keyspace", ",", "functionNam...
Starts a CREATE FUNCTION query with the given function name for the given keyspace name.
[ "Starts", "a", "CREATE", "FUNCTION", "query", "with", "the", "given", "function", "name", "for", "the", "given", "keyspace", "name", "." ]
train
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L480-L484
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/helper/CompensationUtil.java
CompensationUtil.throwCompensationEvent
public static void throwCompensationEvent(List<EventSubscriptionEntity> eventSubscriptions, ActivityExecution execution, boolean async) { """ we create a separate execution for each compensation handler invocation. """ // first spawn the compensating executions for (EventSubscriptionEntity eventSubscr...
java
public static void throwCompensationEvent(List<EventSubscriptionEntity> eventSubscriptions, ActivityExecution execution, boolean async) { // first spawn the compensating executions for (EventSubscriptionEntity eventSubscription : eventSubscriptions) { // check whether compensating execution is already cr...
[ "public", "static", "void", "throwCompensationEvent", "(", "List", "<", "EventSubscriptionEntity", ">", "eventSubscriptions", ",", "ActivityExecution", "execution", ",", "boolean", "async", ")", "{", "// first spawn the compensating executions", "for", "(", "EventSubscripti...
we create a separate execution for each compensation handler invocation.
[ "we", "create", "a", "separate", "execution", "for", "each", "compensation", "handler", "invocation", "." ]
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/helper/CompensationUtil.java#L55-L89
FINRAOS/DataGenerator
dg-core/src/main/java/org/finra/datagenerator/engine/scxml/SCXMLGapper.java
SCXMLGapper.reproduce
public Frontier reproduce(Map<String, String> decomposition) { """ Produces an SCXMLFrontier by reversing a decomposition; the model text is bundled into the decomposition. @param decomposition the decomposition, assembled back into a map @return a rebuilt SCXMLFrontier """ return reproduce(decomp...
java
public Frontier reproduce(Map<String, String> decomposition) { return reproduce(decomposition, new LinkedList<CustomTagExtension>()); }
[ "public", "Frontier", "reproduce", "(", "Map", "<", "String", ",", "String", ">", "decomposition", ")", "{", "return", "reproduce", "(", "decomposition", ",", "new", "LinkedList", "<", "CustomTagExtension", ">", "(", ")", ")", ";", "}" ]
Produces an SCXMLFrontier by reversing a decomposition; the model text is bundled into the decomposition. @param decomposition the decomposition, assembled back into a map @return a rebuilt SCXMLFrontier
[ "Produces", "an", "SCXMLFrontier", "by", "reversing", "a", "decomposition", ";", "the", "model", "text", "is", "bundled", "into", "the", "decomposition", "." ]
train
https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/engine/scxml/SCXMLGapper.java#L106-L108
playn/playn
android/src/playn/android/AndroidGraphics.java
AndroidGraphics.registerFont
public void registerFont(Typeface face, String name, Font.Style style, String... ligatureGlyphs) { """ Registers a font with the graphics system. @param face the typeface to be registered. It can be loaded via {@link AndroidAssets#getTypeface}. @param name the name under which to register the font. @param st...
java
public void registerFont(Typeface face, String name, Font.Style style, String... ligatureGlyphs) { Pair<String,Font.Style> key = Pair.create(name, style); fonts.put(key, face); ligatureHacks.put(key, ligatureGlyphs); }
[ "public", "void", "registerFont", "(", "Typeface", "face", ",", "String", "name", ",", "Font", ".", "Style", "style", ",", "String", "...", "ligatureGlyphs", ")", "{", "Pair", "<", "String", ",", "Font", ".", "Style", ">", "key", "=", "Pair", ".", "cre...
Registers a font with the graphics system. @param face the typeface to be registered. It can be loaded via {@link AndroidAssets#getTypeface}. @param name the name under which to register the font. @param style the style variant of the specified name provided by the font file. For example one might {@code registerFont(...
[ "Registers", "a", "font", "with", "the", "graphics", "system", "." ]
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/android/src/playn/android/AndroidGraphics.java#L86-L90
jenkinsci/java-client-api
jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java
BuildWithDetails.updateDisplayNameAndDescription
public BuildWithDetails updateDisplayNameAndDescription(String displayName, String description) throws IOException { """ Update <code>displayName</code> and the <code>description</code> of a build. @param displayName The new displayName which should be set. @param description The description which should be s...
java
public BuildWithDetails updateDisplayNameAndDescription(String displayName, String description) throws IOException { return updateDisplayNameAndDescription(displayName, description, false); }
[ "public", "BuildWithDetails", "updateDisplayNameAndDescription", "(", "String", "displayName", ",", "String", "description", ")", "throws", "IOException", "{", "return", "updateDisplayNameAndDescription", "(", "displayName", ",", "description", ",", "false", ")", ";", "...
Update <code>displayName</code> and the <code>description</code> of a build. @param displayName The new displayName which should be set. @param description The description which should be set. @throws IOException in case of errors.
[ "Update", "<code", ">", "displayName<", "/", "code", ">", "and", "the", "<code", ">", "description<", "/", "code", ">", "of", "a", "build", "." ]
train
https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java#L204-L206
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.updateKey
public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion) { """ The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. In order to perform this operation, the key must already exist in the Key Vau...
java
public KeyBundle updateKey(String vaultBaseUrl, String keyName, String keyVersion) { return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion).toBlocking().single().body(); }
[ "public", "KeyBundle", "updateKey", "(", "String", "vaultBaseUrl", ",", "String", "keyName", ",", "String", "keyVersion", ")", "{", "return", "updateKeyWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "keyName", ",", "keyVersion", ")", ".", "toBlocking", "(", ...
The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires...
[ "The", "update", "key", "operation", "changes", "specified", "attributes", "of", "a", "stored", "key", "and", "can", "be", "applied", "to", "any", "key", "type", "and", "key", "version", "stored", "in", "Azure", "Key", "Vault", ".", "In", "order", "to", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L1176-L1178
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java
CFTree.findLeaf
public ClusteringFeature findLeaf(NumberVector nv) { """ Find the leaf of a cluster, to get the final cluster assignment. <p> In contrast to {@link #insert}, this does not modify the tree. @param nv Object data @return Leaf this vector should be assigned to """ if(root == null) { throw new Ille...
java
public ClusteringFeature findLeaf(NumberVector nv) { if(root == null) { throw new IllegalStateException("CFTree not yet built."); } return findLeaf(root, nv); }
[ "public", "ClusteringFeature", "findLeaf", "(", "NumberVector", "nv", ")", "{", "if", "(", "root", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"CFTree not yet built.\"", ")", ";", "}", "return", "findLeaf", "(", "root", ",", "nv", ...
Find the leaf of a cluster, to get the final cluster assignment. <p> In contrast to {@link #insert}, this does not modify the tree. @param nv Object data @return Leaf this vector should be assigned to
[ "Find", "the", "leaf", "of", "a", "cluster", "to", "get", "the", "final", "cluster", "assignment", ".", "<p", ">", "In", "contrast", "to", "{", "@link", "#insert", "}", "this", "does", "not", "modify", "the", "tree", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java#L307-L312
NessComputing/components-ness-pg
src/main/java/com/nesscomputing/db/postgres/junit/EmbeddedPostgresRules.java
EmbeddedPostgresRules.embeddedDatabaseRule
public static EmbeddedPostgresTestDatabaseRule embeddedDatabaseRule(@Nonnull final URI baseUri, final String... personalities) { """ Returns a {@link TestRule} to create a Postgres cluster, shared amongst all test cases in this JVM. The rule contributes {@link Config} switches to configure each test case to get i...
java
public static EmbeddedPostgresTestDatabaseRule embeddedDatabaseRule(@Nonnull final URI baseUri, final String... personalities) { return new EmbeddedPostgresTestDatabaseRule(baseUri, personalities); }
[ "public", "static", "EmbeddedPostgresTestDatabaseRule", "embeddedDatabaseRule", "(", "@", "Nonnull", "final", "URI", "baseUri", ",", "final", "String", "...", "personalities", ")", "{", "return", "new", "EmbeddedPostgresTestDatabaseRule", "(", "baseUri", ",", "personali...
Returns a {@link TestRule} to create a Postgres cluster, shared amongst all test cases in this JVM. The rule contributes {@link Config} switches to configure each test case to get its own database.
[ "Returns", "a", "{" ]
train
https://github.com/NessComputing/components-ness-pg/blob/e983d6075645ea1bf51cc5fc16901e5aab0f5c70/src/main/java/com/nesscomputing/db/postgres/junit/EmbeddedPostgresRules.java#L47-L50
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.preProcessOperation
void preProcessOperation(StreamSegmentTruncateOperation operation) throws BadOffsetException { """ Pre-processes a StreamSegmentTruncateOperation. @param operation The Operation. @throws BadOffsetException If the operation's Offset is not between the current StartOffset and current EndOffset (Seg...
java
void preProcessOperation(StreamSegmentTruncateOperation operation) throws BadOffsetException { ensureSegmentId(operation); if (operation.getStreamSegmentOffset() < this.startOffset || operation.getStreamSegmentOffset() > this.length) { String msg = String.format("Truncation Offset must be at...
[ "void", "preProcessOperation", "(", "StreamSegmentTruncateOperation", "operation", ")", "throws", "BadOffsetException", "{", "ensureSegmentId", "(", "operation", ")", ";", "if", "(", "operation", ".", "getStreamSegmentOffset", "(", ")", "<", "this", ".", "startOffset"...
Pre-processes a StreamSegmentTruncateOperation. @param operation The Operation. @throws BadOffsetException If the operation's Offset is not between the current StartOffset and current EndOffset (SegmentLength - 1).
[ "Pre", "-", "processes", "a", "StreamSegmentTruncateOperation", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L337-L344
apache/groovy
src/main/java/org/codehaus/groovy/antlr/treewalker/SourcePrinter.java
SourcePrinter.visitEnumConstantDef
public void visitEnumConstantDef(GroovySourceAST t,int visit) { """ token type EMPTY_STAT obsolete and should be removed, never visited/created """ GroovySourceAST sibling = (GroovySourceAST)t.getNextSibling(); if (sibling != null && sibling.getType() == GroovyTokenTypes.ENUM_CONSTANT_DEF) { ...
java
public void visitEnumConstantDef(GroovySourceAST t,int visit) { GroovySourceAST sibling = (GroovySourceAST)t.getNextSibling(); if (sibling != null && sibling.getType() == GroovyTokenTypes.ENUM_CONSTANT_DEF) { print(t,visit,null,null,", "); } }
[ "public", "void", "visitEnumConstantDef", "(", "GroovySourceAST", "t", ",", "int", "visit", ")", "{", "GroovySourceAST", "sibling", "=", "(", "GroovySourceAST", ")", "t", ".", "getNextSibling", "(", ")", ";", "if", "(", "sibling", "!=", "null", "&&", "siblin...
token type EMPTY_STAT obsolete and should be removed, never visited/created
[ "token", "type", "EMPTY_STAT", "obsolete", "and", "should", "be", "removed", "never", "visited", "/", "created" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/antlr/treewalker/SourcePrinter.java#L259-L264
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.translationRotateScaleInvert
public Matrix4f translationRotateScaleInvert(float tx, float ty, float tz, float qx, float qy, float qz, float qw, float sx, float sy, float sz) { """ Set <code>this</code> matrix to <code>(T * R * S)<sup>-1</sup></...
java
public Matrix4f translationRotateScaleInvert(float tx, float ty, float tz, float qx, float qy, float qz, float qw, float sx, float sy, float sz) { boolean one = Math.abs(sx) == 1.0f && Math.abs(sy) == 1.0f && Mat...
[ "public", "Matrix4f", "translationRotateScaleInvert", "(", "float", "tx", ",", "float", "ty", ",", "float", "tz", ",", "float", "qx", ",", "float", "qy", ",", "float", "qz", ",", "float", "qw", ",", "float", "sx", ",", "float", "sy", ",", "float", "sz"...
Set <code>this</code> matrix to <code>(T * R * S)<sup>-1</sup></code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code>, <code>R</code> is a rotation transformation specified by the quaternion <code>(qx, qy, qz, qw)</code>, and <code>S</code> is a scaling transformation which scales the thre...
[ "Set", "<code", ">", "this<", "/", "code", ">", "matrix", "to", "<code", ">", "(", "T", "*", "R", "*", "S", ")", "<sup", ">", "-", "1<", "/", "sup", ">", "<", "/", "code", ">", "where", "<code", ">", "T<", "/", "code", ">", "is", "a", "tran...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L4177-L4215
sarxos/win-registry
src/main/java/com/github/sarxos/winreg/WindowsRegistry.java
WindowsRegistry.readStringSubKeys
public List<String> readStringSubKeys(HKey hk, String key, String charsetName) throws RegistryException { """ Read the value name(s) from a given key @param hk the HKEY @param key the key @param charsetName which charset to use @return the value name(s) @throws RegistryException when something is not right ...
java
public List<String> readStringSubKeys(HKey hk, String key, String charsetName) throws RegistryException { try { return ReflectedMethods.readStringSubKeys(hk.root(), hk.hex(), key, charsetName); } catch (Exception e) { throw new RegistryException("Cannot read sub keys from key " + key, e); } }
[ "public", "List", "<", "String", ">", "readStringSubKeys", "(", "HKey", "hk", ",", "String", "key", ",", "String", "charsetName", ")", "throws", "RegistryException", "{", "try", "{", "return", "ReflectedMethods", ".", "readStringSubKeys", "(", "hk", ".", "root...
Read the value name(s) from a given key @param hk the HKEY @param key the key @param charsetName which charset to use @return the value name(s) @throws RegistryException when something is not right
[ "Read", "the", "value", "name", "(", "s", ")", "from", "a", "given", "key" ]
train
https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L117-L123
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.collectify
public static <K, V> Collection<Map<K, V>> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType, Class<K> targetKeyType, Class<V> targetValueType) { """ Convert an object to a collection of maps. @param mapper the object mapper @param source ...
java
public static <K, V> Collection<Map<K, V>> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType, Class<K> targetKeyType, Class<V> targetValueType) { MapType mapType = mapper.getTypeFactory().constructMapType(Map.class, targetKeyType, targetValueType); return co...
[ "public", "static", "<", "K", ",", "V", ">", "Collection", "<", "Map", "<", "K", ",", "V", ">", ">", "collectify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ",", "Class", "<", "?", "extends", "Collection", ">", "targetCollectionType", ",", ...
Convert an object to a collection of maps. @param mapper the object mapper @param source the source object @param targetCollectionType the target collection type @param targetKeyType the target map key type @param targetValueType the target map value type @return collection
[ "Convert", "an", "object", "to", "a", "collection", "of", "maps", "." ]
train
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L75-L78
aws/aws-sdk-java
aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/CreateConfigurationRequest.java
CreateConfigurationRequest.withTags
public CreateConfigurationRequest withTags(java.util.Map<String, String> tags) { """ Create tags when creating the configuration. @param tags Create tags when creating the configuration. @return Returns a reference to this object so that method calls can be chained together. """ setTags(tags); ...
java
public CreateConfigurationRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "CreateConfigurationRequest", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
Create tags when creating the configuration. @param tags Create tags when creating the configuration. @return Returns a reference to this object so that method calls can be chained together.
[ "Create", "tags", "when", "creating", "the", "configuration", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/CreateConfigurationRequest.java#L205-L208
jayantk/jklol
src/com/jayantkrish/jklol/ccg/CcgParserUtils.java
CcgParserUtils.filterExampleCollection
public static <T extends CcgExample> List<T> filterExampleCollection( final CcgParser parser, List<T> examples) { """ Checks whether each example in {@code examples} can be produced by this parser. Invalid examples are filtered out of the returned examples. @param parser @param examples @return ""...
java
public static <T extends CcgExample> List<T> filterExampleCollection( final CcgParser parser, List<T> examples) { MapReduceExecutor executor = MapReduceConfiguration.getMapReduceExecutor(); List<T> filteredExamples = executor.filter(examples, new Predicate<T>() { @Override public boolean appl...
[ "public", "static", "<", "T", "extends", "CcgExample", ">", "List", "<", "T", ">", "filterExampleCollection", "(", "final", "CcgParser", "parser", ",", "List", "<", "T", ">", "examples", ")", "{", "MapReduceExecutor", "executor", "=", "MapReduceConfiguration", ...
Checks whether each example in {@code examples} can be produced by this parser. Invalid examples are filtered out of the returned examples. @param parser @param examples @return
[ "Checks", "whether", "each", "example", "in", "{", "@code", "examples", "}", "can", "be", "produced", "by", "this", "parser", ".", "Invalid", "examples", "are", "filtered", "out", "of", "the", "returned", "examples", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParserUtils.java#L37-L49
PistoiaHELM/HELM2NotationToolkit
src/main/java/org/helm/notation2/tools/Validation.java
Validation.checkAttachmentPoint
private static void checkAttachmentPoint(Monomer mon, String str) throws AttachmentException { """ method to check the attachment point's existence @param mon Monomer @param str Attachment point @throws AttachmentException if the Attachment point is not there """ if (!(mon.getAttachmentListString()....
java
private static void checkAttachmentPoint(Monomer mon, String str) throws AttachmentException { if (!(mon.getAttachmentListString().contains(str))) { if (!(str.equals("?") || str.equals("pair")) && !mon.getAlternateId().equals("?")) { LOG.info("Attachment point for source is not there"); throw new Attac...
[ "private", "static", "void", "checkAttachmentPoint", "(", "Monomer", "mon", ",", "String", "str", ")", "throws", "AttachmentException", "{", "if", "(", "!", "(", "mon", ".", "getAttachmentListString", "(", ")", ".", "contains", "(", "str", ")", ")", ")", "...
method to check the attachment point's existence @param mon Monomer @param str Attachment point @throws AttachmentException if the Attachment point is not there
[ "method", "to", "check", "the", "attachment", "point", "s", "existence" ]
train
https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L670-L677
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setNumber
@NonNull @Override public MutableArray setNumber(int index, Number value) { """ Sets an NSNumber object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Number object @return The self object """ return setValue(index, value); ...
java
@NonNull @Override public MutableArray setNumber(int index, Number value) { return setValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setNumber", "(", "int", "index", ",", "Number", "value", ")", "{", "return", "setValue", "(", "index", ",", "value", ")", ";", "}" ]
Sets an NSNumber object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Number object @return The self object
[ "Sets", "an", "NSNumber", "object", "at", "the", "given", "index", "." ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L130-L134
dspinellis/UMLGraph
src/main/java/org/umlgraph/doclet/Options.java
Options.matchOption
protected static boolean matchOption(String given, String expect, boolean negative) { """ Match strings, ignoring leading <tt>-</tt>, <tt>-!</tt>, and <tt>!</tt>. @param given Given string @param expect Expected string @param negative May be negative @return {@code true} on success """ int begin = 0, en...
java
protected static boolean matchOption(String given, String expect, boolean negative) { int begin = 0, end = given.length(); if (begin < end && given.charAt(begin) == '-') ++begin; if (negative && begin < end && given.charAt(begin) == '!') ++begin; return expect.length() == end - begin && expect.regionMatch...
[ "protected", "static", "boolean", "matchOption", "(", "String", "given", ",", "String", "expect", ",", "boolean", "negative", ")", "{", "int", "begin", "=", "0", ",", "end", "=", "given", ".", "length", "(", ")", ";", "if", "(", "begin", "<", "end", ...
Match strings, ignoring leading <tt>-</tt>, <tt>-!</tt>, and <tt>!</tt>. @param given Given string @param expect Expected string @param negative May be negative @return {@code true} on success
[ "Match", "strings", "ignoring", "leading", "<tt", ">", "-", "<", "/", "tt", ">", "<tt", ">", "-", "!<", "/", "tt", ">", "and", "<tt", ">", "!<", "/", "tt", ">", "." ]
train
https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L178-L185
jboss/jboss-jsf-api_spec
src/main/java/javax/faces/component/UIViewRoot.java
UIViewRoot.addComponentResource
public void addComponentResource(FacesContext context, UIComponent componentResource, String target) { """ <p class="changed_added_2_0">Add argument <code>component</code>, which is assumed to represent a resource instance, as a resource to this view. A resource instance is rendered by a resource <code>Rendere...
java
public void addComponentResource(FacesContext context, UIComponent componentResource, String target) { final Map<String,Object> attributes = componentResource.getAttributes(); // look for a target in the component attribute set if arg is not set. if (target == null) { target = (Strin...
[ "public", "void", "addComponentResource", "(", "FacesContext", "context", ",", "UIComponent", "componentResource", ",", "String", "target", ")", "{", "final", "Map", "<", "String", ",", "Object", ">", "attributes", "=", "componentResource", ".", "getAttributes", "...
<p class="changed_added_2_0">Add argument <code>component</code>, which is assumed to represent a resource instance, as a resource to this view. A resource instance is rendered by a resource <code>Renderer</code>, as described in the Standard HTML RenderKit. </p> <div class="changed_added_2_0"> <p> The <code>compone...
[ "<p", "class", "=", "changed_added_2_0", ">", "Add", "argument", "<code", ">", "component<", "/", "code", ">", "which", "is", "assumed", "to", "represent", "a", "resource", "instance", "as", "a", "resource", "to", "this", "view", ".", "A", "resource", "ins...
train
https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIViewRoot.java#L512-L534
goldmansachs/gs-collections
collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java
StringIterate.forEach
@Deprecated public static void forEach(String string, final com.gs.collections.impl.block.procedure.primitive.CharProcedure procedure) { """ For each character in the {@code string}, execute the {@link CharProcedure}. @deprecated since 3.0. Use {@link #forEach(String, CharProcedure)} instead. """ ...
java
@Deprecated public static void forEach(String string, final com.gs.collections.impl.block.procedure.primitive.CharProcedure procedure) { StringIterate.forEachChar(string, new CharProcedure() { public void value(char each) { procedure.value(each); ...
[ "@", "Deprecated", "public", "static", "void", "forEach", "(", "String", "string", ",", "final", "com", ".", "gs", ".", "collections", ".", "impl", ".", "block", ".", "procedure", ".", "primitive", ".", "CharProcedure", "procedure", ")", "{", "StringIterate"...
For each character in the {@code string}, execute the {@link CharProcedure}. @deprecated since 3.0. Use {@link #forEach(String, CharProcedure)} instead.
[ "For", "each", "character", "in", "the", "{", "@code", "string", "}", "execute", "the", "{", "@link", "CharProcedure", "}", "." ]
train
https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L332-L342
apache/reef
lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java
VortexFuture.get
@Override public TOutput get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException, CancellationException { """ Wait a certain period of time for the result of the task. @throws TimeoutException if the timeout provided hits before the Tasklet is done. ...
java
@Override public TOutput get(final long timeout, final TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException, CancellationException { if (!countDownLatch.await(timeout, unit)) { throw new TimeoutException("Waiting for the results of the task timed out. Timeout = " + timeout ...
[ "@", "Override", "public", "TOutput", "get", "(", "final", "long", "timeout", ",", "final", "TimeUnit", "unit", ")", "throws", "InterruptedException", ",", "ExecutionException", ",", "TimeoutException", ",", "CancellationException", "{", "if", "(", "!", "countDown...
Wait a certain period of time for the result of the task. @throws TimeoutException if the timeout provided hits before the Tasklet is done. @throws InterruptedException if the thread is interrupted. @throws ExecutionException if the Tasklet execution failed to complete. @throws CancellationException if the Tasklet was ...
[ "Wait", "a", "certain", "period", "of", "time", "for", "the", "result", "of", "the", "task", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L168-L177
querydsl/querydsl
querydsl-sql/src/main/java/com/querydsl/sql/SQLExpressions.java
SQLExpressions.nthValue
public static <T> WindowOver<T> nthValue(Expression<T> expr, Number n) { """ NTH_VALUE returns the expr value of the nth row in the window defined by the analytic clause. The returned value has the data type of the expr. @param expr measure expression @param n one based row index @return nth_value(expr, n) ...
java
public static <T> WindowOver<T> nthValue(Expression<T> expr, Number n) { return nthValue(expr, ConstantImpl.create(n)); }
[ "public", "static", "<", "T", ">", "WindowOver", "<", "T", ">", "nthValue", "(", "Expression", "<", "T", ">", "expr", ",", "Number", "n", ")", "{", "return", "nthValue", "(", "expr", ",", "ConstantImpl", ".", "create", "(", "n", ")", ")", ";", "}" ...
NTH_VALUE returns the expr value of the nth row in the window defined by the analytic clause. The returned value has the data type of the expr. @param expr measure expression @param n one based row index @return nth_value(expr, n)
[ "NTH_VALUE", "returns", "the", "expr", "value", "of", "the", "nth", "row", "in", "the", "window", "defined", "by", "the", "analytic", "clause", ".", "The", "returned", "value", "has", "the", "data", "type", "of", "the", "expr", "." ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/SQLExpressions.java#L680-L682
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java
P2sVpnServerConfigurationsInner.get
public P2SVpnServerConfigurationInner get(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { """ Retrieves the details of a P2SVpnServerConfiguration. @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. @param virtualWanName The name of the V...
java
public P2SVpnServerConfigurationInner get(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName) { return getWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName).toBlocking().single().body(); }
[ "public", "P2SVpnServerConfigurationInner", "get", "(", "String", "resourceGroupName", ",", "String", "virtualWanName", ",", "String", "p2SVpnServerConfigurationName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "virtualWanName", ",", "...
Retrieves the details of a P2SVpnServerConfiguration. @param resourceGroupName The resource group name of the P2SVpnServerConfiguration. @param virtualWanName The name of the VirtualWan. @param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration. @throws IllegalArgumentException thrown if parameter...
[ "Retrieves", "the", "details", "of", "a", "P2SVpnServerConfiguration", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java#L105-L107
JodaOrg/joda-time
src/main/java/org/joda/time/YearMonthDay.java
YearMonthDay.withYear
public YearMonthDay withYear(int year) { """ Returns a copy of this date with the year field updated. <p> YearMonthDay is immutable, so there are no set methods. Instead, this method returns a new instance with the value of year changed. @param year the year to set @return a copy of this object with the f...
java
public YearMonthDay withYear(int year) { int[] newValues = getValues(); newValues = getChronology().year().set(this, YEAR, newValues, year); return new YearMonthDay(this, newValues); }
[ "public", "YearMonthDay", "withYear", "(", "int", "year", ")", "{", "int", "[", "]", "newValues", "=", "getValues", "(", ")", ";", "newValues", "=", "getChronology", "(", ")", ".", "year", "(", ")", ".", "set", "(", "this", ",", "YEAR", ",", "newValu...
Returns a copy of this date with the year field updated. <p> YearMonthDay is immutable, so there are no set methods. Instead, this method returns a new instance with the value of year changed. @param year the year to set @return a copy of this object with the field set @throws IllegalArgumentException if the value is...
[ "Returns", "a", "copy", "of", "this", "date", "with", "the", "year", "field", "updated", ".", "<p", ">", "YearMonthDay", "is", "immutable", "so", "there", "are", "no", "set", "methods", ".", "Instead", "this", "method", "returns", "a", "new", "instance", ...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonthDay.java#L842-L846
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java
TaskOperations.reactivateTask
public void reactivateTask(String jobId, String taskId) throws BatchErrorException, IOException { """ Reactivates a task, allowing it to run again even if its retry count has been exhausted. @param jobId The ID of the job containing the task. @param taskId The ID of the task. @throws BatchErrorException E...
java
public void reactivateTask(String jobId, String taskId) throws BatchErrorException, IOException { reactivateTask(jobId, taskId, null); }
[ "public", "void", "reactivateTask", "(", "String", "jobId", ",", "String", "taskId", ")", "throws", "BatchErrorException", ",", "IOException", "{", "reactivateTask", "(", "jobId", ",", "taskId", ",", "null", ")", ";", "}" ]
Reactivates a task, allowing it to run again even if its retry count has been exhausted. @param jobId The ID of the job containing the task. @param taskId The ID of the task. @throws BatchErrorException Exception thrown when an error response is received from the Batch service. @throws IOException Exception thrown whe...
[ "Reactivates", "a", "task", "allowing", "it", "to", "run", "again", "even", "if", "its", "retry", "count", "has", "been", "exhausted", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java#L776-L778
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java
ViterbiBuilder.isLatticeBrokenAfter
private boolean isLatticeBrokenAfter(int endIndex, ViterbiLattice lattice) { """ Checks whether there exists any node in the lattice that connects to the newly inserted entry on the right side (after the new entry). @param endIndex @param lattice @return whether the lattice has a node that starts at endIndex...
java
private boolean isLatticeBrokenAfter(int endIndex, ViterbiLattice lattice) { ViterbiNode[][] nodeStartIndices = lattice.getStartIndexArr(); return nodeStartIndices[endIndex] == null; }
[ "private", "boolean", "isLatticeBrokenAfter", "(", "int", "endIndex", ",", "ViterbiLattice", "lattice", ")", "{", "ViterbiNode", "[", "]", "[", "]", "nodeStartIndices", "=", "lattice", ".", "getStartIndexArr", "(", ")", ";", "return", "nodeStartIndices", "[", "e...
Checks whether there exists any node in the lattice that connects to the newly inserted entry on the right side (after the new entry). @param endIndex @param lattice @return whether the lattice has a node that starts at endIndex
[ "Checks", "whether", "there", "exists", "any", "node", "in", "the", "lattice", "that", "connects", "to", "the", "newly", "inserted", "entry", "on", "the", "right", "side", "(", "after", "the", "new", "entry", ")", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L224-L228
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java
VelocityParser.getTableElement
public int getTableElement(char[] array, int currentIndex, StringBuffer velocityBlock, VelocityParserContext context) { """ Get a Velocity table. @param array the source to parse @param currentIndex the current index in the <code>array</code> @param velocityBlock the buffer where to append matched vel...
java
public int getTableElement(char[] array, int currentIndex, StringBuffer velocityBlock, VelocityParserContext context) { return getParameters(array, currentIndex, velocityBlock, ']', context); }
[ "public", "int", "getTableElement", "(", "char", "[", "]", "array", ",", "int", "currentIndex", ",", "StringBuffer", "velocityBlock", ",", "VelocityParserContext", "context", ")", "{", "return", "getParameters", "(", "array", ",", "currentIndex", ",", "velocityBlo...
Get a Velocity table. @param array the source to parse @param currentIndex the current index in the <code>array</code> @param velocityBlock the buffer where to append matched velocity block @param context the parser context to put some informations @return the index in the <code>array</code> after the matched block
[ "Get", "a", "Velocity", "table", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java#L517-L521
aoindustries/ao-servlet-filter
src/main/java/com/aoindustries/servlet/filter/TempFileContext.java
TempFileContext.wrapTempFileList
public static <T> T wrapTempFileList(T original, com.aoindustries.io.TempFileList tempFileList, Wrapper<T> wrapper) { """ If the TempFileContext is enabled, wraps the original object. When the context is inactive, the original object is returned unaltered. This is logged as a warning the first time not wrapped. ...
java
public static <T> T wrapTempFileList(T original, com.aoindustries.io.TempFileList tempFileList, Wrapper<T> wrapper) { if(tempFileList != null) { return wrapper.call(original, tempFileList); } else { // Warn once synchronized(tempFileWarningLock) { if(!tempFileWarned) { if(logger.isLoggable(Level.W...
[ "public", "static", "<", "T", ">", "T", "wrapTempFileList", "(", "T", "original", ",", "com", ".", "aoindustries", ".", "io", ".", "TempFileList", "tempFileList", ",", "Wrapper", "<", "T", ">", "wrapper", ")", "{", "if", "(", "tempFileList", "!=", "null"...
If the TempFileContext is enabled, wraps the original object. When the context is inactive, the original object is returned unaltered. This is logged as a warning the first time not wrapped.
[ "If", "the", "TempFileContext", "is", "enabled", "wraps", "the", "original", "object", ".", "When", "the", "context", "is", "inactive", "the", "original", "object", "is", "returned", "unaltered", ".", "This", "is", "logged", "as", "a", "warning", "the", "fir...
train
https://github.com/aoindustries/ao-servlet-filter/blob/ee1fb95e36b0620949e9cb8ee863ac37fb9e4f2b/src/main/java/com/aoindustries/servlet/filter/TempFileContext.java#L91-L112
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java
ThreadGroup.uncaughtException
public void uncaughtException(Thread t, Throwable e) { """ Called by the Java Virtual Machine when a thread in this thread group stops because of an uncaught exception, and the thread does not have a specific {@link Thread.UncaughtExceptionHandler} installed. <p> The <code>uncaughtException</code> method of ...
java
public void uncaughtException(Thread t, Throwable e) { if (parent != null) { parent.uncaughtException(t, e); } else { Thread.UncaughtExceptionHandler ueh = Thread.getDefaultUncaughtExceptionHandler(); if (ueh != null) { ueh.uncaughtExce...
[ "public", "void", "uncaughtException", "(", "Thread", "t", ",", "Throwable", "e", ")", "{", "if", "(", "parent", "!=", "null", ")", "{", "parent", ".", "uncaughtException", "(", "t", ",", "e", ")", ";", "}", "else", "{", "Thread", ".", "UncaughtExcepti...
Called by the Java Virtual Machine when a thread in this thread group stops because of an uncaught exception, and the thread does not have a specific {@link Thread.UncaughtExceptionHandler} installed. <p> The <code>uncaughtException</code> method of <code>ThreadGroup</code> does the following: <ul> <li>If this thread g...
[ "Called", "by", "the", "Java", "Virtual", "Machine", "when", "a", "thread", "in", "this", "thread", "group", "stops", "because", "of", "an", "uncaught", "exception", "and", "the", "thread", "does", "not", "have", "a", "specific", "{", "@link", "Thread", "....
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L1060-L1074
mikepenz/FastAdapter
library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java
SubItemUtil.selectAllSubItems
public static <T extends IItem & IExpandable> void selectAllSubItems(final FastAdapter adapter, T header, boolean select) { """ select or unselect all sub itmes underneath an expandable item @param adapter the adapter instance @param header the header who's children should be selected or deselected @param se...
java
public static <T extends IItem & IExpandable> void selectAllSubItems(final FastAdapter adapter, T header, boolean select) { selectAllSubItems(adapter, header, select, false, null); }
[ "public", "static", "<", "T", "extends", "IItem", "&", "IExpandable", ">", "void", "selectAllSubItems", "(", "final", "FastAdapter", "adapter", ",", "T", "header", ",", "boolean", "select", ")", "{", "selectAllSubItems", "(", "adapter", ",", "header", ",", "...
select or unselect all sub itmes underneath an expandable item @param adapter the adapter instance @param header the header who's children should be selected or deselected @param select the new selected state of the sub items
[ "select", "or", "unselect", "all", "sub", "itmes", "underneath", "an", "expandable", "item" ]
train
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L210-L212
kiegroup/drools
drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java
KnowledgeBuilderImpl.addPackageFromXml
public void addPackageFromXml(final Reader reader) throws DroolsParserException, IOException { """ Load a rule package from XML source. @param reader @throws DroolsParserException @throws IOException """ this.resource = new ReaderResource(reader, ResourceType.XDRL); final XmlPa...
java
public void addPackageFromXml(final Reader reader) throws DroolsParserException, IOException { this.resource = new ReaderResource(reader, ResourceType.XDRL); final XmlPackageReader xmlReader = new XmlPackageReader(this.configuration.getSemanticModules()); xmlReader.getParser().setCla...
[ "public", "void", "addPackageFromXml", "(", "final", "Reader", "reader", ")", "throws", "DroolsParserException", ",", "IOException", "{", "this", ".", "resource", "=", "new", "ReaderResource", "(", "reader", ",", "ResourceType", ".", "XDRL", ")", ";", "final", ...
Load a rule package from XML source. @param reader @throws DroolsParserException @throws IOException
[ "Load", "a", "rule", "package", "from", "XML", "source", "." ]
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java#L586-L601
liferay/com-liferay-commerce
commerce-product-type-grouped-service/src/main/java/com/liferay/commerce/product/type/grouped/service/persistence/impl/CPDefinitionGroupedEntryPersistenceImpl.java
CPDefinitionGroupedEntryPersistenceImpl.findAll
@Override public List<CPDefinitionGroupedEntry> findAll(int start, int end) { """ Returns a range of all the cp definition grouped entries. <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 indexe...
java
@Override public List<CPDefinitionGroupedEntry> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CPDefinitionGroupedEntry", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the cp definition grouped entries. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting bo...
[ "Returns", "a", "range", "of", "all", "the", "cp", "definition", "grouped", "entries", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-grouped-service/src/main/java/com/liferay/commerce/product/type/grouped/service/persistence/impl/CPDefinitionGroupedEntryPersistenceImpl.java#L2944-L2947
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java
VersionsImpl.exportAsync
public Observable<LuisApp> exportAsync(UUID appId, String versionId) { """ Exports a LUIS application to JSON format. @param appId The application ID. @param versionId The version ID. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the LuisApp object ""...
java
public Observable<LuisApp> exportAsync(UUID appId, String versionId) { return exportWithServiceResponseAsync(appId, versionId).map(new Func1<ServiceResponse<LuisApp>, LuisApp>() { @Override public LuisApp call(ServiceResponse<LuisApp> response) { return response.body(); ...
[ "public", "Observable", "<", "LuisApp", ">", "exportAsync", "(", "UUID", "appId", ",", "String", "versionId", ")", "{", "return", "exportWithServiceResponseAsync", "(", "appId", ",", "versionId", ")", ".", "map", "(", "new", "Func1", "<", "ServiceResponse", "<...
Exports a LUIS application to JSON format. @param appId The application ID. @param versionId The version ID. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the LuisApp object
[ "Exports", "a", "LUIS", "application", "to", "JSON", "format", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java#L813-L820
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java
PlainChangesLogImpl.getItemState
public ItemState getItemState(String itemIdentifier, int state) { """ Get ItemState by identifier and state. NOTE: Uses index HashMap. @param itemIdentifier @param state @return """ return index.get(new IDStateBasedKey(itemIdentifier, state)); }
java
public ItemState getItemState(String itemIdentifier, int state) { return index.get(new IDStateBasedKey(itemIdentifier, state)); }
[ "public", "ItemState", "getItemState", "(", "String", "itemIdentifier", ",", "int", "state", ")", "{", "return", "index", ".", "get", "(", "new", "IDStateBasedKey", "(", "itemIdentifier", ",", "state", ")", ")", ";", "}" ]
Get ItemState by identifier and state. NOTE: Uses index HashMap. @param itemIdentifier @param state @return
[ "Get", "ItemState", "by", "identifier", "and", "state", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java#L676-L679
unbescape/unbescape
src/main/java/org/unbescape/uri/UriEscape.java
UriEscape.escapeUriFragmentId
public static void escapeUriFragmentId(final String text, final Writer writer) throws IOException { """ <p> Perform am URI fragment identifier <strong>escape</strong> operation on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>. </p> <p> The followin...
java
public static void escapeUriFragmentId(final String text, final Writer writer) throws IOException { escapeUriFragmentId(text, writer, DEFAULT_ENCODING); }
[ "public", "static", "void", "escapeUriFragmentId", "(", "final", "String", "text", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "escapeUriFragmentId", "(", "text", ",", "writer", ",", "DEFAULT_ENCODING", ")", ";", "}" ]
<p> Perform am URI fragment identifier <strong>escape</strong> operation on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>. </p> <p> The following are the only allowed chars in an URI fragment identifier (will not be escaped): </p> <ul> <li><tt>A-Z a-z 0-9</tt></li> <li><...
[ "<p", ">", "Perform", "am", "URI", "fragment", "identifier", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "String<", "/", "tt", ">", "input", "using", "<tt", ">", "UTF", "-", "8<", "/", "tt", ">", "as", "encoding...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L706-L709
playn/playn
core/src/playn/core/Graphics.java
Graphics.createCanvas
public Canvas createCanvas (float width, float height) { """ Creates a {@link Canvas} with the specified display unit size. """ return createCanvasImpl(scale, scale.scaledCeil(width), scale.scaledCeil(height)); }
java
public Canvas createCanvas (float width, float height) { return createCanvasImpl(scale, scale.scaledCeil(width), scale.scaledCeil(height)); }
[ "public", "Canvas", "createCanvas", "(", "float", "width", ",", "float", "height", ")", "{", "return", "createCanvasImpl", "(", "scale", ",", "scale", ".", "scaledCeil", "(", "width", ")", ",", "scale", ".", "scaledCeil", "(", "height", ")", ")", ";", "}...
Creates a {@link Canvas} with the specified display unit size.
[ "Creates", "a", "{" ]
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Graphics.java#L105-L107
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java
WikipediaTemplateInfoDumpWriter.writeSQL
void writeSQL(boolean revTableExists, boolean pageTableExists, GeneratorMode mode) { """ Generate and write sql statements to output file @param revTableExists if revision table does not exists -&gt; create index @param pageTableExists if page table does not exists -&gt; create index @param mode generation...
java
void writeSQL(boolean revTableExists, boolean pageTableExists, GeneratorMode mode) { try (Writer writer = new BufferedWriter(new OutputStreamWriter( new BufferedOutputStream(new FileOutputStream(outputPath)), charset))){ StringBuilder dataToDump = new StringBuilder(); dataToDump.append(generateTemplateIdS...
[ "void", "writeSQL", "(", "boolean", "revTableExists", ",", "boolean", "pageTableExists", ",", "GeneratorMode", "mode", ")", "{", "try", "(", "Writer", "writer", "=", "new", "BufferedWriter", "(", "new", "OutputStreamWriter", "(", "new", "BufferedOutputStream", "("...
Generate and write sql statements to output file @param revTableExists if revision table does not exists -&gt; create index @param pageTableExists if page table does not exists -&gt; create index @param mode generation mode
[ "Generate", "and", "write", "sql", "statements", "to", "output", "file" ]
train
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java#L223-L244
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/extension/properties/PropertiesCoreExtension.java
PropertiesCoreExtension.deleteValue
public int deleteValue(String property, String value) { """ Delete the property value @param property property name @param value property value @return deleted values count """ int count = 0; if (has()) { Map<String, Object> fieldValues = buildFieldValues(property, value); count = getDao().del...
java
public int deleteValue(String property, String value) { int count = 0; if (has()) { Map<String, Object> fieldValues = buildFieldValues(property, value); count = getDao().delete(fieldValues); } return count; }
[ "public", "int", "deleteValue", "(", "String", "property", ",", "String", "value", ")", "{", "int", "count", "=", "0", ";", "if", "(", "has", "(", ")", ")", "{", "Map", "<", "String", ",", "Object", ">", "fieldValues", "=", "buildFieldValues", "(", "...
Delete the property value @param property property name @param value property value @return deleted values count
[ "Delete", "the", "property", "value" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/properties/PropertiesCoreExtension.java#L349-L356
bushidowallet/bushido-java-service
bushido-wallet-service/src/main/java/com/authy/api/Users.java
Users.createUser
public com.authy.api.User createUser(String email, String phone) { """ Create a new user using his e-mail and phone. It uses USA country code by default. @param email @param phone @return a User instance """ return createUser(email, phone, DEFAULT_COUNTRY_CODE); }
java
public com.authy.api.User createUser(String email, String phone) { return createUser(email, phone, DEFAULT_COUNTRY_CODE); }
[ "public", "com", ".", "authy", ".", "api", ".", "User", "createUser", "(", "String", "email", ",", "String", "phone", ")", "{", "return", "createUser", "(", "email", ",", "phone", ",", "DEFAULT_COUNTRY_CODE", ")", ";", "}" ]
Create a new user using his e-mail and phone. It uses USA country code by default. @param email @param phone @return a User instance
[ "Create", "a", "new", "user", "using", "his", "e", "-", "mail", "and", "phone", ".", "It", "uses", "USA", "country", "code", "by", "default", "." ]
train
https://github.com/bushidowallet/bushido-java-service/blob/e1a0157527e57459b509718044d2df44084876a2/bushido-wallet-service/src/main/java/com/authy/api/Users.java#L57-L59
kefirfromperm/kefirbb
src/org/kefirsf/bb/DomConfigurationFactory.java
DomConfigurationFactory.parseVariable
private Variable parseVariable(Node el) { """ Parse variable. The part of pattern. @param el DOM-element @return variable """ Variable variable; if (nodeHasAttribute(el, TAG_VAR_ATTR_REGEX)) { variable = new Variable( nodeAttribute(el, TAG_VAR_ATTR_NAME, Vari...
java
private Variable parseVariable(Node el) { Variable variable; if (nodeHasAttribute(el, TAG_VAR_ATTR_REGEX)) { variable = new Variable( nodeAttribute(el, TAG_VAR_ATTR_NAME, Variable.DEFAULT_NAME), java.util.regex.Pattern.compile( ...
[ "private", "Variable", "parseVariable", "(", "Node", "el", ")", "{", "Variable", "variable", ";", "if", "(", "nodeHasAttribute", "(", "el", ",", "TAG_VAR_ATTR_REGEX", ")", ")", "{", "variable", "=", "new", "Variable", "(", "nodeAttribute", "(", "el", ",", ...
Parse variable. The part of pattern. @param el DOM-element @return variable
[ "Parse", "variable", ".", "The", "part", "of", "pattern", "." ]
train
https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L522-L540
nohana/Amalgam
amalgam/src/main/java/com/amalgam/content/pm/SignatureUtils.java
SignatureUtils.getSignatureHexCode
public static String getSignatureHexCode(Context context, String targetPackageName) { """ Obtains the signature hex code. @param context the context. @param targetPackageName the target package name. @return the hex code of the signature. """ if (TextUtils.isEmpty(targetPackageName)) { r...
java
public static String getSignatureHexCode(Context context, String targetPackageName) { if (TextUtils.isEmpty(targetPackageName)) { return null; } try { PackageInfo info = PackageManagerUtils.getSignaturePackageInfo(context, targetPackageName); if (info.signatur...
[ "public", "static", "String", "getSignatureHexCode", "(", "Context", "context", ",", "String", "targetPackageName", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "targetPackageName", ")", ")", "{", "return", "null", ";", "}", "try", "{", "PackageInfo"...
Obtains the signature hex code. @param context the context. @param targetPackageName the target package name. @return the hex code of the signature.
[ "Obtains", "the", "signature", "hex", "code", "." ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/pm/SignatureUtils.java#L80-L97
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/api/GalleriesApi.java
GalleriesApi.getPhotos
public Photos getPhotos(String galleryId, EnumSet<JinxConstants.PhotoExtras> extras) throws JinxException { """ Return the list of photos for a gallery <br> This method does not require authentication. <br> Note: The Flickr documentation includes a per_page and page argument. However, galleries are limited to ...
java
public Photos getPhotos(String galleryId, EnumSet<JinxConstants.PhotoExtras> extras) throws JinxException { JinxUtils.validateParams(galleryId); Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.galleries.getPhotos"); params.put("gallery_id", galleryId); if (!JinxUtils.isNul...
[ "public", "Photos", "getPhotos", "(", "String", "galleryId", ",", "EnumSet", "<", "JinxConstants", ".", "PhotoExtras", ">", "extras", ")", "throws", "JinxException", "{", "JinxUtils", ".", "validateParams", "(", "galleryId", ")", ";", "Map", "<", "String", ","...
Return the list of photos for a gallery <br> This method does not require authentication. <br> Note: The Flickr documentation includes a per_page and page argument. However, galleries are limited to 18 photos, and Flickr ignores the page and per_page parameters. Since they are not actually used, Jinx does not support t...
[ "Return", "the", "list", "of", "photos", "for", "a", "gallery", "<br", ">", "This", "method", "does", "not", "require", "authentication", ".", "<br", ">", "Note", ":", "The", "Flickr", "documentation", "includes", "a", "per_page", "and", "page", "argument", ...
train
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/GalleriesApi.java#L256-L265
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRFloatAnimation.java
GVRFloatAnimation.setKey
public void setKey(int keyIndex, float time, final float[] values) { """ Set the time and value of the key at the given index @param keyIndex 0 based index of key @param time key time in seconds @param values key values """ int index = keyIndex * mFloatsPerKey; Integer valSize = mFl...
java
public void setKey(int keyIndex, float time, final float[] values) { int index = keyIndex * mFloatsPerKey; Integer valSize = mFloatsPerKey-1; if (values.length != valSize) { throw new IllegalArgumentException("This key needs " + valSize.toString() + " float per value"); ...
[ "public", "void", "setKey", "(", "int", "keyIndex", ",", "float", "time", ",", "final", "float", "[", "]", "values", ")", "{", "int", "index", "=", "keyIndex", "*", "mFloatsPerKey", ";", "Integer", "valSize", "=", "mFloatsPerKey", "-", "1", ";", "if", ...
Set the time and value of the key at the given index @param keyIndex 0 based index of key @param time key time in seconds @param values key values
[ "Set", "the", "time", "and", "value", "of", "the", "key", "at", "the", "given", "index" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRFloatAnimation.java#L333-L344
jamesdbloom/mockserver
mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java
HttpResponse.replaceHeader
public HttpResponse replaceHeader(String name, String... values) { """ Update header to return as a Header object, if a header with the same name already exists it will be modified @param name the header name @param values the header values """ this.headers.replaceEntry(name, values); re...
java
public HttpResponse replaceHeader(String name, String... values) { this.headers.replaceEntry(name, values); return this; }
[ "public", "HttpResponse", "replaceHeader", "(", "String", "name", ",", "String", "...", "values", ")", "{", "this", ".", "headers", ".", "replaceEntry", "(", "name", ",", "values", ")", ";", "return", "this", ";", "}" ]
Update header to return as a Header object, if a header with the same name already exists it will be modified @param name the header name @param values the header values
[ "Update", "header", "to", "return", "as", "a", "Header", "object", "if", "a", "header", "with", "the", "same", "name", "already", "exists", "it", "will", "be", "modified" ]
train
https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java#L258-L261
javamelody/javamelody
javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MRtfWriter.java
MRtfWriter.createWriter
@Override protected DocWriter createWriter(final MBasicTable table, final Document document, final OutputStream out) { """ We create a writer that listens to the document and directs a RTF-stream to out @param table MBasicTable @param document Document @param out OutputStream @return DocWriter "...
java
@Override protected DocWriter createWriter(final MBasicTable table, final Document document, final OutputStream out) { final RtfWriter2 writer = RtfWriter2.getInstance(document, out); // title final String title = buildTitle(table); if (title != null) { final HeaderFooter header = new RtfHeaderF...
[ "@", "Override", "protected", "DocWriter", "createWriter", "(", "final", "MBasicTable", "table", ",", "final", "Document", "document", ",", "final", "OutputStream", "out", ")", "{", "final", "RtfWriter2", "writer", "=", "RtfWriter2", ".", "getInstance", "(", "do...
We create a writer that listens to the document and directs a RTF-stream to out @param table MBasicTable @param document Document @param out OutputStream @return DocWriter
[ "We", "create", "a", "writer", "that", "listens", "to", "the", "document", "and", "directs", "a", "RTF", "-", "stream", "to", "out" ]
train
https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MRtfWriter.java#L124-L151
apache/reef
lang/java/reef-runtime-mesos/src/main/java/org/apache/reef/runtime/mesos/driver/REEFScheduler.java
REEFScheduler.resourceOffers
@Override @SuppressWarnings("checkstyle:hiddenfield") public void resourceOffers(final SchedulerDriver driver, final List<Protos.Offer> offers) { """ All offers in each batch of offers will be either be launched or declined. """ final Map<String, NodeDescriptorEventImpl.Builder> nodeDescriptorEvents = ...
java
@Override @SuppressWarnings("checkstyle:hiddenfield") public void resourceOffers(final SchedulerDriver driver, final List<Protos.Offer> offers) { final Map<String, NodeDescriptorEventImpl.Builder> nodeDescriptorEvents = new HashMap<>(); for (final Offer offer : offers) { if (nodeDescriptorEvents.get(...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"checkstyle:hiddenfield\"", ")", "public", "void", "resourceOffers", "(", "final", "SchedulerDriver", "driver", ",", "final", "List", "<", "Protos", ".", "Offer", ">", "offers", ")", "{", "final", "Map", "<", "S...
All offers in each batch of offers will be either be launched or declined.
[ "All", "offers", "in", "each", "batch", "of", "offers", "will", "be", "either", "be", "launched", "or", "declined", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-mesos/src/main/java/org/apache/reef/runtime/mesos/driver/REEFScheduler.java#L160-L187
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java
PrimitiveUtils.readByte
public static Byte readByte(String value, Byte defaultValue) { """ Read byte. @param value the value @param defaultValue the default value @return the byte """ if (!StringUtils.hasText(value)) return defaultValue; return Byte.valueOf(value); }
java
public static Byte readByte(String value, Byte defaultValue) { if (!StringUtils.hasText(value)) return defaultValue; return Byte.valueOf(value); }
[ "public", "static", "Byte", "readByte", "(", "String", "value", ",", "Byte", "defaultValue", ")", "{", "if", "(", "!", "StringUtils", ".", "hasText", "(", "value", ")", ")", "return", "defaultValue", ";", "return", "Byte", ".", "valueOf", "(", "value", "...
Read byte. @param value the value @param defaultValue the default value @return the byte
[ "Read", "byte", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L56-L60
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
Node.getAffiliations
public List<Affiliation> getAffiliations() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { """ Get the affiliations of this node. @return List of {@link Affiliation} @throws NoResponseException @throws XMPPErrorException @throws NotConnectedEx...
java
public List<Affiliation> getAffiliations() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getAffiliations(null, null); }
[ "public", "List", "<", "Affiliation", ">", "getAffiliations", "(", ")", "throws", "NoResponseException", ",", "XMPPErrorException", ",", "NotConnectedException", ",", "InterruptedException", "{", "return", "getAffiliations", "(", "null", ",", "null", ")", ";", "}" ]
Get the affiliations of this node. @return List of {@link Affiliation} @throws NoResponseException @throws XMPPErrorException @throws NotConnectedException @throws InterruptedException
[ "Get", "the", "affiliations", "of", "this", "node", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java#L257-L260
voldemort/voldemort
src/java/voldemort/tools/admin/command/AdminCommandQuota.java
AdminCommandQuota.executeHelp
public static void executeHelp(String[] args, PrintStream stream) throws Exception { """ Parses command-line input and prints help menu. @throws Exception """ String subCmd = (args.length > 0) ? args[0] : ""; if(subCmd.equals("get")) { SubCommandQuotaGet.printHelp(stream); ...
java
public static void executeHelp(String[] args, PrintStream stream) throws Exception { String subCmd = (args.length > 0) ? args[0] : ""; if(subCmd.equals("get")) { SubCommandQuotaGet.printHelp(stream); } else if(subCmd.equals("set")) { SubCommandQuotaSet.printHelp(stream); ...
[ "public", "static", "void", "executeHelp", "(", "String", "[", "]", "args", ",", "PrintStream", "stream", ")", "throws", "Exception", "{", "String", "subCmd", "=", "(", "args", ".", "length", ">", "0", ")", "?", "args", "[", "0", "]", ":", "\"\"", ";...
Parses command-line input and prints help menu. @throws Exception
[ "Parses", "command", "-", "line", "input", "and", "prints", "help", "menu", "." ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/command/AdminCommandQuota.java#L89-L102
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/neuralnetwork/SOM.java
SOM.setInitialLearningRate
public void setInitialLearningRate(double initialLearningRate) { """ Sets the rate at which input is incorporated at each iteration of the SOM algorithm @param initialLearningRate the rate the SOM learns at """ if(Double.isInfinite(initialLearningRate) || Double.isNaN(initialLearningRate) || initia...
java
public void setInitialLearningRate(double initialLearningRate) { if(Double.isInfinite(initialLearningRate) || Double.isNaN(initialLearningRate) || initialLearningRate <= 0) throw new ArithmeticException("Learning rate must be a positive constant, not " + initialLearningRate); this.initia...
[ "public", "void", "setInitialLearningRate", "(", "double", "initialLearningRate", ")", "{", "if", "(", "Double", ".", "isInfinite", "(", "initialLearningRate", ")", "||", "Double", ".", "isNaN", "(", "initialLearningRate", ")", "||", "initialLearningRate", "<=", "...
Sets the rate at which input is incorporated at each iteration of the SOM algorithm @param initialLearningRate the rate the SOM learns at
[ "Sets", "the", "rate", "at", "which", "input", "is", "incorporated", "at", "each", "iteration", "of", "the", "SOM", "algorithm" ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/neuralnetwork/SOM.java#L180-L185
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java
CreateTableRequest.addFamily
public CreateTableRequest addFamily(String familyId, GCRule gcRule) { """ Adds a new columnFamily with {@link GCRule} to the configuration. Please note that calling this method with the same familyId will overwrite the previous family. @param familyId @param gcRule """ Preconditions.checkNotNull(famil...
java
public CreateTableRequest addFamily(String familyId, GCRule gcRule) { Preconditions.checkNotNull(familyId); tableRequest.putColumnFamilies( familyId, ColumnFamily.newBuilder().setGcRule(gcRule.toProto()).build()); return this; }
[ "public", "CreateTableRequest", "addFamily", "(", "String", "familyId", ",", "GCRule", "gcRule", ")", "{", "Preconditions", ".", "checkNotNull", "(", "familyId", ")", ";", "tableRequest", ".", "putColumnFamilies", "(", "familyId", ",", "ColumnFamily", ".", "newBui...
Adds a new columnFamily with {@link GCRule} to the configuration. Please note that calling this method with the same familyId will overwrite the previous family. @param familyId @param gcRule
[ "Adds", "a", "new", "columnFamily", "with", "{", "@link", "GCRule", "}", "to", "the", "configuration", ".", "Please", "note", "that", "calling", "this", "method", "with", "the", "same", "familyId", "will", "overwrite", "the", "previous", "family", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java#L77-L82
ganglia/jmxetric
src/main/java/info/ganglia/jmxetric/CommandLineArgs.java
CommandLineArgs.getTagValue
private String getTagValue(String tag, String[] input, String defaultValue) { """ /* Parses the string array, input, looking for a pattern tag=value @param tag the tag to search for @param input the array list @param defaultValue the default value if tag is not found @return tha value """ for (S...
java
private String getTagValue(String tag, String[] input, String defaultValue) { for (String arg : input) { Matcher matcher = CommandLineArgs.pattern.matcher(arg); // Get tagname and contents of tag if (matcher.find()) { String tagname = matcher.group(1); if (tag.equals(tagname)) { return matcher.g...
[ "private", "String", "getTagValue", "(", "String", "tag", ",", "String", "[", "]", "input", ",", "String", "defaultValue", ")", "{", "for", "(", "String", "arg", ":", "input", ")", "{", "Matcher", "matcher", "=", "CommandLineArgs", ".", "pattern", ".", "...
/* Parses the string array, input, looking for a pattern tag=value @param tag the tag to search for @param input the array list @param defaultValue the default value if tag is not found @return tha value
[ "/", "*", "Parses", "the", "string", "array", "input", "looking", "for", "a", "pattern", "tag", "=", "value" ]
train
https://github.com/ganglia/jmxetric/blob/0b21edb9bd75e0b2df8370ad1c77a1ea47f502ca/src/main/java/info/ganglia/jmxetric/CommandLineArgs.java#L70-L82
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/core/Transaction.java
Transaction.addSignedInput
public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script scriptPubKey, ECKey sigKey, SigHash sigHash, boolean anyoneCanPay) throws ScriptException { """ Adds a new and fully signed input for the given parameters. Note that this method is <b>not</b> threa...
java
public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script scriptPubKey, ECKey sigKey, SigHash sigHash, boolean anyoneCanPay) throws ScriptException { // Verify the API user didn't try to do operations out of order. checkState(!outputs.isEmpty()...
[ "public", "TransactionInput", "addSignedInput", "(", "TransactionOutPoint", "prevOut", ",", "Script", "scriptPubKey", ",", "ECKey", "sigKey", ",", "SigHash", "sigHash", ",", "boolean", "anyoneCanPay", ")", "throws", "ScriptException", "{", "// Verify the API user didn't t...
Adds a new and fully signed input for the given parameters. Note that this method is <b>not</b> thread safe and requires external synchronization. Please refer to general documentation on Bitcoin scripting and contracts to understand the values of sigHash and anyoneCanPay: otherwise you can use the other form of this m...
[ "Adds", "a", "new", "and", "fully", "signed", "input", "for", "the", "given", "parameters", ".", "Note", "that", "this", "method", "is", "<b", ">", "not<", "/", "b", ">", "thread", "safe", "and", "requires", "external", "synchronization", ".", "Please", ...
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L959-L987
BioPAX/Paxtools
pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java
Searcher.getLeadingZeros
private static String getLeadingZeros(int i, int size) { """ Prepares an int for printing with leading zeros for the given size. @param i the int to prepare @param size max value for i @return printable string for i with leading zeros """ assert i <= size; int w1 = (int) Math.floor(Math.log10(size)); ...
java
private static String getLeadingZeros(int i, int size) { assert i <= size; int w1 = (int) Math.floor(Math.log10(size)); int w2 = (int) Math.floor(Math.log10(i)); String s = ""; for (int j = w2; j < w1; j++) { s += "0"; } return s; }
[ "private", "static", "String", "getLeadingZeros", "(", "int", "i", ",", "int", "size", ")", "{", "assert", "i", "<=", "size", ";", "int", "w1", "=", "(", "int", ")", "Math", ".", "floor", "(", "Math", ".", "log10", "(", "size", ")", ")", ";", "in...
Prepares an int for printing with leading zeros for the given size. @param i the int to prepare @param size max value for i @return printable string for i with leading zeros
[ "Prepares", "an", "int", "for", "printing", "with", "leading", "zeros", "for", "the", "given", "size", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L417-L430
JodaOrg/joda-time
src/main/java/org/joda/time/LocalDate.java
LocalDate.withFieldAdded
public LocalDate withFieldAdded(DurationFieldType fieldType, int amount) { """ Returns a copy of this date with the value of the specified field increased. <p> If the addition is zero or the field is null, then <code>this</code> is returned. <p> These three lines are equivalent: <pre> LocalDate added = dt.wi...
java
public LocalDate withFieldAdded(DurationFieldType fieldType, int amount) { if (fieldType == null) { throw new IllegalArgumentException("Field must not be null"); } if (isSupported(fieldType) == false) { throw new IllegalArgumentException("Field '" + fieldType + "' is not ...
[ "public", "LocalDate", "withFieldAdded", "(", "DurationFieldType", "fieldType", ",", "int", "amount", ")", "{", "if", "(", "fieldType", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Field must not be null\"", ")", ";", "}", "if", "(...
Returns a copy of this date with the value of the specified field increased. <p> If the addition is zero or the field is null, then <code>this</code> is returned. <p> These three lines are equivalent: <pre> LocalDate added = dt.withFieldAdded(DurationFieldType.years(), 6); LocalDate added = dt.plusYears(6); LocalDate a...
[ "Returns", "a", "copy", "of", "this", "date", "with", "the", "value", "of", "the", "specified", "field", "increased", ".", "<p", ">", "If", "the", "addition", "is", "zero", "or", "the", "field", "is", "null", "then", "<code", ">", "this<", "/", "code",...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDate.java#L1126-L1138
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java
Expressions.comparableTemplate
public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl, Template template, Object... args) { """ Create a new Template expression @param cl type of expression @param template tem...
java
public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl, Template template, Object... args) { return comparableTemplate(cl, template, ImmutableList.copyOf(args)); }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", ">", ">", "ComparableTemplate", "<", "T", ">", "comparableTemplate", "(", "Class", "<", "?", "extends", "T", ">", "cl", ",", "Template", "template", ",", "Object", "...", "args", ")", "{", ...
Create a new Template expression @param cl type of expression @param template template @param args template parameters @return template expression
[ "Create", "a", "new", "Template", "expression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L439-L442
wdtinc/mapbox-vector-tile-java
src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java
JtsAdapter.createTileGeom
public static TileGeomResult createTileGeom(List<Geometry> g, Envelope tileEnvelope, Envelope clipEnvelope, GeometryFactory geomFactory, ...
java
public static TileGeomResult createTileGeom(List<Geometry> g, Envelope tileEnvelope, Envelope clipEnvelope, GeometryFactory geomFactory, ...
[ "public", "static", "TileGeomResult", "createTileGeom", "(", "List", "<", "Geometry", ">", "g", ",", "Envelope", "tileEnvelope", ",", "Envelope", "clipEnvelope", ",", "GeometryFactory", "geomFactory", ",", "MvtLayerParams", "mvtLayerParams", ",", "IGeometryFilter", "f...
<p>Create geometry clipped and then converted to MVT 'extent' coordinates. Result contains both clipped geometry (intersection) and transformed geometry for encoding to MVT.</p> <p>Allows specifying separate tile and clipping coordinates. {@code clipEnvelope} can be bigger than {@code tileEnvelope} to have geometry ex...
[ "<p", ">", "Create", "geometry", "clipped", "and", "then", "converted", "to", "MVT", "extent", "coordinates", ".", "Result", "contains", "both", "clipped", "geometry", "(", "intersection", ")", "and", "transformed", "geometry", "for", "encoding", "to", "MVT", ...
train
https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java#L87-L141
spotbugs/spotbugs
eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java
ASTUtil.getMethodDeclaration
public static MethodDeclaration getMethodDeclaration(TypeDeclaration type, String methodName, String methodSignature) throws MethodDeclarationNotFoundException { """ Returns the <CODE>MethodDeclaration</CODE> for the specified method name and signature. The method has to be declared in the specified ...
java
public static MethodDeclaration getMethodDeclaration(TypeDeclaration type, String methodName, String methodSignature) throws MethodDeclarationNotFoundException { requireNonNull(type, "type declaration"); requireNonNull(methodName, "method name"); requireNonNull(methodSignature, "meth...
[ "public", "static", "MethodDeclaration", "getMethodDeclaration", "(", "TypeDeclaration", "type", ",", "String", "methodName", ",", "String", "methodSignature", ")", "throws", "MethodDeclarationNotFoundException", "{", "requireNonNull", "(", "type", ",", "\"type declaration\...
Returns the <CODE>MethodDeclaration</CODE> for the specified method name and signature. The method has to be declared in the specified <CODE>TypeDeclaration</CODE>. @param type The <CODE>TypeDeclaration</CODE>, where the <CODE>MethodDeclaration</CODE> is declared in. @param methodName The method name to search for. @p...
[ "Returns", "the", "<CODE", ">", "MethodDeclaration<", "/", "CODE", ">", "for", "the", "specified", "method", "name", "and", "signature", ".", "The", "method", "has", "to", "be", "declared", "in", "the", "specified", "<CODE", ">", "TypeDeclaration<", "/", "CO...
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java#L362-L373
shrinkwrap/resolver
maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/bootstrap/ShrinkWrapResolverServiceLocator.java
ShrinkWrapResolverServiceLocator.setServices
@SuppressWarnings("unchecked") private <T> ShrinkWrapResolverServiceLocator setServices(Class<T> type, T... services) { """ Sets the instances for a service. @param <T> The service type. @param type The interface describing the service, must not be {@code null}. @param services The instances of the servic...
java
@SuppressWarnings("unchecked") private <T> ShrinkWrapResolverServiceLocator setServices(Class<T> type, T... services) { CacheItem item = cache.get(type); if (item == null) { item = new CacheItem(type); } item.replaceInstances(services); cache.put(type, item); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "T", ">", "ShrinkWrapResolverServiceLocator", "setServices", "(", "Class", "<", "T", ">", "type", ",", "T", "...", "services", ")", "{", "CacheItem", "item", "=", "cache", ".", "get", "(", ...
Sets the instances for a service. @param <T> The service type. @param type The interface describing the service, must not be {@code null}. @param services The instances of the service, may be {@code null} but must not contain {@code null} elements. @return This locator for chaining, never {@code null}.
[ "Sets", "the", "instances", "for", "a", "service", "." ]
train
https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/bootstrap/ShrinkWrapResolverServiceLocator.java#L218-L230
OpenBEL/openbel-framework
org.openbel.framework.common/src/main/java/org/openbel/framework/common/protonetwork/model/NamespaceTable.java
NamespaceTable.addNamespace
public int addNamespace(TableNamespace namespace, int did) { """ Adds a namespace to the {@code namespaces} set. The insertion index is captured by {@code namespaceIndex}. The association of document to namespaces is also captured using the {@code documentNamespaces} map. @param namespace {@link TableNamespac...
java
public int addNamespace(TableNamespace namespace, int did) { if (namespaces == null) { throw new InvalidArgument("namespace is null"); } if (namespaces.add(namespace)) { int nextIndex = namespaces.size() - 1; namespaceIndex.put(namespace, nextIndex); ...
[ "public", "int", "addNamespace", "(", "TableNamespace", "namespace", ",", "int", "did", ")", "{", "if", "(", "namespaces", "==", "null", ")", "{", "throw", "new", "InvalidArgument", "(", "\"namespace is null\"", ")", ";", "}", "if", "(", "namespaces", ".", ...
Adds a namespace to the {@code namespaces} set. The insertion index is captured by {@code namespaceIndex}. The association of document to namespaces is also captured using the {@code documentNamespaces} map. @param namespace {@link TableNamespace}, the namespace to add, which cannot be null @param did {@code int}, the...
[ "Adds", "a", "namespace", "to", "the", "{", "@code", "namespaces", "}", "set", ".", "The", "insertion", "index", "is", "captured", "by", "{", "@code", "namespaceIndex", "}", ".", "The", "association", "of", "document", "to", "namespaces", "is", "also", "ca...
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/protonetwork/model/NamespaceTable.java#L113-L133