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
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/storage/SimpleDOWriter.java
SimpleDOWriter.addDatastream
public void addDatastream(Datastream datastream, boolean addNewVersion) throws ServerException { """ Adds a datastream to the object. @param datastream The datastream. @throws ServerException If any type of error occurred fulfilling the request. """ assertNotInvalidated(); ass...
java
public void addDatastream(Datastream datastream, boolean addNewVersion) throws ServerException { assertNotInvalidated(); assertNotPendingRemoval(); // use this call to handle versionable m_obj.addDatastreamVersion(datastream, addNewVersion); }
[ "public", "void", "addDatastream", "(", "Datastream", "datastream", ",", "boolean", "addNewVersion", ")", "throws", "ServerException", "{", "assertNotInvalidated", "(", ")", ";", "assertNotPendingRemoval", "(", ")", ";", "// use this call to handle versionable", "m_obj", ...
Adds a datastream to the object. @param datastream The datastream. @throws ServerException If any type of error occurred fulfilling the request.
[ "Adds", "a", "datastream", "to", "the", "object", "." ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/SimpleDOWriter.java#L167-L173
b3log/latke
latke-core/src/main/java/org/b3log/latke/Keys.java
Keys.fillRuntime
public static void fillRuntime(final Map<String, Object> dataModel) { """ Fills the runtime info into the specified data model. <ul> <li>{@value org.b3log.latke.Keys.Runtime#RUNTIME_CACHE}</li> <li>{@value org.b3log.latke.Keys.Runtime#RUNTIME_DATABASE}</li> <li>{@value org.b3log.latke.Keys.Runtime#RUNTIME_MODE...
java
public static void fillRuntime(final Map<String, Object> dataModel) { dataModel.put(Runtime.RUNTIME_CACHE, Latkes.getRuntimeCache().name()); dataModel.put(Runtime.RUNTIME_DATABASE, Latkes.getRuntimeDatabase().name()); dataModel.put(Runtime.RUNTIME_MODE, Latkes.getRuntimeMode().name()); }
[ "public", "static", "void", "fillRuntime", "(", "final", "Map", "<", "String", ",", "Object", ">", "dataModel", ")", "{", "dataModel", ".", "put", "(", "Runtime", ".", "RUNTIME_CACHE", ",", "Latkes", ".", "getRuntimeCache", "(", ")", ".", "name", "(", ")...
Fills the runtime info into the specified data model. <ul> <li>{@value org.b3log.latke.Keys.Runtime#RUNTIME_CACHE}</li> <li>{@value org.b3log.latke.Keys.Runtime#RUNTIME_DATABASE}</li> <li>{@value org.b3log.latke.Keys.Runtime#RUNTIME_MODE}</li> </ul> @param dataModel the specified data model
[ "Fills", "the", "runtime", "info", "into", "the", "specified", "data", "model", ".", "<ul", ">", "<li", ">", "{", "@value", "org", ".", "b3log", ".", "latke", ".", "Keys", ".", "Runtime#RUNTIME_CACHE", "}", "<", "/", "li", ">", "<li", ">", "{", "@val...
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/Keys.java#L168-L172
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/bcc/BccClient.java
BccClient.bindInstanceToSecurityGroup
public void bindInstanceToSecurityGroup(String instanceId, String securityGroupId) { """ Binding the instance to specified securitygroup. @param instanceId The id of the instance. @param securityGroupId The id of the securitygroup. """ this.bindInstanceToSecurityGroup(new BindSecurityGroupRequest()...
java
public void bindInstanceToSecurityGroup(String instanceId, String securityGroupId) { this.bindInstanceToSecurityGroup(new BindSecurityGroupRequest() .withInstanceId(instanceId).withSecurityGroupId(securityGroupId)); }
[ "public", "void", "bindInstanceToSecurityGroup", "(", "String", "instanceId", ",", "String", "securityGroupId", ")", "{", "this", ".", "bindInstanceToSecurityGroup", "(", "new", "BindSecurityGroupRequest", "(", ")", ".", "withInstanceId", "(", "instanceId", ")", ".", ...
Binding the instance to specified securitygroup. @param instanceId The id of the instance. @param securityGroupId The id of the securitygroup.
[ "Binding", "the", "instance", "to", "specified", "securitygroup", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L712-L715
marvinlabs/android-intents
library/src/main/java/com/marvinlabs/intents/GeoIntents.java
GeoIntents.newNavigationIntent
public static Intent newNavigationIntent(float latitude, float longitude) { """ Intent that should allow opening a map showing the given location (if it exists) @param latitude The latitude of the center of the map @param longitude The longitude of the center of the map @return the intent """ Str...
java
public static Intent newNavigationIntent(float latitude, float longitude) { StringBuilder sb = new StringBuilder(); sb.append("google.navigation:q="); sb.append(latitude); sb.append(","); sb.append(longitude); return new Intent(Intent.ACTION_VIEW, Uri.parse(sb.toString(...
[ "public", "static", "Intent", "newNavigationIntent", "(", "float", "latitude", ",", "float", "longitude", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"google.navigation:q=\"", ")", ";", "sb", ".", ...
Intent that should allow opening a map showing the given location (if it exists) @param latitude The latitude of the center of the map @param longitude The longitude of the center of the map @return the intent
[ "Intent", "that", "should", "allow", "opening", "a", "map", "showing", "the", "given", "location", "(", "if", "it", "exists", ")" ]
train
https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/GeoIntents.java#L115-L124
googleapis/google-http-java-client
google-http-client/src/main/java/com/google/api/client/json/JsonFactory.java
JsonFactory.fromInputStream
public final <T> T fromInputStream(InputStream inputStream, Class<T> destinationClass) throws IOException { """ Parse and close an input stream as a JSON object, array, or value into a new instance of the given destination class using {@link JsonParser#parseAndClose(Class)}. <p>Tries to detect the charse...
java
public final <T> T fromInputStream(InputStream inputStream, Class<T> destinationClass) throws IOException { return createJsonParser(inputStream).parseAndClose(destinationClass); }
[ "public", "final", "<", "T", ">", "T", "fromInputStream", "(", "InputStream", "inputStream", ",", "Class", "<", "T", ">", "destinationClass", ")", "throws", "IOException", "{", "return", "createJsonParser", "(", "inputStream", ")", ".", "parseAndClose", "(", "...
Parse and close an input stream as a JSON object, array, or value into a new instance of the given destination class using {@link JsonParser#parseAndClose(Class)}. <p>Tries to detect the charset of the input stream automatically. @param inputStream JSON value in an input stream @param destinationClass destination cla...
[ "Parse", "and", "close", "an", "input", "stream", "as", "a", "JSON", "object", "array", "or", "value", "into", "a", "new", "instance", "of", "the", "given", "destination", "class", "using", "{", "@link", "JsonParser#parseAndClose", "(", "Class", ")", "}", ...
train
https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonFactory.java#L197-L200
h2oai/h2o-3
h2o-core/src/main/java/water/DTask.java
DTask.setException
public synchronized void setException(Throwable ex) { """ Capture the first exception in _ex. Later setException attempts are ignored. """ if(_ex == null) { _ex = AutoBuffer.javaSerializeWritePojo(((ex instanceof DistributedException) ? (DistributedException) ex : new DistributedException(ex,false /...
java
public synchronized void setException(Throwable ex) { if(_ex == null) { _ex = AutoBuffer.javaSerializeWritePojo(((ex instanceof DistributedException) ? (DistributedException) ex : new DistributedException(ex,false /* don't want this setException(ex) call in the stacktrace */))); } }
[ "public", "synchronized", "void", "setException", "(", "Throwable", "ex", ")", "{", "if", "(", "_ex", "==", "null", ")", "{", "_ex", "=", "AutoBuffer", ".", "javaSerializeWritePojo", "(", "(", "(", "ex", "instanceof", "DistributedException", ")", "?", "(", ...
Capture the first exception in _ex. Later setException attempts are ignored.
[ "Capture", "the", "first", "exception", "in", "_ex", ".", "Later", "setException", "attempts", "are", "ignored", "." ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/DTask.java#L38-L42
joniles/mpxj
src/main/java/net/sf/mpxj/common/DateHelper.java
DateHelper.addDays
public static Date addDays(Date date, int days) { """ Add a number of days to the supplied date. @param date start date @param days number of days to add @return new date """ Calendar cal = popCalendar(date); cal.add(Calendar.DAY_OF_YEAR, days); Date result = cal.getTime(); pushCa...
java
public static Date addDays(Date date, int days) { Calendar cal = popCalendar(date); cal.add(Calendar.DAY_OF_YEAR, days); Date result = cal.getTime(); pushCalendar(cal); return result; }
[ "public", "static", "Date", "addDays", "(", "Date", "date", ",", "int", "days", ")", "{", "Calendar", "cal", "=", "popCalendar", "(", "date", ")", ";", "cal", ".", "add", "(", "Calendar", ".", "DAY_OF_YEAR", ",", "days", ")", ";", "Date", "result", "...
Add a number of days to the supplied date. @param date start date @param days number of days to add @return new date
[ "Add", "a", "number", "of", "days", "to", "the", "supplied", "date", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/DateHelper.java#L441-L448
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocBookBuildUtilities.java
DocBookBuildUtilities.isUniqueAttributeId
public static boolean isUniqueAttributeId(final BuildData buildData, final String id, final ITopicNode topicNode, final Map<SpecTopic, Set<String>> usedIdAttributes) { """ Checks to see if a supplied attribute id is unique within this book, based upon the used id attributes that were calculated earlie...
java
public static boolean isUniqueAttributeId(final BuildData buildData, final String id, final ITopicNode topicNode, final Map<SpecTopic, Set<String>> usedIdAttributes) { // Make sure the id doesn't match the spec topic's unique link if (topicNode instanceof SpecTopic && id.equals( ...
[ "public", "static", "boolean", "isUniqueAttributeId", "(", "final", "BuildData", "buildData", ",", "final", "String", "id", ",", "final", "ITopicNode", "topicNode", ",", "final", "Map", "<", "SpecTopic", ",", "Set", "<", "String", ">", ">", "usedIdAttributes", ...
Checks to see if a supplied attribute id is unique within this book, based upon the used id attributes that were calculated earlier. @param buildData @param id The Attribute id to be checked @param topicNode The id of the topic the attribute id was found in @param usedIdAttributes The set of used ...
[ "Checks", "to", "see", "if", "a", "supplied", "attribute", "id", "is", "unique", "within", "this", "book", "based", "upon", "the", "used", "id", "attributes", "that", "were", "calculated", "earlier", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocBookBuildUtilities.java#L189-L212
codegist/crest
core/src/main/java/org/codegist/crest/CRestBuilder.java
CRestBuilder.deserializeJsonWith
public CRestBuilder deserializeJsonWith(Class<? extends Deserializer> deserializer) { """ <p>Overrides the default {@link org.codegist.crest.serializer.jackson.JacksonDeserializer} JSON deserializer with the given one</p> <p>By default, <b>CRest</b> will use this deserializer for the following response Content-Ty...
java
public CRestBuilder deserializeJsonWith(Class<? extends Deserializer> deserializer) { return deserializeJsonWith(deserializer, Collections.<String, Object>emptyMap()); }
[ "public", "CRestBuilder", "deserializeJsonWith", "(", "Class", "<", "?", "extends", "Deserializer", ">", "deserializer", ")", "{", "return", "deserializeJsonWith", "(", "deserializer", ",", "Collections", ".", "<", "String", ",", "Object", ">", "emptyMap", "(", ...
<p>Overrides the default {@link org.codegist.crest.serializer.jackson.JacksonDeserializer} JSON deserializer with the given one</p> <p>By default, <b>CRest</b> will use this deserializer for the following response Content-Type:</p> <ul> <li>application/json</li> <li>application/javascript</li> <li>text/javascript</li> ...
[ "<p", ">", "Overrides", "the", "default", "{" ]
train
https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L777-L779
alexruiz/fest-reflect
src/main/java/org/fest/reflect/type/TypeLoader.java
TypeLoader.loadAs
public @NotNull <T> Class<? extends T> loadAs(@NotNull Class<T> superType) { """ Loads the class as the given super-type. <p/> Examples: <pre> // import static {@link org.fest.reflect.core.Reflection#type(String) org.fest.reflect.core.Reflection.type}; // Loads the class 'org.republic.Jedi' Class&lt;?&gt;...
java
public @NotNull <T> Class<? extends T> loadAs(@NotNull Class<T> superType) { checkNotNull(superType); try { return checkNotNull(loadType().asSubclass(superType)); } catch (Throwable t) { String format = "Unable to load class '%s' as %s using ClassLoader %s"; throw new ReflectionError(Strin...
[ "public", "@", "NotNull", "<", "T", ">", "Class", "<", "?", "extends", "T", ">", "loadAs", "(", "@", "NotNull", "Class", "<", "T", ">", "superType", ")", "{", "checkNotNull", "(", "superType", ")", ";", "try", "{", "return", "checkNotNull", "(", "loa...
Loads the class as the given super-type. <p/> Examples: <pre> // import static {@link org.fest.reflect.core.Reflection#type(String) org.fest.reflect.core.Reflection.type}; // Loads the class 'org.republic.Jedi' Class&lt;?&gt; jediType = {@link org.fest.reflect.core.Reflection#type(String) type}("org.republic.Jedi").{...
[ "Loads", "the", "class", "as", "the", "given", "super", "-", "type", ".", "<p", "/", ">", "Examples", ":", "<pre", ">", "//", "import", "static", "{", "@link", "org", ".", "fest", ".", "reflect", ".", "core", ".", "Reflection#type", "(", "String", ")...
train
https://github.com/alexruiz/fest-reflect/blob/6db30716808633ef880e439b3dc6602ecb3f1b08/src/main/java/org/fest/reflect/type/TypeLoader.java#L101-L109
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonWrite.java
JsonWrite.writeGeoJson
public static void writeGeoJson(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException { """ Write the JSON file. @param connection @param fileName @param tableReference @param encoding @throws IOException @throws SQLException """ Js...
java
public static void writeGeoJson(Connection connection, String fileName, String tableReference, String encoding) throws IOException, SQLException { JsonDriverFunction jsonDriver = new JsonDriverFunction(); jsonDriver.exportTable(connection,tableReference, URIUtilities.fileFromString(fileName), ne...
[ "public", "static", "void", "writeGeoJson", "(", "Connection", "connection", ",", "String", "fileName", ",", "String", "tableReference", ",", "String", "encoding", ")", "throws", "IOException", ",", "SQLException", "{", "JsonDriverFunction", "jsonDriver", "=", "new"...
Write the JSON file. @param connection @param fileName @param tableReference @param encoding @throws IOException @throws SQLException
[ "Write", "the", "JSON", "file", "." ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/json/JsonWrite.java#L57-L60
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java
WDataTableRenderer.paintSortElement
private void paintSortElement(final WDataTable table, final XmlStringBuilder xml) { """ Paint the rowSelection aspects of the WDataTable. @param table the WDataTable being rendered @param xml the string builder in use """ int col = table.getSortColumnIndex(); boolean ascending = table.isSortAscending(); ...
java
private void paintSortElement(final WDataTable table, final XmlStringBuilder xml) { int col = table.getSortColumnIndex(); boolean ascending = table.isSortAscending(); xml.appendTagOpen("ui:sort"); xml.appendOptionalAttribute("col", col >= 0, col); xml.appendOptionalAttribute("descending", col >= 0 && !ascend...
[ "private", "void", "paintSortElement", "(", "final", "WDataTable", "table", ",", "final", "XmlStringBuilder", "xml", ")", "{", "int", "col", "=", "table", ".", "getSortColumnIndex", "(", ")", ";", "boolean", "ascending", "=", "table", ".", "isSortAscending", "...
Paint the rowSelection aspects of the WDataTable. @param table the WDataTable being rendered @param xml the string builder in use
[ "Paint", "the", "rowSelection", "aspects", "of", "the", "WDataTable", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java#L220-L238
openengsb/openengsb
components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java
SubStringOperation.getToParameter
private Integer getToParameter(Map<String, String> parameters, Integer defaultValue) throws TransformationOperationException { """ Get the 'to' parameter from the parameters. If the parameter is not set the defaultValue is taken instead. """ return getSubStringParameter(parameters, toParam, def...
java
private Integer getToParameter(Map<String, String> parameters, Integer defaultValue) throws TransformationOperationException { return getSubStringParameter(parameters, toParam, defaultValue); }
[ "private", "Integer", "getToParameter", "(", "Map", "<", "String", ",", "String", ">", "parameters", ",", "Integer", "defaultValue", ")", "throws", "TransformationOperationException", "{", "return", "getSubStringParameter", "(", "parameters", ",", "toParam", ",", "d...
Get the 'to' parameter from the parameters. If the parameter is not set the defaultValue is taken instead.
[ "Get", "the", "to", "parameter", "from", "the", "parameters", ".", "If", "the", "parameter", "is", "not", "set", "the", "defaultValue", "is", "taken", "instead", "." ]
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java#L104-L107
line/armeria
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
ServerBuilder.annotatedService
public ServerBuilder annotatedService(String pathPrefix, Object service) { """ Binds the specified annotated service object under the specified path prefix. """ return annotatedService(pathPrefix, service, Function.identity(), ImmutableList.of()); }
java
public ServerBuilder annotatedService(String pathPrefix, Object service) { return annotatedService(pathPrefix, service, Function.identity(), ImmutableList.of()); }
[ "public", "ServerBuilder", "annotatedService", "(", "String", "pathPrefix", ",", "Object", "service", ")", "{", "return", "annotatedService", "(", "pathPrefix", ",", "service", ",", "Function", ".", "identity", "(", ")", ",", "ImmutableList", ".", "of", "(", "...
Binds the specified annotated service object under the specified path prefix.
[ "Binds", "the", "specified", "annotated", "service", "object", "under", "the", "specified", "path", "prefix", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java#L1025-L1027
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAddressRestrictionPersistenceImpl.java
CommerceAddressRestrictionPersistenceImpl.fetchByC_C_C
@Override public CommerceAddressRestriction fetchByC_C_C(long classNameId, long classPK, long commerceCountryId) { """ Returns the commerce address restriction where classNameId = &#63; and classPK = &#63; and commerceCountryId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache...
java
@Override public CommerceAddressRestriction fetchByC_C_C(long classNameId, long classPK, long commerceCountryId) { return fetchByC_C_C(classNameId, classPK, commerceCountryId, true); }
[ "@", "Override", "public", "CommerceAddressRestriction", "fetchByC_C_C", "(", "long", "classNameId", ",", "long", "classPK", ",", "long", "commerceCountryId", ")", "{", "return", "fetchByC_C_C", "(", "classNameId", ",", "classPK", ",", "commerceCountryId", ",", "tru...
Returns the commerce address restriction where classNameId = &#63; and classPK = &#63; and commerceCountryId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param classNameId the class name ID @param classPK the class pk @param commerceCountryId the commerce country ID @return th...
[ "Returns", "the", "commerce", "address", "restriction", "where", "classNameId", "=", "&#63", ";", "and", "classPK", "=", "&#63", ";", "and", "commerceCountryId", "=", "&#63", ";", "or", "returns", "<code", ">", "null<", "/", "code", ">", "if", "it", "could...
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAddressRestrictionPersistenceImpl.java#L1247-L1251
apache/groovy
src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java
ArrayTypeUtils.elementType
public static Class elementType(Class clazz, int dim) { """ Get the type of array elements by the dimension @param clazz the type of array @param dim the target dimension @return the result array """ checkArrayType(clazz); if (dim < 0) { throw new IllegalArgumentException("The...
java
public static Class elementType(Class clazz, int dim) { checkArrayType(clazz); if (dim < 0) { throw new IllegalArgumentException("The target dimension should not be less than zero: " + dim); } while (clazz.isArray() && dimension(clazz) > dim) { clazz = clazz.get...
[ "public", "static", "Class", "elementType", "(", "Class", "clazz", ",", "int", "dim", ")", "{", "checkArrayType", "(", "clazz", ")", ";", "if", "(", "dim", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The target dimension should not ...
Get the type of array elements by the dimension @param clazz the type of array @param dim the target dimension @return the result array
[ "Get", "the", "type", "of", "array", "elements", "by", "the", "dimension" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ArrayTypeUtils.java#L68-L80
wildfly-extras/wildfly-camel
common/src/main/java/org/wildfly/camel/utils/IllegalStateAssertion.java
IllegalStateAssertion.assertFalse
public static Boolean assertFalse(Boolean value, String message) { """ Throws an IllegalStateException when the given value is not false. """ if (Boolean.valueOf(value)) throw new IllegalStateException(message); return value; }
java
public static Boolean assertFalse(Boolean value, String message) { if (Boolean.valueOf(value)) throw new IllegalStateException(message); return value; }
[ "public", "static", "Boolean", "assertFalse", "(", "Boolean", "value", ",", "String", "message", ")", "{", "if", "(", "Boolean", ".", "valueOf", "(", "value", ")", ")", "throw", "new", "IllegalStateException", "(", "message", ")", ";", "return", "value", "...
Throws an IllegalStateException when the given value is not false.
[ "Throws", "an", "IllegalStateException", "when", "the", "given", "value", "is", "not", "false", "." ]
train
https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/common/src/main/java/org/wildfly/camel/utils/IllegalStateAssertion.java#L67-L71
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
MappedParametrizedObjectEntry.getParameterLong
public Long getParameterLong(String name, Long defaultValue) { """ Parse named parameter as Long. @param name parameter name @param defaultValue default Long value @return Long value """ String value = getParameterValue(name, null); if (value != null) { try { ...
java
public Long getParameterLong(String name, Long defaultValue) { String value = getParameterValue(name, null); if (value != null) { try { return StringNumberParser.parseLong(value); } catch (NumberFormatException e) { if (LOG.isTra...
[ "public", "Long", "getParameterLong", "(", "String", "name", ",", "Long", "defaultValue", ")", "{", "String", "value", "=", "getParameterValue", "(", "name", ",", "null", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "try", "{", "return", "String...
Parse named parameter as Long. @param name parameter name @param defaultValue default Long value @return Long value
[ "Parse", "named", "parameter", "as", "Long", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java#L197-L216
jayantk/jklol
src/com/jayantkrish/jklol/util/PairCountAccumulator.java
PairCountAccumulator.incrementOutcomes
public void incrementOutcomes(Multimap<A, B> outcomes, double amount) { """ Increments the count of every outcome (key/value pair) in {@code outcomes} by {@code amount}. @param outcomes @param amount """ for (A key : outcomes.keySet()) { for (B value : outcomes.get(key)) { incrementOutco...
java
public void incrementOutcomes(Multimap<A, B> outcomes, double amount) { for (A key : outcomes.keySet()) { for (B value : outcomes.get(key)) { incrementOutcome(key, value, amount); } } }
[ "public", "void", "incrementOutcomes", "(", "Multimap", "<", "A", ",", "B", ">", "outcomes", ",", "double", "amount", ")", "{", "for", "(", "A", "key", ":", "outcomes", ".", "keySet", "(", ")", ")", "{", "for", "(", "B", "value", ":", "outcomes", "...
Increments the count of every outcome (key/value pair) in {@code outcomes} by {@code amount}. @param outcomes @param amount
[ "Increments", "the", "count", "of", "every", "outcome", "(", "key", "/", "value", "pair", ")", "in", "{", "@code", "outcomes", "}", "by", "{", "@code", "amount", "}", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/PairCountAccumulator.java#L68-L74
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/CalendarAstronomer.java
CalendarAstronomer.getMoonTime
public long getMoonTime(double desired, boolean next) { """ Find the next or previous time at which the Moon's ecliptic longitude will have the desired value. <p> @param desired The desired longitude. @param next <tt>true</tt> if the next occurrance of the phase is desired, <tt>false</tt> for the previ...
java
public long getMoonTime(double desired, boolean next) { return timeOfAngle( new AngleFunc() { @Override public double eval() { return getMoonAge(); } }, desired, SYNODIC_MONTH, ...
[ "public", "long", "getMoonTime", "(", "double", "desired", ",", "boolean", "next", ")", "{", "return", "timeOfAngle", "(", "new", "AngleFunc", "(", ")", "{", "@", "Override", "public", "double", "eval", "(", ")", "{", "return", "getMoonAge", "(", ")", ";...
Find the next or previous time at which the Moon's ecliptic longitude will have the desired value. <p> @param desired The desired longitude. @param next <tt>true</tt> if the next occurrance of the phase is desired, <tt>false</tt> for the previous occurrance. @hide draft / provisional / internal are hidden on And...
[ "Find", "the", "next", "or", "previous", "time", "at", "which", "the", "Moon", "s", "ecliptic", "longitude", "will", "have", "the", "desired", "value", ".", "<p", ">" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/CalendarAstronomer.java#L1169-L1178
Blazebit/blaze-utils
blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java
ReflectionUtils.resolveTypeVariable
public static Class<?> resolveTypeVariable(Class<?> concreteClass, TypeVariable<?> typeVariable) { """ Tries to resolve the type variable against the concrete class. The concrete class has to be a subtype of the type in which the type variable has been declared. This method tries to resolve the given type variab...
java
public static Class<?> resolveTypeVariable(Class<?> concreteClass, TypeVariable<?> typeVariable) { Type resolvedType = resolveTypeVariableType(concreteClass, typeVariable); return resolveType(concreteClass, resolvedType); }
[ "public", "static", "Class", "<", "?", ">", "resolveTypeVariable", "(", "Class", "<", "?", ">", "concreteClass", ",", "TypeVariable", "<", "?", ">", "typeVariable", ")", "{", "Type", "resolvedType", "=", "resolveTypeVariableType", "(", "concreteClass", ",", "t...
Tries to resolve the type variable against the concrete class. The concrete class has to be a subtype of the type in which the type variable has been declared. This method tries to resolve the given type variable by inspecting the subclasses of the class in which the type variable was declared and as soon as the resolv...
[ "Tries", "to", "resolve", "the", "type", "variable", "against", "the", "concrete", "class", ".", "The", "concrete", "class", "has", "to", "be", "a", "subtype", "of", "the", "type", "in", "which", "the", "type", "variable", "has", "been", "declared", ".", ...
train
https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L462-L465
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java
CommonOps_DDRM.multTransA
public static void multTransA(double alpha , DMatrix1Row a , DMatrix1Row b , DMatrix1Row c ) { """ <p>Performs the following operation:<br> <br> c = &alpha; * a<sup>T</sup> * b <br> <br> c<sub>ij</sub> = &alpha; &sum;<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>kj</sub>} </p> @param alpha Scaling factor. @pa...
java
public static void multTransA(double alpha , DMatrix1Row a , DMatrix1Row b , DMatrix1Row c ) { // TODO add a matrix vectory multiply here if( a.numCols >= EjmlParameters.MULT_COLUMN_SWITCH || b.numCols >= EjmlParameters.MULT_COLUMN_SWITCH ) { MatrixMatrixMult_DDRM.multTra...
[ "public", "static", "void", "multTransA", "(", "double", "alpha", ",", "DMatrix1Row", "a", ",", "DMatrix1Row", "b", ",", "DMatrix1Row", "c", ")", "{", "// TODO add a matrix vectory multiply here", "if", "(", "a", ".", "numCols", ">=", "EjmlParameters", ".", "MUL...
<p>Performs the following operation:<br> <br> c = &alpha; * a<sup>T</sup> * b <br> <br> c<sub>ij</sub> = &alpha; &sum;<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>kj</sub>} </p> @param alpha Scaling factor. @param a The left matrix in the multiplication operation. Not modified. @param b The right matrix in the multiplica...
[ "<p", ">", "Performs", "the", "following", "operation", ":", "<br", ">", "<br", ">", "c", "=", "&alpha", ";", "*", "a<sup", ">", "T<", "/", "sup", ">", "*", "b", "<br", ">", "<br", ">", "c<sub", ">", "ij<", "/", "sub", ">", "=", "&alpha", ";", ...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L152-L161
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/GridBagLayoutFormBuilder.java
GridBagLayoutFormBuilder.appendLabeledField
public GridBagLayoutFormBuilder appendLabeledField(String propertyName, int colSpan) { """ Appends a label and field to the end of the current line. <p /> The label will be to the left of the field, and be right-justified. <br /> The field will "grow" horizontally as space allows. <p /> @param propertyNa...
java
public GridBagLayoutFormBuilder appendLabeledField(String propertyName, int colSpan) { return appendLabeledField(propertyName, LabelOrientation.LEFT, colSpan); }
[ "public", "GridBagLayoutFormBuilder", "appendLabeledField", "(", "String", "propertyName", ",", "int", "colSpan", ")", "{", "return", "appendLabeledField", "(", "propertyName", ",", "LabelOrientation", ".", "LEFT", ",", "colSpan", ")", ";", "}" ]
Appends a label and field to the end of the current line. <p /> The label will be to the left of the field, and be right-justified. <br /> The field will "grow" horizontally as space allows. <p /> @param propertyName the name of the property to create the controls for @param colSpan the number of columns the fie...
[ "Appends", "a", "label", "and", "field", "to", "the", "end", "of", "the", "current", "line", ".", "<p", "/", ">" ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/GridBagLayoutFormBuilder.java#L79-L81
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.changeServletProperties
public boolean changeServletProperties(Servlet servlet, Dictionary<String, String> properties) { """ Change the servlet properties to these properties. @param servlet @param properties @return """ if (servlet instanceof WebappServlet) { Dictionary<String, String> dictionary = ((W...
java
public boolean changeServletProperties(Servlet servlet, Dictionary<String, String> properties) { if (servlet instanceof WebappServlet) { Dictionary<String, String> dictionary = ((WebappServlet)servlet).getProperties(); properties = BaseBundleActivator.putAll(properties, dicti...
[ "public", "boolean", "changeServletProperties", "(", "Servlet", "servlet", ",", "Dictionary", "<", "String", ",", "String", ">", "properties", ")", "{", "if", "(", "servlet", "instanceof", "WebappServlet", ")", "{", "Dictionary", "<", "String", ",", "String", ...
Change the servlet properties to these properties. @param servlet @param properties @return
[ "Change", "the", "servlet", "properties", "to", "these", "properties", "." ]
train
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L283-L291
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java
ByteOp.cmp
public static boolean cmp(byte[] a, byte[] b) { """ Compare two byte arrays @param a byte array to compare @param b byte array to compare @return true if a and b have same length, and all the same values, false otherwise """ if(a.length != b.length) { return false; } for(int i = 0; i < a.length; i...
java
public static boolean cmp(byte[] a, byte[] b) { if(a.length != b.length) { return false; } for(int i = 0; i < a.length; i++) { if(a[i] != b[i]) { return false; } } return true; }
[ "public", "static", "boolean", "cmp", "(", "byte", "[", "]", "a", ",", "byte", "[", "]", "b", ")", "{", "if", "(", "a", ".", "length", "!=", "b", ".", "length", ")", "{", "return", "false", ";", "}", "for", "(", "int", "i", "=", "0", ";", "...
Compare two byte arrays @param a byte array to compare @param b byte array to compare @return true if a and b have same length, and all the same values, false otherwise
[ "Compare", "two", "byte", "arrays" ]
train
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java#L61-L71
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigFactory.java
XMLConfigFactory.createFileFromResource
static void createFileFromResource(String resource, Resource file) throws IOException { """ creates a File and his content froma a resurce @param resource @param file @throws IOException """ createFileFromResource(resource, file, null); }
java
static void createFileFromResource(String resource, Resource file) throws IOException { createFileFromResource(resource, file, null); }
[ "static", "void", "createFileFromResource", "(", "String", "resource", ",", "Resource", "file", ")", "throws", "IOException", "{", "createFileFromResource", "(", "resource", ",", "file", ",", "null", ")", ";", "}" ]
creates a File and his content froma a resurce @param resource @param file @throws IOException
[ "creates", "a", "File", "and", "his", "content", "froma", "a", "resurce" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigFactory.java#L287-L289
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java
ByteConverter.float4
public static void float4(byte[] target, int idx, float value) { """ Encodes a int value to the byte array. @param target The byte array to encode to. @param idx The starting index in the byte array. @param value The value to encode. """ int4(target, idx, Float.floatToRawIntBits(value)); }
java
public static void float4(byte[] target, int idx, float value) { int4(target, idx, Float.floatToRawIntBits(value)); }
[ "public", "static", "void", "float4", "(", "byte", "[", "]", "target", ",", "int", "idx", ",", "float", "value", ")", "{", "int4", "(", "target", ",", "idx", ",", "Float", ".", "floatToRawIntBits", "(", "value", ")", ")", ";", "}" ]
Encodes a int value to the byte array. @param target The byte array to encode to. @param idx The starting index in the byte array. @param value The value to encode.
[ "Encodes", "a", "int", "value", "to", "the", "byte", "array", "." ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java#L164-L166
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java
UCharacter.codePointAt
public static final int codePointAt(char[] text, int index) { """ Same as {@link Character#codePointAt(char[], int)}. Returns the code point at index. This examines only the characters at index and index+1. @param text the characters to check @param index the index of the first or only char forming the code ...
java
public static final int codePointAt(char[] text, int index) { char c1 = text[index++]; if (isHighSurrogate(c1)) { if (index < text.length) { char c2 = text[index]; if (isLowSurrogate(c2)) { return toCodePoint(c1, c2); } ...
[ "public", "static", "final", "int", "codePointAt", "(", "char", "[", "]", "text", ",", "int", "index", ")", "{", "char", "c1", "=", "text", "[", "index", "++", "]", ";", "if", "(", "isHighSurrogate", "(", "c1", ")", ")", "{", "if", "(", "index", ...
Same as {@link Character#codePointAt(char[], int)}. Returns the code point at index. This examines only the characters at index and index+1. @param text the characters to check @param index the index of the first or only char forming the code point @return the code point at the index
[ "Same", "as", "{", "@link", "Character#codePointAt", "(", "char", "[]", "int", ")", "}", ".", "Returns", "the", "code", "point", "at", "index", ".", "This", "examines", "only", "the", "characters", "at", "index", "and", "index", "+", "1", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L5344-L5355
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.dedicatedCloud_serviceName_additionalBandwidth_GET
public ArrayList<String> dedicatedCloud_serviceName_additionalBandwidth_GET(String serviceName, OvhAdditionalBandwidthEnum bandwidth) throws IOException { """ Get allowed durations for 'additionalBandwidth' option REST: GET /order/dedicatedCloud/{serviceName}/additionalBandwidth @param bandwidth [required] How...
java
public ArrayList<String> dedicatedCloud_serviceName_additionalBandwidth_GET(String serviceName, OvhAdditionalBandwidthEnum bandwidth) throws IOException { String qPath = "/order/dedicatedCloud/{serviceName}/additionalBandwidth"; StringBuilder sb = path(qPath, serviceName); query(sb, "bandwidth", bandwidth); Str...
[ "public", "ArrayList", "<", "String", ">", "dedicatedCloud_serviceName_additionalBandwidth_GET", "(", "String", "serviceName", ",", "OvhAdditionalBandwidthEnum", "bandwidth", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/dedicatedCloud/{serviceName}/addit...
Get allowed durations for 'additionalBandwidth' option REST: GET /order/dedicatedCloud/{serviceName}/additionalBandwidth @param bandwidth [required] How much additional bandwidth do you want ? @param serviceName [required]
[ "Get", "allowed", "durations", "for", "additionalBandwidth", "option" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5718-L5724
apache/groovy
subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
Sql.asList
protected List<GroovyRowResult> asList(String sql, ResultSet rs) throws SQLException { """ Hook to allow derived classes to override list of result collection behavior. The default behavior is to return a list of GroovyRowResult objects corresponding to each row in the ResultSet. @param sql query to execute ...
java
protected List<GroovyRowResult> asList(String sql, ResultSet rs) throws SQLException { return asList(sql, rs, null); }
[ "protected", "List", "<", "GroovyRowResult", ">", "asList", "(", "String", "sql", ",", "ResultSet", "rs", ")", "throws", "SQLException", "{", "return", "asList", "(", "sql", ",", "rs", ",", "null", ")", ";", "}" ]
Hook to allow derived classes to override list of result collection behavior. The default behavior is to return a list of GroovyRowResult objects corresponding to each row in the ResultSet. @param sql query to execute @param rs the ResultSet to process @return the resulting list of rows @throws SQLException if a data...
[ "Hook", "to", "allow", "derived", "classes", "to", "override", "list", "of", "result", "collection", "behavior", ".", "The", "default", "behavior", "is", "to", "return", "a", "list", "of", "GroovyRowResult", "objects", "corresponding", "to", "each", "row", "in...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L3954-L3956
google/closure-compiler
src/com/google/javascript/jscomp/gwt/linker/MinimalLinker.java
MinimalLinker.formatOutput
private static String formatOutput(String js, boolean export) { """ Formats the application's JS code for output. @param js Code to format. @param export Whether to export via JSInterop. @return Formatted, linked code. """ StringBuilder output = new StringBuilder(); // Shadow window so that non-b...
java
private static String formatOutput(String js, boolean export) { StringBuilder output = new StringBuilder(); // Shadow window so that non-browser environments can pass their own global object here. output.append("(function(window){"); // If $wnd is set to this, then JSInterop's normal export will run, ...
[ "private", "static", "String", "formatOutput", "(", "String", "js", ",", "boolean", "export", ")", "{", "StringBuilder", "output", "=", "new", "StringBuilder", "(", ")", ";", "// Shadow window so that non-browser environments can pass their own global object here.", "output...
Formats the application's JS code for output. @param js Code to format. @param export Whether to export via JSInterop. @return Formatted, linked code.
[ "Formats", "the", "application", "s", "JS", "code", "for", "output", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/gwt/linker/MinimalLinker.java#L67-L98
looly/hutool
hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java
SqlBuilder.in
@SuppressWarnings("unchecked") public <T> SqlBuilder in(String field, T... values) { """ 多值选择 @param <T> 值类型 @param field 字段名 @param values 值列表 @return 自身 """ sql.append(wrapper.wrap(field)).append(" IN ").append("(").append(ArrayUtil.join(values, StrUtil.COMMA)).append(")"); return this; }
java
@SuppressWarnings("unchecked") public <T> SqlBuilder in(String field, T... values) { sql.append(wrapper.wrap(field)).append(" IN ").append("(").append(ArrayUtil.join(values, StrUtil.COMMA)).append(")"); return this; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "SqlBuilder", "in", "(", "String", "field", ",", "T", "...", "values", ")", "{", "sql", ".", "append", "(", "wrapper", ".", "wrap", "(", "field", ")", ")", ".", "append", "(...
多值选择 @param <T> 值类型 @param field 字段名 @param values 值列表 @return 自身
[ "多值选择" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L337-L341
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java
RegularFile.transferTo
public long transferTo(long pos, long count, WritableByteChannel dest) throws IOException { """ Transfers up to {@code count} bytes to the given channel starting at position {@code pos} in this file. Returns the number of bytes transferred, possibly 0. Note that unlike all other read methods in this class, this ...
java
public long transferTo(long pos, long count, WritableByteChannel dest) throws IOException { long bytesToRead = bytesToRead(pos, count); if (bytesToRead > 0) { long remaining = bytesToRead; int blockIndex = blockIndex(pos); byte[] block = blocks[blockIndex]; int off = offsetInBlock(pos)...
[ "public", "long", "transferTo", "(", "long", "pos", ",", "long", "count", ",", "WritableByteChannel", "dest", ")", "throws", "IOException", "{", "long", "bytesToRead", "=", "bytesToRead", "(", "pos", ",", "count", ")", ";", "if", "(", "bytesToRead", ">", "...
Transfers up to {@code count} bytes to the given channel starting at position {@code pos} in this file. Returns the number of bytes transferred, possibly 0. Note that unlike all other read methods in this class, this method does not return -1 if {@code pos} is greater than or equal to the current size. This for consist...
[ "Transfers", "up", "to", "{" ]
train
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L559-L588
eduarddrenth/ConfigurableReports
src/main/java/com/vectorprint/report/itext/style/FontLoader.java
FontLoader.loadFont
public LOADSTATUS loadFont(InputStream in, String extension) throws IOException, VectorPrintException { """ allows loading font from a stream by first saving the bytes from the stream to a tempfile and then calling {@link #loadFont(java.lang.String) }. @param in @param extension e.g. .ttf @return @throws I...
java
public LOADSTATUS loadFont(InputStream in, String extension) throws IOException, VectorPrintException { // first download, then load File f = File.createTempFile("font.", extension); f.deleteOnExit(); IOHelper.load(in, new FileOutputStream(f), ReportConstants.DEFAULTBUFFERSIZE, true); retu...
[ "public", "LOADSTATUS", "loadFont", "(", "InputStream", "in", ",", "String", "extension", ")", "throws", "IOException", ",", "VectorPrintException", "{", "// first download, then load", "File", "f", "=", "File", ".", "createTempFile", "(", "\"font.\"", ",", "extensi...
allows loading font from a stream by first saving the bytes from the stream to a tempfile and then calling {@link #loadFont(java.lang.String) }. @param in @param extension e.g. .ttf @return @throws IOException
[ "allows", "loading", "font", "from", "a", "stream", "by", "first", "saving", "the", "bytes", "from", "the", "stream", "to", "a", "tempfile", "and", "then", "calling", "{", "@link", "#loadFont", "(", "java", ".", "lang", ".", "String", ")", "}", "." ]
train
https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/FontLoader.java#L98-L104
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/tls/MariaDbX509TrustManager.java
MariaDbX509TrustManager.checkClientTrusted
@Override public void checkClientTrusted(X509Certificate[] x509Certificates, String string) throws CertificateException { """ Check client trusted. @param x509Certificates certificate @param string string @throws CertificateException exception """ if (trustManager == null) { re...
java
@Override public void checkClientTrusted(X509Certificate[] x509Certificates, String string) throws CertificateException { if (trustManager == null) { return; } trustManager.checkClientTrusted(x509Certificates, string); }
[ "@", "Override", "public", "void", "checkClientTrusted", "(", "X509Certificate", "[", "]", "x509Certificates", ",", "String", "string", ")", "throws", "CertificateException", "{", "if", "(", "trustManager", "==", "null", ")", "{", "return", ";", "}", "trustManag...
Check client trusted. @param x509Certificates certificate @param string string @throws CertificateException exception
[ "Check", "client", "trusted", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/tls/MariaDbX509TrustManager.java#L203-L210
classgraph/classgraph
src/main/java/io/github/classgraph/AnnotationInfo.java
AnnotationInfo.loadClassAndInstantiate
public Annotation loadClassAndInstantiate() { """ Load the {@link Annotation} class corresponding to this {@link AnnotationInfo} object, by calling {@code getClassInfo().loadClass()}, then create a new instance of the annotation, with the annotation parameter values obtained from this {@link AnnotationInfo} obje...
java
public Annotation loadClassAndInstantiate() { final Class<? extends Annotation> annotationClass = getClassInfo().loadClass(Annotation.class); return (Annotation) Proxy.newProxyInstance(annotationClass.getClassLoader(), new Class[] { annotationClass }, new AnnotationInvocationHandler(anno...
[ "public", "Annotation", "loadClassAndInstantiate", "(", ")", "{", "final", "Class", "<", "?", "extends", "Annotation", ">", "annotationClass", "=", "getClassInfo", "(", ")", ".", "loadClass", "(", "Annotation", ".", "class", ")", ";", "return", "(", "Annotatio...
Load the {@link Annotation} class corresponding to this {@link AnnotationInfo} object, by calling {@code getClassInfo().loadClass()}, then create a new instance of the annotation, with the annotation parameter values obtained from this {@link AnnotationInfo} object, possibly overriding default annotation parameter valu...
[ "Load", "the", "{", "@link", "Annotation", "}", "class", "corresponding", "to", "this", "{", "@link", "AnnotationInfo", "}", "object", "by", "calling", "{", "@code", "getClassInfo", "()", ".", "loadClass", "()", "}", "then", "create", "a", "new", "instance",...
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/AnnotationInfo.java#L275-L279
MenoData/Time4J
base/src/main/java/net/time4j/range/SpanOfWeekdays.java
SpanOfWeekdays.between
public static SpanOfWeekdays between( Weekday start, Weekday end ) { """ /*[deutsch] <p>Erzeugt eine neue Spanne von Wochentagen. </p> <p>Es ist m&ouml;glich, denselben Wochentag f&uuml;r Start und Ende zu w&auml;hlen. In diesem Fall besteht die Spanne aus genau einem Wochentag. </p> @p...
java
public static SpanOfWeekdays between( Weekday start, Weekday end ) { if (start == null || end == null) { throw new NullPointerException("Missing day of week."); } return new SpanOfWeekdays(start, end); }
[ "public", "static", "SpanOfWeekdays", "between", "(", "Weekday", "start", ",", "Weekday", "end", ")", "{", "if", "(", "start", "==", "null", "||", "end", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Missing day of week.\"", ")", ";...
/*[deutsch] <p>Erzeugt eine neue Spanne von Wochentagen. </p> <p>Es ist m&ouml;glich, denselben Wochentag f&uuml;r Start und Ende zu w&auml;hlen. In diesem Fall besteht die Spanne aus genau einem Wochentag. </p> @param start the starting weekday @param end the ending weekday (inclusive) @return new...
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Erzeugt", "eine", "neue", "Spanne", "von", "Wochentagen", ".", "<", "/", "p", ">" ]
train
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/SpanOfWeekdays.java#L216-L227
networknt/light-rest-4j
openapi-validator/src/main/java/com/networknt/openapi/RequestValidator.java
RequestValidator.validateRequest
public Status validateRequest(final NormalisedPath requestPath, HttpServerExchange exchange, OpenApiOperation openApiOperation) { """ Validate the request against the given API operation @param requestPath normalised path @param exchange The HttpServerExchange to validate @param openApiOperation OpenAPI operati...
java
public Status validateRequest(final NormalisedPath requestPath, HttpServerExchange exchange, OpenApiOperation openApiOperation) { requireNonNull(requestPath, "A request path is required"); requireNonNull(exchange, "An exchange is required"); requireNonNull(openApiOperation, "An OpenAPI operation...
[ "public", "Status", "validateRequest", "(", "final", "NormalisedPath", "requestPath", ",", "HttpServerExchange", "exchange", ",", "OpenApiOperation", "openApiOperation", ")", "{", "requireNonNull", "(", "requestPath", ",", "\"A request path is required\"", ")", ";", "requ...
Validate the request against the given API operation @param requestPath normalised path @param exchange The HttpServerExchange to validate @param openApiOperation OpenAPI operation @return A validation report containing validation errors
[ "Validate", "the", "request", "against", "the", "given", "API", "operation" ]
train
https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/openapi-validator/src/main/java/com/networknt/openapi/RequestValidator.java#L70-L90
googleapis/google-cloud-java
google-cloud-clients/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceClient.java
TranslationServiceClient.detectLanguage
public final DetectLanguageResponse detectLanguage(String parent, String model, String mimeType) { """ Detects the language of text within a request. <p>Sample code: <pre><code> try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) { String formattedParent = Translatio...
java
public final DetectLanguageResponse detectLanguage(String parent, String model, String mimeType) { if (!parent.isEmpty()) { LOCATION_PATH_TEMPLATE.validate(parent, "detectLanguage"); } DetectLanguageRequest request = DetectLanguageRequest.newBuilder() .setParent(parent) ...
[ "public", "final", "DetectLanguageResponse", "detectLanguage", "(", "String", "parent", ",", "String", "model", ",", "String", "mimeType", ")", "{", "if", "(", "!", "parent", ".", "isEmpty", "(", ")", ")", "{", "LOCATION_PATH_TEMPLATE", ".", "validate", "(", ...
Detects the language of text within a request. <p>Sample code: <pre><code> try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) { String formattedParent = TranslationServiceClient.formatLocationName("[PROJECT]", "[LOCATION]"); String model = ""; String mimeType = ""; DetectLangu...
[ "Detects", "the", "language", "of", "text", "within", "a", "request", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceClient.java#L333-L344
prestodb/presto
presto-main/src/main/java/com/facebook/presto/util/DateTimeUtils.java
DateTimeUtils.parseTimeLiteral
@Deprecated public static long parseTimeLiteral(TimeZoneKey timeZoneKey, String value) { """ Parse a string (optionally containing a zone) as a value of either TIME or TIME WITH TIME ZONE type. If the string doesn't specify a zone, it is interpreted in {@code timeZoneKey} zone. @return stack representation...
java
@Deprecated public static long parseTimeLiteral(TimeZoneKey timeZoneKey, String value) { try { return parseTimeWithTimeZone(value); } catch (Exception e) { return parseTimeWithoutTimeZone(timeZoneKey, value); } }
[ "@", "Deprecated", "public", "static", "long", "parseTimeLiteral", "(", "TimeZoneKey", "timeZoneKey", ",", "String", "value", ")", "{", "try", "{", "return", "parseTimeWithTimeZone", "(", "value", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "ret...
Parse a string (optionally containing a zone) as a value of either TIME or TIME WITH TIME ZONE type. If the string doesn't specify a zone, it is interpreted in {@code timeZoneKey} zone. @return stack representation of legacy TIME or TIME WITH TIME ZONE type, depending on input
[ "Parse", "a", "string", "(", "optionally", "containing", "a", "zone", ")", "as", "a", "value", "of", "either", "TIME", "or", "TIME", "WITH", "TIME", "ZONE", "type", ".", "If", "the", "string", "doesn", "t", "specify", "a", "zone", "it", "is", "interpre...
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/util/DateTimeUtils.java#L321-L330
phax/ph-commons
ph-cli/src/main/java/com/helger/cli/HelpFormatter.java
HelpFormatter.printUsage
public void printUsage (@Nonnull final PrintWriter aPW, final int nWidth, final String sAppName, final Options aOptions) { """ Prints the usage statement for the specified application. @param aPW The PrintWriter to print the usage st...
java
public void printUsage (@Nonnull final PrintWriter aPW, final int nWidth, final String sAppName, final Options aOptions) { // initialise the string buffer final StringBuilder aSB = new StringBuilder (getSyntaxPrefix ()).append (sApp...
[ "public", "void", "printUsage", "(", "@", "Nonnull", "final", "PrintWriter", "aPW", ",", "final", "int", "nWidth", ",", "final", "String", "sAppName", ",", "final", "Options", "aOptions", ")", "{", "// initialise the string buffer", "final", "StringBuilder", "aSB"...
Prints the usage statement for the specified application. @param aPW The PrintWriter to print the usage statement @param nWidth The number of characters to display per line @param sAppName The application name @param aOptions The command line Options
[ "Prints", "the", "usage", "statement", "for", "the", "specified", "application", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-cli/src/main/java/com/helger/cli/HelpFormatter.java#L626-L675
rometools/rome
rome/src/main/java/com/rometools/rome/io/impl/RSS090Generator.java
RSS090Generator.populateChannel
protected void populateChannel(final Channel channel, final Element eChannel) { """ Populates the given channel with parsed data from the ROME element that holds the channel data. @param channel the channel into which parsed data will be added. @param eChannel the XML element that holds the data for the chann...
java
protected void populateChannel(final Channel channel, final Element eChannel) { final String title = channel.getTitle(); if (title != null) { eChannel.addContent(generateSimpleElement("title", title)); } final String link = channel.getLink(); if (link != null) { ...
[ "protected", "void", "populateChannel", "(", "final", "Channel", "channel", ",", "final", "Element", "eChannel", ")", "{", "final", "String", "title", "=", "channel", ".", "getTitle", "(", ")", ";", "if", "(", "title", "!=", "null", ")", "{", "eChannel", ...
Populates the given channel with parsed data from the ROME element that holds the channel data. @param channel the channel into which parsed data will be added. @param eChannel the XML element that holds the data for the channel.
[ "Populates", "the", "given", "channel", "with", "parsed", "data", "from", "the", "ROME", "element", "that", "holds", "the", "channel", "data", "." ]
train
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/RSS090Generator.java#L111-L124
beihaifeiwu/dolphin
dolphin-common/src/main/java/com/freetmp/common/type/ResolvableType.java
ResolvableType.forField
public static ResolvableType forField(Field field, ResolvableType implementationType) { """ Return a {@link ResolvableType} for the specified {@link Field} with a given implementation. <p>Use this variant when the class that declares the field includes generic parameter variables that are satisfied by the imple...
java
public static ResolvableType forField(Field field, ResolvableType implementationType) { Assert.notNull(field, "Field must not be null"); implementationType = (implementationType == null ? NONE : implementationType); ResolvableType owner = implementationType.as(field.getDeclaringClass()); return forType(null, ne...
[ "public", "static", "ResolvableType", "forField", "(", "Field", "field", ",", "ResolvableType", "implementationType", ")", "{", "Assert", ".", "notNull", "(", "field", ",", "\"Field must not be null\"", ")", ";", "implementationType", "=", "(", "implementationType", ...
Return a {@link ResolvableType} for the specified {@link Field} with a given implementation. <p>Use this variant when the class that declares the field includes generic parameter variables that are satisfied by the implementation type. @param field the source field @param implementationType the implementation type @ret...
[ "Return", "a", "{" ]
train
https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/type/ResolvableType.java#L953-L958
lesaint/damapping
core-parent/annotation-processor/src/main/java/fr/javatronic/damapping/processor/impl/javaxparsing/ProcessingEnvironmentWrapper.java
ProcessingEnvironmentWrapper.getAnnotationMirror
@Nullable private AnnotationMirror getAnnotationMirror(final TypeElement annotation, final Element element) { """ Récupère l'AnnotationMirror sur l'Element spécifié qui correspond à l'annotation traitée par l'AnnotationProcessor dont le TypeElement est spécifié. </p> Cela permet de connaitre la ligne dans les...
java
@Nullable private AnnotationMirror getAnnotationMirror(final TypeElement annotation, final Element element) { Optional<? extends AnnotationMirror> annotationMirror = FluentIterable .from(element.getAnnotationMirrors()) .filter(new Predicate<AnnotationMirror>() { @Override publi...
[ "@", "Nullable", "private", "AnnotationMirror", "getAnnotationMirror", "(", "final", "TypeElement", "annotation", ",", "final", "Element", "element", ")", "{", "Optional", "<", "?", "extends", "AnnotationMirror", ">", "annotationMirror", "=", "FluentIterable", ".", ...
Récupère l'AnnotationMirror sur l'Element spécifié qui correspond à l'annotation traitée par l'AnnotationProcessor dont le TypeElement est spécifié. </p> Cela permet de connaitre la ligne dans les sources où se trouver l'annotation traitée et de contextualiser encore plus finement le message d'erreur à la compilation. ...
[ "Récupère", "l", "AnnotationMirror", "sur", "l", "Element", "spécifié", "qui", "correspond", "à", "l", "annotation", "traitée", "par", "l", "AnnotationProcessor", "dont", "le", "TypeElement", "est", "spécifié", ".", "<", "/", "p", ">", "Cela", "permet", "de", ...
train
https://github.com/lesaint/damapping/blob/357afa5866939fd2a18c09213975ffef4836f328/core-parent/annotation-processor/src/main/java/fr/javatronic/damapping/processor/impl/javaxparsing/ProcessingEnvironmentWrapper.java#L134-L149
RestComm/sip-servlets
sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookSignatureUtil.java
FacebookSignatureUtil.verifySignature
public static boolean verifySignature(Map<String, CharSequence> params, String secret, String expected) { """ Verifies that a signature received matches the expected value. @param params a map of parameters and their values, such as one obtained from extractFacebookNamespa...
java
public static boolean verifySignature(Map<String, CharSequence> params, String secret, String expected) { assert !(null == secret || "".equals(secret)); if (null == params || params.isEmpty() ) return false; if (null == expected || "".equals(expected)) { r...
[ "public", "static", "boolean", "verifySignature", "(", "Map", "<", "String", ",", "CharSequence", ">", "params", ",", "String", "secret", ",", "String", "expected", ")", "{", "assert", "!", "(", "null", "==", "secret", "||", "\"\"", ".", "equals", "(", "...
Verifies that a signature received matches the expected value. @param params a map of parameters and their values, such as one obtained from extractFacebookNamespaceParams @return a boolean indicating whether the calculated signature matched the expected signature
[ "Verifies", "that", "a", "signature", "received", "matches", "the", "expected", "value", "." ]
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookSignatureUtil.java#L197-L208
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java
CoverageUtilities.buildCoverage
public static GridCoverage2D buildCoverage( String name, RenderedImage renderedImage, HashMap<String, Double> envelopeParams, CoordinateReferenceSystem crs ) { """ Creates a {@link GridCoverage2D coverage} from the {@link RenderedImage image} and the necessary geographic Information. @param name the...
java
public static GridCoverage2D buildCoverage( String name, RenderedImage renderedImage, HashMap<String, Double> envelopeParams, CoordinateReferenceSystem crs ) { double west = envelopeParams.get(WEST); double south = envelopeParams.get(SOUTH); double east = envelopeParams.get(EAST); ...
[ "public", "static", "GridCoverage2D", "buildCoverage", "(", "String", "name", ",", "RenderedImage", "renderedImage", ",", "HashMap", "<", "String", ",", "Double", ">", "envelopeParams", ",", "CoordinateReferenceSystem", "crs", ")", "{", "double", "west", "=", "env...
Creates a {@link GridCoverage2D coverage} from the {@link RenderedImage image} and the necessary geographic Information. @param name the name of the coverage. @param renderedImage the image containing the data. @param envelopeParams the map of boundary parameters. @param crs the {@link CoordinateReferenceSystem}. @ret...
[ "Creates", "a", "{", "@link", "GridCoverage2D", "coverage", "}", "from", "the", "{", "@link", "RenderedImage", "image", "}", "and", "the", "necessary", "geographic", "Information", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L862-L874
azkaban/azkaban
azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java
RestfulApiClient.completeRequest
private static HttpEntityEnclosingRequestBase completeRequest( final HttpEntityEnclosingRequestBase request, final List<Pair<String, String>> params) throws UnsupportedEncodingException { """ helper function to fill the request with header entries and posting body . """ if (request != null) { ...
java
private static HttpEntityEnclosingRequestBase completeRequest( final HttpEntityEnclosingRequestBase request, final List<Pair<String, String>> params) throws UnsupportedEncodingException { if (request != null) { if (null != params && !params.isEmpty()) { final List<NameValuePair> formParams...
[ "private", "static", "HttpEntityEnclosingRequestBase", "completeRequest", "(", "final", "HttpEntityEnclosingRequestBase", "request", ",", "final", "List", "<", "Pair", "<", "String", ",", "String", ">", ">", "params", ")", "throws", "UnsupportedEncodingException", "{", ...
helper function to fill the request with header entries and posting body .
[ "helper", "function", "to", "fill", "the", "request", "with", "header", "entries", "and", "posting", "body", "." ]
train
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java#L86-L99
bazaarvoice/emodb
auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java
ApiKeyRealm.hasPermissionById
public boolean hasPermissionById(String id, String permission) { """ Test for whether an API key has a specific permission using its ID. """ Permission resolvedPermission = getPermissionResolver().resolvePermission(permission); return hasPermissionById(id, resolvedPermission); }
java
public boolean hasPermissionById(String id, String permission) { Permission resolvedPermission = getPermissionResolver().resolvePermission(permission); return hasPermissionById(id, resolvedPermission); }
[ "public", "boolean", "hasPermissionById", "(", "String", "id", ",", "String", "permission", ")", "{", "Permission", "resolvedPermission", "=", "getPermissionResolver", "(", ")", ".", "resolvePermission", "(", "permission", ")", ";", "return", "hasPermissionById", "(...
Test for whether an API key has a specific permission using its ID.
[ "Test", "for", "whether", "an", "API", "key", "has", "a", "specific", "permission", "using", "its", "ID", "." ]
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/apikey/ApiKeyRealm.java#L432-L435
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java
RegistriesInner.beginScheduleRun
public RunInner beginScheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { """ Schedules a new run based on the request parameters and add it to the run queue. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The ...
java
public RunInner beginScheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { return beginScheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).toBlocking().single().body(); }
[ "public", "RunInner", "beginScheduleRun", "(", "String", "resourceGroupName", ",", "String", "registryName", ",", "RunRequest", "runRequest", ")", "{", "return", "beginScheduleRunWithServiceResponseAsync", "(", "resourceGroupName", ",", "registryName", ",", "runRequest", ...
Schedules a new run based on the request parameters and add it to the run queue. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param runRequest The parameters of a run that needs to scheduled. @throws IllegalArg...
[ "Schedules", "a", "new", "run", "based", "on", "the", "request", "parameters", "and", "add", "it", "to", "the", "run", "queue", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java#L1802-L1804
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/MessageBuilder.java
MessageBuilder.replaceFirst
public MessageBuilder replaceFirst(String target, String replacement) { """ Replaces the first substring that matches the target string with the specified replacement string. @param target the sequence of char values to be replaced @param replacement the replacement sequence of char values @return The M...
java
public MessageBuilder replaceFirst(String target, String replacement) { int index = builder.indexOf(target); if (index != -1) { builder.replace(index, index + target.length(), replacement); } return this; }
[ "public", "MessageBuilder", "replaceFirst", "(", "String", "target", ",", "String", "replacement", ")", "{", "int", "index", "=", "builder", ".", "indexOf", "(", "target", ")", ";", "if", "(", "index", "!=", "-", "1", ")", "{", "builder", ".", "replace",...
Replaces the first substring that matches the target string with the specified replacement string. @param target the sequence of char values to be replaced @param replacement the replacement sequence of char values @return The MessageBuilder instance. Useful for chaining.
[ "Replaces", "the", "first", "substring", "that", "matches", "the", "target", "string", "with", "the", "specified", "replacement", "string", "." ]
train
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/MessageBuilder.java#L410-L418
mongodb/stitch-android-sdk
core/sdk/src/main/java/com/mongodb/stitch/core/auth/internal/CoreStitchAuth.java
CoreStitchAuth.doAuthenticatedRequest
public <T> T doAuthenticatedRequest(final StitchAuthRequest stitchReq, final Decoder<T> resultDecoder) { """ Performs a request against Stitch using the provided {@link StitchAuthRequest} object, and decodes the response using the provided result decoder. @param stitchReq ...
java
public <T> T doAuthenticatedRequest(final StitchAuthRequest stitchReq, final Decoder<T> resultDecoder) { final Response response = doAuthenticatedRequest(stitchReq); try { final String bodyStr = IoUtils.readAllToString(response.getBody()); final JsonReader bsonR...
[ "public", "<", "T", ">", "T", "doAuthenticatedRequest", "(", "final", "StitchAuthRequest", "stitchReq", ",", "final", "Decoder", "<", "T", ">", "resultDecoder", ")", "{", "final", "Response", "response", "=", "doAuthenticatedRequest", "(", "stitchReq", ")", ";",...
Performs a request against Stitch using the provided {@link StitchAuthRequest} object, and decodes the response using the provided result decoder. @param stitchReq The request to perform. @return The response to the request, successful or not.
[ "Performs", "a", "request", "against", "Stitch", "using", "the", "provided", "{", "@link", "StitchAuthRequest", "}", "object", "and", "decodes", "the", "response", "using", "the", "provided", "result", "decoder", "." ]
train
https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/auth/internal/CoreStitchAuth.java#L252-L267
BioPAX/Paxtools
json-converter/src/main/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverter.java
JsonldBiopaxConverter.convertToJsonld
public void convertToJsonld(InputStream in, OutputStream os) throws IOException { """ /* Convert inputstream in owl/rdf format to outputsream in jsonld format """ File inputProcessedFile = preProcessFile(in); LOG.info("OWl File processed successfully "); // print current time SimpleDateFormat...
java
public void convertToJsonld(InputStream in, OutputStream os) throws IOException { File inputProcessedFile = preProcessFile(in); LOG.info("OWl File processed successfully "); // print current time SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); LOG.info("Conversion RDF to JSONLD started " ...
[ "public", "void", "convertToJsonld", "(", "InputStream", "in", ",", "OutputStream", "os", ")", "throws", "IOException", "{", "File", "inputProcessedFile", "=", "preProcessFile", "(", "in", ")", ";", "LOG", ".", "info", "(", "\"OWl File processed successfully \"", ...
/* Convert inputstream in owl/rdf format to outputsream in jsonld format
[ "/", "*", "Convert", "inputstream", "in", "owl", "/", "rdf", "format", "to", "outputsream", "in", "jsonld", "format" ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/json-converter/src/main/java/org/biopax/paxtools/io/jsonld/JsonldBiopaxConverter.java#L29-L59
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java
GrailsDomainBinder.bindUnidirectionalOneToMany
protected void bindUnidirectionalOneToMany(org.grails.datastore.mapping.model.types.OneToMany property, InFlightMetadataCollector mappings, Collection collection) { """ Binds a unidirectional one-to-many creating a psuedo back reference property in the process. @param property @param mappings @param collectio...
java
protected void bindUnidirectionalOneToMany(org.grails.datastore.mapping.model.types.OneToMany property, InFlightMetadataCollector mappings, Collection collection) { Value v = collection.getElement(); v.createForeignKey(); String entityName; if (v instanceof ManyToOne) { ManyT...
[ "protected", "void", "bindUnidirectionalOneToMany", "(", "org", ".", "grails", ".", "datastore", ".", "mapping", ".", "model", ".", "types", ".", "OneToMany", "property", ",", "InFlightMetadataCollector", "mappings", ",", "Collection", "collection", ")", "{", "Val...
Binds a unidirectional one-to-many creating a psuedo back reference property in the process. @param property @param mappings @param collection
[ "Binds", "a", "unidirectional", "one", "-", "to", "-", "many", "creating", "a", "psuedo", "back", "reference", "property", "in", "the", "process", "." ]
train
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L917-L941
groupe-sii/ogham
ogham-core/src/main/java/fr/sii/ogham/core/util/EqualsBuilder.java
EqualsBuilder.append
public EqualsBuilder append(Object objectFieldValue, Object otherFieldValue) { """ Test if two Objects are equal using their equals method. @param objectFieldValue the value of a field of the object @param otherFieldValue the value of a field of the other object @return used to chain calls """ if (equ...
java
public EqualsBuilder append(Object objectFieldValue, Object otherFieldValue) { if (equals && !same) { delegate.append(objectFieldValue, otherFieldValue); } return this; }
[ "public", "EqualsBuilder", "append", "(", "Object", "objectFieldValue", ",", "Object", "otherFieldValue", ")", "{", "if", "(", "equals", "&&", "!", "same", ")", "{", "delegate", ".", "append", "(", "objectFieldValue", ",", "otherFieldValue", ")", ";", "}", "...
Test if two Objects are equal using their equals method. @param objectFieldValue the value of a field of the object @param otherFieldValue the value of a field of the other object @return used to chain calls
[ "Test", "if", "two", "Objects", "are", "equal", "using", "their", "equals", "method", "." ]
train
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/util/EqualsBuilder.java#L145-L150
wildfly/wildfly-maven-plugin
core/src/main/java/org/wildfly/plugin/core/Assertions.java
Assertions.requiresNotNullOrNotEmptyParameter
static String requiresNotNullOrNotEmptyParameter(final String name, final String value) throws IllegalArgumentException { """ Checks if the parameter is {@code null} or empty and throws an {@link IllegalArgumentException} if it is. @param name the name of the parameter @param value the value to check @retu...
java
static String requiresNotNullOrNotEmptyParameter(final String name, final String value) throws IllegalArgumentException { Assert.checkNotNullParam(name, value); Assert.checkNotEmptyParam(name, value); return value; }
[ "static", "String", "requiresNotNullOrNotEmptyParameter", "(", "final", "String", "name", ",", "final", "String", "value", ")", "throws", "IllegalArgumentException", "{", "Assert", ".", "checkNotNullParam", "(", "name", ",", "value", ")", ";", "Assert", ".", "chec...
Checks if the parameter is {@code null} or empty and throws an {@link IllegalArgumentException} if it is. @param name the name of the parameter @param value the value to check @return the parameter value @throws IllegalArgumentException if the object representing the parameter is {@code null}
[ "Checks", "if", "the", "parameter", "is", "{", "@code", "null", "}", "or", "empty", "and", "throws", "an", "{", "@link", "IllegalArgumentException", "}", "if", "it", "is", "." ]
train
https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/Assertions.java#L41-L45
phax/ph-web
ph-servlet/src/main/java/com/helger/servlet/mock/MockHttpServletRequest.java
MockHttpServletRequest.setParameter
@Nonnull public MockHttpServletRequest setParameter (@Nonnull final String sName, @Nullable final String sValue) { """ Set a single value for the specified HTTP parameter. <p> If there are already one or more values registered for the given parameter name, they will be replaced. @param sName Parameter nam...
java
@Nonnull public MockHttpServletRequest setParameter (@Nonnull final String sName, @Nullable final String sValue) { m_aParameters.remove (sName); m_aParameters.add (sName, sValue); return this; }
[ "@", "Nonnull", "public", "MockHttpServletRequest", "setParameter", "(", "@", "Nonnull", "final", "String", "sName", ",", "@", "Nullable", "final", "String", "sValue", ")", "{", "m_aParameters", ".", "remove", "(", "sName", ")", ";", "m_aParameters", ".", "add...
Set a single value for the specified HTTP parameter. <p> If there are already one or more values registered for the given parameter name, they will be replaced. @param sName Parameter name @param sValue Parameter value @return this
[ "Set", "a", "single", "value", "for", "the", "specified", "HTTP", "parameter", ".", "<p", ">", "If", "there", "are", "already", "one", "or", "more", "values", "registered", "for", "the", "given", "parameter", "name", "they", "will", "be", "replaced", "." ]
train
https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/mock/MockHttpServletRequest.java#L398-L404
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java
UfsJournalFile.decodeCheckpointFile
@Nullable static UfsJournalFile decodeCheckpointFile(UfsJournal journal, String filename) { """ Decodes a checkpoint file name into a {@link UfsJournalFile}. @param journal the UFS journal instance @param filename the filename @return the instance of {@link UfsJournalFile}, null if the file invalid """ ...
java
@Nullable static UfsJournalFile decodeCheckpointFile(UfsJournal journal, String filename) { URI location = URIUtils.appendPathOrDie(journal.getCheckpointDir(), filename); try { String[] parts = filename.split("-"); // There can be temporary files in logs directory. Skip them. if (parts.leng...
[ "@", "Nullable", "static", "UfsJournalFile", "decodeCheckpointFile", "(", "UfsJournal", "journal", ",", "String", "filename", ")", "{", "URI", "location", "=", "URIUtils", ".", "appendPathOrDie", "(", "journal", ".", "getCheckpointDir", "(", ")", ",", "filename", ...
Decodes a checkpoint file name into a {@link UfsJournalFile}. @param journal the UFS journal instance @param filename the filename @return the instance of {@link UfsJournalFile}, null if the file invalid
[ "Decodes", "a", "checkpoint", "file", "name", "into", "a", "{", "@link", "UfsJournalFile", "}", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L179-L201
Netflix/eureka
eureka-core/src/main/java/com/netflix/eureka/resources/ApplicationResource.java
ApplicationResource.getInstanceInfo
@Path(" { """ Gets information about a particular instance of an application. @param id the unique identifier of the instance. @return information about a particular instance. """id}") public InstanceResource getInstanceInfo(@PathParam("id") String id) { return new InstanceResource(this, id, s...
java
@Path("{id}") public InstanceResource getInstanceInfo(@PathParam("id") String id) { return new InstanceResource(this, id, serverConfig, registry); }
[ "@", "Path", "(", "\"{id}\"", ")", "public", "InstanceResource", "getInstanceInfo", "(", "@", "PathParam", "(", "\"id\"", ")", "String", "id", ")", "{", "return", "new", "InstanceResource", "(", "this", ",", "id", ",", "serverConfig", ",", "registry", ")", ...
Gets information about a particular instance of an application. @param id the unique identifier of the instance. @return information about a particular instance.
[ "Gets", "information", "about", "a", "particular", "instance", "of", "an", "application", "." ]
train
https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/resources/ApplicationResource.java#L127-L130
Azure/azure-sdk-for-java
resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java
ResourcesInner.validateMoveResources
public void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { """ Validates whether resources can be moved from one resource group to another resource group. This operation checks whether the specified resources can be moved to the target. The resources to move must be in the s...
java
public void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { validateMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().last().body(); }
[ "public", "void", "validateMoveResources", "(", "String", "sourceResourceGroupName", ",", "ResourcesMoveInfo", "parameters", ")", "{", "validateMoveResourcesWithServiceResponseAsync", "(", "sourceResourceGroupName", ",", "parameters", ")", ".", "toBlocking", "(", ")", ".", ...
Validates whether resources can be moved from one resource group to another resource group. This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succe...
[ "Validates", "whether", "resources", "can", "be", "moved", "from", "one", "resource", "group", "to", "another", "resource", "group", ".", "This", "operation", "checks", "whether", "the", "specified", "resources", "can", "be", "moved", "to", "the", "target", "....
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L582-L584
xmlunit/xmlunit
xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameQualifier.java
ElementNameQualifier.equalsNamespace
protected boolean equalsNamespace(Node control, Node test) { """ Determine whether two nodes are defined by the same namespace URI @param control @param test @return true if the two nodes are both defined by the same namespace URI (including the default - empty - namespace), false otherwise """ Str...
java
protected boolean equalsNamespace(Node control, Node test) { String controlNS = control.getNamespaceURI(); String testNS = test.getNamespaceURI(); if (controlNS == null) { return testNS == null; } return controlNS.equals(testNS); }
[ "protected", "boolean", "equalsNamespace", "(", "Node", "control", ",", "Node", "test", ")", "{", "String", "controlNS", "=", "control", ".", "getNamespaceURI", "(", ")", ";", "String", "testNS", "=", "test", ".", "getNamespaceURI", "(", ")", ";", "if", "(...
Determine whether two nodes are defined by the same namespace URI @param control @param test @return true if the two nodes are both defined by the same namespace URI (including the default - empty - namespace), false otherwise
[ "Determine", "whether", "two", "nodes", "are", "defined", "by", "the", "same", "namespace", "URI" ]
train
https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/ElementNameQualifier.java#L70-L77
kohsuke/args4j
args4j/src/org/kohsuke/args4j/spi/MapOptionHandler.java
MapOptionHandler.addToMap
protected void addToMap(Map m, String key, String value) { """ This is the opportunity to convert values to some typed objects. """ m.put(key,value); }
java
protected void addToMap(Map m, String key, String value) { m.put(key,value); }
[ "protected", "void", "addToMap", "(", "Map", "m", ",", "String", "key", ",", "String", "value", ")", "{", "m", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
This is the opportunity to convert values to some typed objects.
[ "This", "is", "the", "opportunity", "to", "convert", "values", "to", "some", "typed", "objects", "." ]
train
https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/spi/MapOptionHandler.java#L91-L93
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/parser/SimpleTextExtractingPdfContentStreamProcessor.java
SimpleTextExtractingPdfContentStreamProcessor.displayText
public void displayText(String text, Matrix endingTextMatrix) { """ Writes text to the result. @param text The text that needs to be displayed @param endingTextMatrix a text matrix @see com.lowagie.text.pdf.parser.PdfContentStreamProcessor#displayText(java.lang.String, com.lowagie.text.pdf.parser.Matrix) ""...
java
public void displayText(String text, Matrix endingTextMatrix){ boolean hardReturn = false; if (lastTextLineMatrix != null && lastTextLineMatrix.get(Matrix.I32) != getCurrentTextLineMatrix().get(Matrix.I32)){ hardReturn = true; } float currentX = getCurrentTextMatrix()....
[ "public", "void", "displayText", "(", "String", "text", ",", "Matrix", "endingTextMatrix", ")", "{", "boolean", "hardReturn", "=", "false", ";", "if", "(", "lastTextLineMatrix", "!=", "null", "&&", "lastTextLineMatrix", ".", "get", "(", "Matrix", ".", "I32", ...
Writes text to the result. @param text The text that needs to be displayed @param endingTextMatrix a text matrix @see com.lowagie.text.pdf.parser.PdfContentStreamProcessor#displayText(java.lang.String, com.lowagie.text.pdf.parser.Matrix)
[ "Writes", "text", "to", "the", "result", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/parser/SimpleTextExtractingPdfContentStreamProcessor.java#L92-L121
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java
DocBookBuilder.buildBook
public HashMap<String, byte[]> buildBook(final ContentSpec contentSpec, final String requester, final DocBookBuildingOptions buildingOptions) throws BuilderCreationException, BuildProcessingException { """ Builds a DocBook Formatted Book using a Content Specification to define the structure and content...
java
public HashMap<String, byte[]> buildBook(final ContentSpec contentSpec, final String requester, final DocBookBuildingOptions buildingOptions) throws BuilderCreationException, BuildProcessingException { return buildBook(contentSpec, requester, buildingOptions, new HashMap<String, byte[]>()); }
[ "public", "HashMap", "<", "String", ",", "byte", "[", "]", ">", "buildBook", "(", "final", "ContentSpec", "contentSpec", ",", "final", "String", "requester", ",", "final", "DocBookBuildingOptions", "buildingOptions", ")", "throws", "BuilderCreationException", ",", ...
Builds a DocBook Formatted Book using a Content Specification to define the structure and contents of the book. @param contentSpec The content specification to build from. @param requester The user who requested the build. @param buildingOptions The options to be used when building. @return Returns a mapping...
[ "Builds", "a", "DocBook", "Formatted", "Book", "using", "a", "Content", "Specification", "to", "define", "the", "structure", "and", "contents", "of", "the", "book", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java#L387-L390
diffplug/durian
src/com/diffplug/common/base/MoreCollectors.java
MoreCollectors.singleOrEmptyShortCircuiting
public static <T> Optional<T> singleOrEmptyShortCircuiting(Stream<T> stream) { """ Same behavior as {@link #singleOrEmpty}, except that it returns early if it is possible to do so. Unfortunately, it is not possible to implement early-return behavior using the Collector interface, so MoreCollectors takes the st...
java
public static <T> Optional<T> singleOrEmptyShortCircuiting(Stream<T> stream) { return stream.limit(2).map(Optional::ofNullable).reduce(Optional.empty(), (a, b) -> a.isPresent() ^ b.isPresent() ? b : Optional.empty()); }
[ "public", "static", "<", "T", ">", "Optional", "<", "T", ">", "singleOrEmptyShortCircuiting", "(", "Stream", "<", "T", ">", "stream", ")", "{", "return", "stream", ".", "limit", "(", "2", ")", ".", "map", "(", "Optional", "::", "ofNullable", ")", ".", ...
Same behavior as {@link #singleOrEmpty}, except that it returns early if it is possible to do so. Unfortunately, it is not possible to implement early-return behavior using the Collector interface, so MoreCollectors takes the stream as an argument. <p> Implementation credit to Thomas Jungblut <a href="http://stackover...
[ "Same", "behavior", "as", "{" ]
train
https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/MoreCollectors.java#L47-L50
Samsung/GearVRf
GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRGenericConstraint.java
GVRGenericConstraint.setLinearUpperLimits
public void setLinearUpperLimits(float limitX, float limitY, float limitZ) { """ Sets the upper limits for the "moving" body translation relative to joint point. @param limitX the X upper lower translation limit @param limitY the Y upper lower translation limit @param limitZ the Z upper lower translation limi...
java
public void setLinearUpperLimits(float limitX, float limitY, float limitZ) { Native3DGenericConstraint.setLinearUpperLimits(getNative(), limitX, limitY, limitZ); }
[ "public", "void", "setLinearUpperLimits", "(", "float", "limitX", ",", "float", "limitY", ",", "float", "limitZ", ")", "{", "Native3DGenericConstraint", ".", "setLinearUpperLimits", "(", "getNative", "(", ")", ",", "limitX", ",", "limitY", ",", "limitZ", ")", ...
Sets the upper limits for the "moving" body translation relative to joint point. @param limitX the X upper lower translation limit @param limitY the Y upper lower translation limit @param limitZ the Z upper lower translation limit
[ "Sets", "the", "upper", "limits", "for", "the", "moving", "body", "translation", "relative", "to", "joint", "point", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRGenericConstraint.java#L85-L87
aws/aws-sdk-java
aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/UpdatePatchBaselineRequest.java
UpdatePatchBaselineRequest.getApprovedPatches
public java.util.List<String> getApprovedPatches() { """ <p> A list of explicitly approved patches for the baseline. </p> <p> For information about accepted formats for lists of approved patches and rejected patches, see <a href= "https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-appr...
java
public java.util.List<String> getApprovedPatches() { if (approvedPatches == null) { approvedPatches = new com.amazonaws.internal.SdkInternalList<String>(); } return approvedPatches; }
[ "public", "java", ".", "util", ".", "List", "<", "String", ">", "getApprovedPatches", "(", ")", "{", "if", "(", "approvedPatches", "==", "null", ")", "{", "approvedPatches", "=", "new", "com", ".", "amazonaws", ".", "internal", ".", "SdkInternalList", "<",...
<p> A list of explicitly approved patches for the baseline. </p> <p> For information about accepted formats for lists of approved patches and rejected patches, see <a href= "https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html" >Package Name Formats for ...
[ "<p", ">", "A", "list", "of", "explicitly", "approved", "patches", "for", "the", "baseline", ".", "<", "/", "p", ">", "<p", ">", "For", "information", "about", "accepted", "formats", "for", "lists", "of", "approved", "patches", "and", "rejected", "patches"...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/UpdatePatchBaselineRequest.java#L308-L313
roboconf/roboconf-platform
miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/AbstractStructuredRenderer.java
AbstractStructuredRenderer.saveImage
private void saveImage( final Component comp, DiagramType type, AbstractRoboconfTransformer transformer, StringBuilder sb ) throws IOException { """ Generates and saves an image. @param comp the component to highlight in the image @param type the kind of relation to show in the diagram @param transformer a tra...
java
private void saveImage( final Component comp, DiagramType type, AbstractRoboconfTransformer transformer, StringBuilder sb ) throws IOException { String baseName = comp.getName() + "_" + type; //$NON-NLS-1$ String relativePath = "png/" + baseName + ".png"; //$NON-NLS-1$ //$NON-NLS-2$ if( this.options.containsKey...
[ "private", "void", "saveImage", "(", "final", "Component", "comp", ",", "DiagramType", "type", ",", "AbstractRoboconfTransformer", "transformer", ",", "StringBuilder", "sb", ")", "throws", "IOException", "{", "String", "baseName", "=", "comp", ".", "getName", "(",...
Generates and saves an image. @param comp the component to highlight in the image @param type the kind of relation to show in the diagram @param transformer a transformer for the graph generation @param sb the string builder to append the link to the generated image @throws IOException if something went wrong
[ "Generates", "and", "saves", "an", "image", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-doc-generator/src/main/java/net/roboconf/doc/generator/internal/AbstractStructuredRenderer.java#L576-L598
evant/binding-collection-adapter
bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/Utils.java
Utils.createClass
@SuppressWarnings("unchecked") static <T, A extends BindingCollectionAdapter<T>> A createClass(Class<? extends BindingCollectionAdapter> adapterClass, ItemBinding<T> itemBinding) { """ Constructs a binding adapter class from it's class name using reflection. """ try { return (A) adapter...
java
@SuppressWarnings("unchecked") static <T, A extends BindingCollectionAdapter<T>> A createClass(Class<? extends BindingCollectionAdapter> adapterClass, ItemBinding<T> itemBinding) { try { return (A) adapterClass.getConstructor(ItemBinding.class).newInstance(itemBinding); } catch (Exceptio...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "static", "<", "T", ",", "A", "extends", "BindingCollectionAdapter", "<", "T", ">", ">", "A", "createClass", "(", "Class", "<", "?", "extends", "BindingCollectionAdapter", ">", "adapterClass", ",", "ItemBinding...
Constructs a binding adapter class from it's class name using reflection.
[ "Constructs", "a", "binding", "adapter", "class", "from", "it", "s", "class", "name", "using", "reflection", "." ]
train
https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/Utils.java#L99-L106
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.cleanAreaAsync
public CacheManagerTask cleanAreaAsync(Context ctx, BoundingBox bb, int zoomMin, int zoomMax) { """ Remove all cached tiles in the specified area. @param ctx @param bb @param zoomMin @param zoomMax """ final CacheManagerTask task = new CacheManagerTask(this, getCleaningAction(), bb, zoomMin, zoom...
java
public CacheManagerTask cleanAreaAsync(Context ctx, BoundingBox bb, int zoomMin, int zoomMax) { final CacheManagerTask task = new CacheManagerTask(this, getCleaningAction(), bb, zoomMin, zoomMax); task.addCallback(getCleaningDialog(ctx, task)); return execute(task); }
[ "public", "CacheManagerTask", "cleanAreaAsync", "(", "Context", "ctx", ",", "BoundingBox", "bb", ",", "int", "zoomMin", ",", "int", "zoomMax", ")", "{", "final", "CacheManagerTask", "task", "=", "new", "CacheManagerTask", "(", "this", ",", "getCleaningAction", "...
Remove all cached tiles in the specified area. @param ctx @param bb @param zoomMin @param zoomMax
[ "Remove", "all", "cached", "tiles", "in", "the", "specified", "area", "." ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L891-L895
spring-projects/spring-android
spring-android-rest-template/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java
DefaultResponseErrorHandler.handleError
public void handleError(ClientHttpResponse response) throws IOException { """ This default implementation throws a {@link HttpClientErrorException} if the response status code is {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR}, a {@link HttpServerErrorException} if it is {@link org.springframewor...
java
public void handleError(ClientHttpResponse response) throws IOException { HttpStatus statusCode = getHttpStatusCode(response); switch (statusCode.series()) { case CLIENT_ERROR: throw new HttpClientErrorException(statusCode, response.getStatusText(), response.getHeaders(), getResponseBody(response), get...
[ "public", "void", "handleError", "(", "ClientHttpResponse", "response", ")", "throws", "IOException", "{", "HttpStatus", "statusCode", "=", "getHttpStatusCode", "(", "response", ")", ";", "switch", "(", "statusCode", ".", "series", "(", ")", ")", "{", "case", ...
This default implementation throws a {@link HttpClientErrorException} if the response status code is {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR}, a {@link HttpServerErrorException} if it is {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR}, and a {@link RestClientException} in other ca...
[ "This", "default", "implementation", "throws", "a", "{" ]
train
https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java#L84-L96
google/closure-compiler
src/com/google/javascript/jscomp/AstFactory.java
AstFactory.createJSCompMakeAsyncIteratorCall
Node createJSCompMakeAsyncIteratorCall(Node iterable, Scope scope) { """ Given an iterable like {@code rhs} in <pre>{@code for await (lhs of rhs) { block(); } }</pre> <p>returns a call node for the {@code rhs} wrapped in a {@code $jscomp.makeAsyncIterator} call. <pre>{@code $jscomp.makeAsyncIterator(rh...
java
Node createJSCompMakeAsyncIteratorCall(Node iterable, Scope scope) { Node makeIteratorAsyncName = createQName(scope, "$jscomp.makeAsyncIterator"); // Since createCall (currently) doesn't handle templated functions, fill in the template types // of makeIteratorName manually. if (isAddingTypes() && !makeI...
[ "Node", "createJSCompMakeAsyncIteratorCall", "(", "Node", "iterable", ",", "Scope", "scope", ")", "{", "Node", "makeIteratorAsyncName", "=", "createQName", "(", "scope", ",", "\"$jscomp.makeAsyncIterator\"", ")", ";", "// Since createCall (currently) doesn't handle templated ...
Given an iterable like {@code rhs} in <pre>{@code for await (lhs of rhs) { block(); } }</pre> <p>returns a call node for the {@code rhs} wrapped in a {@code $jscomp.makeAsyncIterator} call. <pre>{@code $jscomp.makeAsyncIterator(rhs) }</pre>
[ "Given", "an", "iterable", "like", "{", "@code", "rhs", "}", "in" ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AstFactory.java#L861-L886
Nexmo/nexmo-java
src/main/java/com/nexmo/client/sms/HexUtil.java
HexUtil.bytesToHex
public static String bytesToHex(byte[] bytes, String separator) { """ translate a byte array of raw data into a String with a hex representation of that data. Each octet will be separated with a specific separator. @param bytes raw binary data @param separator This string will be injected into the output in b...
java
public static String bytesToHex(byte[] bytes, String separator) { StringBuilder tmpBuffer = new StringBuilder(); if (bytes != null) { for (byte c : bytes) { int b = c; if (b < 0) b += 256; if (separator != null) ...
[ "public", "static", "String", "bytesToHex", "(", "byte", "[", "]", "bytes", ",", "String", "separator", ")", "{", "StringBuilder", "tmpBuffer", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "bytes", "!=", "null", ")", "{", "for", "(", "byte", ...
translate a byte array of raw data into a String with a hex representation of that data. Each octet will be separated with a specific separator. @param bytes raw binary data @param separator This string will be injected into the output in between each octet in the stream @return String Hex representation of the raw d...
[ "translate", "a", "byte", "array", "of", "raw", "data", "into", "a", "String", "with", "a", "hex", "representation", "of", "that", "data", ".", "Each", "octet", "will", "be", "separated", "with", "a", "specific", "separator", "." ]
train
https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/sms/HexUtil.java#L62-L76
infinispan/infinispan
extended-statistics/src/main/java/org/infinispan/stats/topK/StreamSummaryContainer.java
StreamSummaryContainer.addPut
public void addPut(Object key, boolean remote) { """ Adds the key to the put top-key. @param remote {@code true} if the key is remote, {@code false} otherwise. """ if (!isEnabled()) { return; } syncOffer(remote ? Stat.REMOTE_PUT : Stat.LOCAL_PUT, key); }
java
public void addPut(Object key, boolean remote) { if (!isEnabled()) { return; } syncOffer(remote ? Stat.REMOTE_PUT : Stat.LOCAL_PUT, key); }
[ "public", "void", "addPut", "(", "Object", "key", ",", "boolean", "remote", ")", "{", "if", "(", "!", "isEnabled", "(", ")", ")", "{", "return", ";", "}", "syncOffer", "(", "remote", "?", "Stat", ".", "REMOTE_PUT", ":", "Stat", ".", "LOCAL_PUT", ",",...
Adds the key to the put top-key. @param remote {@code true} if the key is remote, {@code false} otherwise.
[ "Adds", "the", "key", "to", "the", "put", "top", "-", "key", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/topK/StreamSummaryContainer.java#L114-L120
OpenLiberty/open-liberty
dev/com.ibm.ws.repository.parsers/src/com/ibm/ws/repository/parsers/ParserBase.java
ParserBase.findFiles
private static Collection<Path> findFiles(FileSystem fs, final String contains) throws IOException { """ Find files in the given fs where the path contains the string <code>contains</code>. Will throw an IOException if the fs contains more than one root directory. """ final ArrayList<Path> rv = new Ar...
java
private static Collection<Path> findFiles(FileSystem fs, final String contains) throws IOException { final ArrayList<Path> rv = new ArrayList<>(); Iterator<Path> dirs = fs.getRootDirectories().iterator(); Files.walkFileTree(dirs.next(), new SimpleFileVisitor<Path>() { @Override ...
[ "private", "static", "Collection", "<", "Path", ">", "findFiles", "(", "FileSystem", "fs", ",", "final", "String", "contains", ")", "throws", "IOException", "{", "final", "ArrayList", "<", "Path", ">", "rv", "=", "new", "ArrayList", "<>", "(", ")", ";", ...
Find files in the given fs where the path contains the string <code>contains</code>. Will throw an IOException if the fs contains more than one root directory.
[ "Find", "files", "in", "the", "given", "fs", "where", "the", "path", "contains", "the", "string", "<code", ">", "contains<", "/", "code", ">", ".", "Will", "throw", "an", "IOException", "if", "the", "fs", "contains", "more", "than", "one", "root", "direc...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.parsers/src/com/ibm/ws/repository/parsers/ParserBase.java#L630-L647
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.getPermissions
public CmsPermissionSet getPermissions(String resourceName, String userName) throws CmsException { """ Returns the set of permissions of a given user for a given resource.<p> @param resourceName the name of the resource @param userName the name of the user @return the current permissions on this resource ...
java
public CmsPermissionSet getPermissions(String resourceName, String userName) throws CmsException { // reading permissions is allowed even if the resource is marked as deleted CmsResource resource = readResource(resourceName, CmsResourceFilter.ALL); CmsUser user = readUser(userName); ret...
[ "public", "CmsPermissionSet", "getPermissions", "(", "String", "resourceName", ",", "String", "userName", ")", "throws", "CmsException", "{", "// reading permissions is allowed even if the resource is marked as deleted", "CmsResource", "resource", "=", "readResource", "(", "res...
Returns the set of permissions of a given user for a given resource.<p> @param resourceName the name of the resource @param userName the name of the user @return the current permissions on this resource @throws CmsException if something goes wrong
[ "Returns", "the", "set", "of", "permissions", "of", "a", "given", "user", "for", "a", "given", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1677-L1683
haifengl/smile
core/src/main/java/smile/association/FPGrowth.java
FPGrowth.learn
private long learn(PrintStream out, List<ItemSet> list, TotalSupportTree ttree) { """ Mines the frequent item sets. The discovered frequent item sets will be printed out to the provided stream. @param out a print stream for output of frequent item sets. @return the number of discovered frequent item sets. "...
java
private long learn(PrintStream out, List<ItemSet> list, TotalSupportTree ttree) { if (MulticoreExecutor.getThreadPoolSize() > 1) { return grow(out, list, ttree, T0, null, null, null); } else { return grow(out, list, ttree, T0, null); } }
[ "private", "long", "learn", "(", "PrintStream", "out", ",", "List", "<", "ItemSet", ">", "list", ",", "TotalSupportTree", "ttree", ")", "{", "if", "(", "MulticoreExecutor", ".", "getThreadPoolSize", "(", ")", ">", "1", ")", "{", "return", "grow", "(", "o...
Mines the frequent item sets. The discovered frequent item sets will be printed out to the provided stream. @param out a print stream for output of frequent item sets. @return the number of discovered frequent item sets.
[ "Mines", "the", "frequent", "item", "sets", ".", "The", "discovered", "frequent", "item", "sets", "will", "be", "printed", "out", "to", "the", "provided", "stream", "." ]
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/FPGrowth.java#L176-L182
kiswanij/jk-util
src/main/java/com/jk/util/validation/builtin/ValidationBundle.java
ValidationBundle.getMessage
public static String getMessage(final Class class1, final String string, final int port) { """ Gets the message. @param class1 the class 1 @param string the string @param port the port @return the message """ return JKMessage.get(string, port); }
java
public static String getMessage(final Class class1, final String string, final int port) { return JKMessage.get(string, port); }
[ "public", "static", "String", "getMessage", "(", "final", "Class", "class1", ",", "final", "String", "string", ",", "final", "int", "port", ")", "{", "return", "JKMessage", ".", "get", "(", "string", ",", "port", ")", ";", "}" ]
Gets the message. @param class1 the class 1 @param string the string @param port the port @return the message
[ "Gets", "the", "message", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/validation/builtin/ValidationBundle.java#L37-L39
ow2-chameleon/fuchsia
discoveries/file-based/src/main/java/org/ow2/chameleon/fuchsia/discovery/filebased/AbstractFileBasedDiscovery.java
AbstractFileBasedDiscovery.createAndRegisterDeclaration
private D createAndRegisterDeclaration(Map<String, Object> metadata) { """ Create and register the declaration of class D with the given metadata. @param metadata the metadata to create the declaration @return the created declaration of class D """ D declaration; if (klass.equals(ImportDecl...
java
private D createAndRegisterDeclaration(Map<String, Object> metadata) { D declaration; if (klass.equals(ImportDeclaration.class)) { declaration = (D) ImportDeclarationBuilder.fromMetadata(metadata).build(); } else if (klass.equals(ExportDeclaration.class)) { declaration = ...
[ "private", "D", "createAndRegisterDeclaration", "(", "Map", "<", "String", ",", "Object", ">", "metadata", ")", "{", "D", "declaration", ";", "if", "(", "klass", ".", "equals", "(", "ImportDeclaration", ".", "class", ")", ")", "{", "declaration", "=", "(",...
Create and register the declaration of class D with the given metadata. @param metadata the metadata to create the declaration @return the created declaration of class D
[ "Create", "and", "register", "the", "declaration", "of", "class", "D", "with", "the", "given", "metadata", "." ]
train
https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/discoveries/file-based/src/main/java/org/ow2/chameleon/fuchsia/discovery/filebased/AbstractFileBasedDiscovery.java#L188-L199
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/view/explorer/BugPrioritySorter.java
BugPrioritySorter.compareMarkers
static int compareMarkers(IMarker m1, IMarker m2) { """ Sorts markers on rank, then priority, and then on name if requested @param m1 @param m2 @return """ if (m1 == null || m2 == null || !m1.exists() || !m2.exists()) { return 0; } int rank1 = MarkerUtil.findBugRankForM...
java
static int compareMarkers(IMarker m1, IMarker m2) { if (m1 == null || m2 == null || !m1.exists() || !m2.exists()) { return 0; } int rank1 = MarkerUtil.findBugRankForMarker(m1); int rank2 = MarkerUtil.findBugRankForMarker(m2); int result = rank1 - rank2; if (re...
[ "static", "int", "compareMarkers", "(", "IMarker", "m1", ",", "IMarker", "m2", ")", "{", "if", "(", "m1", "==", "null", "||", "m2", "==", "null", "||", "!", "m1", ".", "exists", "(", ")", "||", "!", "m2", ".", "exists", "(", ")", ")", "{", "ret...
Sorts markers on rank, then priority, and then on name if requested @param m1 @param m2 @return
[ "Sorts", "markers", "on", "rank", "then", "priority", "and", "then", "on", "name", "if", "requested" ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/view/explorer/BugPrioritySorter.java#L89-L108
ReactiveX/RxJavaAsyncUtil
src/main/java/rx/util/async/Async.java
Async.toAsyncThrowing
public static <T1, T2, T3, T4, T5, T6, R> Func6<T1, T2, T3, T4, T5, T6, Observable<R>> toAsyncThrowing(final ThrowingFunc6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> func, final Scheduler scheduler) { """ Convert a synchronous function call into an asynchronous function ca...
java
public static <T1, T2, T3, T4, T5, T6, R> Func6<T1, T2, T3, T4, T5, T6, Observable<R>> toAsyncThrowing(final ThrowingFunc6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> func, final Scheduler scheduler) { return new Func6<T1, T2, T3, T4, T5, T6, Observable<R>>() { ...
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ",", "T6", ",", "R", ">", "Func6", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ",", "T6", ",", "Observable", "<", "R", ">", ">", "toAsyncThrowing", "(", "...
Convert a synchronous function call into an asynchronous function call through an Observable. <p> <img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt=""> @param <T1> the first parameter type @param <T2> the second parameter type @param <T3> the third parameter type @...
[ "Convert", "a", "synchronous", "function", "call", "into", "an", "asynchronous", "function", "call", "through", "an", "Observable", ".", "<p", ">", "<img", "width", "=", "640", "src", "=", "https", ":", "//", "raw", ".", "github", ".", "com", "/", "wiki"...
train
https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L1311-L1318
dkmfbk/knowledgestore
ks-server-hbase/src/main/java/eu/fbk/knowledgestore/datastore/hbase/HBaseDataStore.java
HBaseDataStore.checkAndCreateTable
private void checkAndCreateTable(final String tabName, final String colFamName) throws IOException { """ Verifies the existence of tables. @param tableName to be verified @param columnFamilyName of the table @throws IOException """ hbaseUtils.checkAndCreateTable(tabName, colFamName); ...
java
private void checkAndCreateTable(final String tabName, final String colFamName) throws IOException { hbaseUtils.checkAndCreateTable(tabName, colFamName); }
[ "private", "void", "checkAndCreateTable", "(", "final", "String", "tabName", ",", "final", "String", "colFamName", ")", "throws", "IOException", "{", "hbaseUtils", ".", "checkAndCreateTable", "(", "tabName", ",", "colFamName", ")", ";", "}" ]
Verifies the existence of tables. @param tableName to be verified @param columnFamilyName of the table @throws IOException
[ "Verifies", "the", "existence", "of", "tables", "." ]
train
https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-server-hbase/src/main/java/eu/fbk/knowledgestore/datastore/hbase/HBaseDataStore.java#L132-L136
apache/incubator-atlas
webapp/src/main/java/org/apache/atlas/web/service/CuratorFactory.java
CuratorFactory.leaderLatchInstance
public LeaderLatch leaderLatchInstance(String serverId, String zkRoot) { """ Create a new instance {@link LeaderLatch} @param serverId the ID used to register this instance with curator. This ID should typically be obtained using {@link org.apache.atlas.ha.AtlasServerIdSelector#selectServerId(Configuration)} @...
java
public LeaderLatch leaderLatchInstance(String serverId, String zkRoot) { return new LeaderLatch(curatorFramework, zkRoot+APACHE_ATLAS_LEADER_ELECTOR_PATH, serverId); }
[ "public", "LeaderLatch", "leaderLatchInstance", "(", "String", "serverId", ",", "String", "zkRoot", ")", "{", "return", "new", "LeaderLatch", "(", "curatorFramework", ",", "zkRoot", "+", "APACHE_ATLAS_LEADER_ELECTOR_PATH", ",", "serverId", ")", ";", "}" ]
Create a new instance {@link LeaderLatch} @param serverId the ID used to register this instance with curator. This ID should typically be obtained using {@link org.apache.atlas.ha.AtlasServerIdSelector#selectServerId(Configuration)} @param zkRoot the root znode under which the leader latch node is added. @return
[ "Create", "a", "new", "instance", "{" ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/service/CuratorFactory.java#L195-L197
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/kernelized/OSKL.java
OSKL.setR
public void setR(double R) { """ Sets the maximum allowed norm of the model. The original paper suggests values in the range 10<sup>x</sup> for <i>x</i> &isin; {0, 1, 2, 3, 4, 5}. @param R the maximum allowed norm for the model """ if(R <= 0 || Double.isNaN(R) || Double.isInfinite(R)) th...
java
public void setR(double R) { if(R <= 0 || Double.isNaN(R) || Double.isInfinite(R)) throw new IllegalArgumentException("R must be positive, not " + R); this.R = R; }
[ "public", "void", "setR", "(", "double", "R", ")", "{", "if", "(", "R", "<=", "0", "||", "Double", ".", "isNaN", "(", "R", ")", "||", "Double", ".", "isInfinite", "(", "R", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"R must be positiv...
Sets the maximum allowed norm of the model. The original paper suggests values in the range 10<sup>x</sup> for <i>x</i> &isin; {0, 1, 2, 3, 4, 5}. @param R the maximum allowed norm for the model
[ "Sets", "the", "maximum", "allowed", "norm", "of", "the", "model", ".", "The", "original", "paper", "suggests", "values", "in", "the", "range", "10<sup", ">", "x<", "/", "sup", ">", "for", "<i", ">", "x<", "/", "i", ">", "&isin", ";", "{", "0", "1"...
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/kernelized/OSKL.java#L228-L233
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfContentByte.java
PdfContentByte.setColorFill
public void setColorFill(PdfSpotColor sp, float tint) { """ Sets the fill color to a spot color. @param sp the spot color @param tint the tint for the spot color. 0 is no color and 1 is 100% color """ checkWriter(); state.colorDetails = writer.addSimple(sp); PageResources prs = getPa...
java
public void setColorFill(PdfSpotColor sp, float tint) { checkWriter(); state.colorDetails = writer.addSimple(sp); PageResources prs = getPageResources(); PdfName name = state.colorDetails.getColorName(); name = prs.addColor(name, state.colorDetails.getIndirectReference()); ...
[ "public", "void", "setColorFill", "(", "PdfSpotColor", "sp", ",", "float", "tint", ")", "{", "checkWriter", "(", ")", ";", "state", ".", "colorDetails", "=", "writer", ".", "addSimple", "(", "sp", ")", ";", "PageResources", "prs", "=", "getPageResources", ...
Sets the fill color to a spot color. @param sp the spot color @param tint the tint for the spot color. 0 is no color and 1 is 100% color
[ "Sets", "the", "fill", "color", "to", "a", "spot", "color", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2268-L2275
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/ServerInstanceLogRecordListImpl.java
ServerInstanceLogRecordListImpl.getNewIterator
protected Iterator<RepositoryLogRecord> getNewIterator(int offset, int length) { """ Creates new OnePidRecordIterator returning records in the range. @param offset the number of records skipped from the beginning of the list. @param length the number of records to return. @return OnePidRecordIterator instan...
java
protected Iterator<RepositoryLogRecord> getNewIterator(int offset, int length) { OnePidRecordListImpl logResult = getLogResult(); OnePidRecordListImpl traceResult = getTraceResult(); if (logResult == null && traceResult == null) { return EMPTY_ITERATOR; } else if (traceResult == null) { return logResult.g...
[ "protected", "Iterator", "<", "RepositoryLogRecord", ">", "getNewIterator", "(", "int", "offset", ",", "int", "length", ")", "{", "OnePidRecordListImpl", "logResult", "=", "getLogResult", "(", ")", ";", "OnePidRecordListImpl", "traceResult", "=", "getTraceResult", "...
Creates new OnePidRecordIterator returning records in the range. @param offset the number of records skipped from the beginning of the list. @param length the number of records to return. @return OnePidRecordIterator instance.
[ "Creates", "new", "OnePidRecordIterator", "returning", "records", "in", "the", "range", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/ServerInstanceLogRecordListImpl.java#L221-L235
samskivert/samskivert
src/main/java/com/samskivert/velocity/FormTool.java
FormTool.fixedTextarea
public String fixedTextarea (String name, String extra, Object value) { """ Construct a text area with the specified name, optional extra parameters and the specified text. """ StringBuilder buf = new StringBuilder(); buf.append("<textarea name=\"").append(name).append("\""); if (!Stri...
java
public String fixedTextarea (String name, String extra, Object value) { StringBuilder buf = new StringBuilder(); buf.append("<textarea name=\"").append(name).append("\""); if (!StringUtil.isBlank(extra)) { buf.append(" ").append(extra); } buf.append(">"); ...
[ "public", "String", "fixedTextarea", "(", "String", "name", ",", "String", "extra", ",", "Object", "value", ")", "{", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", ")", ";", "buf", ".", "append", "(", "\"<textarea name=\\\"\"", ")", ".", "append"...
Construct a text area with the specified name, optional extra parameters and the specified text.
[ "Construct", "a", "text", "area", "with", "the", "specified", "name", "optional", "extra", "parameters", "and", "the", "specified", "text", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L352-L365
vvakame/JsonPullParser
jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java
JsonUtil.putCharacterList
public static void putCharacterList(Writer writer, List<Character> values) throws IOException { """ Writes the given value with the given writer, sanitizing with {@link #sanitize(String)} as a valid JSON-formatted data. @param writer @param values @throws IOException @author vvakame """ if (values == nul...
java
public static void putCharacterList(Writer writer, List<Character> values) throws IOException { if (values == null) { writer.write("null"); } else { startArray(writer); for (int i = 0; i < values.size(); i++) { put(writer, values.get(i)); if (i != values.size() - 1) { addSeparator(writer); ...
[ "public", "static", "void", "putCharacterList", "(", "Writer", "writer", ",", "List", "<", "Character", ">", "values", ")", "throws", "IOException", "{", "if", "(", "values", "==", "null", ")", "{", "writer", ".", "write", "(", "\"null\"", ")", ";", "}",...
Writes the given value with the given writer, sanitizing with {@link #sanitize(String)} as a valid JSON-formatted data. @param writer @param values @throws IOException @author vvakame
[ "Writes", "the", "given", "value", "with", "the", "given", "writer", "sanitizing", "with", "{" ]
train
https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L212-L225
amaembo/streamex
src/main/java/one/util/streamex/StreamEx.java
StreamEx.ofSubLists
public static <T> StreamEx<List<T>> ofSubLists(List<T> source, int length, int shift) { """ Returns a new {@code StreamEx} which consists of possibly-overlapping sublists of given source list having the specified length with given shift value. <p> This method calls {@link List#subList(int, int)} internally, ...
java
public static <T> StreamEx<List<T>> ofSubLists(List<T> source, int length, int shift) { if (length <= 0) throw new IllegalArgumentException("length = " + length); if (shift <= 0) throw new IllegalArgumentException("shift = " + shift); if (source.isEmpty()) ret...
[ "public", "static", "<", "T", ">", "StreamEx", "<", "List", "<", "T", ">", ">", "ofSubLists", "(", "List", "<", "T", ">", "source", ",", "int", "length", ",", "int", "shift", ")", "{", "if", "(", "length", "<=", "0", ")", "throw", "new", "Illegal...
Returns a new {@code StreamEx} which consists of possibly-overlapping sublists of given source list having the specified length with given shift value. <p> This method calls {@link List#subList(int, int)} internally, so source list must have it properly implemented as well as provide fast random access. <p> The shift...
[ "Returns", "a", "new", "{", "@code", "StreamEx", "}", "which", "consists", "of", "possibly", "-", "overlapping", "sublists", "of", "given", "source", "list", "having", "the", "specified", "length", "with", "given", "shift", "value", "." ]
train
https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L3054-L3062
SUSE/salt-netapi-client
src/main/java/com/suse/salt/netapi/calls/modules/File.java
File.mkdir
public static LocalCall<String> mkdir(String path, String mode) { """ Ensures that a directory is available @param path Path to directory @param mode Mode for the newly created directory @return The {@link LocalCall} object to make the call """ return mkdir(path, Optional.empty(), Optional....
java
public static LocalCall<String> mkdir(String path, String mode) { return mkdir(path, Optional.empty(), Optional.empty(), Optional.of(mode)); }
[ "public", "static", "LocalCall", "<", "String", ">", "mkdir", "(", "String", "path", ",", "String", "mode", ")", "{", "return", "mkdir", "(", "path", ",", "Optional", ".", "empty", "(", ")", ",", "Optional", ".", "empty", "(", ")", ",", "Optional", "...
Ensures that a directory is available @param path Path to directory @param mode Mode for the newly created directory @return The {@link LocalCall} object to make the call
[ "Ensures", "that", "a", "directory", "is", "available" ]
train
https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/calls/modules/File.java#L251-L253
jcuda/jcusparse
JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java
JCusparse.cusparseSgtsv
public static int cusparseSgtsv( cusparseHandle handle, int m, int n, Pointer dl, Pointer d, Pointer du, Pointer B, int ldb) { """ <pre> Description: Solution of tridiagonal linear system A * X = B, with multiple right-hand-sides. The...
java
public static int cusparseSgtsv( cusparseHandle handle, int m, int n, Pointer dl, Pointer d, Pointer du, Pointer B, int ldb) { return checkResult(cusparseSgtsvNative(handle, m, n, dl, d, du, B, ldb)); }
[ "public", "static", "int", "cusparseSgtsv", "(", "cusparseHandle", "handle", ",", "int", "m", ",", "int", "n", ",", "Pointer", "dl", ",", "Pointer", "d", ",", "Pointer", "du", ",", "Pointer", "B", ",", "int", "ldb", ")", "{", "return", "checkResult", "...
<pre> Description: Solution of tridiagonal linear system A * X = B, with multiple right-hand-sides. The coefficient matrix A is composed of lower (dl), main (d) and upper (du) diagonals, and the right-hand-sides B are overwritten with the solution X. These routine use pivoting. </pre>
[ "<pre", ">", "Description", ":", "Solution", "of", "tridiagonal", "linear", "system", "A", "*", "X", "=", "B", "with", "multiple", "right", "-", "hand", "-", "sides", ".", "The", "coefficient", "matrix", "A", "is", "composed", "of", "lower", "(", "dl", ...
train
https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L8017-L8028
carewebframework/carewebframework-vista
org.carewebframework.vista.api-parent/org.carewebframework.vista.api.core/src/main/java/org/carewebframework/vista/api/property/PropertyCollection.java
PropertyCollection.getValue
public String getValue(String name, String dflt) { """ Returns a string property value. @param name Property name. @param dflt Default value if a property value is not found. @return Property value or default value if property value not found. """ Property prop = getProperty(name); return ...
java
public String getValue(String name, String dflt) { Property prop = getProperty(name); return prop == null ? dflt : prop.getValue(); }
[ "public", "String", "getValue", "(", "String", "name", ",", "String", "dflt", ")", "{", "Property", "prop", "=", "getProperty", "(", "name", ")", ";", "return", "prop", "==", "null", "?", "dflt", ":", "prop", ".", "getValue", "(", ")", ";", "}" ]
Returns a string property value. @param name Property name. @param dflt Default value if a property value is not found. @return Property value or default value if property value not found.
[ "Returns", "a", "string", "property", "value", "." ]
train
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.core/src/main/java/org/carewebframework/vista/api/property/PropertyCollection.java#L177-L180
getsentry/sentry-java
sentry/src/main/java/io/sentry/jul/SentryHandler.java
SentryHandler.formatMessage
protected String formatMessage(String message, Object[] parameters) { """ Returns formatted Event message when provided the message template and parameters. @param message Message template body. @param parameters Array of parameters for the message. @return Formatted message. """ String formatted...
java
protected String formatMessage(String message, Object[] parameters) { String formatted; if (printfStyle) { formatted = String.format(message, parameters); } else { formatted = MessageFormat.format(message, parameters); } return formatted; }
[ "protected", "String", "formatMessage", "(", "String", "message", ",", "Object", "[", "]", "parameters", ")", "{", "String", "formatted", ";", "if", "(", "printfStyle", ")", "{", "formatted", "=", "String", ".", "format", "(", "message", ",", "parameters", ...
Returns formatted Event message when provided the message template and parameters. @param message Message template body. @param parameters Array of parameters for the message. @return Formatted message.
[ "Returns", "formatted", "Event", "message", "when", "provided", "the", "message", "template", "and", "parameters", "." ]
train
https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/jul/SentryHandler.java#L177-L185
Coveros/selenified
src/main/java/com/coveros/selenified/element/Element.java
Element.isNotPresentEnabledInput
private boolean isNotPresentEnabledInput(String action, String expected) { """ Determines if something is present, enabled, and an input. This returns true if all three are true, otherwise, it returns false @param action - what action is occurring @param expected - what is the expected result @return Boole...
java
private boolean isNotPresentEnabledInput(String action, String expected) { // wait for element to be present if (isNotPresent(action, expected, Element.CANT_TYPE)) { return true; } // wait for element to be enabled return isNotEnabled(action, expected, Element.CANT_TY...
[ "private", "boolean", "isNotPresentEnabledInput", "(", "String", "action", ",", "String", "expected", ")", "{", "// wait for element to be present", "if", "(", "isNotPresent", "(", "action", ",", "expected", ",", "Element", ".", "CANT_TYPE", ")", ")", "{", "return...
Determines if something is present, enabled, and an input. This returns true if all three are true, otherwise, it returns false @param action - what action is occurring @param expected - what is the expected result @return Boolean: is the element present, enabled, and an input?
[ "Determines", "if", "something", "is", "present", "enabled", "and", "an", "input", ".", "This", "returns", "true", "if", "all", "three", "are", "true", "otherwise", "it", "returns", "false" ]
train
https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L715-L722
livetribe/livetribe-slp
core/src/main/java/org/livetribe/slp/Attributes.java
Attributes.unescapeTag
public static String unescapeTag(String escapedTag) { """ Unescapes the given escaped tag following RFC 2608, 5.0. For example, the escaped tag string <code>file\5fpath</code> will be converted into <code>file_path</code>. @param escapedTag the tag string to unescape @return the unescaped tag @throws Servic...
java
public static String unescapeTag(String escapedTag) { // Check that the escaped tag does not contain reserved characters checkEscaped(escapedTag, Tag.reservedChars, false); // Unescape the tag return unescape(escapedTag, Tag.reservedChars); }
[ "public", "static", "String", "unescapeTag", "(", "String", "escapedTag", ")", "{", "// Check that the escaped tag does not contain reserved characters", "checkEscaped", "(", "escapedTag", ",", "Tag", ".", "reservedChars", ",", "false", ")", ";", "// Unescape the tag", "r...
Unescapes the given escaped tag following RFC 2608, 5.0. For example, the escaped tag string <code>file\5fpath</code> will be converted into <code>file_path</code>. @param escapedTag the tag string to unescape @return the unescaped tag @throws ServiceLocationException if the escaping is wrong @see #escapeTag(String)
[ "Unescapes", "the", "given", "escaped", "tag", "following", "RFC", "2608", "5", ".", "0", ".", "For", "example", "the", "escaped", "tag", "string", "<code", ">", "file", "\\", "5fpath<", "/", "code", ">", "will", "be", "converted", "into", "<code", ">", ...
train
https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/Attributes.java#L285-L291
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/RealexHpp.java
RealexHpp.responseFromJson
public HppResponse responseFromJson(String json, boolean encoded) { """ <p> Method produces <code>HppResponse</code> object from JSON. Carries out the following actions: <ul> <li>Deserialises JSON to response object</li> <li>Decodes Base64 inputs</li> <li>Validates hash</li> </ul> </p> @param json @par...
java
public HppResponse responseFromJson(String json, boolean encoded) { LOGGER.info("Converting JSON to HppResponse."); //convert to HppResponse from JSON HppResponse hppResponse = JsonUtils.fromJsonHppResponse(json); //decode if necessary if (encoded) { LOGGER.debug("Decoding object."); try { hppRes...
[ "public", "HppResponse", "responseFromJson", "(", "String", "json", ",", "boolean", "encoded", ")", "{", "LOGGER", ".", "info", "(", "\"Converting JSON to HppResponse.\"", ")", ";", "//convert to HppResponse from JSON", "HppResponse", "hppResponse", "=", "JsonUtils", "....
<p> Method produces <code>HppResponse</code> object from JSON. Carries out the following actions: <ul> <li>Deserialises JSON to response object</li> <li>Decodes Base64 inputs</li> <li>Validates hash</li> </ul> </p> @param json @param encoded <code>true</code> if the JSON values have been encoded. @return HppRequest
[ "<p", ">", "Method", "produces", "<code", ">", "HppResponse<", "/", "code", ">", "object", "from", "JSON", ".", "Carries", "out", "the", "following", "actions", ":", "<ul", ">", "<li", ">", "Deserialises", "JSON", "to", "response", "object<", "/", "li", ...
train
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/RealexHpp.java#L263-L286
dain/leveldb
leveldb/src/main/java/org/iq80/leveldb/util/Slice.java
Slice.getBytes
public void getBytes(int index, OutputStream out, int length) throws IOException { """ Transfers this buffer's data to the specified stream starting at the specified absolute {@code index}. @param length the number of bytes to transfer @throws IndexOutOfBoundsException if the specified {@code inde...
java
public void getBytes(int index, OutputStream out, int length) throws IOException { checkPositionIndexes(index, index + length, this.length); index += offset; out.write(data, index, length); }
[ "public", "void", "getBytes", "(", "int", "index", ",", "OutputStream", "out", ",", "int", "length", ")", "throws", "IOException", "{", "checkPositionIndexes", "(", "index", ",", "index", "+", "length", ",", "this", ".", "length", ")", ";", "index", "+=", ...
Transfers this buffer's data to the specified stream starting at the specified absolute {@code index}. @param length the number of bytes to transfer @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or if {@code index + length} is greater than {@code this.capacity} @throws java.io...
[ "Transfers", "this", "buffer", "s", "data", "to", "the", "specified", "stream", "starting", "at", "the", "specified", "absolute", "{", "@code", "index", "}", "." ]
train
https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L259-L265
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java
GVRShadowMap.setOrthoShadowMatrix
void setOrthoShadowMatrix(Matrix4f modelMtx, GVRLight light) { """ Sets the direct light shadow matrix for the light from the input model/view matrix and the shadow camera projection matrix. @param modelMtx light model transform (to world coordinates) @param light direct light component to update """ ...
java
void setOrthoShadowMatrix(Matrix4f modelMtx, GVRLight light) { GVROrthogonalCamera camera = (GVROrthogonalCamera) getCamera(); if (camera == null) { return; } float w = camera.getRightClippingDistance() - camera.getLeftClippingDistance(); float h = camera...
[ "void", "setOrthoShadowMatrix", "(", "Matrix4f", "modelMtx", ",", "GVRLight", "light", ")", "{", "GVROrthogonalCamera", "camera", "=", "(", "GVROrthogonalCamera", ")", "getCamera", "(", ")", ";", "if", "(", "camera", "==", "null", ")", "{", "return", ";", "}...
Sets the direct light shadow matrix for the light from the input model/view matrix and the shadow camera projection matrix. @param modelMtx light model transform (to world coordinates) @param light direct light component to update
[ "Sets", "the", "direct", "light", "shadow", "matrix", "for", "the", "light", "from", "the", "input", "model", "/", "view", "matrix", "and", "the", "shadow", "camera", "projection", "matrix", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java#L171-L198
GII/broccoli
broccoli-owls/src/main/java/com/hi3project/broccoli/bsdf/impl/owl/OWLValueObject.java
OWLValueObject.buildFromClasAndCollection
private static OWLValueObject buildFromClasAndCollection(OWLModel model, OWLURIClass uriClass, Collection collection) throws NotYetImplementedException, OWLTranslationException { """ Builds an instance @param model @param uriClass @param collection @return @throws NotYetImplementedException @throws OWLTransl...
java
private static OWLValueObject buildFromClasAndCollection(OWLModel model, OWLURIClass uriClass, Collection collection) throws NotYetImplementedException, OWLTranslationException { OWLList<OWLIndividual> owlList = ObjectOWLSTranslator.owlListFromOWLModel(model); Object[] collectionAsArray = colle...
[ "private", "static", "OWLValueObject", "buildFromClasAndCollection", "(", "OWLModel", "model", ",", "OWLURIClass", "uriClass", ",", "Collection", "collection", ")", "throws", "NotYetImplementedException", ",", "OWLTranslationException", "{", "OWLList", "<", "OWLIndividual",...
Builds an instance @param model @param uriClass @param collection @return @throws NotYetImplementedException @throws OWLTranslationException
[ "Builds", "an", "instance" ]
train
https://github.com/GII/broccoli/blob/a3033a90322cbcee4dc0f1719143b84b822bc4ba/broccoli-owls/src/main/java/com/hi3project/broccoli/bsdf/impl/owl/OWLValueObject.java#L276-L292
groves/yarrgs
src/main/java/com/bungleton/yarrgs/Yarrgs.java
Yarrgs.parseInMain
public static <T> T parseInMain (Class<T> argsType, String[] args) { """ Parses <code>args</code> into an instance of <code>argsType</code> using {@link Parsers#createFieldParserFactory()}. Calls <code>System.exit(1)</code> if the user supplied bad arguments after printing a reason to <code>System.err</code>. Th...
java
public static <T> T parseInMain (Class<T> argsType, String[] args) { return parseInMain(argsType, args, Parsers.createFieldParserFactory()); }
[ "public", "static", "<", "T", ">", "T", "parseInMain", "(", "Class", "<", "T", ">", "argsType", ",", "String", "[", "]", "args", ")", "{", "return", "parseInMain", "(", "argsType", ",", "args", ",", "Parsers", ".", "createFieldParserFactory", "(", ")", ...
Parses <code>args</code> into an instance of <code>argsType</code> using {@link Parsers#createFieldParserFactory()}. Calls <code>System.exit(1)</code> if the user supplied bad arguments after printing a reason to <code>System.err</code>. Thus, this is suitable to be called from a <code>main</code> method that's parsing...
[ "Parses", "<code", ">", "args<", "/", "code", ">", "into", "an", "instance", "of", "<code", ">", "argsType<", "/", "code", ">", "using", "{" ]
train
https://github.com/groves/yarrgs/blob/5599e82b63db56db3b0c2f7668d9a535cde456e1/src/main/java/com/bungleton/yarrgs/Yarrgs.java#L25-L28
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleIO.java
ParticleIO.saveEmitter
public static void saveEmitter(File file, ConfigurableEmitter emitter) throws IOException { """ Save a single emitter to the XML file @param file The file to save the emitter to @param emitter The emitter to store to the XML file @throws IOException Indicates a failure to write or encode the XML ""...
java
public static void saveEmitter(File file, ConfigurableEmitter emitter) throws IOException { saveEmitter(new FileOutputStream(file), emitter); }
[ "public", "static", "void", "saveEmitter", "(", "File", "file", ",", "ConfigurableEmitter", "emitter", ")", "throws", "IOException", "{", "saveEmitter", "(", "new", "FileOutputStream", "(", "file", ")", ",", "emitter", ")", ";", "}" ]
Save a single emitter to the XML file @param file The file to save the emitter to @param emitter The emitter to store to the XML file @throws IOException Indicates a failure to write or encode the XML
[ "Save", "a", "single", "emitter", "to", "the", "XML", "file" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleIO.java#L432-L435