repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java
GeometryMetadataDataSource.populate
public GeometryMetadata populate(long geoPackageId, String tableName, long geomId, GeometryEnvelope envelope) { GeometryMetadata metadata = new GeometryMetadata(); metadata.setGeoPackageId(geoPackageId); metadata.setTableName(tableName); metadata.setId(geomId); metadata.setMinX(...
java
public GeometryMetadata populate(long geoPackageId, String tableName, long geomId, GeometryEnvelope envelope) { GeometryMetadata metadata = new GeometryMetadata(); metadata.setGeoPackageId(geoPackageId); metadata.setTableName(tableName); metadata.setId(geomId); metadata.setMinX(...
[ "public", "GeometryMetadata", "populate", "(", "long", "geoPackageId", ",", "String", "tableName", ",", "long", "geomId", ",", "GeometryEnvelope", "envelope", ")", "{", "GeometryMetadata", "metadata", "=", "new", "GeometryMetadata", "(", ")", ";", "metadata", ".",...
Populate a new geometry metadata from an envelope @param geoPackageId GeoPackage id @param tableName table name @param geomId geometry id @param envelope geometry envelope @return geometry metadata
[ "Populate", "a", "new", "geometry", "metadata", "from", "an", "envelope" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java#L135-L154
test
Populates a GeometryMetadata object from the GeometryEnvelope.
Of course, here is the Java code you requested: ```java public GeometryMetadata populate(long geoPackageId, String tableName, long geomId, GeometryEnvelope envelope) { GeometryMetadata metadata = new GeometryMetadata(); metadata.setGeoPackageId(geoPackageId); metadata.setTableName(tableName); ...
zaproxy/zaproxy
src/org/parosproxy/paros/core/proxy/ProxyThread.java
ProxyThread.notifyConnectMessage
private void notifyConnectMessage(HttpMessage connectMessage) { for (ConnectRequestProxyListener listener : parentServer.getConnectRequestProxyListeners()) { try { listener.receivedConnectRequest(connectMessage); } catch (Exception e) { log.error("An ...
java
private void notifyConnectMessage(HttpMessage connectMessage) { for (ConnectRequestProxyListener listener : parentServer.getConnectRequestProxyListeners()) { try { listener.receivedConnectRequest(connectMessage); } catch (Exception e) { log.error("An ...
[ "private", "void", "notifyConnectMessage", "(", "HttpMessage", "connectMessage", ")", "{", "for", "(", "ConnectRequestProxyListener", "listener", ":", "parentServer", ".", "getConnectRequestProxyListeners", "(", ")", ")", "{", "try", "{", "listener", ".", "receivedCon...
Notifies the {@code ConnectRequestProxyListener}s that a HTTP CONNECT request was received from a client. @param connectMessage the HTTP CONNECT request received from a client
[ "Notifies", "the", "{", "@code", "ConnectRequestProxyListener", "}", "s", "that", "a", "HTTP", "CONNECT", "request", "was", "received", "from", "a", "client", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/proxy/ProxyThread.java#L357-L365
train
Notifies all connect request proxy listeners.
Of course, here is the Java code you requested: ```java private void notifyConnectMessage(HttpMessage connectMessage) { for (ConnectRequestProxyListener listener : parentServer.getConnectRequestProxyListeners()) { try { listener.receivedConnectRequest(connectMessage); ...
orientechnologies/orientdb
graphdb/src/main/java/com/orientechnologies/orient/graph/sql/OCommandExecutorSQLDeleteVertex.java
OCommandExecutorSQLDeleteVertex.execute
public Object execute(final Map<Object, Object> iArgs) { if (rid == null && query == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); if (!returning.equalsIgnoreCase("COUNT")) allDeletedRecords = new ArrayList<ORecord>(); txAlr...
java
public Object execute(final Map<Object, Object> iArgs) { if (rid == null && query == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); if (!returning.equalsIgnoreCase("COUNT")) allDeletedRecords = new ArrayList<ORecord>(); txAlr...
[ "public", "Object", "execute", "(", "final", "Map", "<", "Object", ",", "Object", ">", "iArgs", ")", "{", "if", "(", "rid", "==", "null", "&&", "query", "==", "null", ")", "throw", "new", "OCommandExecutionException", "(", "\"Cannot execute the command because...
Execute the command and return the ODocument object created.
[ "Execute", "the", "command", "and", "return", "the", "ODocument", "object", "created", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/orientechnologies/orient/graph/sql/OCommandExecutorSQLDeleteVertex.java#L180-L230
test
Executes the command.
Of course, here is the Java code you requested: ```java public Object execute(final Map<Object, Object> iArgs) { if (rid == null && query == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); if (!returning.equalsIgnoreCase("COUNT")) a...
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.security.feature/src/com/ibm/ws/webcontainer/security/feature/internal/FeatureWebSecurityConfigImpl.java
FeatureWebSecurityConfigImpl.getOverrideHttpAuthMethod
@Override public String getOverrideHttpAuthMethod() { WebAppSecurityConfig globalConfig = WebAppSecurityCollaboratorImpl.getGlobalWebAppSecurityConfig(); if (globalConfig != null) return WebAppSecurityCollaboratorImpl.getGlobalWebAppSecurityConfig().getOverrideHttpAuthMethod(); e...
java
@Override public String getOverrideHttpAuthMethod() { WebAppSecurityConfig globalConfig = WebAppSecurityCollaboratorImpl.getGlobalWebAppSecurityConfig(); if (globalConfig != null) return WebAppSecurityCollaboratorImpl.getGlobalWebAppSecurityConfig().getOverrideHttpAuthMethod(); e...
[ "@", "Override", "public", "String", "getOverrideHttpAuthMethod", "(", ")", "{", "WebAppSecurityConfig", "globalConfig", "=", "WebAppSecurityCollaboratorImpl", ".", "getGlobalWebAppSecurityConfig", "(", ")", ";", "if", "(", "globalConfig", "!=", "null", ")", "return", ...
{@inheritDoc}
[ "{" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security.feature/src/com/ibm/ws/webcontainer/security/feature/internal/FeatureWebSecurityConfigImpl.java#L374-L381
train
Gets the override HTTP auth method.
Of course, here is the Java code you requested: ```java @Override public String getOverrideHttpAuthMethod() { WebAppSecurityConfig globalConfig = WebAppSecurityCollaboratorImpl.getGlobalWebAppSecurityConfig(); if (globalConfig != null) return WebAppSecurityCollaboratorImpl.getGlobalWebA...
finmath/finmath-lib
src/main/java/net/finmath/montecarlo/interestrate/products/components/ProductCollection.java
ProductCollection.getValue
@Override public RandomVariable getValue(final double evaluationTime, final LIBORModelMonteCarloSimulationModel model) throws CalculationException { // Ignite asynchronous calculation if possible ArrayList< Future<RandomVariable> > results = new ArrayList< >(); for(final MonteCarloProduct product : products) { ...
java
@Override public RandomVariable getValue(final double evaluationTime, final LIBORModelMonteCarloSimulationModel model) throws CalculationException { // Ignite asynchronous calculation if possible ArrayList< Future<RandomVariable> > results = new ArrayList< >(); for(final MonteCarloProduct product : products) { ...
[ "@", "Override", "public", "RandomVariable", "getValue", "(", "final", "double", "evaluationTime", ",", "final", "LIBORModelMonteCarloSimulationModel", "model", ")", "throws", "CalculationException", "{", "// Ignite asynchronous calculation if possible", "ArrayList", "<", "Fu...
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time. Cashflows prior evaluationTime...
[ "This", "method", "returns", "the", "value", "random", "variable", "of", "the", "product", "within", "the", "specified", "model", "evaluated", "at", "a", "given", "evalutationTime", ".", "Note", ":", "For", "a", "lattice", "this", "is", "often", "the", "valu...
a3c067d52dd33feb97d851df6cab130e4116759f
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/components/ProductCollection.java#L97-L143
train
This method returns the value of the CRA.
Of course, here is the Java code you requested: ```java @Override public RandomVariable getValue(final double evaluationTime, final LIBORModelMonteCarloSimulationModel model) throws CalculationException { // Ignite asynchronous calculation if possible ArrayList< Future<RandomVariable> > results = new ArrayList< ...
JakeWharton/NineOldAndroids
library/src/com/nineoldandroids/animation/AnimatorSet.java
AnimatorSet.setDuration
@Override public AnimatorSet setDuration(long duration) { if (duration < 0) { throw new IllegalArgumentException("duration must be a value of zero or greater"); } for (Node node : mNodes) { // TODO: don't set the duration of the timing-only nodes created by AnimatorSe...
java
@Override public AnimatorSet setDuration(long duration) { if (duration < 0) { throw new IllegalArgumentException("duration must be a value of zero or greater"); } for (Node node : mNodes) { // TODO: don't set the duration of the timing-only nodes created by AnimatorSe...
[ "@", "Override", "public", "AnimatorSet", "setDuration", "(", "long", "duration", ")", "{", "if", "(", "duration", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"duration must be a value of zero or greater\"", ")", ";", "}", "for", "(", ...
Sets the length of each of the current child animations of this AnimatorSet. By default, each child animation will use its own duration. If the duration is set on the AnimatorSet, then each child animation inherits this duration. @param duration The length of the animation, in milliseconds, of each of the child animat...
[ "Sets", "the", "length", "of", "each", "of", "the", "current", "child", "animations", "of", "this", "AnimatorSet", ".", "By", "default", "each", "child", "animation", "will", "use", "its", "own", "duration", ".", "If", "the", "duration", "is", "set", "on",...
d582f0ec8e79013e9fa96c07986160b52e662e63
https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/AnimatorSet.java#L413-L425
train
Sets the duration of the animation.
Of course, here is the Java code you requested: ```java @Override public AnimatorSet setDuration(long duration) { if (duration < 0) { throw new IllegalArgumentException("duration must be a value of zero or greater"); } for (Node node : mNodes) { // TODO: don't set th...
FINRAOS/DataGenerator
dg-core/src/main/java/org/finra/datagenerator/writer/XmlWriter.java
XmlWriter.appendXmlStartTag
private String appendXmlStartTag(String value) { StringBuilder sb = new StringBuilder(); sb.append("<").append(value).append(">"); return sb.toString(); }
java
private String appendXmlStartTag(String value) { StringBuilder sb = new StringBuilder(); sb.append("<").append(value).append(">"); return sb.toString(); }
[ "private", "String", "appendXmlStartTag", "(", "String", "value", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"<\"", ")", ".", "append", "(", "value", ")", ".", "append", "(", "\">\"", ")", "...
Helper xml start tag writer @param value the output stream to use in writing
[ "Helper", "xml", "start", "tag", "writer" ]
1f69f949401cbed4db4f553c3eb8350832c4d45a
https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/writer/XmlWriter.java#L106-L111
train
Append XML start tag.
Of course, here is the Java code you requested: ```java private String appendXmlStartTag(String value) { StringBuilder sb = new StringBuilder(); sb.append("<").append(value).append(">"); return sb.toString(); } ``` Hope this helps!
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/MetadataStore.java
MetadataStore.createSegment
CompletableFuture<Void> createSegment(String segmentName, Collection<AttributeUpdate> attributes, Duration timeout) { long traceId = LoggerHelpers.traceEnterWithContext(log, traceObjectId, "createSegment", segmentName); long segmentId = this.connector.containerMetadata.getStreamSegmentId(segmentName, tr...
java
CompletableFuture<Void> createSegment(String segmentName, Collection<AttributeUpdate> attributes, Duration timeout) { long traceId = LoggerHelpers.traceEnterWithContext(log, traceObjectId, "createSegment", segmentName); long segmentId = this.connector.containerMetadata.getStreamSegmentId(segmentName, tr...
[ "CompletableFuture", "<", "Void", ">", "createSegment", "(", "String", "segmentName", ",", "Collection", "<", "AttributeUpdate", ">", "attributes", ",", "Duration", "timeout", ")", "{", "long", "traceId", "=", "LoggerHelpers", ".", "traceEnterWithContext", "(", "l...
Creates a new Segment with given name. @param segmentName The case-sensitive Segment Name. @param attributes The initial attributes for the StreamSegment, if any. @param timeout Timeout for the operation. @return A CompletableFuture that, when completed normally, will indicate the Segment has been created. If the...
[ "Creates", "a", "new", "Segment", "with", "given", "name", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/MetadataStore.java#L115-L130
train
Create a new Stream Segment.
Of course, here is the Java code you requested: ```java CompletableFuture<Void> createSegment(String segmentName, Collection<AttributeUpdate> attributes, Duration timeout) { long traceId = LoggerHelpers.traceEnterWithContext(log, traceObjectId, "createSegment", segmentName); long segmentId = this.conne...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiff.java
CoverageDataTiff.drawTile
public CoverageDataTiffImage drawTile(float[] pixelValues, int tileWidth, int tileHeight) { CoverageDataTiffImage image = createImage(tileWidth, tileHeight); for (int y = 0; y < tileHeight; y++) { for (int x = 0; x < tileWidth; x++) { ...
java
public CoverageDataTiffImage drawTile(float[] pixelValues, int tileWidth, int tileHeight) { CoverageDataTiffImage image = createImage(tileWidth, tileHeight); for (int y = 0; y < tileHeight; y++) { for (int x = 0; x < tileWidth; x++) { ...
[ "public", "CoverageDataTiffImage", "drawTile", "(", "float", "[", "]", "pixelValues", ",", "int", "tileWidth", ",", "int", "tileHeight", ")", "{", "CoverageDataTiffImage", "image", "=", "createImage", "(", "tileWidth", ",", "tileHeight", ")", ";", "for", "(", ...
Draw a coverage data image tile from the flat array of float pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + x @param pixelValues float pixel values of length tileWidth * tileHeight @param tileWidth tile width @param tileHeight tile height @return coverage data image tile
[ "Draw", "a", "coverage", "data", "image", "tile", "from", "the", "flat", "array", "of", "float", "pixel", "values", "of", "length", "tileWidth", "*", "tileHeight", "where", "each", "pixel", "is", "at", ":", "(", "y", "*", "tileWidth", ")", "+", "x" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataTiff.java#L210-L224
test
Draw a tile of pixels.
Of course, here is the Java code you requested: ```java public CoverageDataTiffImage drawTile(float[] pixelValues, int tileWidth, int tileHeight) { CoverageDataTiffImage image = createImage(tileWidth, tileHeight); for (int y = 0; y < tileHeight; y++) { ...
alkacon/opencms-core
src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java
CmsUpdateDBProjectId.fillUUIDSColumn
private void fillUUIDSColumn( CmsSetupDb dbCon, String tablename, String column, String newvalue, String oldid, String tempValue) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); if (dbCon.hasTableOrColumn(tablename...
java
private void fillUUIDSColumn( CmsSetupDb dbCon, String tablename, String column, String newvalue, String oldid, String tempValue) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); if (dbCon.hasTableOrColumn(tablename...
[ "private", "void", "fillUUIDSColumn", "(", "CmsSetupDb", "dbCon", ",", "String", "tablename", ",", "String", "column", ",", "String", "newvalue", ",", "String", "oldid", ",", "String", "tempValue", ")", "throws", "SQLException", "{", "System", ".", "out", ".",...
Updates the given table with the new UUID value.<p> @param dbCon the db connection interface @param tablename the table to update @param column the column to update @param newvalue the new value to insert @param oldid the old id to compare the old value to @param tempValue the old value in the temporary table @throws...
[ "Updates", "the", "given", "table", "with", "the", "new", "UUID", "value", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java#L584-L607
train
Fill UUIDS column.
Of course, here is the Java code you requested: ```java private void fillUUIDSColumn( CmsSetupDb dbCon, String tablename, String column, String newvalue, String oldid, String tempValue) throws SQLException { System.out.println(new Exception().getStackTrace()[0]....
datastax/java-driver
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/QueryBuilder.java
QueryBuilder.deleteFrom
@NonNull public static DeleteSelection deleteFrom(@Nullable String keyspace, @NonNull String table) { return deleteFrom( keyspace == null ? null : CqlIdentifier.fromCql(keyspace), CqlIdentifier.fromCql(table)); }
java
@NonNull public static DeleteSelection deleteFrom(@Nullable String keyspace, @NonNull String table) { return deleteFrom( keyspace == null ? null : CqlIdentifier.fromCql(keyspace), CqlIdentifier.fromCql(table)); }
[ "@", "NonNull", "public", "static", "DeleteSelection", "deleteFrom", "(", "@", "Nullable", "String", "keyspace", ",", "@", "NonNull", "String", "table", ")", "{", "return", "deleteFrom", "(", "keyspace", "==", "null", "?", "null", ":", "CqlIdentifier", ".", ...
Shortcut for {@link #deleteFrom(CqlIdentifier, CqlIdentifier) deleteFrom(CqlIdentifier.fromCql(keyspace), CqlIdentifier.fromCql(table))}
[ "Shortcut", "for", "{" ]
612a63f2525618e2020e86c9ad75ab37adba6132
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/QueryBuilder.java#L153-L157
train
Delete from.
Of course, here is the Java code you requested: ```java @NonNull public static DeleteSelection deleteFrom(@Nullable String keyspace, @NonNull String table) { return deleteFrom( keyspace == null ? null : CqlIdentifier.fromCql(keyspace), CqlIdentifier.fromCql(table)); } ``` Hope this helps!
reactor/reactor-core
reactor-core/src/main/java/reactor/core/publisher/Flux.java
Flux.singleOrEmpty
public final Mono<T> singleOrEmpty() { if (this instanceof Callable) { @SuppressWarnings("unchecked") Callable<T> thiz = (Callable<T>)this; return convertToMono(thiz); } return Mono.onAssembly(new MonoSingle<>(this, null, true)); }
java
public final Mono<T> singleOrEmpty() { if (this instanceof Callable) { @SuppressWarnings("unchecked") Callable<T> thiz = (Callable<T>)this; return convertToMono(thiz); } return Mono.onAssembly(new MonoSingle<>(this, null, true)); }
[ "public", "final", "Mono", "<", "T", ">", "singleOrEmpty", "(", ")", "{", "if", "(", "this", "instanceof", "Callable", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "Callable", "<", "T", ">", "thiz", "=", "(", "Callable", "<", "T", ">",...
Expect and emit a single item from this {@link Flux} source, and accept an empty source but signal an {@link IndexOutOfBoundsException} for a source with more than one element. <p> <img class="marble" src="doc-files/marbles/singleOrEmpty.svg" alt=""> @return a {@link Mono} with the expected single item, no item or an ...
[ "Expect", "and", "emit", "a", "single", "item", "from", "this", "{", "@link", "Flux", "}", "source", "and", "accept", "an", "empty", "source", "but", "signal", "an", "{", "@link", "IndexOutOfBoundsException", "}", "for", "a", "source", "with", "more", "tha...
df2eba4ab7d2393e1a942ce972c3307fbbd47ff9
https://github.com/reactor/reactor-core/blob/df2eba4ab7d2393e1a942ce972c3307fbbd47ff9/reactor-core/src/main/java/reactor/core/publisher/Flux.java#L7436-L7443
valid
Returns a Mono that emits only the single value of the source.
Of course, here is the Java code you requested: ```java public final Mono<T> singleOrEmpty() { if (this instanceof Callable) { @SuppressWarnings("unchecked") Callable<T> thiz = (Callable<T>)this; return convertToMono(thiz); } return Mono.onAssembly(new MonoSingle<>(this, null, true)); ...
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java
WikipediaTemplateInfo.getRevisionIdsNotContainingTemplateNames
public List<Integer> getRevisionIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{ return getFilteredRevisionIds(templateNames, false); }
java
public List<Integer> getRevisionIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{ return getFilteredRevisionIds(templateNames, false); }
[ "public", "List", "<", "Integer", ">", "getRevisionIdsNotContainingTemplateNames", "(", "List", "<", "String", ">", "templateNames", ")", "throws", "WikiApiException", "{", "return", "getFilteredRevisionIds", "(", "templateNames", ",", "false", ")", ";", "}" ]
Returns a list containing the ids of all revisions that do not contain a template the name of which equals any of the given Strings. @param templateNames the names of the template that we want to match @return A list with the ids of all revisions that do not contain any of the the specified templates @throws WikiApiEx...
[ "Returns", "a", "list", "containing", "the", "ids", "of", "all", "revisions", "that", "do", "not", "contain", "a", "template", "the", "name", "of", "which", "equals", "any", "of", "the", "given", "Strings", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1096-L1098
train
Returns a list of revision ids that are not contained in the given template names.
Of course, here is the Java code you requested: ```java public List<Integer> getRevisionIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{ return getFilteredRevisionIds(templateNames, false); } ``` Hope this helps!
jenkinsci/github-plugin
src/main/java/org/jenkinsci/plugins/github/config/GitHubTokenCredentialsCreator.java
GitHubTokenCredentialsCreator.createToken
public GHAuthorization createToken(@Nonnull String username, @Nonnull String password, @Nullable String apiUrl) throws IOException { GitHub gitHub = new GitHubBuilder() .withEndpoint(defaultIfBlank(apiUrl, GITHUB_URL))...
java
public GHAuthorization createToken(@Nonnull String username, @Nonnull String password, @Nullable String apiUrl) throws IOException { GitHub gitHub = new GitHubBuilder() .withEndpoint(defaultIfBlank(apiUrl, GITHUB_URL))...
[ "public", "GHAuthorization", "createToken", "(", "@", "Nonnull", "String", "username", ",", "@", "Nonnull", "String", "password", ",", "@", "Nullable", "String", "apiUrl", ")", "throws", "IOException", "{", "GitHub", "gitHub", "=", "new", "GitHubBuilder", "(", ...
Can be used to convert given login and password to GH personal token as more secured way to interact with api @param username gh login @param password gh password @param apiUrl gh api url. Can be null or empty to default @return personal token with requested scope @throws IOException when can't create token with gi...
[ "Can", "be", "used", "to", "convert", "given", "login", "and", "password", "to", "GH", "personal", "token", "as", "more", "secured", "way", "to", "interact", "with", "api" ]
4e05b9aeb488af5342c78f78aa3c55114e8d462a
https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/org/jenkinsci/plugins/github/config/GitHubTokenCredentialsCreator.java#L193-L206
train
Creates a token using the GitHub API.
Of course, here is the Java code you requested: ```java public GHAuthorization createToken(@Nonnull String username, @Nonnull String password, @Nullable String apiUrl) throws IOException { GitHub gitHub = new GitHubBuilder() ...
mcxiaoke/Android-Next
core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java
IOUtils.readStringFromAssets
public static String readStringFromAssets(Context context, String fileName) throws IOException { if (context == null || StringUtils.isEmpty(fileName)) { return null; } StringBuilder s = new StringBuilder(""); InputStreamReader in = new InputStreamReader(context.getReso...
java
public static String readStringFromAssets(Context context, String fileName) throws IOException { if (context == null || StringUtils.isEmpty(fileName)) { return null; } StringBuilder s = new StringBuilder(""); InputStreamReader in = new InputStreamReader(context.getReso...
[ "public", "static", "String", "readStringFromAssets", "(", "Context", "context", ",", "String", "fileName", ")", "throws", "IOException", "{", "if", "(", "context", "==", "null", "||", "StringUtils", ".", "isEmpty", "(", "fileName", ")", ")", "{", "return", ...
get an asset using ACCESS_STREAMING mode. This provides access to files that have been bundled with an application as assets -- that is, files placed in to the "assets" directory. @param context @param fileName The name of the asset to open. This name can be hierarchical. @return
[ "get", "an", "asset", "using", "ACCESS_STREAMING", "mode", ".", "This", "provides", "access", "to", "files", "that", "have", "been", "bundled", "with", "an", "application", "as", "assets", "--", "that", "is", "files", "placed", "in", "to", "the", "assets", ...
1bfdf99d0b81a849aa0fa6697c53ed673151ca39
https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L1062-L1075
train
Reads a string from the assets file.
Of course, here is the Java code you requested: ```java public static String readStringFromAssets(Context context, String fileName) throws IOException { if (context == null || StringUtils.isEmpty(fileName)) { return null; } StringBuilder s = new StringBuilder(""); Inp...
eclipse/xtext-extras
org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/impl/XAbstractWhileExpressionImpl.java
XAbstractWhileExpressionImpl.eUnset
@Override public void eUnset(int featureID) { switch (featureID) { case XbasePackage.XABSTRACT_WHILE_EXPRESSION__PREDICATE: setPredicate((XExpression)null); return; case XbasePackage.XABSTRACT_WHILE_EXPRESSION__BODY: setBody((XExpression)null); return; } super.eUnset(featureID); }
java
@Override public void eUnset(int featureID) { switch (featureID) { case XbasePackage.XABSTRACT_WHILE_EXPRESSION__PREDICATE: setPredicate((XExpression)null); return; case XbasePackage.XABSTRACT_WHILE_EXPRESSION__BODY: setBody((XExpression)null); return; } super.eUnset(featureID); }
[ "@", "Override", "public", "void", "eUnset", "(", "int", "featureID", ")", "{", "switch", "(", "featureID", ")", "{", "case", "XbasePackage", ".", "XABSTRACT_WHILE_EXPRESSION__PREDICATE", ":", "setPredicate", "(", "(", "XExpression", ")", "null", ")", ";", "re...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
451359541295323a29f5855e633f770cec02069a
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/impl/XAbstractWhileExpressionImpl.java#L236-L249
train
Override the eUnset method for the XABSTRACT_WHILE_EXPRESSION feature.
Of course, here is the Java code you requested: ```java @Override public void eUnset(int featureID) { switch (featureID) { case XbasePackage.XABSTRACT_WHILE_EXPRESSION__PREDICATE: setPredicate((XExpression)null); return; case XbasePackage.XABSTRACT_WHILE_EXPRESSION__BODY: setBody((XExpression)n...
Harium/keel
src/main/java/com/harium/keel/catalano/core/FloatPoint.java
FloatPoint.Add
public FloatPoint Add(FloatPoint point1, FloatPoint point2) { FloatPoint result = new FloatPoint(point1); result.Add(point2); return result; }
java
public FloatPoint Add(FloatPoint point1, FloatPoint point2) { FloatPoint result = new FloatPoint(point1); result.Add(point2); return result; }
[ "public", "FloatPoint", "Add", "(", "FloatPoint", "point1", ",", "FloatPoint", "point2", ")", "{", "FloatPoint", "result", "=", "new", "FloatPoint", "(", "point1", ")", ";", "result", ".", "Add", "(", "point2", ")", ";", "return", "result", ";", "}" ]
Adds values of two points. @param point1 FloatPoint. @param point2 FloatPoint. @return A new FloatPoint with the add operation.
[ "Adds", "values", "of", "two", "points", "." ]
0369ae674f9e664bccc5f9e161ae7e7a3b949a1e
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/FloatPoint.java#L137-L141
train
Add two FloatPoints.
Of course, here is the Java code you requested: ```java public FloatPoint Add(FloatPoint point1, FloatPoint point2) { FloatPoint result = new FloatPoint(point1); result.Add(point2); return result; } ``` Hope this helps!
zxing/zxing
core/src/main/java/com/google/zxing/common/GlobalHistogramBinarizer.java
GlobalHistogramBinarizer.getBlackRow
@Override public BitArray getBlackRow(int y, BitArray row) throws NotFoundException { LuminanceSource source = getLuminanceSource(); int width = source.getWidth(); if (row == null || row.getSize() < width) { row = new BitArray(width); } else { row.clear(); } initArrays(width); ...
java
@Override public BitArray getBlackRow(int y, BitArray row) throws NotFoundException { LuminanceSource source = getLuminanceSource(); int width = source.getWidth(); if (row == null || row.getSize() < width) { row = new BitArray(width); } else { row.clear(); } initArrays(width); ...
[ "@", "Override", "public", "BitArray", "getBlackRow", "(", "int", "y", ",", "BitArray", "row", ")", "throws", "NotFoundException", "{", "LuminanceSource", "source", "=", "getLuminanceSource", "(", ")", ";", "int", "width", "=", "source", ".", "getWidth", "(", ...
Applies simple sharpening to the row data to improve performance of the 1D Readers.
[ "Applies", "simple", "sharpening", "to", "the", "row", "data", "to", "improve", "performance", "of", "the", "1D", "Readers", "." ]
653ac2a3beb11481eff82e7d5f2bab8a745f7fac
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/common/GlobalHistogramBinarizer.java#L51-L90
train
Get the black row of the image.
Of course, here is the Java code you requested: ```java @Override public BitArray getBlackRow(int y, BitArray row) throws NotFoundException { LuminanceSource source = getLuminanceSource(); int width = source.getWidth(); if (row == null || row.getSize() < width) { row = new BitArray(width); } el...
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/XARminst.java
XARminst.recover
public Xid[] recover() throws XAResourceNotAvailableException, SystemException { if (tc.isEntryEnabled()) Tr.entry(tc, "recover", _XARes); Xid[] returnedXidArray = null; if (_XARes != null) { final int flags = (XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN); ...
java
public Xid[] recover() throws XAResourceNotAvailableException, SystemException { if (tc.isEntryEnabled()) Tr.entry(tc, "recover", _XARes); Xid[] returnedXidArray = null; if (_XARes != null) { final int flags = (XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN); ...
[ "public", "Xid", "[", "]", "recover", "(", ")", "throws", "XAResourceNotAvailableException", ",", "SystemException", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"recover\"", ",", "_XARes", ")", ";", "...
Drives xares.recover() @return An array of Xids returned by the resource
[ "Drives", "xares", ".", "recover", "()" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/XARminst.java#L78-L234
train
This method is called by the XAResourceImpl class to recover the Xid array from the XAResource.
Of course, here is the Java code you requested: ```java public Xid[] recover() throws XAResourceNotAvailableException, SystemException { if (tc.isEntryEnabled()) Tr.entry(tc, "recover", _XARes); Xid[] returnedXidArray = null; if (_XARes != null) { final int flags = (XA...
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ByteArrayPool.java
ByteArrayPool.returnByteArray
public static void returnByteArray(final byte[] b) { if (b==null) return; byte[][] pool = (byte[][])__pools.get(); for (int i=pool.length;i-->0;) { if (pool[i]==null) { pool[i]=b; return; } ...
java
public static void returnByteArray(final byte[] b) { if (b==null) return; byte[][] pool = (byte[][])__pools.get(); for (int i=pool.length;i-->0;) { if (pool[i]==null) { pool[i]=b; return; } ...
[ "public", "static", "void", "returnByteArray", "(", "final", "byte", "[", "]", "b", ")", "{", "if", "(", "b", "==", "null", ")", "return", ";", "byte", "[", "]", "[", "]", "pool", "=", "(", "byte", "[", "]", "[", "]", ")", "__pools", ".", "get"...
/* ------------------------------------------------------------
[ "/", "*", "------------------------------------------------------------" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteArrayPool.java#L81-L100
train
Return a byte array to the pool.
Of course, here is the Java code you requested: ```java public static void returnByteArray(final byte[] b) { if (b==null) return; byte[][] pool = (byte[][])__pools.get(); for (int i=pool.length;i-->0;) { if (pool[i]==null) { ...
js-lib-com/tiny-container
src/main/java/js/container/ApplicationScopeFactory.java
ApplicationScopeFactory.persistInstance
@Override public void persistInstance(InstanceKey instanceKey, Object instance) { // at this point managed class and instance are guaranteed to be non null instancesPool.put(instanceKey, instance); }
java
@Override public void persistInstance(InstanceKey instanceKey, Object instance) { // at this point managed class and instance are guaranteed to be non null instancesPool.put(instanceKey, instance); }
[ "@", "Override", "public", "void", "persistInstance", "(", "InstanceKey", "instanceKey", ",", "Object", "instance", ")", "{", "// at this point managed class and instance are guaranteed to be non null\r", "instancesPool", ".", "put", "(", "instanceKey", ",", "instance", ")"...
Persist instance bound to given managed instance key. This method simply uses provided <code>instanceKey</code> argument to add instance to {@link #instancesPool}. Both arguments should to be not null. @param instanceKey managed instance key, @param instance managed instance.
[ "Persist", "instance", "bound", "to", "given", "managed", "instance", "key", ".", "This", "method", "simply", "uses", "provided", "<code", ">", "instanceKey<", "/", "code", ">", "argument", "to", "add", "instance", "to", "{", "@link", "#instancesPool", "}", ...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/ApplicationScopeFactory.java#L46-L50
test
Persists an instance to the managed class.
Of course, here is the Java code you requested: ```java @Override public void persistInstance(InstanceKey instanceKey, Object instance) { // at this point managed class and instance are guaranteed to be non null instancesPool.put(instanceKey, instance); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/jsp/CmsJspTagDisplay.java
CmsJspTagDisplay.displayAction
public static void displayAction( CmsResource elementResource, I_CmsFormatterBean formatter, Map<String, String> settings, boolean editable, boolean canCreate, boolean canDelete, String creationSiteMap, String postCreateHandler, PageContext context...
java
public static void displayAction( CmsResource elementResource, I_CmsFormatterBean formatter, Map<String, String> settings, boolean editable, boolean canCreate, boolean canDelete, String creationSiteMap, String postCreateHandler, PageContext context...
[ "public", "static", "void", "displayAction", "(", "CmsResource", "elementResource", ",", "I_CmsFormatterBean", "formatter", ",", "Map", "<", "String", ",", "String", ">", "settings", ",", "boolean", "editable", ",", "boolean", "canCreate", ",", "boolean", "canDele...
Includes the formatter rendering the given element.<p> @param elementResource the element resource @param formatter the formatter configuration bean @param settings the element settings @param editable if editable @param canCreate if new resources may be created @param canDelete if the resource may be deleted @param c...
[ "Includes", "the", "formatter", "rendering", "the", "given", "element", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagDisplay.java#L245-L274
train
Display the AFI action.
Of course, here is the Java code you requested: ```java public static void displayAction( CmsResource elementResource, I_CmsFormatterBean formatter, Map<String, String> settings, boolean editable, boolean canCreate, boolean canDelete, String creationSiteMap, ...
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/ServerLock.java
ServerLock.obtainServerLock
public synchronized void obtainServerLock() { getServerLock(); // if the lock is null or is invalid, the server process is already running if (serverLock == null || !serverLock.isValid()) { serverLock = null; lockFileChannel = null; String lockFilePath = lo...
java
public synchronized void obtainServerLock() { getServerLock(); // if the lock is null or is invalid, the server process is already running if (serverLock == null || !serverLock.isValid()) { serverLock = null; lockFileChannel = null; String lockFilePath = lo...
[ "public", "synchronized", "void", "obtainServerLock", "(", ")", "{", "getServerLock", "(", ")", ";", "// if the lock is null or is invalid, the server process is already running", "if", "(", "serverLock", "==", "null", "||", "!", "serverLock", ".", "isValid", "(", ")", ...
Obtain the lock that will prevent other servers from starting using this directory/workarea. <P> This handles a single server running per JVM. Trying to run multiple servers or multiple instances of a same server within same JVM is not supported. @throws LaunchException exception thrown if there's a problem getting th...
[ "Obtain", "the", "lock", "that", "will", "prevent", "other", "servers", "from", "starting", "using", "this", "directory", "/", "workarea", ".", "<P", ">", "This", "handles", "a", "single", "server", "running", "per", "JVM", ".", "Trying", "to", "run", "mul...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/ServerLock.java#L263-L279
train
Obtain the server lock.
Of course, here is the Java code you requested: ```java public synchronized void obtainServerLock() { getServerLock(); // if the lock is null or is invalid, the server process is already running if (serverLock == null || !serverLock.isValid()) { serverLock = null; lock...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java
AfplibFactoryImpl.createDataObjectFontDescriptorCharRotFromString
public DataObjectFontDescriptorCharRot createDataObjectFontDescriptorCharRotFromString(EDataType eDataType, String initialValue) { DataObjectFontDescriptorCharRot result = DataObjectFontDescriptorCharRot.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is n...
java
public DataObjectFontDescriptorCharRot createDataObjectFontDescriptorCharRotFromString(EDataType eDataType, String initialValue) { DataObjectFontDescriptorCharRot result = DataObjectFontDescriptorCharRot.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is n...
[ "public", "DataObjectFontDescriptorCharRot", "createDataObjectFontDescriptorCharRotFromString", "(", "EDataType", "eDataType", ",", "String", "initialValue", ")", "{", "DataObjectFontDescriptorCharRot", "result", "=", "DataObjectFontDescriptorCharRot", ".", "get", "(", "initialVa...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L6188-L6192
train
Create a DataObjectFontDescriptorCharRot from a String.
Of course, here is the Java code you requested: ```java public DataObjectFontDescriptorCharRot createDataObjectFontDescriptorCharRotFromString(EDataType eDataType, String initialValue) { DataObjectFontDescriptorCharRot result = DataObjectFontDescriptorCharRot.get(initialValue); if (result == null) throw new Illega...
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/component/ResultsManager.java
ResultsManager.lookup
public ActionResult lookup(final ActionRequest actionRequest, final Object resultObject) { ActionResult actionResultHandler = null; // + read @RenderWith value on method { final ActionRuntime actionRuntime = actionRequest.getActionRuntime(); final Class<? extends ActionResult> actionResultClass = actionR...
java
public ActionResult lookup(final ActionRequest actionRequest, final Object resultObject) { ActionResult actionResultHandler = null; // + read @RenderWith value on method { final ActionRuntime actionRuntime = actionRequest.getActionRuntime(); final Class<? extends ActionResult> actionResultClass = actionR...
[ "public", "ActionResult", "lookup", "(", "final", "ActionRequest", "actionRequest", ",", "final", "Object", "resultObject", ")", "{", "ActionResult", "actionResultHandler", "=", "null", ";", "// + read @RenderWith value on method", "{", "final", "ActionRuntime", "actionRu...
Lookups for {@link jodd.madvoc.result.ActionResult action result handler} based on current {@link jodd.madvoc.ActionRequest action request} and action method result object.
[ "Lookups", "for", "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/ResultsManager.java#L126-L173
test
Lookup an action result handler.
Of course, here is the Java code you requested: ```java public ActionResult lookup(final ActionRequest actionRequest, final Object resultObject) { ActionResult actionResultHandler = null; // + read @RenderWith value on method { final ActionRuntime actionRuntime = actionRequest.getActionRuntime(); final ...
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.lastIndexOf
public int lastIndexOf(final char ch, int startIndex) { startIndex = (startIndex >= size ? size - 1 : startIndex); if (startIndex < 0) { return -1; } for (int i = startIndex; i >= 0; i--) { if (buffer[i] == ch) { return i; } } ...
java
public int lastIndexOf(final char ch, int startIndex) { startIndex = (startIndex >= size ? size - 1 : startIndex); if (startIndex < 0) { return -1; } for (int i = startIndex; i >= 0; i--) { if (buffer[i] == ch) { return i; } } ...
[ "public", "int", "lastIndexOf", "(", "final", "char", "ch", ",", "int", "startIndex", ")", "{", "startIndex", "=", "(", "startIndex", ">=", "size", "?", "size", "-", "1", ":", "startIndex", ")", ";", "if", "(", "startIndex", "<", "0", ")", "{", "retu...
Searches the string builder to find the last reference to the specified char. @param ch the character to find @param startIndex the index to start at, invalid index rounded to edge @return the last index of the character, or -1 if not found
[ "Searches", "the", "string", "builder", "to", "find", "the", "last", "reference", "to", "the", "specified", "char", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2541-L2552
train
Gets the last index of the specified character in the buffer.
Of course, here is the Java code you requested: ```java public int lastIndexOf(final char ch, int startIndex) { startIndex = (startIndex >= size ? size - 1 : startIndex); if (startIndex < 0) { return -1; } for (int i = startIndex; i >= 0; i--) { if (buffer[i] == ...
validator/validator
src/nu/validator/gnu/xml/aelfred2/XmlParser.java
XmlParser.parseNotationDecl
private void parseNotationDecl() throws Exception { String nname; ExternalIdentifiers ids; requireWhitespace(); nname = readNmtoken(true); // NE08 if (nname.indexOf(':') >= 0) { fatal("Illegal character(':') in notation name ", nname, null); } ...
java
private void parseNotationDecl() throws Exception { String nname; ExternalIdentifiers ids; requireWhitespace(); nname = readNmtoken(true); // NE08 if (nname.indexOf(':') >= 0) { fatal("Illegal character(':') in notation name ", nname, null); } ...
[ "private", "void", "parseNotationDecl", "(", ")", "throws", "Exception", "{", "String", "nname", ";", "ExternalIdentifiers", "ids", ";", "requireWhitespace", "(", ")", ";", "nname", "=", "readNmtoken", "(", "true", ")", ";", "// NE08", "if", "(", "nname", "....
Parse a notation declaration. <pre> [82] NotationDecl ::= '&lt;!NOTATION' S Name S (ExternalID | PublicID) S? '&gt;' [83] PublicID ::= 'PUBLIC' S PubidLiteral </pre> <P> NOTE: the '&lt;!NOTATION' has already been read.
[ "Parse", "a", "notation", "declaration", "." ]
c7b7f85b3a364df7d9944753fb5b2cd0ce642889
https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2437-L2457
train
Parses the notation declaration.
Of course, here is the Java code you requested: ```java private void parseNotationDecl() throws Exception { String nname; ExternalIdentifiers ids; requireWhitespace(); nname = readNmtoken(true); // NE08 if (nname.indexOf(':') >= 0) { fatal("Illegal character...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java
Ifc4PackageImpl.getIfcLibraryInformation
@Override public EClass getIfcLibraryInformation() { if (ifcLibraryInformationEClass == null) { ifcLibraryInformationEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(338); } return ifcLibraryInformationEClass; }
java
@Override public EClass getIfcLibraryInformation() { if (ifcLibraryInformationEClass == null) { ifcLibraryInformationEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(338); } return ifcLibraryInformationEClass; }
[ "@", "Override", "public", "EClass", "getIfcLibraryInformation", "(", ")", "{", "if", "(", "ifcLibraryInformationEClass", "==", "null", ")", "{", "ifcLibraryInformationEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackag...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java#L20652-L20659
train
Get the IfcLibraryInformationEClass for the interface.
Of course, here is the Java code you requested: ```java @Override public EClass getIfcLibraryInformation() { if (ifcLibraryInformationEClass == null) { ifcLibraryInformationEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(338); } return ifcLibrar...
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java
ExcelUtil.readBySax
public static void readBySax(File file, int sheetIndex, RowHandler rowHandler) { BufferedInputStream in = null; try { in = FileUtil.getInputStream(file); readBySax(in, sheetIndex, rowHandler); } finally { IoUtil.close(in); } }
java
public static void readBySax(File file, int sheetIndex, RowHandler rowHandler) { BufferedInputStream in = null; try { in = FileUtil.getInputStream(file); readBySax(in, sheetIndex, rowHandler); } finally { IoUtil.close(in); } }
[ "public", "static", "void", "readBySax", "(", "File", "file", ",", "int", "sheetIndex", ",", "RowHandler", "rowHandler", ")", "{", "BufferedInputStream", "in", "=", "null", ";", "try", "{", "in", "=", "FileUtil", ".", "getInputStream", "(", "file", ")", ";...
通过Sax方式读取Excel,同时支持03和07格式 @param file Excel文件 @param sheetIndex sheet序号 @param rowHandler 行处理器 @since 3.2.0
[ "通过Sax方式读取Excel,同时支持03和07格式" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L53-L61
train
Reads a sequence of bytes from a file using the specified sheet index and row handler.
Of course, here is the Java code you requested: ```java public static void readBySax(File file, int sheetIndex, RowHandler rowHandler) { BufferedInputStream in = null; try { in = FileUtil.getInputStream(file); readBySax(in, sheetIndex, rowHandler); } finally { IoUtil.close(in); } } ``` Hope ...
skuzzle/semantic-version
src/it/java/de/skuzzle/semantic/VersionRegEx.java
VersionRegEx.create
public static final VersionRegEx create(int major, int minor, int patch, String preRelease, String buildMetaData) { checkParams(major, minor, patch); require(preRelease != null, "preRelease is null"); require(buildMetaData != null, "buildMetaData is null"); if (!...
java
public static final VersionRegEx create(int major, int minor, int patch, String preRelease, String buildMetaData) { checkParams(major, minor, patch); require(preRelease != null, "preRelease is null"); require(buildMetaData != null, "buildMetaData is null"); if (!...
[ "public", "static", "final", "VersionRegEx", "create", "(", "int", "major", ",", "int", "minor", ",", "int", "patch", ",", "String", "preRelease", ",", "String", "buildMetaData", ")", "{", "checkParams", "(", "major", ",", "minor", ",", "patch", ")", ";", ...
Creates a new Version from the provided components. Neither value of {@code major, minor} or {@code patch} must be lower than 0 and at least one must be greater than zero. {@code preRelease} or {@code buildMetaData} may be the empty String. In this case, the created {@code Version} will have no pre release resp. build ...
[ "Creates", "a", "new", "Version", "from", "the", "provided", "components", ".", "Neither", "value", "of", "{", "@code", "major", "minor", "}", "or", "{", "@code", "patch", "}", "must", "be", "lower", "than", "0", "and", "at", "least", "one", "must", "b...
2ddb66fb80244cd7f67c77ed5f8072d1132ad933
https://github.com/skuzzle/semantic-version/blob/2ddb66fb80244cd7f67c77ed5f8072d1132ad933/src/it/java/de/skuzzle/semantic/VersionRegEx.java#L447-L462
train
Create a new VersionRegEx object.
Of course, here is the Java code you requested: ```java public static final VersionRegEx create(int major, int minor, int patch, String preRelease, String buildMetaData) { checkParams(major, minor, patch); require(preRelease != null, "preRelease is null"); require(buildM...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/vridparam.java
vridparam.update
public static base_response update(nitro_service client, vridparam resource) throws Exception { vridparam updateresource = new vridparam(); updateresource.sendtomaster = resource.sendtomaster; return updateresource.update_resource(client); }
java
public static base_response update(nitro_service client, vridparam resource) throws Exception { vridparam updateresource = new vridparam(); updateresource.sendtomaster = resource.sendtomaster; return updateresource.update_resource(client); }
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "vridparam", "resource", ")", "throws", "Exception", "{", "vridparam", "updateresource", "=", "new", "vridparam", "(", ")", ";", "updateresource", ".", "sendtomaster", "=", "resour...
Use this API to update vridparam.
[ "Use", "this", "API", "to", "update", "vridparam", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/vridparam.java#L94-L98
train
Use this API to update vridparam.
Of course, here is the Java code you requested: ```java public static base_response update(nitro_service client, vridparam resource) throws Exception { vridparam updateresource = new vridparam(); updateresource.sendtomaster = resource.sendtomaster; return updateresource.update_resource(client); } ``` Hope this...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/NameConstraintsExtension.java
NameConstraintsExtension.set
public void set(String name, Object obj) throws IOException { if (name.equalsIgnoreCase(PERMITTED_SUBTREES)) { if (!(obj instanceof GeneralSubtrees)) { throw new IOException("Attribute value should be" + " of type GeneralSubtrees."); } ...
java
public void set(String name, Object obj) throws IOException { if (name.equalsIgnoreCase(PERMITTED_SUBTREES)) { if (!(obj instanceof GeneralSubtrees)) { throw new IOException("Attribute value should be" + " of type GeneralSubtrees."); } ...
[ "public", "void", "set", "(", "String", "name", ",", "Object", "obj", ")", "throws", "IOException", "{", "if", "(", "name", ".", "equalsIgnoreCase", "(", "PERMITTED_SUBTREES", ")", ")", "{", "if", "(", "!", "(", "obj", "instanceof", "GeneralSubtrees", ")",...
Set the attribute value.
[ "Set", "the", "attribute", "value", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/NameConstraintsExtension.java#L245-L263
train
Set the value of the attribute.
Of course, here is the Java code you requested: ```java public void set(String name, Object obj) throws IOException { if (name.equalsIgnoreCase(PERMITTED_SUBTREES)) { if (!(obj instanceof GeneralSubtrees)) { throw new IOException("Attribute value should be" ...
adorsys/hbci4java-adorsys
src/main/java/org/kapott/hbci/manager/HBCIJobFactory.java
HBCIJobFactory.newJob
public static AbstractHBCIJob newJob(String jobname, HBCIPassportInternal passport) { log.debug("creating new job " + jobname); if (jobname == null || jobname.length() == 0) throw new InvalidArgumentException(HBCIUtils.getLocMsg("EXCMSG_EMPTY_JOBNAME")); AbstractHBCIJob ret = null;...
java
public static AbstractHBCIJob newJob(String jobname, HBCIPassportInternal passport) { log.debug("creating new job " + jobname); if (jobname == null || jobname.length() == 0) throw new InvalidArgumentException(HBCIUtils.getLocMsg("EXCMSG_EMPTY_JOBNAME")); AbstractHBCIJob ret = null;...
[ "public", "static", "AbstractHBCIJob", "newJob", "(", "String", "jobname", ",", "HBCIPassportInternal", "passport", ")", "{", "log", ".", "debug", "(", "\"creating new job \"", "+", "jobname", ")", ";", "if", "(", "jobname", "==", "null", "||", "jobname", ".",...
<p>Erzeugen eines neuen Highlevel-HBCI-Jobs. Diese Methode gibt ein neues Job-Objekt zurück. Dieses Objekt wird allerdings noch <em>nicht</em> zum HBCI-Dialog hinzugefügt. Statt dessen müssen erst alle zur Beschreibung des jeweiligen Jobs benötigten Parameter gesetzt werden. <p>Eine Beschreibung aller unterstützten Ges...
[ "<p", ">", "Erzeugen", "eines", "neuen", "Highlevel", "-", "HBCI", "-", "Jobs", ".", "Diese", "Methode", "gibt", "ein", "neues", "Job", "-", "Objekt", "zurück", ".", "Dieses", "Objekt", "wird", "allerdings", "noch", "<em", ">", "nicht<", "/", "em", ">", ...
5e24f7e429d6b555e1d993196b4cf1adda6433cf
https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIJobFactory.java#L28-L49
train
Create a new highlevel job.
Of course, here is the Java code you requested: ```java public static AbstractHBCIJob newJob(String jobname, HBCIPassportInternal passport) { log.debug("creating new job " + jobname); if (jobname == null || jobname.length() == 0) throw new InvalidArgumentException(HBCIUtils.getLocMsg("EXCM...
ihaolin/session
session-api/src/main/java/me/hao0/session/util/PropertiesReader.java
PropertiesReader.read
public static final Properties read(String classpath) throws IOException{ final URL url = Resources.getResource(classpath); final ByteSource byteSource = Resources.asByteSource(url); final Properties properties = new Properties(); InputStream inputStream = null; try { ...
java
public static final Properties read(String classpath) throws IOException{ final URL url = Resources.getResource(classpath); final ByteSource byteSource = Resources.asByteSource(url); final Properties properties = new Properties(); InputStream inputStream = null; try { ...
[ "public", "static", "final", "Properties", "read", "(", "String", "classpath", ")", "throws", "IOException", "{", "final", "URL", "url", "=", "Resources", ".", "getResource", "(", "classpath", ")", ";", "final", "ByteSource", "byteSource", "=", "Resources", "....
read properties from classpath @param classpath properties file classpath @return Properties object @throws java.io.IOException
[ "read", "properties", "from", "classpath" ]
322c3a9f47b305a39345135fa8163dd7e065b4f8
https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/util/PropertiesReader.java#L21-L41
train
Read a properties file from a classpath.
Of course, here is the Java code you requested: ```java public static final Properties read(String classpath) throws IOException{ final URL url = Resources.getResource(classpath); final ByteSource byteSource = Resources.asByteSource(url); final Properties properties = new Properties(); ...
apache/flink
flink-core/src/main/java/org/apache/flink/types/Either.java
Either.Left
public static <L, R> Either<L, R> Left(L value) { return new Left<L, R>(value); }
java
public static <L, R> Either<L, R> Left(L value) { return new Left<L, R>(value); }
[ "public", "static", "<", "L", ",", "R", ">", "Either", "<", "L", ",", "R", ">", "Left", "(", "L", "value", ")", "{", "return", "new", "Left", "<", "L", ",", "R", ">", "(", "value", ")", ";", "}" ]
Create a Left value of Either
[ "Create", "a", "Left", "value", "of", "Either" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Either.java#L44-L46
train
Create a Left instance.
Of course, here is the Java code you requested: ```java public static <L, R> Either<L, R> Left(L value) { return new Left<L, R>(value); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java
HttpOutboundServiceContextImpl.startEarlyRead
private VirtualConnection startEarlyRead(InterChannelCallback cb, boolean forceQueue) { // disallow rewrites once we start mixing the request and temp responses getLink().disallowRewrites(); setAppReadCallback(cb); // check for an existing final response if (headersParsed() && !...
java
private VirtualConnection startEarlyRead(InterChannelCallback cb, boolean forceQueue) { // disallow rewrites once we start mixing the request and temp responses getLink().disallowRewrites(); setAppReadCallback(cb); // check for an existing final response if (headersParsed() && !...
[ "private", "VirtualConnection", "startEarlyRead", "(", "InterChannelCallback", "cb", ",", "boolean", "forceQueue", ")", "{", "// disallow rewrites once we start mixing the request and temp responses", "getLink", "(", ")", ".", "disallowRewrites", "(", ")", ";", "setAppReadCal...
Common utility method to start the response read now, regardless of the request message state. @param cb - app side read callback @param forceQueue @return VirtualConnection - non null if the final response has already arrived
[ "Common", "utility", "method", "to", "start", "the", "response", "read", "now", "regardless", "of", "the", "request", "message", "state", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java#L544-L590
train
This method is called by the application channel when a read is early.
Of course, here is the Java code you requested: ```java private VirtualConnection startEarlyRead(InterChannelCallback cb, boolean forceQueue) { // disallow rewrites once we start mixing the request and temp responses getLink().disallowRewrites(); setAppReadCallback(cb); // check for an...
Hack23/cia
service.api/src/main/java/com/hack23/cia/service/api/action/kpi/ComplianceCheckResponse.java
ComplianceCheckResponse.setResourceTypeMap
public void setResourceTypeMap(final Map<ResourceType, List<RuleViolation>> resourceTypeMap) { this.resourceTypeMap = Collections.unmodifiableMap(MapUtils.emptyIfNull(resourceTypeMap)); }
java
public void setResourceTypeMap(final Map<ResourceType, List<RuleViolation>> resourceTypeMap) { this.resourceTypeMap = Collections.unmodifiableMap(MapUtils.emptyIfNull(resourceTypeMap)); }
[ "public", "void", "setResourceTypeMap", "(", "final", "Map", "<", "ResourceType", ",", "List", "<", "RuleViolation", ">", ">", "resourceTypeMap", ")", "{", "this", ".", "resourceTypeMap", "=", "Collections", ".", "unmodifiableMap", "(", "MapUtils", ".", "emptyIf...
Sets the resource type map. @param resourceTypeMap the new resource type map
[ "Sets", "the", "resource", "type", "map", "." ]
223312ca0eec74888a57a060de5b164f95a7785f
https://github.com/Hack23/cia/blob/223312ca0eec74888a57a060de5b164f95a7785f/service.api/src/main/java/com/hack23/cia/service/api/action/kpi/ComplianceCheckResponse.java#L112-L114
valid
Sets the resource type map.
Of course, here is the Java code you requested: ```java public void setResourceTypeMap(final Map<ResourceType, List<RuleViolation>> resourceTypeMap) { this.resourceTypeMap = Collections.unmodifiableMap(MapUtils.emptyIfNull(resourceTypeMap)); } ``` Hope this helps!
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/ie/crf/CRFClassifier.java
CRFClassifier.getJarClassifier
public static <IN extends CoreMap> CRFClassifier<IN> getJarClassifier(String resourceName, Properties props) { CRFClassifier<IN> crf = new CRFClassifier<IN>(); crf.loadJarClassifier(resourceName, props); return crf; }
java
public static <IN extends CoreMap> CRFClassifier<IN> getJarClassifier(String resourceName, Properties props) { CRFClassifier<IN> crf = new CRFClassifier<IN>(); crf.loadJarClassifier(resourceName, props); return crf; }
[ "public", "static", "<", "IN", "extends", "CoreMap", ">", "CRFClassifier", "<", "IN", ">", "getJarClassifier", "(", "String", "resourceName", ",", "Properties", "props", ")", "{", "CRFClassifier", "<", "IN", ">", "crf", "=", "new", "CRFClassifier", "<", "IN"...
Used to load a classifier stored as a resource inside a jar file. THIS FUNCTION WILL ONLY WORK IF THE CODE WAS LOADED FROM A JAR FILE WHICH HAS A SERIALIZED CLASSIFIER STORED INSIDE IT. @param resourceName Name of clasifier resource inside the jar file. @return A CRFClassifier stored in the jar file
[ "Used", "to", "load", "a", "classifier", "stored", "as", "a", "resource", "inside", "a", "jar", "file", ".", "THIS", "FUNCTION", "WILL", "ONLY", "WORK", "IF", "THE", "CODE", "WAS", "LOADED", "FROM", "A", "JAR", "FILE", "WHICH", "HAS", "A", "SERIALIZED", ...
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/CRFClassifier.java#L2327-L2331
train
Gets a CRFClassifier from a jar file.
Of course, here is the Java code you requested: ```java public static <IN extends CoreMap> CRFClassifier<IN> getJarClassifier(String resourceName, Properties props) { CRFClassifier<IN> crf = new CRFClassifier<IN>(); crf.loadJarClassifier(resourceName, props); return crf; } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/Captions.java
Captions.setCaptionSources
@Deprecated public void setCaptionSources(java.util.Collection<CaptionSource> captionSources) { if (captionSources == null) { this.captionSources = null; return; } this.captionSources = new com.amazonaws.internal.SdkInternalList<CaptionSource>(captionSources); }
java
@Deprecated public void setCaptionSources(java.util.Collection<CaptionSource> captionSources) { if (captionSources == null) { this.captionSources = null; return; } this.captionSources = new com.amazonaws.internal.SdkInternalList<CaptionSource>(captionSources); }
[ "@", "Deprecated", "public", "void", "setCaptionSources", "(", "java", ".", "util", ".", "Collection", "<", "CaptionSource", ">", "captionSources", ")", "{", "if", "(", "captionSources", "==", "null", ")", "{", "this", ".", "captionSources", "=", "null", ";"...
<p> Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave <code>CaptionSources</code> blank. </p> @param captionSources Source files for the input sidecar captions used during the transcoding process. To omit all sidecar captions, leave <code>CaptionSource...
[ "<p", ">", "Source", "files", "for", "the", "input", "sidecar", "captions", "used", "during", "the", "transcoding", "process", ".", "To", "omit", "all", "sidecar", "captions", "leave", "<code", ">", "CaptionSources<", "/", "code", ">", "blank", ".", "<", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/Captions.java#L298-L306
train
Sets the value of the captionSources property.
Of course, here is the Java code you requested: ```java @Deprecated public void setCaptionSources(java.util.Collection<CaptionSource> captionSources) { if (captionSources == null) { this.captionSources = null; return; } this.captionSources = new com.amazonaws.intern...
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipManagerDelegate.java
SipManagerDelegate.getSipApplicationSession
public MobicentsSipApplicationSession getSipApplicationSession(final SipApplicationSessionKey key, final boolean create) { if(logger.isDebugEnabled()) { logger.debug("getSipApplicationSession with key=" + key); } MobicentsSipApplicationSession sipApplicationSessionImpl = null; //first we check if the app ses...
java
public MobicentsSipApplicationSession getSipApplicationSession(final SipApplicationSessionKey key, final boolean create) { if(logger.isDebugEnabled()) { logger.debug("getSipApplicationSession with key=" + key); } MobicentsSipApplicationSession sipApplicationSessionImpl = null; //first we check if the app ses...
[ "public", "MobicentsSipApplicationSession", "getSipApplicationSession", "(", "final", "SipApplicationSessionKey", "key", ",", "final", "boolean", "create", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"ge...
Retrieve a sip application session from its key. If none exists, one can enforce the creation through the create parameter to true. @param key the key identifying the sip application session to retrieve @param create if set to true, if no session has been found one will be created @return the sip application session ma...
[ "Retrieve", "a", "sip", "application", "session", "from", "its", "key", ".", "If", "none", "exists", "one", "can", "enforce", "the", "creation", "through", "the", "create", "parameter", "to", "true", "." ]
fd7011d2803ab1d205b140768a760c8c69e0c997
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipManagerDelegate.java#L202-L229
train
Get the sip application session object for the given key.
Of course, here is the Java code you requested: ```java public MobicentsSipApplicationSession getSipApplicationSession(final SipApplicationSessionKey key, final boolean create) { if(logger.isDebugEnabled()) { logger.debug("getSipApplicationSession with key=" + key); } MobicentsSipApplicationSession sipApplica...
aws/aws-sdk-java
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/JmesPathCodeGenVisitor.java
JmesPathCodeGenVisitor.visit
@Override public String visit(final JmesPathFlatten flatten, final Void aVoid) throws InvalidTypeException { return "new JmesPathFlatten( " + flatten.getFlattenExpr() .accept(this, aVoid) + ")"; }
java
@Override public String visit(final JmesPathFlatten flatten, final Void aVoid) throws InvalidTypeException { return "new JmesPathFlatten( " + flatten.getFlattenExpr() .accept(this, aVoid) + ")"; }
[ "@", "Override", "public", "String", "visit", "(", "final", "JmesPathFlatten", "flatten", ",", "final", "Void", "aVoid", ")", "throws", "InvalidTypeException", "{", "return", "\"new JmesPathFlatten( \"", "+", "flatten", ".", "getFlattenExpr", "(", ")", ".", "accep...
Generates the code for a new JmesPathFlatten. @param flatten JmesPath flatten type @param aVoid void @return String that represents a call to the new flatten projection @throws InvalidTypeException
[ "Generates", "the", "code", "for", "a", "new", "JmesPathFlatten", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/JmesPathCodeGenVisitor.java#L97-L102
train
Generates the code for a new CRASS AZZILLAZY.
Of course, here is the Java code you requested: ```java @Override public String visit(final JmesPathFlatten flatten, final Void aVoid) throws InvalidTypeException { return "new JmesPathFlatten( " + flatten.getFlattenExpr() .accept(this, aVoid) + ")"; } ``` Hope this helps!
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/LoggingFactory.java
LoggingFactory.createLogger
public static Logger createLogger(final LoggerType type, final String consumerName) throws LoggingException { Logger log = new Logger(type, consumerName); if (consumerLoggingIndex.put(consumerName, log) != null) { throw ErrorFactory .createLoggingException(ErrorKeys.LOGGING_LOGGINGFACTORY_LOGGER_ALRE...
java
public static Logger createLogger(final LoggerType type, final String consumerName) throws LoggingException { Logger log = new Logger(type, consumerName); if (consumerLoggingIndex.put(consumerName, log) != null) { throw ErrorFactory .createLoggingException(ErrorKeys.LOGGING_LOGGINGFACTORY_LOGGER_ALRE...
[ "public", "static", "Logger", "createLogger", "(", "final", "LoggerType", "type", ",", "final", "String", "consumerName", ")", "throws", "LoggingException", "{", "Logger", "log", "=", "new", "Logger", "(", "type", ",", "consumerName", ")", ";", "if", "(", "c...
Creates a new Logger. @param consumerName Consumer Name @return The referenced Logger @throws LoggingException
[ "Creates", "a", "new", "Logger", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/LoggingFactory.java#L70-L82
train
Creates a new Logger instance.
Of course, here is the Java code you requested: ```java public static Logger createLogger(final LoggerType type, final String consumerName) throws LoggingException { Logger log = new Logger(type, consumerName); if (consumerLoggingIndex.put(consumerName, log) != null) { throw ErrorFactory .createLogg...
HanSolo/SteelSeries-Swing
src/main/java/eu/hansolo/steelseries/gauges/DisplayCircular.java
DisplayCircular.init
@Override public final AbstractGauge init(final int WIDTH, final int HEIGHT) { if (WIDTH <= 1 || HEIGHT <= 1) { return this; } // Create Background Image if (bImage != null) { bImage.flush(); } bImage = UTIL.createImage(WIDTH, WIDTH, Transpare...
java
@Override public final AbstractGauge init(final int WIDTH, final int HEIGHT) { if (WIDTH <= 1 || HEIGHT <= 1) { return this; } // Create Background Image if (bImage != null) { bImage.flush(); } bImage = UTIL.createImage(WIDTH, WIDTH, Transpare...
[ "@", "Override", "public", "final", "AbstractGauge", "init", "(", "final", "int", "WIDTH", ",", "final", "int", "HEIGHT", ")", "{", "if", "(", "WIDTH", "<=", "1", "||", "HEIGHT", "<=", "1", ")", "{", "return", "this", ";", "}", "// Create Background Imag...
<editor-fold defaultstate="collapsed" desc="Initialization">
[ "<editor", "-", "fold", "defaultstate", "=", "collapsed", "desc", "=", "Initialization", ">" ]
c2f7b45a477757ef21bbb6a1174ddedb2250ae57
https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/DisplayCircular.java#L87-L196
train
Initialize the AbstractGauge.
Of course, here is the Java code you requested: ```java @Override public final AbstractGauge init(final int WIDTH, final int HEIGHT) { if (WIDTH <= 1 || HEIGHT <= 1) { return this; } // Create Background Image if (bImage != null) { bImage.flush(); } ...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
SMTPAppenderBase.checkEntryConditions
public boolean checkEntryConditions() { if (!this.started) { addError("Attempting to append to a non-started appender: " + this.getName()); return false; } if (this.eventEvaluator == null) { addError("No EventEvaluator is set for appender [" + name + "]."); return fals...
java
public boolean checkEntryConditions() { if (!this.started) { addError("Attempting to append to a non-started appender: " + this.getName()); return false; } if (this.eventEvaluator == null) { addError("No EventEvaluator is set for appender [" + name + "]."); return fals...
[ "public", "boolean", "checkEntryConditions", "(", ")", "{", "if", "(", "!", "this", ".", "started", ")", "{", "addError", "(", "\"Attempting to append to a non-started appender: \"", "+", "this", ".", "getName", "(", ")", ")", ";", "return", "false", ";", "}",...
This method determines if there is a sense in attempting to append. <p> It checks whether there is a set output target and also if there is a set layout. If these checks fail, then the boolean value <code>false</code> is returned. @return true if appender is setup properly
[ "This", "method", "determines", "if", "there", "is", "a", "sense", "in", "attempting", "to", "append", ".", "<p", ">", "It", "checks", "whether", "there", "is", "a", "set", "output", "target", "and", "also", "if", "there", "is", "a", "set", "layout", "...
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java#L231-L250
test
Check the conditions for the entry.
Of course, here is the Java code you requested: ```java public boolean checkEntryConditions() { if (!this.started) { addError("Attempting to append to a non-started appender: " + this.getName()); return false; } if (this.eventEvaluator == null) { addError("No EventEvaluator...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/ContainerStream.java
ContainerStream.getIndexEntry
public IndexEntry getIndexEntry(int position) { long cPtr = VideoJNI.ContainerStream_getIndexEntry(swigCPtr, this, position); return (cPtr == 0) ? null : new IndexEntry(cPtr, false); }
java
public IndexEntry getIndexEntry(int position) { long cPtr = VideoJNI.ContainerStream_getIndexEntry(swigCPtr, this, position); return (cPtr == 0) ? null : new IndexEntry(cPtr, false); }
[ "public", "IndexEntry", "getIndexEntry", "(", "int", "position", ")", "{", "long", "cPtr", "=", "VideoJNI", ".", "ContainerStream_getIndexEntry", "(", "swigCPtr", ",", "this", ",", "position", ")", ";", "return", "(", "cPtr", "==", "0", ")", "?", "null", "...
Get the IndexEntry at the given position in this<br> Stream object's index.<br> <p><br> Not all ContainerFormat types maintain<br> Stream indexes, but if they do,<br> this method can return those entries.<br> </p><br> <p><br> Do not modify the Container this stream<br> is from between calls to this method and<br> #getN...
[ "Get", "the", "IndexEntry", "at", "the", "given", "position", "in", "this<br", ">", "Stream", "object", "s", "index", ".", "<br", ">", "<p", ">", "<br", ">", "Not", "all", "ContainerFormat", "types", "maintain<br", ">", "Stream", "indexes", "but", "if", ...
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/ContainerStream.java#L375-L378
test
Returns the index entry for the specified position.
Of course, here is the Java code you requested: ```java public IndexEntry getIndexEntry(int position) { long cPtr = VideoJNI.ContainerStream_getIndexEntry(swigCPtr, this, position); return (cPtr == 0) ? null : new IndexEntry(cPtr, false); } ``` Hope this helps!
Netflix/spectator
spectator-api/src/main/java/com/netflix/spectator/api/Functions.java
Functions.nameEquals
public static Predicate<Meter> nameEquals(String name) { Preconditions.checkNotNull(name, "name"); return m -> name.equals(m.id().name()); }
java
public static Predicate<Meter> nameEquals(String name) { Preconditions.checkNotNull(name, "name"); return m -> name.equals(m.id().name()); }
[ "public", "static", "Predicate", "<", "Meter", ">", "nameEquals", "(", "String", "name", ")", "{", "Preconditions", ".", "checkNotNull", "(", "name", ",", "\"name\"", ")", ";", "return", "m", "->", "name", ".", "equals", "(", "m", ".", "id", "(", ")", ...
Returns a predicate that matches if the {code}id.name(){code} value for the input meter is equal to {code}name{code}. Example of usage: <pre> long numberOfMatches = registry.stream().filter(Functions.nameEquals("foo")).count(); </pre> @param name The name to use for finding matching meter instances. Cannot be null. @...
[ "Returns", "a", "predicate", "that", "matches", "if", "the", "{", "code", "}", "id", ".", "name", "()", "{", "code", "}", "value", "for", "the", "input", "meter", "is", "equal", "to", "{", "code", "}", "name", "{", "code", "}", ".", "Example", "of"...
259318252770de3bad581b85adff187d8f2c6537
https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-api/src/main/java/com/netflix/spectator/api/Functions.java#L109-L112
train
Returns a predicate that returns true if the name of the meter is equal to the id of the meter.
Of course, here is the Java code you requested: ```java public static Predicate<Meter> nameEquals(String name) { Preconditions.checkNotNull(name, "name"); return m -> name.equals(m.id().name()); } ``` Hope this helps!
baratine/baratine
core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java
ByteCodeWriter.writeUTF8
public void writeUTF8(String value) throws IOException { writeUTF8(_bb, value); writeShort(_bb.size()); _os.write(_bb.getBuffer(), 0, _bb.size()); }
java
public void writeUTF8(String value) throws IOException { writeUTF8(_bb, value); writeShort(_bb.size()); _os.write(_bb.getBuffer(), 0, _bb.size()); }
[ "public", "void", "writeUTF8", "(", "String", "value", ")", "throws", "IOException", "{", "writeUTF8", "(", "_bb", ",", "value", ")", ";", "writeShort", "(", "_bb", ".", "size", "(", ")", ")", ";", "_os", ".", "write", "(", "_bb", ".", "getBuffer", "...
Writes UTF-8
[ "Writes", "UTF", "-", "8" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java#L187-L194
train
Write a UTF - 8 string to the output stream.
Of course, here is the Java code you requested: ```java public void writeUTF8(String value) throws IOException { writeUTF8(_bb, value); writeShort(_bb.size()); _os.write(_bb.getBuffer(), 0, _bb.size()); } ``` Hope this helps!
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java
TimeZone.getTimeZone
private static TimeZone getTimeZone(String id, int type, boolean frozen) { TimeZone result; if (type == TIMEZONE_JDK) { result = JavaTimeZone.createTimeZone(id); if (result != null) { return frozen ? result.freeze() : result; } result = get...
java
private static TimeZone getTimeZone(String id, int type, boolean frozen) { TimeZone result; if (type == TIMEZONE_JDK) { result = JavaTimeZone.createTimeZone(id); if (result != null) { return frozen ? result.freeze() : result; } result = get...
[ "private", "static", "TimeZone", "getTimeZone", "(", "String", "id", ",", "int", "type", ",", "boolean", "frozen", ")", "{", "TimeZone", "result", ";", "if", "(", "type", "==", "TIMEZONE_JDK", ")", "{", "result", "=", "JavaTimeZone", ".", "createTimeZone", ...
Gets the <code>TimeZone</code> for the given ID and the timezone type. @param id time zone ID @param type time zone implementation type, TIMEZONE_JDK or TIMEZONE_ICU @param frozen specify if the returned object can be frozen @return the specified <code>TimeZone</code> or UNKNOWN_ZONE if the given ID cannot be understoo...
[ "Gets", "the", "<code", ">", "TimeZone<", "/", "code", ">", "for", "the", "given", "ID", "and", "the", "timezone", "type", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java#L683-L699
train
Get the timezone for the given id.
Of course, here is the Java code you requested: ```java private static TimeZone getTimeZone(String id, int type, boolean frozen) { TimeZone result; if (type == TIMEZONE_JDK) { result = JavaTimeZone.createTimeZone(id); if (result != null) { return frozen ? result....
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.loadXMLSpecification
private GeneratorMain loadXMLSpecification() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); URL url = ClassLoader.getSystemResource(GENERATOR_SCHEMA_FILE); if(url != null) { ...
java
private GeneratorMain loadXMLSpecification() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); URL url = ClassLoader.getSystemResource(GENERATOR_SCHEMA_FILE); if(url != null) { ...
[ "private", "GeneratorMain", "loadXMLSpecification", "(", ")", "{", "try", "{", "DocumentBuilderFactory", "dbf", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "dbf", ".", "setFeature", "(", "\"http://apache.org/xml/features/nonvalidating/load-external-dtd...
Load the XML configuration file. @return Generator
[ "Load", "the", "XML", "configuration", "file", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L245-L286
train
Load the XML specification.
Of course, here is the Java code you requested: ```java private GeneratorMain loadXMLSpecification() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); URL url = ClassLoader.getSystemR...
innoq/LiQID
ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java
LdapHelper.findGroups
@Override public Set<Node> findGroups(final String cn) { QueryBuilder qb = new LdapQueryBuilder(); if ("*".equals(cn)) { qb.append(LdapKeys.OBJECT_CLASS, groupObjectClass); } else { qb.append(LdapKeys.OBJECT_CLASS, groupObjectClass); qb.append(groupIdentif...
java
@Override public Set<Node> findGroups(final String cn) { QueryBuilder qb = new LdapQueryBuilder(); if ("*".equals(cn)) { qb.append(LdapKeys.OBJECT_CLASS, groupObjectClass); } else { qb.append(LdapKeys.OBJECT_CLASS, groupObjectClass); qb.append(groupIdentif...
[ "@", "Override", "public", "Set", "<", "Node", ">", "findGroups", "(", "final", "String", "cn", ")", "{", "QueryBuilder", "qb", "=", "new", "LdapQueryBuilder", "(", ")", ";", "if", "(", "\"*\"", ".", "equals", "(", "cn", ")", ")", "{", "qb", ".", "...
Returns several LDAP-Groups for a given search-String. @param cn the cn (or part of cn) for the groups. @return Groups as a Set of Nodes.
[ "Returns", "several", "LDAP", "-", "Groups", "for", "a", "given", "search", "-", "String", "." ]
ae3de2c1fd78c40219780d510eba57c931901279
https://github.com/innoq/LiQID/blob/ae3de2c1fd78c40219780d510eba57c931901279/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapHelper.java#L399-L409
train
Find Groups.
Of course, here is the Java code you requested: ```java @Override public Set<Node> findGroups(final String cn) { QueryBuilder qb = new LdapQueryBuilder(); if ("*".equals(cn)) { qb.append(LdapKeys.OBJECT_CLASS, groupObjectClass); } else { qb.append(LdapKeys.OBJECT_CLA...
threerings/narya
core/src/main/java/com/threerings/bureau/data/AgentObject.java
AgentObject.setClientOid
@Generated(value={"com.threerings.presents.tools.GenDObjectTask"}) public void setClientOid (int value) { int ovalue = this.clientOid; requestAttributeChange( CLIENT_OID, Integer.valueOf(value), Integer.valueOf(ovalue)); this.clientOid = value; }
java
@Generated(value={"com.threerings.presents.tools.GenDObjectTask"}) public void setClientOid (int value) { int ovalue = this.clientOid; requestAttributeChange( CLIENT_OID, Integer.valueOf(value), Integer.valueOf(ovalue)); this.clientOid = value; }
[ "@", "Generated", "(", "value", "=", "{", "\"com.threerings.presents.tools.GenDObjectTask\"", "}", ")", "public", "void", "setClientOid", "(", "int", "value", ")", "{", "int", "ovalue", "=", "this", ".", "clientOid", ";", "requestAttributeChange", "(", "CLIENT_OID...
Requests that the <code>clientOid</code> field be set to the specified value. The local value will be updated immediately and an event will be propagated through the system to notify all listeners that the attribute did change. Proxied copies of this object (on clients) will apply the value change when they received th...
[ "Requests", "that", "the", "<code", ">", "clientOid<", "/", "code", ">", "field", "be", "set", "to", "the", "specified", "value", ".", "The", "local", "value", "will", "be", "updated", "immediately", "and", "an", "event", "will", "be", "propagated", "throu...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/data/AgentObject.java#L162-L169
train
Sets the value of the clientOid property.
Of course, here is the Java code you requested: ```java @Generated(value={"com.threerings.presents.tools.GenDObjectTask"}) public void setClientOid (int value) { int ovalue = this.clientOid; requestAttributeChange( CLIENT_OID, Integer.valueOf(value), Integer.valueOf(ovalue)); ...
ineunetOS/knife-commons
knife-commons-utils/src/main/java/com/ineunet/knife/util/CryptUtils.java
CryptUtils.decryptByDES
public static String decryptByDES(SecretKey key, String sInfo) { // 定义 加密算法, String algorithm = "DES"; // 加密随机数生成器 (RNG) SecureRandom sr = new SecureRandom(); byte[] cipherByte = null; try { // 得到加密/解密器 Cipher c1 = Cipher.getInstance(algorithm); // 用指定的密钥和模式初始化Cipher对象 c1.init(Cipher.DECRYPT_MOD...
java
public static String decryptByDES(SecretKey key, String sInfo) { // 定义 加密算法, String algorithm = "DES"; // 加密随机数生成器 (RNG) SecureRandom sr = new SecureRandom(); byte[] cipherByte = null; try { // 得到加密/解密器 Cipher c1 = Cipher.getInstance(algorithm); // 用指定的密钥和模式初始化Cipher对象 c1.init(Cipher.DECRYPT_MOD...
[ "public", "static", "String", "decryptByDES", "(", "SecretKey", "key", ",", "String", "sInfo", ")", "{", "// 定义 加密算法,", "String", "algorithm", "=", "\"DES\"", ";", "// 加密随机数生成器 (RNG)", "SecureRandom", "sr", "=", "new", "SecureRandom", "(", ")", ";", "byte", "[...
根据密匙进行DES解密 @param key 密匙 @param sInfo 要解密的密文 @return String 返回解密后信息
[ "根据密匙进行DES解密" ]
eae9e59afa020a00ae8977c10d43ac8ae46ae236
https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/CryptUtils.java#L144-L162
train
Decrypt by DES
Of course, here is the Java code you requested: ```java public static String decryptByDES(SecretKey key, String sInfo) { // 定义 加密算法, String algorithm = "DES"; // 加密随机数生成器 (RNG) SecureRandom sr = new SecureRandom(); byte[] cipherByte = null; try { // 得到加密/解密器 Cipher c1 = Cipher.getInstance(algorithm);...
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobsInner.java
JobsInner.stopAsync
public Observable<Void> stopAsync(String resourceGroupName, String automationAccountName, UUID jobId) { return stopWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> res...
java
public Observable<Void> stopAsync(String resourceGroupName, String automationAccountName, UUID jobId) { return stopWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> res...
[ "public", "Observable", "<", "Void", ">", "stopAsync", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "UUID", "jobId", ")", "{", "return", "stopWithServiceResponseAsync", "(", "resourceGroupName", ",", "automationAccountName", ",", "j...
Stop the job identified by jobId. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param jobId The job id. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceResponse} object if successful.
[ "Stop", "the", "job", "identified", "by", "jobId", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobsInner.java#L417-L424
train
Stops a job identified by jobId.
Of course, here is the Java code you requested: ```java public Observable<Void> stopAsync(String resourceGroupName, String automationAccountName, UUID jobId) { return stopWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId).map(new Func1<ServiceResponse<Void>, Void>() { @Overri...
guardtime/ksi-java-sdk
ksi-common/src/main/java/com/guardtime/ksi/util/BaseX.java
BaseX.addMinMax
private void addMinMax(String chars) { for (int i = 0; i < chars.length(); i++) { int c = chars.codePointAt(i); if (min == -1 || min > c) { min = c; } if (max == -1 || max < c) { max = c; } } }
java
private void addMinMax(String chars) { for (int i = 0; i < chars.length(); i++) { int c = chars.codePointAt(i); if (min == -1 || min > c) { min = c; } if (max == -1 || max < c) { max = c; } } }
[ "private", "void", "addMinMax", "(", "String", "chars", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "chars", ".", "length", "(", ")", ";", "i", "++", ")", "{", "int", "c", "=", "chars", ".", "codePointAt", "(", "i", ")", ";", "...
Updates {@code min} and {@code max} so that the range {@code min..max} includes all values from {@code chars}. @param chars the list of characters to process.
[ "Updates", "{", "@code", "min", "}", "and", "{", "@code", "max", "}", "so", "that", "the", "range", "{", "@code", "min", "..", "max", "}", "includes", "all", "values", "from", "{", "@code", "chars", "}", "." ]
b2cd877050f0f392657c724452318d10a1002171
https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/util/BaseX.java#L131-L141
train
Add the min and max values to the array of chars.
Of course, here is the Java code you requested: ```java private void addMinMax(String chars) { for (int i = 0; i < chars.length(); i++) { int c = chars.codePointAt(i); if (min == -1 || min > c) { min = c; } if (max == -1 || max < c) { ...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/basic/servicegroup.java
servicegroup.update
public static base_response update(nitro_service client, servicegroup resource) throws Exception { servicegroup updateresource = new servicegroup(); updateresource.servicegroupname = resource.servicegroupname; updateresource.servername = resource.servername; updateresource.port = resource.port; updateresource...
java
public static base_response update(nitro_service client, servicegroup resource) throws Exception { servicegroup updateresource = new servicegroup(); updateresource.servicegroupname = resource.servicegroupname; updateresource.servername = resource.servername; updateresource.port = resource.port; updateresource...
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "servicegroup", "resource", ")", "throws", "Exception", "{", "servicegroup", "updateresource", "=", "new", "servicegroup", "(", ")", ";", "updateresource", ".", "servicegroupname", "...
Use this API to update servicegroup.
[ "Use", "this", "API", "to", "update", "servicegroup", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/servicegroup.java#L1427-L1465
train
Use this API to update servicegroup.
Of course, here is the Java code you requested: ```java public static base_response update(nitro_service client, servicegroup resource) throws Exception { servicegroup updateresource = new servicegroup(); updateresource.servicegroupname = resource.servicegroupname; updateresource.servername = resource.servername...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/config/ConfigurationClient.java
ConfigurationClient.getAllConfigurations
public ConfigurationListing getAllConfigurations() { Configuration configuration = new Configuration(); if(this.serviceTicket != null) { configuration.setServiceTicket(this.serviceTicket); } return new ConfigurationListing(this.postJson( configur...
java
public ConfigurationListing getAllConfigurations() { Configuration configuration = new Configuration(); if(this.serviceTicket != null) { configuration.setServiceTicket(this.serviceTicket); } return new ConfigurationListing(this.postJson( configur...
[ "public", "ConfigurationListing", "getAllConfigurations", "(", ")", "{", "Configuration", "configuration", "=", "new", "Configuration", "(", ")", ";", "if", "(", "this", ".", "serviceTicket", "!=", "null", ")", "{", "configuration", ".", "setServiceTicket", "(", ...
Retrieves all Configurations. @return All the Configurations.
[ "Retrieves", "all", "Configurations", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/config/ConfigurationClient.java#L81-L92
test
Get all the configuration.
Of course, here is the Java code you requested: ```java public ConfigurationListing getAllConfigurations() { Configuration configuration = new Configuration(); if(this.serviceTicket != null) { configuration.setServiceTicket(this.serviceTicket); } return new Con...
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createPlz
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "plz") public JAXBElement<String> createPlz(String value) { return new JAXBElement<String>(_Plz_QNAME, String.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "plz") public JAXBElement<String> createPlz(String value) { return new JAXBElement<String>(_Plz_QNAME, String.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"plz\"", ")", "public", "JAXBElement", "<", "String", ">", "createPlz", "(", "String", "value", ")", "{", "return", "new", "JAXBElement", "<", "String", ">", "(", ...
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "String", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L819-L822
test
Create an instance of a PLZ element.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "plz") public JAXBElement<String> createPlz(String value) { return new JAXBElement<String>(_Plz_QNAME, String.class, null, value); } ``` Hope this helps!
shrinkwrap/descriptors
spi/src/main/java/org/jboss/shrinkwrap/descriptor/spi/node/NodeDescriptorImporterBase.java
NodeDescriptorImporterBase.fromStream
@Override public T fromStream(final InputStream in, final boolean close) throws IllegalArgumentException, DescriptorImportException { // Precondition check if (in == null) { throw new IllegalArgumentException("InputStream must be specified"); } final Node rootNod...
java
@Override public T fromStream(final InputStream in, final boolean close) throws IllegalArgumentException, DescriptorImportException { // Precondition check if (in == null) { throw new IllegalArgumentException("InputStream must be specified"); } final Node rootNod...
[ "@", "Override", "public", "T", "fromStream", "(", "final", "InputStream", "in", ",", "final", "boolean", "close", ")", "throws", "IllegalArgumentException", ",", "DescriptorImportException", "{", "// Precondition check", "if", "(", "in", "==", "null", ")", "{", ...
{@inheritDoc} @see org.jboss.shrinkwrap.descriptor.api.DescriptorImporter#fromStream(java.io.InputStream)
[ "{", "@inheritDoc", "}" ]
023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba
https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/spi/src/main/java/org/jboss/shrinkwrap/descriptor/spi/node/NodeDescriptorImporterBase.java#L62-L91
train
Create an end - user view from an input stream.
Of course, here is the Java code you requested: ```java @Override public T fromStream(final InputStream in, final boolean close) throws IllegalArgumentException, DescriptorImportException { // Precondition check if (in == null) { throw new IllegalArgumentException("InputStream m...
yoojia/NextInputs-Android
inputs/src/main/java/com/github/yoojia/inputs/ValueScheme.java
ValueScheme.rangeValue
public static Scheme rangeValue(final Integer fixedMinValue, final Integer fixedMaxValue) { return rangeValue(fixedMinValue.doubleValue(), fixedMaxValue.doubleValue()); }
java
public static Scheme rangeValue(final Integer fixedMinValue, final Integer fixedMaxValue) { return rangeValue(fixedMinValue.doubleValue(), fixedMaxValue.doubleValue()); }
[ "public", "static", "Scheme", "rangeValue", "(", "final", "Integer", "fixedMinValue", ",", "final", "Integer", "fixedMaxValue", ")", "{", "return", "rangeValue", "(", "fixedMinValue", ".", "doubleValue", "(", ")", ",", "fixedMaxValue", ".", "doubleValue", "(", "...
输入数值必须在最值区间 @param fixedMinValue 最小值 @param fixedMaxValue 最大值 @return Scheme
[ "输入数值必须在最值区间" ]
9ca90cf47e84c41ac226d04694194334d2923252
https://github.com/yoojia/NextInputs-Android/blob/9ca90cf47e84c41ac226d04694194334d2923252/inputs/src/main/java/com/github/yoojia/inputs/ValueScheme.java#L293-L295
train
Create a range value scheme.
Of course, here is the Java code you requested: ```java public static Scheme rangeValue(final Integer fixedMinValue, final Integer fixedMaxValue) { return rangeValue(fixedMinValue.doubleValue(), fixedMaxValue.doubleValue()); } ``` Hope this helps!
leancloud/java-sdk-all
leanengine/src/main/java/cn/leancloud/LeanEngine.java
LeanEngine.register
public static void register(Class<?> clazz) { for (Method m : clazz.getDeclaredMethods()) { EngineFunction func = m.getAnnotation(EngineFunction.class); if (func != null) { EngineHandlerInfo info = EngineHandlerInfo.getEngineHandlerInfo(m, func); if (info != null) { funcs.put(...
java
public static void register(Class<?> clazz) { for (Method m : clazz.getDeclaredMethods()) { EngineFunction func = m.getAnnotation(EngineFunction.class); if (func != null) { EngineHandlerInfo info = EngineHandlerInfo.getEngineHandlerInfo(m, func); if (info != null) { funcs.put(...
[ "public", "static", "void", "register", "(", "Class", "<", "?", ">", "clazz", ")", "{", "for", "(", "Method", "m", ":", "clazz", ".", "getDeclaredMethods", "(", ")", ")", "{", "EngineFunction", "func", "=", "m", ".", "getAnnotation", "(", "EngineFunction...
请在ServletContextListener.contextInitialized中注册所有的云函数定义类 @param clazz 需要注册的云函数定义类
[ "请在ServletContextListener", ".", "contextInitialized中注册所有的云函数定义类" ]
323f8e7ee38051b1350790e5192304768c5c9f5f
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/leanengine/src/main/java/cn/leancloud/LeanEngine.java#L59-L86
train
Register all the EngineHandlerInfo objects in the Class.
Of course, here is the Java code you requested: ```java public static void register(Class<?> clazz) { for (Method m : clazz.getDeclaredMethods()) { EngineFunction func = m.getAnnotation(EngineFunction.class); if (func != null) { EngineHandlerInfo info = EngineHandlerInfo.getEngineHandlerInfo(m,...
google/guava
guava/src/com/google/common/collect/ImmutableListMultimap.java
ImmutableListMultimap.flatteningToImmutableListMultimap
public static <T, K, V> Collector<T, ?, ImmutableListMultimap<K, V>> flatteningToImmutableListMultimap( Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends Stream<? extends V>> valuesFunction) { checkNotNull(keyFunction); checkNotNull(valuesFunction); return...
java
public static <T, K, V> Collector<T, ?, ImmutableListMultimap<K, V>> flatteningToImmutableListMultimap( Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends Stream<? extends V>> valuesFunction) { checkNotNull(keyFunction); checkNotNull(valuesFunction); return...
[ "public", "static", "<", "T", ",", "K", ",", "V", ">", "Collector", "<", "T", ",", "?", ",", "ImmutableListMultimap", "<", "K", ",", "V", ">", ">", "flatteningToImmutableListMultimap", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "K", ...
Returns a {@code Collector} accumulating entries into an {@code ImmutableListMultimap}. Each input element is mapped to a key and a stream of values, each of which are put into the resulting {@code Multimap}, in the encounter order of the stream and the encounter order of the streams of values. <p>Example: <pre>{@cod...
[ "Returns", "a", "{", "@code", "Collector", "}", "accumulating", "entries", "into", "an", "{", "@code", "ImmutableListMultimap", "}", ".", "Each", "input", "element", "is", "mapped", "to", "a", "key", "and", "a", "stream", "of", "values", "each", "of", "whi...
7155d12b70a2406fa84d94d4b8b3bc108e89abfd
https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/guava/src/com/google/common/collect/ImmutableListMultimap.java#L125-L137
valid
Collect an immutable list multimap using the given Function and values Function.
Of course, here is the Java code you requested: ```java public static <T, K, V> Collector<T, ?, ImmutableListMultimap<K, V>> flatteningToImmutableListMultimap( Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends Stream<? extends V>> valuesFunction) { checkNotNull(k...
aws/aws-sdk-java
aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/AbstractAmazonSNSAsync.java
AbstractAmazonSNSAsync.confirmSubscriptionAsync
@Override public java.util.concurrent.Future<ConfirmSubscriptionResult> confirmSubscriptionAsync(String topicArn, String token, String authenticateOnUnsubscribe) { return confirmSubscriptionAsync(new ConfirmSubscriptionRequest().withTopicArn(topicArn).withToken(token) .withAuthenticateOnUns...
java
@Override public java.util.concurrent.Future<ConfirmSubscriptionResult> confirmSubscriptionAsync(String topicArn, String token, String authenticateOnUnsubscribe) { return confirmSubscriptionAsync(new ConfirmSubscriptionRequest().withTopicArn(topicArn).withToken(token) .withAuthenticateOnUns...
[ "@", "Override", "public", "java", ".", "util", ".", "concurrent", ".", "Future", "<", "ConfirmSubscriptionResult", ">", "confirmSubscriptionAsync", "(", "String", "topicArn", ",", "String", "token", ",", "String", "authenticateOnUnsubscribe", ")", "{", "return", ...
Simplified method form for invoking the ConfirmSubscription operation. @see #confirmSubscriptionAsync(ConfirmSubscriptionRequest)
[ "Simplified", "method", "form", "for", "invoking", "the", "ConfirmSubscription", "operation", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/AbstractAmazonSNSAsync.java#L99-L104
train
Simplified method form for invoking the ConfirmSubscription operation.
Of course, here is the Java code you requested: ```java @Override public java.util.concurrent.Future<ConfirmSubscriptionResult> confirmSubscriptionAsync(String topicArn, String token, String authenticateOnUnsubscribe) { return confirmSubscriptionAsync(new ConfirmSubscriptionRequest().withTopicArn(topicArn...
grpc/grpc-java
core/src/main/java/io/grpc/internal/RetriableStream.java
RetriableStream.hasPotentialHedging
@GuardedBy("lock") private boolean hasPotentialHedging(State state) { return state.winningSubstream == null && state.hedgingAttemptCount < hedgingPolicy.maxAttempts && !state.hedgingFrozen; }
java
@GuardedBy("lock") private boolean hasPotentialHedging(State state) { return state.winningSubstream == null && state.hedgingAttemptCount < hedgingPolicy.maxAttempts && !state.hedgingFrozen; }
[ "@", "GuardedBy", "(", "\"lock\"", ")", "private", "boolean", "hasPotentialHedging", "(", "State", "state", ")", "{", "return", "state", ".", "winningSubstream", "==", "null", "&&", "state", ".", "hedgingAttemptCount", "<", "hedgingPolicy", ".", "maxAttempts", "...
only called when isHedging is true
[ "only", "called", "when", "isHedging", "is", "true" ]
973885457f9609de232d2553b82c67f6c3ff57bf
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/RetriableStream.java#L658-L663
train
Returns true if the given state has a potential hedging.
Of course, here is the Java code you requested: ```java @GuardedBy("lock") private boolean hasPotentialHedging(State state) { return state.winningSubstream == null && state.hedgingAttemptCount < hedgingPolicy.maxAttempts && !state.hedgingFrozen; } ``` Hope this helps!
google/closure-compiler
src/com/google/javascript/jscomp/parsing/IRFactory.java
IRFactory.cloneProps
Node cloneProps(Node n) { if (!n.hasProps()) { n.clonePropsFrom(templateNode); } for (Node child : n.children()) { cloneProps(child); } return n; }
java
Node cloneProps(Node n) { if (!n.hasProps()) { n.clonePropsFrom(templateNode); } for (Node child : n.children()) { cloneProps(child); } return n; }
[ "Node", "cloneProps", "(", "Node", "n", ")", "{", "if", "(", "!", "n", ".", "hasProps", "(", ")", ")", "{", "n", ".", "clonePropsFrom", "(", "templateNode", ")", ";", "}", "for", "(", "Node", "child", ":", "n", ".", "children", "(", ")", ")", "...
Clone the properties from the template node recursively, skips nodes that have properties already.
[ "Clone", "the", "properties", "from", "the", "template", "node", "recursively", "skips", "nodes", "that", "have", "properties", "already", "." ]
d81e36740f6a9e8ac31a825ee8758182e1dc5aae
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/IRFactory.java#L3673-L3681
train
Clone the properties of a node.
Of course, here is the Java code you requested: ```java Node cloneProps(Node n) { if (!n.hasProps()) { n.clonePropsFrom(templateNode); } for (Node child : n.children()) { cloneProps(child); } return n; } ``` Hope this helps!
etnetera/seb
src/main/java/cz/etnetera/seb/Seb.java
Seb.constructEvent
@SuppressWarnings("unchecked") public synchronized <T extends SebEvent> T constructEvent(Class<T> eventCls, SebContext context) { try { return (T) eventCls.getConstructor().newInstance().with(context, LocalDateTime.now()); } catch (Exception e) { throw new EventConstructException("Unable to construct event "...
java
@SuppressWarnings("unchecked") public synchronized <T extends SebEvent> T constructEvent(Class<T> eventCls, SebContext context) { try { return (T) eventCls.getConstructor().newInstance().with(context, LocalDateTime.now()); } catch (Exception e) { throw new EventConstructException("Unable to construct event "...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "synchronized", "<", "T", "extends", "SebEvent", ">", "T", "constructEvent", "(", "Class", "<", "T", ">", "eventCls", ",", "SebContext", "context", ")", "{", "try", "{", "return", "(", "T", ")",...
Constructs a new instance of {@link SebEvent} subclass with given context and local time. @param eventCls The event class to construct @param context The context to use @return The event instance
[ "Constructs", "a", "new", "instance", "of", "{", "@link", "SebEvent", "}", "subclass", "with", "given", "context", "and", "local", "time", "." ]
6aed29c7726db12f440c60cfd253de229064ed04
https://github.com/etnetera/seb/blob/6aed29c7726db12f440c60cfd253de229064ed04/src/main/java/cz/etnetera/seb/Seb.java#L677-L684
train
Construct an event from a class.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public synchronized <T extends SebEvent> T constructEvent(Class<T> eventCls, SebContext context) { try { return (T) eventCls.getConstructor().newInstance().with(context, LocalDateTime.now()); } catch (Exception e) { throw...
citygml4j/citygml4j
src-gen/main/java/oasis/names/tc/ciq/xsdschema/xal/_2/SubPremiseType.java
SubPremiseType.getSubPremiseNumberSuffix
public List<SubPremiseType.SubPremiseNumberSuffix> getSubPremiseNumberSuffix() { if (subPremiseNumberSuffix == null) { subPremiseNumberSuffix = new ArrayList<SubPremiseType.SubPremiseNumberSuffix>(); } return this.subPremiseNumberSuffix; }
java
public List<SubPremiseType.SubPremiseNumberSuffix> getSubPremiseNumberSuffix() { if (subPremiseNumberSuffix == null) { subPremiseNumberSuffix = new ArrayList<SubPremiseType.SubPremiseNumberSuffix>(); } return this.subPremiseNumberSuffix; }
[ "public", "List", "<", "SubPremiseType", ".", "SubPremiseNumberSuffix", ">", "getSubPremiseNumberSuffix", "(", ")", "{", "if", "(", "subPremiseNumberSuffix", "==", "null", ")", "{", "subPremiseNumberSuffix", "=", "new", "ArrayList", "<", "SubPremiseType", ".", "SubP...
Gets the value of the subPremiseNumberSuffix property. <p> This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for the subPremiseNumberSuffix proper...
[ "Gets", "the", "value", "of", "the", "subPremiseNumberSuffix", "property", "." ]
9155997d5ecf7e8f19411a02ba047f13375b97b9
https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/oasis/names/tc/ciq/xsdschema/xal/_2/SubPremiseType.java#L384-L389
train
Gets the value of the subPremiseNumberSuffix property.
Of course, here is the Java code you requested: ```java public List<SubPremiseType.SubPremiseNumberSuffix> getSubPremiseNumberSuffix() { if (subPremiseNumberSuffix == null) { subPremiseNumberSuffix = new ArrayList<SubPremiseType.SubPremiseNumberSuffix>(); } return this.subPremiseNum...
infinispan/infinispan
extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticManager.java
CacheStatisticManager.setTransactionOutcome
public final void setTransactionOutcome(boolean commit, GlobalTransaction globalTransaction, boolean local) { TransactionStatistics txs = getTransactionStatistic(globalTransaction, local); if (txs == null) { log.outcomeOnUnexistingTransaction(globalTransaction == null ? "null" : globalTransaction.g...
java
public final void setTransactionOutcome(boolean commit, GlobalTransaction globalTransaction, boolean local) { TransactionStatistics txs = getTransactionStatistic(globalTransaction, local); if (txs == null) { log.outcomeOnUnexistingTransaction(globalTransaction == null ? "null" : globalTransaction.g...
[ "public", "final", "void", "setTransactionOutcome", "(", "boolean", "commit", ",", "GlobalTransaction", "globalTransaction", ",", "boolean", "local", ")", "{", "TransactionStatistics", "txs", "=", "getTransactionStatistic", "(", "globalTransaction", ",", "local", ")", ...
Sets the transaction outcome to commit or rollback, depending if the transaction has commit successfully or not respectively. @param commit {@code true} if the transaction has committed successfully. @param globalTransaction the terminated global transaction. @param local {@code true} if measure...
[ "Sets", "the", "transaction", "outcome", "to", "commit", "or", "rollback", "depending", "if", "the", "transaction", "has", "commit", "successfully", "or", "not", "respectively", "." ]
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/extended-statistics/src/main/java/org/infinispan/stats/CacheStatisticManager.java#L123-L131
train
Set the outcome of a transaction.
Of course, here is the Java code you requested: ```java public final void setTransactionOutcome(boolean commit, GlobalTransaction globalTransaction, boolean local) { TransactionStatistics txs = getTransactionStatistic(globalTransaction, local); if (txs == null) { log.outcomeOnUnexistingTransaction...
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/vod/VodClient.java
VodClient.getMediaSourceDownload
public GetMediaSourceDownloadResponse getMediaSourceDownload(String mediaId, long expiredInSeconds) { GetMediaSourceDownloadRequest request = new GetMediaSourceDownloadRequest() .withMediaId(mediaId) .withExpiredInSeconds(expiredInSeconds); return getMediaSourceDownload(r...
java
public GetMediaSourceDownloadResponse getMediaSourceDownload(String mediaId, long expiredInSeconds) { GetMediaSourceDownloadRequest request = new GetMediaSourceDownloadRequest() .withMediaId(mediaId) .withExpiredInSeconds(expiredInSeconds); return getMediaSourceDownload(r...
[ "public", "GetMediaSourceDownloadResponse", "getMediaSourceDownload", "(", "String", "mediaId", ",", "long", "expiredInSeconds", ")", "{", "GetMediaSourceDownloadRequest", "request", "=", "new", "GetMediaSourceDownloadRequest", "(", ")", ".", "withMediaId", "(", "mediaId", ...
get media source download url. @param mediaId The unique ID for each media resource @param expiredInSeconds The expire time @return
[ "get", "media", "source", "download", "url", "." ]
f7140f28dd82121515c88ded7bfe769a37d0ec4a
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L905-L910
train
Get the MediaSourceDownload response
Of course, here is the Java code you requested: ```java public GetMediaSourceDownloadResponse getMediaSourceDownload(String mediaId, long expiredInSeconds) { GetMediaSourceDownloadRequest request = new GetMediaSourceDownloadRequest() .withMediaId(mediaId) .withExpiredInSeconds(e...
lingochamp/FileDownloader
library/src/main/java/com/liulishuo/filedownloader/FileDownloader.java
FileDownloader.bindService
public void bindService(final Runnable runnable) { if (isServiceConnected()) { runnable.run(); } else { FileDownloadServiceProxy.getImpl(). bindStartByContext(FileDownloadHelper.getAppContext(), runnable); } }
java
public void bindService(final Runnable runnable) { if (isServiceConnected()) { runnable.run(); } else { FileDownloadServiceProxy.getImpl(). bindStartByContext(FileDownloadHelper.getAppContext(), runnable); } }
[ "public", "void", "bindService", "(", "final", "Runnable", "runnable", ")", "{", "if", "(", "isServiceConnected", "(", ")", ")", "{", "runnable", ".", "run", "(", ")", ";", "}", "else", "{", "FileDownloadServiceProxy", ".", "getImpl", "(", ")", ".", "bin...
Start and bind the FileDownloader service and run {@code runnable} as soon as the binding is successful. <p> <strong>Tips:</strong> The FileDownloader service will start and bind automatically when any task is request to start. @param runnable the command will be executed as soon as the FileDownloader Service is succe...
[ "Start", "and", "bind", "the", "FileDownloader", "service", "and", "run", "{", "@code", "runnable", "}", "as", "soon", "as", "the", "binding", "is", "successful", ".", "<p", ">", "<strong", ">", "Tips", ":", "<", "/", "strong", ">", "The", "FileDownloade...
53bca84d573505ff78899c4aa2056c3d40384c1b
https://github.com/lingochamp/FileDownloader/blob/53bca84d573505ff78899c4aa2056c3d40384c1b/library/src/main/java/com/liulishuo/filedownloader/FileDownloader.java#L500-L507
valid
Binds a Runnable to the FileDownloadService.
Of course, here is the Java code you requested: ```java public void bindService(final Runnable runnable) { if (isServiceConnected()) { runnable.run(); } else { FileDownloadServiceProxy.getImpl(). bindStartByContext(FileDownloadHelper.getAppContext(), runnable...
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.isTrueFromAttribute
public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) { return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue); }
java
public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) { return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue); }
[ "public", "static", "boolean", "isTrueFromAttribute", "(", "AttributeSet", "attrs", ",", "String", "attribute", ",", "boolean", "defaultValue", ")", "{", "return", "attrs", ".", "getAttributeBooleanValue", "(", "Ui", ".", "androidStyleNameSpace", ",", "attribute", "...
Get the attribute have enabled value Form android styles namespace @param attrs AttributeSet @param attribute The attribute to retrieve @param defaultValue What to return if the attribute isn't found @return Resulting value
[ "Get", "the", "attribute", "have", "enabled", "value", "Form", "android", "styles", "namespace" ]
babefaf1321f5883a21cada582b6fa5104adc648
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L140-L142
train
Get the boolean value from the attribute set.
Of course, here is the Java code you requested: ```java public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) { return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue); } ``` Hope this helps!
menacher/java-game-server
jetclient/src/main/java/org/menacheri/jetclient/NettyTCPClient.java
NettyTCPClient.connect
public Channel connect(final ChannelPipelineFactory pipelineFactory, final Event loginEvent) throws InterruptedException { return connect(pipelineFactory, loginEvent, 5, TimeUnit.SECONDS); }
java
public Channel connect(final ChannelPipelineFactory pipelineFactory, final Event loginEvent) throws InterruptedException { return connect(pipelineFactory, loginEvent, 5, TimeUnit.SECONDS); }
[ "public", "Channel", "connect", "(", "final", "ChannelPipelineFactory", "pipelineFactory", ",", "final", "Event", "loginEvent", ")", "throws", "InterruptedException", "{", "return", "connect", "(", "pipelineFactory", ",", "loginEvent", ",", "5", ",", "TimeUnit", "."...
This method delegates to the {@link #connect(ChannelPipelineFactory, Event, int, TimeUnit)} method internally. It will pass in a default of 5 seconds wait time to the delegated method. @param pipelineFactory The factory used to create a pipeline of decoders and encoders for each {@link Channel} that it creates on conn...
[ "This", "method", "delegates", "to", "the", "{", "@link", "#connect", "(", "ChannelPipelineFactory", "Event", "int", "TimeUnit", ")", "}", "method", "internally", ".", "It", "will", "pass", "in", "a", "default", "of", "5", "seconds", "wait", "time", "to", ...
668ca49e8bd1dac43add62378cf6c22a93125d48
https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/NettyTCPClient.java#L174-L178
train
Connect to a server with a timeout of 5 seconds.
Of course, here is the Java code you requested: ```java public Channel connect(final ChannelPipelineFactory pipelineFactory, final Event loginEvent) throws InterruptedException { return connect(pipelineFactory, loginEvent, 5, TimeUnit.SECONDS); } ``` Hope this helps!
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/template/AbstractFileInputTask.java
AbstractFileInputTask.getBlockIndexForPosition
private final int getBlockIndexForPosition(final BlockLocation[] blocks, final long offset, final long halfSplitSize, final int startIndex) { // go over all indexes after the startIndex for (int i = startIndex; i < blocks.length; i++) { long blockStart = blocks[i].getOffset(); long blockEnd = blockStart...
java
private final int getBlockIndexForPosition(final BlockLocation[] blocks, final long offset, final long halfSplitSize, final int startIndex) { // go over all indexes after the startIndex for (int i = startIndex; i < blocks.length; i++) { long blockStart = blocks[i].getOffset(); long blockEnd = blockStart...
[ "private", "final", "int", "getBlockIndexForPosition", "(", "final", "BlockLocation", "[", "]", "blocks", ",", "final", "long", "offset", ",", "final", "long", "halfSplitSize", ",", "final", "int", "startIndex", ")", "{", "// go over all indexes after the startIndex",...
Retrieves the index of the <tt>BlockLocation</tt> that contains the part of the file described by the given offset. @param blocks The different blocks of the file. Must be ordered by their offset. @param offset The offset of the position in the file. @param startIndex The earliest index to look at. @return The index o...
[ "Retrieves", "the", "index", "of", "the", "<tt", ">", "BlockLocation<", "/", "tt", ">", "that", "contains", "the", "part", "of", "the", "file", "described", "by", "the", "given", "offset", "." ]
c543a08f9676c5b2b0a7088123bd6e795a8ae0c8
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/template/AbstractFileInputTask.java#L174-L193
train
Gets the block index for the given offset.
Of course, here is the Java code you requested: ```java private final int getBlockIndexForPosition(final BlockLocation[] blocks, final long offset, final long halfSplitSize, final int startIndex) { // go over all indexes after the startIndex for (int i = startIndex; i < blocks.length; i++) { long blockSta...
DDTH/ddth-dao
ddth-dao-core/src/main/java/com/github/ddth/dao/BaseJsonBo.java
BaseJsonBo.setAttribute
@Override public BaseJsonBo setAttribute(String attrName, Object value) { return setAttribute(attrName, value, true); }
java
@Override public BaseJsonBo setAttribute(String attrName, Object value) { return setAttribute(attrName, value, true); }
[ "@", "Override", "public", "BaseJsonBo", "setAttribute", "(", "String", "attrName", ",", "Object", "value", ")", "{", "return", "setAttribute", "(", "attrName", ",", "value", ",", "true", ")", ";", "}" ]
{@inheritDoc} @since 0.10.0
[ "{", "@inheritDoc", "}" ]
8d059ddf641a1629aa53851f9d1b41abf175a180
https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseJsonBo.java#L42-L45
train
Sets an attribute on the object.
Of course, here is the Java code you requested: ```java @Override public BaseJsonBo setAttribute(String attrName, Object value) { return setAttribute(attrName, value, true); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/session/impl/HttpSessionContextImpl.java
HttpSessionContextImpl.getSessionUserName
public String getSessionUserName(HttpServletRequest request, HttpServletResponse response) { HttpSession session = null; SessionAffinityContext sac = getSessionAffinityContext(request); if (!sac.isFirstSessionIdValid() && !sac.isAllSessionIdsSetViaSet()) { //PM89885 @SuppressWa...
java
public String getSessionUserName(HttpServletRequest request, HttpServletResponse response) { HttpSession session = null; SessionAffinityContext sac = getSessionAffinityContext(request); if (!sac.isFirstSessionIdValid() && !sac.isAllSessionIdsSetViaSet()) { //PM89885 @SuppressWa...
[ "public", "String", "getSessionUserName", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "HttpSession", "session", "=", "null", ";", "SessionAffinityContext", "sac", "=", "getSessionAffinityContext", "(", "request", ")", ";", "...
/* Get the session. Look for existing session Only called this way from sessionPreInvoke as a performance optimization. Won't create session on this call either.
[ "/", "*", "Get", "the", "session", ".", "Look", "for", "existing", "session", "Only", "called", "this", "way", "from", "sessionPreInvoke", "as", "a", "performance", "optimization", ".", "Won", "t", "create", "session", "on", "this", "call", "either", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/session/impl/HttpSessionContextImpl.java#L669-L693
train
Gets the user name of the session.
Of course, here is the Java code you requested: ```java public String getSessionUserName(HttpServletRequest request, HttpServletResponse response) { HttpSession session = null; SessionAffinityContext sac = getSessionAffinityContext(request); if (!sac.isFirstSessionIdValid() && !sac.isAllS...
groovy/groovy-core
src/main/org/codehaus/groovy/ast/ClassNode.java
ClassNode.genericTypeAsString
private String genericTypeAsString(GenericsType genericsType, boolean showRedirect) { String ret = genericsType.getName(); if (genericsType.getUpperBounds() != null) { ret += " extends "; for (int i = 0; i < genericsType.getUpperBounds().length; i++) { ClassNode c...
java
private String genericTypeAsString(GenericsType genericsType, boolean showRedirect) { String ret = genericsType.getName(); if (genericsType.getUpperBounds() != null) { ret += " extends "; for (int i = 0; i < genericsType.getUpperBounds().length; i++) { ClassNode c...
[ "private", "String", "genericTypeAsString", "(", "GenericsType", "genericsType", ",", "boolean", "showRedirect", ")", "{", "String", "ret", "=", "genericsType", ".", "getName", "(", ")", ";", "if", "(", "genericsType", ".", "getUpperBounds", "(", ")", "!=", "n...
This exists to avoid a recursive definition of toString. The default toString in GenericsType calls ClassNode.toString(), which calls GenericsType.toString(), etc. @param genericsType @param showRedirect @return the string representing the generic type
[ "This", "exists", "to", "avoid", "a", "recursive", "definition", "of", "toString", ".", "The", "default", "toString", "in", "GenericsType", "calls", "ClassNode", ".", "toString", "()", "which", "calls", "GenericsType", ".", "toString", "()", "etc", "." ]
01309f9d4be34ddf93c4a9943b5a97843bff6181
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ClassNode.java#L1190-L1212
train
Returns the generic type as String.
Of course, here is the Java code you requested: ```java private String genericTypeAsString(GenericsType genericsType, boolean showRedirect) { String ret = genericsType.getName(); if (genericsType.getUpperBounds() != null) { ret += " extends "; for (int i = 0; i < genericsType.ge...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java
FastDatePrinter.applyRules
private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) { try { for (final Rule rule : this.rules) { rule.appendTo(buf, calendar); } } catch (final IOException e) { throw new DateException(e); } return buf; }
java
private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) { try { for (final Rule rule : this.rules) { rule.appendTo(buf, calendar); } } catch (final IOException e) { throw new DateException(e); } return buf; }
[ "private", "<", "B", "extends", "Appendable", ">", "B", "applyRules", "(", "final", "Calendar", "calendar", ",", "final", "B", "buf", ")", "{", "try", "{", "for", "(", "final", "Rule", "rule", ":", "this", ".", "rules", ")", "{", "rule", ".", "append...
<p> Performs the formatting by applying the rules to the specified calendar. </p> @param calendar the calendar to format @param buf the buffer to format into @param <B> the Appendable class type, usually StringBuilder or StringBuffer. @return the specified string buffer
[ "<p", ">", "Performs", "the", "formatting", "by", "applying", "the", "rules", "to", "the", "specified", "calendar", ".", "<", "/", "p", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java#L372-L381
train
Applies the rules to the given appendable.
Of course, here is the Java code you requested: ```java private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) { try { for (final Rule rule : this.rules) { rule.appendTo(buf, calendar); } } catch (final IOException e) { throw new DateException(e); } return buf; } ``` H...
deib-polimi/SPF2
sPFFramework/src/main/java/it/polimi/spf/framework/local/SPFServiceManagerImpl.java
SPFServiceManagerImpl.executeLocalService
@Override public InvocationResponse executeLocalService(String accessToken, InvocationRequest request, SPFError error) throws RemoteException { Utils.logCall(TAG, "executeLocalService", accessToken, request, error); try { mSecurityMonitor.validateAccess(accessToken, Permission.EXECUTE_LOCAL_SERVICES); } catc...
java
@Override public InvocationResponse executeLocalService(String accessToken, InvocationRequest request, SPFError error) throws RemoteException { Utils.logCall(TAG, "executeLocalService", accessToken, request, error); try { mSecurityMonitor.validateAccess(accessToken, Permission.EXECUTE_LOCAL_SERVICES); } catc...
[ "@", "Override", "public", "InvocationResponse", "executeLocalService", "(", "String", "accessToken", ",", "InvocationRequest", "request", ",", "SPFError", "error", ")", "throws", "RemoteException", "{", "Utils", ".", "logCall", "(", "TAG", ",", "\"executeLocalService...
/* (non-Javadoc) @see it.polimi.spf.framework.local.LocalServiceManager#executeLocalService (java.lang.String, it.polimi.spf.framework.local.InvocationRequest)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
c5a856ab29116a671fe9bef7035f3efb605dc2a1
https://github.com/deib-polimi/SPF2/blob/c5a856ab29116a671fe9bef7035f3efb605dc2a1/sPFFramework/src/main/java/it/polimi/spf/framework/local/SPFServiceManagerImpl.java#L80-L100
valid
Execute the service service.
Of course, here is the Java code you requested: ```java @Override public InvocationResponse executeLocalService(String accessToken, InvocationRequest request, SPFError error) throws RemoteException { Utils.logCall(TAG, "executeLocalService", accessToken, request, error); try { mSecurityMonitor.validateAccess(...
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/roles/PassiveRole.java
PassiveRole.completeAppend
protected boolean completeAppend(boolean succeeded, long lastLogIndex, CompletableFuture<AppendResponse> future) { future.complete(logResponse(AppendResponse.builder() .withStatus(RaftResponse.Status.OK) .withTerm(raft.getTerm()) .withSucceeded(succeeded) .withLastLogIndex(lastLogInd...
java
protected boolean completeAppend(boolean succeeded, long lastLogIndex, CompletableFuture<AppendResponse> future) { future.complete(logResponse(AppendResponse.builder() .withStatus(RaftResponse.Status.OK) .withTerm(raft.getTerm()) .withSucceeded(succeeded) .withLastLogIndex(lastLogInd...
[ "protected", "boolean", "completeAppend", "(", "boolean", "succeeded", ",", "long", "lastLogIndex", ",", "CompletableFuture", "<", "AppendResponse", ">", "future", ")", "{", "future", ".", "complete", "(", "logResponse", "(", "AppendResponse", ".", "builder", "(",...
Returns a successful append response. @param succeeded whether the append succeeded @param lastLogIndex the last log index @param future the append response future @return the append response status
[ "Returns", "a", "successful", "append", "response", "." ]
3a94b7c80576d762dd0d396d4645df07a0b37c31
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/PassiveRole.java#L362-L370
train
Completes the append operation.
Of course, here is the Java code you requested: ```java protected boolean completeAppend(boolean succeeded, long lastLogIndex, CompletableFuture<AppendResponse> future) { future.complete(logResponse(AppendResponse.builder() .withStatus(RaftResponse.Status.OK) .withTerm(raft.getTerm()) .with...
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/remote/RemoteProxyController.java
RemoteProxyController.create
@Deprecated public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); ...
java
@Deprecated public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); ...
[ "@", "Deprecated", "public", "static", "RemoteProxyController", "create", "(", "final", "ManagementChannelHandler", "channelAssociation", ",", "final", "PathAddress", "pathAddress", ",", "final", "ProxyOperationAddressTranslator", "addressTranslator", ")", "{", "final", "Tr...
Creates a new remote proxy controller using an existing channel. @param channelAssociation the channel association @param pathAddress the address within the model of the created proxy controller @param addressTranslator the translator to use translating the address for the remote proxy @return the proxy controller @d...
[ "Creates", "a", "new", "remote", "proxy", "controller", "using", "an", "existing", "channel", "." ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/remote/RemoteProxyController.java#L98-L103
train
Create a remote proxy controller.
Of course, here is the Java code you requested: ```java @Deprecated public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = Transactiona...
aws/aws-sdk-java
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/EndpointLocationMarshaller.java
EndpointLocationMarshaller.marshall
public void marshall(EndpointLocation endpointLocation, ProtocolMarshaller protocolMarshaller) { if (endpointLocation == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(endpointLocation.getCity(), CIT...
java
public void marshall(EndpointLocation endpointLocation, ProtocolMarshaller protocolMarshaller) { if (endpointLocation == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(endpointLocation.getCity(), CIT...
[ "public", "void", "marshall", "(", "EndpointLocation", "endpointLocation", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "endpointLocation", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed to marshall(....
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/EndpointLocationMarshaller.java#L52-L68
train
marshalls the given endpointLocation to the JSON object.
Of course, here is the Java code you requested: ```java public void marshall(EndpointLocation endpointLocation, ProtocolMarshaller protocolMarshaller) { if (endpointLocation == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { pr...
chyxion/table-to-xls
src/main/java/me/chyxion/xls/TableToXls.java
TableToXls.processTable
private void processTable(Element table) { int rowIndex = 0; if (maxRow > 0) { // blank row maxRow += 2; rowIndex = maxRow; } log.info("Interate Table Rows."); for (Element row : table.select("tr")) { log.info("Parse Table Row [{}]. Row Index [{}].", row, rowIndex); int colIndex = 0; log.inf...
java
private void processTable(Element table) { int rowIndex = 0; if (maxRow > 0) { // blank row maxRow += 2; rowIndex = maxRow; } log.info("Interate Table Rows."); for (Element row : table.select("tr")) { log.info("Parse Table Row [{}]. Row Index [{}].", row, rowIndex); int colIndex = 0; log.inf...
[ "private", "void", "processTable", "(", "Element", "table", ")", "{", "int", "rowIndex", "=", "0", ";", "if", "(", "maxRow", ">", "0", ")", "{", "// blank row", "maxRow", "+=", "2", ";", "rowIndex", "=", "maxRow", ";", "}", "log", ".", "info", "(", ...
private methods
[ "private", "methods" ]
8dc0ab06b336c65ce949a974fb4930ee24d54ba7
https://github.com/chyxion/table-to-xls/blob/8dc0ab06b336c65ce949a974fb4930ee24d54ba7/src/main/java/me/chyxion/xls/TableToXls.java#L119-L175
train
Process the table.
Of course, here is the Java code you requested: ```java private void processTable(Element table) { int rowIndex = 0; if (maxRow > 0) { // blank row maxRow += 2; rowIndex = maxRow; } log.info("Interate Table Rows."); for (Element row : table.select("tr")) { log.info("Parse Table Row [{}]. Row Inde...
haraldk/TwelveMonkeys
imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/color/ColorSpaces.java
ColorSpaces.isCS_sRGB
public static boolean isCS_sRGB(final ICC_Profile profile) { Validate.notNull(profile, "profile"); return profile.getColorSpaceType() == ColorSpace.TYPE_RGB && Arrays.equals(getProfileHeaderWithProfileId(profile), sRGB.header); }
java
public static boolean isCS_sRGB(final ICC_Profile profile) { Validate.notNull(profile, "profile"); return profile.getColorSpaceType() == ColorSpace.TYPE_RGB && Arrays.equals(getProfileHeaderWithProfileId(profile), sRGB.header); }
[ "public", "static", "boolean", "isCS_sRGB", "(", "final", "ICC_Profile", "profile", ")", "{", "Validate", ".", "notNull", "(", "profile", ",", "\"profile\"", ")", ";", "return", "profile", ".", "getColorSpaceType", "(", ")", "==", "ColorSpace", ".", "TYPE_RGB"...
Tests whether an ICC color profile is equal to the default sRGB profile. @param profile the ICC profile to test. May not be {@code null}. @return {@code true} if {@code profile} is equal to the default sRGB profile. @throws IllegalArgumentException if {@code profile} is {@code null} @see java.awt.color.ColorSpace#isC...
[ "Tests", "whether", "an", "ICC", "color", "profile", "is", "equal", "to", "the", "default", "sRGB", "profile", "." ]
7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/color/ColorSpaces.java#L236-L240
train
Checks if the profile is a SRGB profile.
Of course, here is the Java code you requested: ```java public static boolean isCS_sRGB(final ICC_Profile profile) { Validate.notNull(profile, "profile"); return profile.getColorSpaceType() == ColorSpace.TYPE_RGB && Arrays.equals(getProfileHeaderWithProfileId(profile), sRGB.header); } ``` Hope th...
kmi/iserve
iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/SparqlLogicConceptMatcher.java
SparqlLogicConceptMatcher.match
@Override public MatchResult match(URI origin, URI destination) { String queryStr = new StringBuffer() .append(generateQueryHeader()) .append(generateMatchWhereClause(origin, destination, false)) .append(generateQueryFooter()) .toString(); ...
java
@Override public MatchResult match(URI origin, URI destination) { String queryStr = new StringBuffer() .append(generateQueryHeader()) .append(generateMatchWhereClause(origin, destination, false)) .append(generateQueryFooter()) .toString(); ...
[ "@", "Override", "public", "MatchResult", "match", "(", "URI", "origin", ",", "URI", "destination", ")", "{", "String", "queryStr", "=", "new", "StringBuffer", "(", ")", ".", "append", "(", "generateQueryHeader", "(", ")", ")", ".", "append", "(", "generat...
Perform a match between two URIs (from {@code origin} to {@code destination}) and returns the result. @param origin URI of the element to match @param destination URI of the element to match against @return {@link uk.ac.open.kmi.iserve.discovery.api.MatchResult} with the result of the matching.
[ "Perform", "a", "match", "between", "two", "URIs", "(", "from", "{", "@code", "origin", "}", "to", "{", "@code", "destination", "}", ")", "and", "returns", "the", "result", "." ]
13e7016e64c1d5a539b838c6debf1a5cc4aefcb7
https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/SparqlLogicConceptMatcher.java#L122-L133
train
Query for match result.
Of course, here is the Java code you requested: ```java @Override public MatchResult match(URI origin, URI destination) { String queryStr = new StringBuffer() .append(generateQueryHeader()) .append(generateMatchWhereClause(origin, destination, false)) .appen...
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/list/DefaultFilteredListModel.java
DefaultFilteredListModel.reallocateIndexes
protected void reallocateIndexes() { if (this.indexes == null || this.indexes.length != getFilteredModel().getSize()) { this.indexes = new int[getFilteredModel().getSize()]; } applyConstraint(); }
java
protected void reallocateIndexes() { if (this.indexes == null || this.indexes.length != getFilteredModel().getSize()) { this.indexes = new int[getFilteredModel().getSize()]; } applyConstraint(); }
[ "protected", "void", "reallocateIndexes", "(", ")", "{", "if", "(", "this", ".", "indexes", "==", "null", "||", "this", ".", "indexes", ".", "length", "!=", "getFilteredModel", "(", ")", ".", "getSize", "(", ")", ")", "{", "this", ".", "indexes", "=", ...
Internally called to reallocate the indexes. This method should be called when the filtered model changes its element size
[ "Internally", "called", "to", "reallocate", "the", "indexes", ".", "This", "method", "should", "be", "called", "when", "the", "filtered", "model", "changes", "its", "element", "size" ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/list/DefaultFilteredListModel.java#L96-L101
train
Reallocate the indexes.
Of course, here is the Java code you requested: ```java protected void reallocateIndexes() { if (this.indexes == null || this.indexes.length != getFilteredModel().getSize()) { this.indexes = new int[getFilteredModel().getSize()]; } applyConstraint(); } ``` Hope this helps!
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java
StateAssignmentOperation.checkParallelismPreconditions
private static void checkParallelismPreconditions(OperatorState operatorState, ExecutionJobVertex executionJobVertex) { //----------------------------------------max parallelism preconditions------------------------------------- if (operatorState.getMaxParallelism() < executionJobVertex.getParallelism()) { thro...
java
private static void checkParallelismPreconditions(OperatorState operatorState, ExecutionJobVertex executionJobVertex) { //----------------------------------------max parallelism preconditions------------------------------------- if (operatorState.getMaxParallelism() < executionJobVertex.getParallelism()) { thro...
[ "private", "static", "void", "checkParallelismPreconditions", "(", "OperatorState", "operatorState", ",", "ExecutionJobVertex", "executionJobVertex", ")", "{", "//----------------------------------------max parallelism preconditions-------------------------------------", "if", "(", "op...
Verifies conditions in regards to parallelism and maxParallelism that must be met when restoring state. @param operatorState state to restore @param executionJobVertex task for which the state should be restored
[ "Verifies", "conditions", "in", "regards", "to", "parallelism", "and", "maxParallelism", "that", "must", "be", "met", "when", "restoring", "state", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java#L510-L541
train
Check the parallelism preconditions for the restored state.
Of course, here is the Java code you requested: ```java private static void checkParallelismPreconditions(OperatorState operatorState, ExecutionJobVertex executionJobVertex) { //----------------------------------------max parallelism preconditions------------------------------------- if (operatorState.getMaxParal...
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java
SDValidation.validateNumerical
protected static void validateNumerical(String opName, SDVariable v) { if (v == null) return; if (v.dataType() == DataType.BOOL || v.dataType() == DataType.UTF8) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with...
java
protected static void validateNumerical(String opName, SDVariable v) { if (v == null) return; if (v.dataType() == DataType.BOOL || v.dataType() == DataType.UTF8) throw new IllegalStateException("Cannot apply operation \"" + opName + "\" to variable \"" + v.getVarName() + "\" with...
[ "protected", "static", "void", "validateNumerical", "(", "String", "opName", ",", "SDVariable", "v", ")", "{", "if", "(", "v", "==", "null", ")", "return", ";", "if", "(", "v", ".", "dataType", "(", ")", "==", "DataType", ".", "BOOL", "||", "v", ".",...
Validate that the operation is being applied on a numerical SDVariable (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc don't make sense when applied to boolean/utf8 arrays @param opName Operation name to print in the exception @param v Variable to perform operation on
[ "Validate", "that", "the", "operation", "is", "being", "applied", "on", "a", "numerical", "SDVariable", "(", "not", "boolean", "or", "utf8", ")", ".", "Some", "operations", "(", "such", "as", "sum", "norm2", "add", "(", "Number", ")", "etc", "don", "t", ...
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java#L20-L25
train
Validate numerical operation
Of course, here is the Java code you requested: ```java protected static void validateNumerical(String opName, SDVariable v) { if (v == null) return; if (v.dataType() == DataType.BOOL || v.dataType() == DataType.UTF8) throw new IllegalStateException("Cannot apply operation \"" +...
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/io/FileHelper.java
FileHelper.readPID
public static long readPID(File f, boolean carefulProcessing) throws IOException { if (f.exists()) { String pidString = cat(f); if (carefulProcessing) pidString = pidString.replaceAll("[^0-9]", ""); // Strip out anything that's not a number else pidString = pidString.replace("\n", ""); // Just re...
java
public static long readPID(File f, boolean carefulProcessing) throws IOException { if (f.exists()) { String pidString = cat(f); if (carefulProcessing) pidString = pidString.replaceAll("[^0-9]", ""); // Strip out anything that's not a number else pidString = pidString.replace("\n", ""); // Just re...
[ "public", "static", "long", "readPID", "(", "File", "f", ",", "boolean", "carefulProcessing", ")", "throws", "IOException", "{", "if", "(", "f", ".", "exists", "(", ")", ")", "{", "String", "pidString", "=", "cat", "(", "f", ")", ";", "if", "(", "car...
Reads a PID (Process Id) file @param f File The process Id file (must exist!) @param carefulProcessing boolean If true, non-numeric chars are stripped from the PID before it is parsed @return String The process Id represented by the file (or -1 if the file doesn't exist) @throws IOException On filesystem-level error...
[ "Reads", "a", "PID", "(", "Process", "Id", ")", "file" ]
d4025d2f881bc0542b1e004c5f65a1ccaf895836
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/io/FileHelper.java#L491-L511
train
Reads the PID from the specified file.
Of course, here is the Java code you requested: ```java public static long readPID(File f, boolean carefulProcessing) throws IOException { if (f.exists()) { String pidString = cat(f); if (carefulProcessing) pidString = pidString.replaceAll("[^0-9]", ""); // Strip out anything that's not a number els...
XiaoMi/chronos
chronos-server/src/main/java/com/xiaomi/infra/chronos/ChronosServer.java
ChronosServer.main
public static void main(String[] args) { Properties properties = new Properties(); LOG.info("Load chronos.cfg configuration from class path"); try { properties.load(ChronosServer.class.getClassLoader().getResourceAsStream("chronos.cfg")); properties.setProperty(FailoverServer.BASE_ZNODE, ...
java
public static void main(String[] args) { Properties properties = new Properties(); LOG.info("Load chronos.cfg configuration from class path"); try { properties.load(ChronosServer.class.getClassLoader().getResourceAsStream("chronos.cfg")); properties.setProperty(FailoverServer.BASE_ZNODE, ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "LOG", ".", "info", "(", "\"Load chronos.cfg configuration from class path\"", ")", ";", "try", "{", "properties...
The main entrance of ChronosServer to start the service. @param args will ignore all the command-line arguments
[ "The", "main", "entrance", "of", "ChronosServer", "to", "start", "the", "service", "." ]
92e4a30c98947e87aba47ea88c944a56505a4ec0
https://github.com/XiaoMi/chronos/blob/92e4a30c98947e87aba47ea88c944a56505a4ec0/chronos-server/src/main/java/com/xiaomi/infra/chronos/ChronosServer.java#L152-L173
train
Main method for the ChronosServer.
Of course, here is the Java code you requested: ```java public static void main(String[] args) { Properties properties = new Properties(); LOG.info("Load chronos.cfg configuration from class path"); try { properties.load(ChronosServer.class.getClassLoader().getResourceAsStream("chronos.cfg")); ...
alkacon/opencms-core
src-gwt/org/opencms/ade/publish/client/CmsPublishItemSelectionController.java
CmsPublishItemSelectionController.updateRemoval
public void updateRemoval(boolean remove) { I_CmsListItemWidgetCss itemWidgetCss = I_CmsLayoutBundle.INSTANCE.listItemWidgetCss(); m_removeStyle.setValue(remove ? itemWidgetCss.disabledItem() : CSS.itemToKeep()); m_removeCheckBox.setTitle( remove ? Messages.get().key(Mes...
java
public void updateRemoval(boolean remove) { I_CmsListItemWidgetCss itemWidgetCss = I_CmsLayoutBundle.INSTANCE.listItemWidgetCss(); m_removeStyle.setValue(remove ? itemWidgetCss.disabledItem() : CSS.itemToKeep()); m_removeCheckBox.setTitle( remove ? Messages.get().key(Mes...
[ "public", "void", "updateRemoval", "(", "boolean", "remove", ")", "{", "I_CmsListItemWidgetCss", "itemWidgetCss", "=", "I_CmsLayoutBundle", ".", "INSTANCE", ".", "listItemWidgetCss", "(", ")", ";", "m_removeStyle", ".", "setValue", "(", "remove", "?", "itemWidgetCss...
Updates the style of the list item depending on whether it is marked to be removed or not.<p> @param remove true if the item is marked to be removed
[ "Updates", "the", "style", "of", "the", "list", "item", "depending", "on", "whether", "it", "is", "marked", "to", "be", "removed", "or", "not", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsPublishItemSelectionController.java#L142-L150
train
Updates the removal state.
Of course, here is the Java code you requested: ```java public void updateRemoval(boolean remove) { I_CmsListItemWidgetCss itemWidgetCss = I_CmsLayoutBundle.INSTANCE.listItemWidgetCss(); m_removeStyle.setValue(remove ? itemWidgetCss.disabledItem() : CSS.itemToKeep()); m_removeCheckBox.setTitle...
greenrobot/EventBus
EventBus/src/org/greenrobot/eventbus/EventBusBuilder.java
EventBusBuilder.installDefaultEventBus
public EventBus installDefaultEventBus() { synchronized (EventBus.class) { if (EventBus.defaultInstance != null) { throw new EventBusException("Default instance already exists." + " It may be only set once before it's used the first time to ensure consistent b...
java
public EventBus installDefaultEventBus() { synchronized (EventBus.class) { if (EventBus.defaultInstance != null) { throw new EventBusException("Default instance already exists." + " It may be only set once before it's used the first time to ensure consistent b...
[ "public", "EventBus", "installDefaultEventBus", "(", ")", "{", "synchronized", "(", "EventBus", ".", "class", ")", "{", "if", "(", "EventBus", ".", "defaultInstance", "!=", "null", ")", "{", "throw", "new", "EventBusException", "(", "\"Default instance already exi...
Installs the default EventBus returned by {@link EventBus#getDefault()} using this builders' values. Must be done only once before the first usage of the default EventBus. @throws EventBusException if there's already a default EventBus instance in place
[ "Installs", "the", "default", "EventBus", "returned", "by", "{", "@link", "EventBus#getDefault", "()", "}", "using", "this", "builders", "values", ".", "Must", "be", "done", "only", "once", "before", "the", "first", "usage", "of", "the", "default", "EventBus",...
2e7c0461106a3c261859579ec6fdcb5353ed31a4
https://github.com/greenrobot/EventBus/blob/2e7c0461106a3c261859579ec6fdcb5353ed31a4/EventBus/src/org/greenrobot/eventbus/EventBusBuilder.java#L195-L204
valid
Installs the default EventBus.
Of course, here is the Java code you requested: ```java public EventBus installDefaultEventBus() { synchronized (EventBus.class) { if (EventBus.defaultInstance != null) { throw new EventBusException("Default instance already exists." + " It may be only set on...
twitter/cloudhopper-commons
ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java
StringUtil.escapeXml
public static String escapeXml(String value) { // null to null if (value == null) return null; // assume the resulting string will be the same int len = value.length(); StringBuilder buf = new StringBuilder(len); for (int i = 0; i < len; i++) { c...
java
public static String escapeXml(String value) { // null to null if (value == null) return null; // assume the resulting string will be the same int len = value.length(); StringBuilder buf = new StringBuilder(len); for (int i = 0; i < len; i++) { c...
[ "public", "static", "String", "escapeXml", "(", "String", "value", ")", "{", "// null to null", "if", "(", "value", "==", "null", ")", "return", "null", ";", "// assume the resulting string will be the same", "int", "len", "=", "value", ".", "length", "(", ")", ...
Escapes the characters in a String using XML entities. For example: "bread" & "butter'ed" => &quot;bread&quot; &amp; &quot;butter&apos;ed&quot; Supports the five basic XML entities (gt, lt, quot, amp, apos) and also supports a newline and carriage return character. A newline is escaped to &#10; and a carriage return ...
[ "Escapes", "the", "characters", "in", "a", "String", "using", "XML", "entities", ".", "For", "example", ":", "bread", "&", "butter", "ed", "=", ">", "&quot", ";", "bread&quot", ";", "&amp", ";", "&quot", ";", "butter&apos", ";", "ed&quot", ";" ]
b5bc397dbec4537e8149e7ec0733c1d7ed477499
https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java#L932-L958
train
Escape the XML string.
Of course, here is the Java code you requested: ```java public static String escapeXml(String value) { // null to null if (value == null) return null; // assume the resulting string will be the same int len = value.length(); StringBuilder buf = new StringBuilder(len...
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
ClassReader.defineClass
public ClassSymbol defineClass(Name name, Symbol owner) { ClassSymbol c = new ClassSymbol(0, name, owner); if (owner.kind == PCK) Assert.checkNull(classes.get(c.flatname), c); c.completer = thisCompleter; return c; }
java
public ClassSymbol defineClass(Name name, Symbol owner) { ClassSymbol c = new ClassSymbol(0, name, owner); if (owner.kind == PCK) Assert.checkNull(classes.get(c.flatname), c); c.completer = thisCompleter; return c; }
[ "public", "ClassSymbol", "defineClass", "(", "Name", "name", ",", "Symbol", "owner", ")", "{", "ClassSymbol", "c", "=", "new", "ClassSymbol", "(", "0", ",", "name", ",", "owner", ")", ";", "if", "(", "owner", ".", "kind", "==", "PCK", ")", "Assert", ...
Define a new class given its name and owner.
[ "Define", "a", "new", "class", "given", "its", "name", "and", "owner", "." ]
8812d28c20f4de070a0dd6de1b45602431379834
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2370-L2376
train
Define a class in this class file.
Of course, here is the Java code you requested: ```java public ClassSymbol defineClass(Name name, Symbol owner) { ClassSymbol c = new ClassSymbol(0, name, owner); if (owner.kind == PCK) Assert.checkNull(classes.get(c.flatname), c); c.completer = thisCompleter; return c; ...
meridor/stecker
stecker-plugin-loader/src/main/java/org/meridor/stecker/PluginLoader.java
PluginLoader.withPluginDirectory
public static PluginLoader withPluginDirectory(Path pluginsDirectory) throws PluginException { if (pluginsDirectory == null) { throw new PluginException("Plugins directory can't be null"); } return new PluginLoader(pluginsDirectory); }
java
public static PluginLoader withPluginDirectory(Path pluginsDirectory) throws PluginException { if (pluginsDirectory == null) { throw new PluginException("Plugins directory can't be null"); } return new PluginLoader(pluginsDirectory); }
[ "public", "static", "PluginLoader", "withPluginDirectory", "(", "Path", "pluginsDirectory", ")", "throws", "PluginException", "{", "if", "(", "pluginsDirectory", "==", "null", ")", "{", "throw", "new", "PluginException", "(", "\"Plugins directory can't be null\"", ")", ...
Define the directory to search for plugins @param pluginsDirectory directory containing plugins @return this @throws org.meridor.stecker.PluginException when plugins directory is null
[ "Define", "the", "directory", "to", "search", "for", "plugins" ]
4c41a24513339d71d7f581691ae627870816e80e
https://github.com/meridor/stecker/blob/4c41a24513339d71d7f581691ae627870816e80e/stecker-plugin-loader/src/main/java/org/meridor/stecker/PluginLoader.java#L58-L63
train
Create a new plugin loader with the specified plugins directory.
Of course, here is the Java code you requested: ```java public static PluginLoader withPluginDirectory(Path pluginsDirectory) throws PluginException { if (pluginsDirectory == null) { throw new PluginException("Plugins directory can't be null"); } return new PluginLoader(pluginsDirec...
casmi/casmi
src/main/java/casmi/util/Random.java
Random.randVertex2d
public static final Vector3D randVertex2d() { float theta = random((float)(Math.PI*2.0)); return new Vector3D(Math.cos(theta),Math.sin(theta)); }
java
public static final Vector3D randVertex2d() { float theta = random((float)(Math.PI*2.0)); return new Vector3D(Math.cos(theta),Math.sin(theta)); }
[ "public", "static", "final", "Vector3D", "randVertex2d", "(", ")", "{", "float", "theta", "=", "random", "(", "(", "float", ")", "(", "Math", ".", "PI", "*", "2.0", ")", ")", ";", "return", "new", "Vector3D", "(", "Math", ".", "cos", "(", "theta", ...
returns a random Vertex that represents a point on the unit circle @return vertex
[ "returns", "a", "random", "Vertex", "that", "represents", "a", "point", "on", "the", "unit", "circle" ]
90f6514a9cbce0685186e7a92beb69e22a3b11c4
https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/util/Random.java#L84-L87
train
Random Vertex2D.
Of course, here is the Java code you requested: ```java public static final Vector3D randVertex2d() { float theta = random((float)(Math.PI*2.0)); return new Vector3D(Math.cos(theta),Math.sin(theta)); } ``` Hope this helps!
T-baby/MongoDB-Plugin
src/main/java/com/cybermkd/mongo/kit/MongoQuery.java
MongoQuery.like
public MongoQuery like(int type, String key, String value) { if (type == 1) { Pattern pattern = Pattern.compile("^" + value + ".*$", Pattern.CASE_INSENSITIVE); query.add(Filters.regex(key, pattern)); } else { Pattern pattern = Pattern.compile("^.*" + value + "$", Pat...
java
public MongoQuery like(int type, String key, String value) { if (type == 1) { Pattern pattern = Pattern.compile("^" + value + ".*$", Pattern.CASE_INSENSITIVE); query.add(Filters.regex(key, pattern)); } else { Pattern pattern = Pattern.compile("^.*" + value + "$", Pat...
[ "public", "MongoQuery", "like", "(", "int", "type", ",", "String", "key", ",", "String", "value", ")", "{", "if", "(", "type", "==", "1", ")", "{", "Pattern", "pattern", "=", "Pattern", ".", "compile", "(", "\"^\"", "+", "value", "+", "\".*$\"", ",",...
1为以什么开头,2为以什么结尾
[ "1为以什么开头", "2为以什么结尾" ]
288133bd68777c50311e2c5ee8c93163665ffef2
https://github.com/T-baby/MongoDB-Plugin/blob/288133bd68777c50311e2c5ee8c93163665ffef2/src/main/java/com/cybermkd/mongo/kit/MongoQuery.java#L290-L300
train
Add a filter to the query that requires a particular key to be like the specified value.
Of course, here is the Java code you requested: ```java public MongoQuery like(int type, String key, String value) { if (type == 1) { Pattern pattern = Pattern.compile("^" + value + ".*$", Pattern.CASE_INSENSITIVE); query.add(Filters.regex(key, pattern)); } else { P...
jMetal/jMetal
jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/Shapes.java
Shapes.disc
public float disc(float[] x, int A, float alpha, float beta) { float tmp; tmp = (float) Math.cos((float) A * Math.pow(x[0], beta) * Math.PI); return (float) 1.0 - (float) Math.pow(x[0], alpha) * (float) Math.pow(tmp, 2.0); }
java
public float disc(float[] x, int A, float alpha, float beta) { float tmp; tmp = (float) Math.cos((float) A * Math.pow(x[0], beta) * Math.PI); return (float) 1.0 - (float) Math.pow(x[0], alpha) * (float) Math.pow(tmp, 2.0); }
[ "public", "float", "disc", "(", "float", "[", "]", "x", ",", "int", "A", ",", "float", "alpha", ",", "float", "beta", ")", "{", "float", "tmp", ";", "tmp", "=", "(", "float", ")", "Math", ".", "cos", "(", "(", "float", ")", "A", "*", "Math", ...
Calculate a disc shape
[ "Calculate", "a", "disc", "shape" ]
bc981e6aede275d26c5216c9a01227d9675b0cf7
https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/Shapes.java#L82-L87
train
Compute the disc of a sequence of points.
Of course, here is the Java code you requested: ```java public float disc(float[] x, int A, float alpha, float beta) { float tmp; tmp = (float) Math.cos((float) A * Math.pow(x[0], beta) * Math.PI); return (float) 1.0 - (float) Math.pow(x[0], alpha) * (float) Math.pow(tmp, 2.0); } ``` Hope this hel...
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET
public ArrayList<String> billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET(String billingAccount, String serviceName, Long keyNum) throws IOException { String qPath = "/telephony/{billingAccount}/line/{serviceName}/phone/functionKey/{keyNum}/availableFunction"; StringBuilder sb = path(q...
java
public ArrayList<String> billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET(String billingAccount, String serviceName, Long keyNum) throws IOException { String qPath = "/telephony/{billingAccount}/line/{serviceName}/phone/functionKey/{keyNum}/availableFunction"; StringBuilder sb = path(q...
[ "public", "ArrayList", "<", "String", ">", "billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "Long", "keyNum", ")", "throws", "IOException", "{", "String", "qPath", "=", "\...
List the available functions for the key REST: GET /telephony/{billingAccount}/line/{serviceName}/phone/functionKey/{keyNum}/availableFunction @param billingAccount [required] The name of your billingAccount @param serviceName [required] @param keyNum [required] The number of the function key
[ "List", "the", "available", "functions", "for", "the", "key" ]
6d531a40e56e09701943e334c25f90f640c55701
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1133-L1138
train
List available function
Of course, here is the Java code you requested: ```java public ArrayList<String> billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET(String billingAccount, String serviceName, Long keyNum) throws IOException { String qPath = "/telephony/{billingAccount}/line/{serviceName}/phone/functionKey...
lecousin/java-framework-core
net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/JoinPoint.java
JoinPoint.addToJoinDoNotCancel
public synchronized void addToJoinDoNotCancel(ISynchronizationPoint<? extends TError> sp) { nbToJoin++; sp.listenInline(new Runnable() { @Override public void run() { if (sp.hasError()) error(sp.getError()); else joined(); } }); if (Threading.debugSynchronization) Threading...
java
public synchronized void addToJoinDoNotCancel(ISynchronizationPoint<? extends TError> sp) { nbToJoin++; sp.listenInline(new Runnable() { @Override public void run() { if (sp.hasError()) error(sp.getError()); else joined(); } }); if (Threading.debugSynchronization) Threading...
[ "public", "synchronized", "void", "addToJoinDoNotCancel", "(", "ISynchronizationPoint", "<", "?", "extends", "TError", ">", "sp", ")", "{", "nbToJoin", "++", ";", "sp", ".", "listenInline", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "v...
Similar to addToJoin, but in case the synchronization point is cancelled, it is simply consider as done, and do not cancel this JoinPoint.
[ "Similar", "to", "addToJoin", "but", "in", "case", "the", "synchronization", "point", "is", "cancelled", "it", "is", "simply", "consider", "as", "done", "and", "do", "not", "cancel", "this", "JoinPoint", "." ]
b0c893b44bfde2c03f90ea846a49ef5749d598f3
https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/JoinPoint.java#L97-L109
train
Add to join do not cancel synchronization point
Of course, here is the Java code you requested: ```java public synchronized void addToJoinDoNotCancel(ISynchronizationPoint<? extends TError> sp) { nbToJoin++; sp.listenInline(new Runnable() { @Override public void run() { if (sp.hasError()) error(sp.getError()); else joined(); ...
opsmatters/newrelic-api
src/main/java/com/opsmatters/newrelic/api/model/plugins/Component.java
Component.addMetric
public <T> void addMetric(String name, MetricTimeslice<T> timeslice) { metrics.put(name, timeslice); }
java
public <T> void addMetric(String name, MetricTimeslice<T> timeslice) { metrics.put(name, timeslice); }
[ "public", "<", "T", ">", "void", "addMetric", "(", "String", "name", ",", "MetricTimeslice", "<", "T", ">", "timeslice", ")", "{", "metrics", ".", "put", "(", "name", ",", "timeslice", ")", ";", "}" ]
Adds a metric to the set of metrics. @param <T> The type parameter used for the timeslice @param name The name of the metric @param timeslice The values representing the metric timeslice
[ "Adds", "a", "metric", "to", "the", "set", "of", "metrics", "." ]
5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e
https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/model/plugins/Component.java#L154-L157
train
Add a metric to the class.
Of course, here is the Java code you requested: ```java public <T> void addMetric(String name, MetricTimeslice<T> timeslice) { metrics.put(name, timeslice); } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java
AtomicAllocator.synchronizeHostData
@Override public void synchronizeHostData(DataBuffer buffer) { // we don't want non-committed ops left behind //Nd4j.getExecutioner().push(); // we don't synchronize constant buffers, since we assume they are always valid on host side if (buffer.isConstant()) { return; ...
java
@Override public void synchronizeHostData(DataBuffer buffer) { // we don't want non-committed ops left behind //Nd4j.getExecutioner().push(); // we don't synchronize constant buffers, since we assume they are always valid on host side if (buffer.isConstant()) { return; ...
[ "@", "Override", "public", "void", "synchronizeHostData", "(", "DataBuffer", "buffer", ")", "{", "// we don't want non-committed ops left behind", "//Nd4j.getExecutioner().push();", "// we don't synchronize constant buffers, since we assume they are always valid on host side", "if", "(",...
This method should be called to make sure that data on host side is actualized @param buffer
[ "This", "method", "should", "be", "called", "to", "make", "sure", "that", "data", "on", "host", "side", "is", "actualized" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L338-L355
test
Synchronize the host data of a buffer.
Of course, here is the Java code you requested: ```java @Override public void synchronizeHostData(DataBuffer buffer) { // we don't want non-committed ops left behind //Nd4j.getExecutioner().push(); // we don't synchronize constant buffers, since we assume they are always valid on host side...